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

Everything posted by Draco18s

  1. 3. You should be passing a 3.
  2. Or I could do everything in the base mod class and delegate to the proxy when, and only when, sided code is required. i.e. the registering of event handlers, renderers, and suchlike.
  3. No, no one has ever done that ever. Also, NEI is "dead." It's not going to update. I think JEI is the "hot shit" now.
  4. IBlockAccess is "world-lite" or "read-only World." World implements IBlockAcess and IBlockAccess provides access to blocks (every single getter). Please look at world#setBlock to know what that last parameter does. 1 is not the right value to pass.
  5. Eehhh. I prefer that common goes goes in the base mod class. I see way to much "it should be in the proxy" so the main mod class tells the proxy about the init events, then the proxy goes "well all the code is over in the ModBlocks class" and shunts the event over there. It's a right pain in the ass to debug when the person has a problem because we have to ask for THREE classes to identify the problem (oops, their ModBlocks.preInit() method is actually called durring an init event). There's no reason to shunt method calls around, sure it adheres to some abstract notion of encapsulation, but encapsulation really isn't that good (if encapsulation is followed to the letter, then no package would ever import any package other than itself, its direct parent, and its direct children sub-packages and all cross-package invocation would be fired up or down this chain*). *That is, in order for a block to reference an item, the block would have to ask ModBlocks to forward a call to BaseMod, which would then forward the call to ModItems, and so forth.
  6. ...which will then probably make you write writeToNBT and readFromNBT methods. (Protip: an interface never lets you avoid implementing something)
  7. I heard that from diesieben07, if he's wrong then the information I have available to me is wrong and there's no way I'd know that.
  8. Override public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) Get the TileEntity Get the block stored in the TE Ask it what it's icon is
  9. If it's in the Block class and you're overriding it, then @Depreicated doesn't mean "we're not using this any more." Mojang is using the annotation incorrectly.
  10. I would store the block inside the TileEntity and then get the TileEntity from world.getTileEntityAt
  11. Yeah, no shit. Creating a new biome instance is not the same as referencing an existing instance.
  12. After running gradlew build, you need to browse to build/libs to find your jar file. One of those other two commands likely deleted it.
  13. http://www.sololearn.com/Course/Java/
  14. See all this stuff? private boolean isAdv = false; private Block block; private TileEntityElevator tile; You can't do that. Blocks are singleton classes. You must store this information in the TE. You should never ever be storing a reference to the TileEntity in your block class either, that already tells you you have no idea WTF you're doing. Also, don't use BlockContainer. Override hasTileEntity and createNewTileEntity instead. Also... public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { try{ return new TileEntityElevator(); }catch (Exception var3){ throw new RuntimeException(var3); } } WHY ARE YOU DOING THIS. You catch an exception for the sole purpose of throwing it again? Why? Not to mention that creating a new TE can't even throw an exception!
  15. If the raycast hits with distance 5, then its guaranteed to hit if the distance is 6 instead. However, it is not guaranteed to hit if the distance is 4...
  16. You need to show more of the class, then. Post the whole thing.
  17. Isn't that what Ernio showed via PlayerEvent.Clone? I missed that.
  18. Also, you will need to manually copy the capability on respawn. The respawned EntityPlayer is a new instance.
  19. Mmm. You've posted the same code again along with a bunch of words. It doesn't help me figure out why you're not using this.block.getIcon(side,meta); Yes, I skipped the "else" statement, but whatever. I still don't know what the "problem" you're having even is.
  20. Well of course it still crashes. Inside the loop you're doing a raytrace at increasingly shorter distances. What do you think happens when that raytrace doesn't hit something?
  21. @SideOnly(Side.CLIENT) public IIcon getIcon(int side, int meta){ if(this.isAdv && this.block != null){ return this.block.getIcon(side,meta); //why not this? } } ?
  22. Is the method onItemRightClick marked as @SideOnly(Side.CLIENT) in the Item class?
  23. While....vaguely correct, you shouldn't use the unlocalized name for your json. You should use your registry name for both of those.
  24. Honestly, store the rotation in metadata, then store the rest in the TE. (2 bits for fabric, BTW, is 4 colors)

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.