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


  • Posts

  • Joined

  • Last visited

Everything posted by Notunknown

  1. But swords, pickaxes and shovels all work fine with the custom tool material, and the axe works fine if I substitute ToolMaterial.IRON there.
  2. java.lang.ArrayIndexOutOfBoundsException: 5 at net.minecraft.item.ItemAxe.<init>(ItemAxe.java:19) ~[forgeSrc-1.9-] at ... Error is caused by a subclass of ItemAxe calling super(custom material) Sword, Shovel and Pickaxe work fine.
  3. Can I just get a confirmation that this is bugged, there is a method that I forgot to override or an event that I need to use?
  4. I am working on increasing the attack/block break distance for players. I have using PlayerInteractionManager#setBlockReachDistance set it on the server to 100.0D and replaced PlayerControllerMP on the client to increase it to 100.0F there (Why is server double and client float?) and can now correctly interact 100 blocks away. But I cannot attack monsters 100 blocks away. I cannot attack them, nor interact with anything behind them. What am I missing?
  5. That is only for EntityPlayerMP. For the client, PlayerControllerMP only has getBlockReachDistance, no setBlockReachDistance. So even IF you increase the block reach distance on the server you wont be able to reach that far on the client.
  6. Really? I had been searching for it, but never found anything which suggest that it exists.
  7. How do I change the color of a specific layer? For example, for potions or leather armour?
  8. I don't see any situation where you do not want it to play the re-equip animation, but do want to reset the block break animation.
  9. This new attribute is mainly used for players, but it could be used by other mobs, increasing their hitbox for attacking. The RANGE attribute increases the distance which players can attempt to damage entities and break blocks. Now, although this can be replicated, it would make development easier and prevent potential mod conflicts (mostly for increasing block break range, as it requires replacing PlayerControllerMP).
  10. Whilst breaking a block, any change to an ItemStack's NBT data will reset the block break timer. This is unaffected by #shouldCauseReequipAnimation, meaning that it is impossible to prevent this from happening.
  11. Even when it simply returns false, it still does not allow it to break the block, so it probably has nothing to do with that method, but I will have a little look.
  12. Implementation of shouldCauseReequipAnimation? @Override public boolean shouldCauseReequipAnimation(ItemStack oldStack, ItemStack newStack, boolean slotChanged) { return !oldStack.isItemEqual(newStack) || oldStack.getTagCompound().getBoolean("glowing") != newStack.getTagCompound().getBoolean("glowing"); }
  13. I am overriding that - but it still does not prevent block break from resetting...
  14. Right, but is there a way to not cause it to refresh the block break whenever NBT data changes? It really makes things problematic.
  15. Hmm... I considered doing that. I will try that now. Also, is there a way to allocate an Item to a new ItemStack class? Edit: Oh yeah, that still will not work, as the tick counter does affect other NBT data periodically.
  16. I am changing a tick counter in an item every frame, and as a result the ItemStack is "changing" and thus appears to reset the block breakage. Is there a method I can override to prevent this?
  17. Once per hand? I completely forgot that players have two hands now... Also, I had assumed that it would only work on the side of the server. I guess that is the wrong assumption to make.
  18. Whenever I right click on a block, it calls RightClickBlock event 4 times, which is really messing up my mod. I am only registering it once, what am I doing wrong?
  19. Is shouldCauseReequipAnimation bugged, or has it been replaced? I use a lot of NBT manipulation (once per tick, in fact) and it is basically invisible, constantly at the bottom of the screen. I have changed shouldCauseReequipAnimation to always return false, but to no effect. Nevermind. Forge was just out of date. I should have thought of that sooner. I am an idiot.
  20. Okay, so maybe a more detailed explanation will help: So I am making a mod which includes weapons and tools made from a number of different components, such as a sword blade or pickaxe head. Although all weapons/tools of a type share the same base components, tools may contain one or more optional components. Now, rather than create tens or even hundreds of thousands of different models for each tool and weapon type, I want to create a model for each individual component, then use code based on the items NBT data to select which models to combine together to form the resulting model.
  21. I think I may be barking up the wrong tree, so to speak, with the method I am trying to use. There must be a method for this - right?
  22. I believe I have solved it, sort of. I solved it by using a custom IBakedModel class: import java.util.ArrayList; import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemModelMesher; import net.minecraft.client.renderer.block.model.BakedQuad; import net.minecraft.client.renderer.block.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.resources.model.IBakedModel; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; public class ItemTestModel implements IBakedModel { @Override public List<BakedQuad> getFaceQuads(EnumFacing p_177551_1_) { List<BakedQuad> quads = new ArrayList<BakedQuad>(); ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher(); quads.addAll(0, mesher.getItemModel(new ItemStack(Items.apple)).getFaceQuads(p_177551_1_)); quads.addAll(0, mesher.getItemModel(new ItemStack(Items.diamond_horse_armor)).getFaceQuads(p_177551_1_)); return quads; } @Override public List<BakedQuad> getGeneralQuads() { List<BakedQuad> quads = new ArrayList<BakedQuad>(); ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher(); quads.addAll(0, mesher.getItemModel(new ItemStack(Items.apple)).getGeneralQuads()); quads.addAll(0, mesher.getItemModel(new ItemStack(Items.diamond_horse_armor)).getGeneralQuads()); return quads; } @Override public boolean isAmbientOcclusion() { return false; } @Override public boolean isGui3d() { return false; } @Override public boolean isBuiltInRenderer() { return false; } @Override public TextureAtlasSprite getParticleTexture() { ItemModelMesher mesher = Minecraft.getMinecraft().getRenderItem().getItemModelMesher(); return mesher.getItemModel(new ItemStack(Items.diamond_horse_armor)).getParticleTexture(); } @Override public ItemCameraTransforms getItemCameraTransforms() { return ItemCameraTransforms.DEFAULT; } } Edit: Ah, I just noticed that the item is held at a strange angle in third person, which I believe is to do with getItemCameraTransforms. If this is the case, what is the ItemCameraTransforms that I should be using, if not DEFAULT?
  23. I have an item which is made from an unknown number of components, depending on the NBT data of the item. For this, I believe the easiest strategy would be to use a composite of multiple models, chosen with the code. Is there any way to do this?
  • Create New...

Important Information

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