Everything posted by Notunknown
-
[1.9] ItemAxe ArrayOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException: 5 at net.minecraft.item.ItemAxe.<init>(ItemAxe.java:19) ~[forgeSrc-1.9-12.16.0.1858-1.9.jar:?] at ... Error is caused by a subclass of ItemAxe calling super(custom material) Sword, Shovel and Pickaxe work fine.
-
[1.9] NBT change resetting block break
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?
-
[1.9] Increasing player attack distance
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?
-
[1.9] SharedMonsterAttributes RANGE
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.
-
[1.9] SharedMonsterAttributes RANGE
Really? I had been searching for it, but never found anything which suggest that it exists.
-
[1.9] Change Layer Color
How do I change the color of a specific layer? For example, for potions or leather armour?
-
Why isn't Forge the "Official" mod loader for Minecraft
Isn't Minecraft a giant pile of hacks?
-
[1.9] NBT change resetting block break
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.
-
[1.9] SharedMonsterAttributes RANGE
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).
-
[1.9] Item#shouldCauseReequipAnimation does not affect block breaking
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.
-
[1.9] NBT change resetting block break
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.
-
[1.9] NBT change resetting block break
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"); }
-
[1.9] NBT change resetting block break
I am overriding that - but it still does not prevent block break from resetting...
-
[1.9] NBT change resetting block break
Right, but is there a way to not cause it to refresh the block break whenever NBT data changes? It really makes things problematic.
-
[1.9] NBT change resetting block break
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.
-
[1.9] NBT change resetting block break
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?
-
[1.9] [Fixed] RightClickBlock occurs 4 times
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.
-
[1.9] [Fixed] RightClickBlock occurs 4 times
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?
-
[1.9] [Fixed] Re-equip Animation
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.
-
[1.8.9] Composite Models
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.
-
[1.8.9] Composite Models
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?
-
[1.8.9] Composite Models
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?
-
[1.8.9] Composite Models
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?
-
[1.8] Code-based item renderer
Works perfectly, thank you!
-
[1.8] Code-based item renderer
I have an item, which contains NBT data about an ItemStack, and I wish to have the model of the item be the model that the NBT ItemStack would use. (Sorry for the bad explanation.) Edit: How do I register an ISmartItemModel for my item?
IPS spam blocked by CleanTalk.