Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Draco18s

Members
  • Joined

  • Last visited

Posts posted by Draco18s

  1. Oh god.

     

    Why is your render registration code inside your item?  That will absolutely positively crash the server, it does not give a shit that you only call that method from the client, the JVM still needs to load the class and validate it and the mere existence of a reference to a client-side class will cause it to attempt to also load that class.

    Why are you using getUnlocalizedName()?  The unlocalized name shouldn't be used for anything other than language localization.

     

    You did not include your JSON

  2. You will want the data in two places.

     

    Place 1 is where it gets read from the config file and stored.  I would store this in my ServerProxy (or CommonProxy, whatever you want to name it).  These values will still exist when the player logs into a server, but won't be used unless the player starts a local server.

     

    Place 2 is where the client would store the values it receives from the server and uses for display.  I would store this in my ClientProxy.  Note: this is a separate field that is public in the ClientProxy along side the public field in the ServerProxy.

     

    These client-side values would be overwritten every time the client receives the info packet the server sends on login (sent in the PlayerLoggedInEvent from the sever).

     

    The cool thing is, you don't have to do anything special for this setup to work for a singleplayer game: the single player instance would send a packet to the single player client and the values would be updated correctly.

  3. it doesn't have a 'current' and I can't jump out of it if I can't touch the bottom of a pool of it.

     

    That's because both of those factors are handled by EntityBase#onEntityUpdate

     

    They check the current block that the entity is in, and if that block's material is water, you get pushed (and get a drown meter).  If it's lava, you get set on fire.

  4. On 2) TileEntities do no exist in your inventory.  In your inventory everything is an item stack.  You will need to also add NBTtags to the ItemStack for the block when it is in ItemStack form.  Crafting and such will need to have custom recipes (look up IRecipe).

     

    On 1) You need to override getActualState() IIRC

  5. By the way, you won't want to overwrite the values from the client's config.  If they connect to a server (receiving the server's values), then disconnect, and load their own single player game, the config values should be used at that point.

     

    Otherwise you'll have a disparity between logging into the server first, then playing single player, than playing single player directly.

  6. The particles setting is only used by
    RenderGlobal#spawnEntityFX

    , but some particles are spawned using

    EffectRenderer#addEffect

    directly and won't be affected by the setting. The setting doesn't affect the particle limit, it just reduces the chance for particles to spawn (Decreased) or completely stops particles from spawning (Minimal).

     

    Oooh, alright. :)

    I knew that the setting lowered the chance of the particle spawning, but I thought it lowered the cap, too.

  7. I see a possible problem: There are several methods called "registerRender" in various non-sided classes, and each tries to get Minecraft. If I recall correctly, that's a client-only call. Methods called registerRender should either be in your client proxy or calling proxy.something to avoid blowing up the server. Indeed, you'd be well served to relegate all mention of "render" to your client proxy, because all rendering (graphics) is display stuff that is toxic to a server

     

    More or less correct.

    The problem is not the code running, but the class loading into the JVM.

  8. Let me quote it again.

     

     

    GameRegistry.addShapelessRecipe(new ItemStack(Bong.bbowl, 3), new Object(), " B ", 'B', Items.iron_ingot); 

     

    new Object()

    ?  Seriously?

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.