Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited


  • Gender
  • Location

imadnsn's Achievements

Creeper Killer

Creeper Killer (4/8)



  1. The method getActualState() no longer exists due to the flattening. Now you can either treat your states as blockstate like fences do, use extended states, or use TEs.
  2. Minecraft.getMinecraft() is client-sided only, you use it in a field and a method that can get called in server
  3. You must remember that clients and servers can be on totally different physical places, you can't just let the server send an instance of the container to the client, they would only communicate through the network.
  4. Guess how Minecraft ticks? It's already in a loop, when the server gets launched, it gets into a snippet while (this.serverRunning) { // this is the server // This is where Minecraft server code happens, including running tick handlers' code every relevant tick depending on what they subscribed for, then it sleeps for at most 50 milliseconds before the loop goes on } This means that wherever you are in Minecraft, you are on a loop (one of 2 actually, one for server and one for client, but that's not the point). If a lot happens on the same tick, the game lags because the game loop doesn't go on. Forge added tick handling events so mods can run their code on each relevant tick, if modders want to tick without pausing the game they start counting their ticks (on a global variable you still didn't make) and each time the tick counter reaches certain amount the mod runs its code.
  5. You're most likely missing one of those methods look at the forge's documentation of blockstates here: http://mcforge.readthedocs.io/en/latest/blockstates/states/ I assure it will help you like it did to me.
  6. Post the error that logs in the console. It wouldn't use the black and purple unless it either can't find the model or can't find the texture. So make sure your textures are at assets.modid.textures.items and at assets.modid.textures.armor (as you specified in your json file) and your model at assets.modid.models.item/plasticlegs.json (as you specified in setCustomModelResourceLocation). also unrelated but use setUnlocalisedName when registering your item so you can give it a name in gui
  7. using reflection with PlayerInteractionManager#isDestroyingBlock might work on server side, I'm not sure though PlayerInteractionManager of a player is in the public final field EntityPlayerMP#interactionManager
  8. he's trying to set an ItemStack with metadata I think, but no idea why not new ItemStack instead of putting its parameters and expecting it to magically work
  9. If you want you can tidy it up by putting these conditions in a function that returns a boolean, where it returns false whenever any of the armor pieces isn't present. That won't make much of a change, however. As for the hurting, check if the entity is instance of EntityLivingBase (super class for all entities with health even players) then use EntityLivingBase#attackEntityFrom with DamageSource being DamageSource.causePlayerDamage(player)
  10. Block#canHarvestBlock is used to check whether the player has the tool to break the block or fire a PlayerEvent.HarvestCheck if he doesn't have the required tool to check whether he can. other mods may have other implementations but that's the forge implementation in the Block class
  11. I know that in the block class it Block#getMetaFromState and Block#getStateFromMeta but I mean if you want to make a BlockState like you make a new ItemStack from somewhere else in the code, can't you use IBlockState#withProperty ?
  12. Shouldn't the easier way be by block.getDefaultState.withProperty(IProperty, value) ?
  13. override Item.getSubItems(Item, CreativeTabs, List<ItemStack>) if you don't already, you return the list after adding all the sub-items of the item you are making so it can be shown in the creative tab
  14. We offer help for free here in this forum, don't ask for anything to give the answer. What you did is intolerable! As for op, A lot of things are quite similar but here's what you should change: Make sure the class implements IWorldGenerator The fifth parameter of generate should be of type IChunkGenerator not IChunkProvider world.provider.getDimensionType() instead of world.provider.dimensionId and the cases are DimensionType.NETHER , DimensionType.OVERWORLD and/or DimensionType.THE_END new WorldGenMinable() now takes IBlockState which would indicate the block and the metadata. It also takes IPredicate<IBlockstate> to get the blocks that can surround the ore, you can get that using BlockMatcher.forBlock(Blocks.STONE) WorldGenMinable#generate() takes BlockPos instead of x , y and z which is easily made by new BlockPos(x, y, z)
  15. if you mean then that's not java-related but explaining what you might want to do.
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.