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

PegBeard

Members
  • Posts

    59
  • Joined

  • Last visited

Posts posted by PegBeard

  1. Before 1.9 I was using this piece of code to add a direct heal when food was eaten.

     

    @SubscribeEvent
    public void onUseItem(PlayerUseItemEvent.Finish event)
    {
    	if (event.item.getItem() instanceof ItemFood)
    	{
    		float h = 0.3F * (((ItemFood)event.item.getItem()).getHealAmount(event.item));
    		event.entityPlayer.heal(h);
    	}
    }

     

    Obviously, this applied the heal to all food, which was what I wanted.

     

    In 1.9, I have switched to the 'LivingEntityUseItemEvent.Finish' event, but this doesn't work in the same way.

    My main problem is that 'event.getItem()' does not allow me to check if the item is an instance of 'ItemFood' and I am unsure how to do this for 1.9.

    I do want this to cover all food, so matching the item to each individual food would be impractical. Any suggestions would be much appreciated.

     

    (this effect is only added if natural regen is off, I just trimmed the code because that still works)

  2. In 1.8 I used this piece of code to drop a random enchanted book from the list of registered enchantments.

     

    Enchantment enchant = Enchantment.enchantmentsBookList[itemRand.nextInt(Enchantment.enchantmentsBookList.length)];
    int level = MathHelper.getRandomIntegerInRange(itemRand, enchant.getMinLevel(), enchant.getMaxLevel());
    ItemStack book = Items.ENCHANTED_BOOK.getEnchantedItemStack(new EnchantmentData(enchant, level));
    player.entityDropItem(book, 1);

     

    However, in 1.9.4 'enchantmentsBookList cannot be resolved'. I have done some searching, but I have been unable to find a replacement. Is there a method I can use to fix this piece of code, or should I try something different.

  3. It seems the LivingJumpEvent is detecting a change in the entity Ymotion (I may be wrong). This has caused some unexpected issues.

     

    I have noticed, while using LivingJumpEvent, the event triggers when climbing ladders. I have used !player.isOnLadder() to avoid this, but the event still triggers when the player reaches the top of a ladder.

    The event also triggers when the player is attacked (knocked back), but only when on a server.

  4. Pretty simple question: Do I need a tile entity?

     

    Specifically, if I make a functional block, such as a block breaker, but don't give it an inventory, do I still need a tile entity? I have looked at tutorials for functional blocks, but they have all used inventories and none of them discussed the necessity of tile entities.

  5. I have a couple of custom enchants, and I have the effects for when my item is enchanted. Everything works fine in that regard.

    My problem is that my enchants are being applied to vanilla items.

    Currently, my custom item extends ItemBow, thus my enchants use the EnumEnchantmentType.BOW.

     

    I have been looking around for a way to prevent my enchants from appearing on vanilla items, and/or for a way to specify a custom enchant type, but most tutorials/requests for help only go into adding effects to vanilla stuff (the opposite of what I want)

     

    I have tried this, on suggestion from a search result:

     

    public boolean canApply(ItemStack stack) {
    if (stack.getItem() instanceof DTPotshot) {
    	return true;
    } else {
    	return false;
    }
    }
    

     

    And:

    public boolean canApply(ItemStack stack) {
    if (stack.getItem() == DTItems.potShot) {
    	return true;
    } else {
    	return false;
    }
    }
    

     

     

    But this seems do have done utterly nothing (that I can see).

     

    My question is; how can I set a custom Enchant Type (if possible), or how can I prevent my enchants on going on vanilla items?

  6. I have an item that causes the player to 'slowfall', while wearing the item and sneaking. This code works as intended but after a few seconds (if playing on a server) the player is kicked for flying.

     

    I am aware that I can set 'allowFlying' to true, in the armour tick, and false, in a tick handler. But I had some concerns about this and would appreciate some clarification.

     

    Firstly, would setting allowFlying to false in a tick handler cause issues with other mods trying to grant permission for a similar reason?

    Second, I don't actually want to grant the player the ability to fly, as this item is not intended to completely protect the player from falling or enable them to go higher, so is there a way I can prevent being kicked without using flight permissions?

     

    If it makes a difference, I am using player.motionY to limit the player's falling speed, and ((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S12PacketEntityVelocity(player)) to update the player.

     

     

    @Override
    public void onArmorTick(World world, EntityPlayer player, ItemStack stack)
    {
    if (player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem() == DTItems.rexoLeggings)
    {
    	if (!player.onGround && !player.isOnLadder() && !player.isInWater() && player.motionY < 0)
    	{
    		if (player.isSneaking())
    		{
    			if (world.isRemote)
    			{
    				world.spawnParticle("fireworksSpark", player.posX, player.posY - 1.5D, player.posZ, itemRand.nextGaussian() * 0.05D, -player.motionY * 0.5D, itemRand.nextGaussian() * 0.05D);
    			}
    			if (!world.isRemote && player.motionY < -0.1)
    			{
    				player.motionY += 0.1;
    				((EntityPlayerMP) player).playerNetServerHandler.sendPacket(new S12PacketEntityVelocity(player));
    				if (player.fallDistance < 1)
    				{
    					player.fallDistance = 1;
    				}
    				else
    				{
    					--player.fallDistance;
    				}
    			}
    		}
    	}
    }
    }
    

     

  7. I had guessed it was something like checking the Y motion, or what not. Just thought it was really odd, as it seems like a bug.

    I can work around it with a keybind for my item, instead of livingJump (just didn't really want to), unless anyone has a good idea on a work around.

     

    Also, would it be a good idea to report this as a bug?

  8. I would rather do this without using the jump boost potion effect on armour tick, and like I said I have already got a working jump boost. My question wasn't how to make the player jump higher, but why does livingJump trigger when the player is knocked and how can I prevent it.

  9. I have piece of armour that increases the player's jump height when worn. I have achieved this by using the living jump event, which works fine in single player, but on multiplayer the effect triggers when the player wearing the item is attack or otherwise knocked back/upward.

     

    I am trying to avoid using keybinds, which is why I am using the jump event. I am just not sure why it fires when the jump key isn't pressed.

     

    I have tried checking is the player was recently hurt and not proceeding if true, but that doesn't seem like a great way to do it.

    I've been trying to fix this for several days, and that's the best I could come up with, so suggestions would be greatly appreciated.

  10. I have a feeling this is a really simple thing to do and probably a dumb question, but I have been searching for a while and not really found what I am looking for.

     

    What I want to do is, detect when the player selects an item (scrolls to it, or presses the hotbar number). I have attempted to check the player's currently equipped item and compare it to the previously equipped item (as in the last held item), but I couldn't find a method for previously equipped items.

     

    I did attempt a LivingUpdateEvent, to check and store the held item, but it didn't seem like the most practical way to do it, so I was wondering if anyone could advise me on a better way to detect when the player changes their held item.

  11. I have made a new block, extending BlockPane. Initially, I had the texture set to the vanilla Iron Bars. This didn't require me to register any textures (obviously), just declare the already registered texture, when initialising the block, like so:

     

    public static Block poweredFence = new REFence("iron_bars", "iron_bars", Material.rock, false).setBlockName(Names.Traps.POWEREDFENCE);

     

    Now that I have gotten the block functioning as I want it to, I am attempting to add my own texture to it. I tried registering the texture as normal, in the block class - and adjusting the block initialisation:

     

    public static Block poweredFence = new REFence("powered_fence", "powered_fence", Material.rock, false).setBlockName(Names.Traps.POWEREDFENCE);

     

    @SideOnly(Side.CLIENT)
        @Override
        public void registerBlockIcons(IIconRegister icon)
        {
            blockIcon = icon.registerIcon(this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
        }

     

    This has worked for everything else I have done, and does retexture the in-hand icon, but when placed in the world the game crashes with a null pointer exception.

    I know that I need to register the texture file, and the way I have it works, but I am not sure why it causes a crash when the block is placed.

    I presume I need to register the icon somewhere else, though I am not sure where/how, as registering the icon in my client proxy was unsuccessful and I couldn't find a sufficient tutorial that explained/solved my problem.

     

    Here is the crash report too:

     

    ---- Minecraft Crash Report ----

    // I blame Dinnerbone.

     

    Time: 22/07/15 19:45

    Description: Unexpected error

     

    java.lang.NullPointerException: Unexpected error

    at net.minecraft.client.renderer.RenderBlocks.renderBlockPane(RenderBlocks.java:3275)

    at net.minecraft.client.renderer.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:378)

    at net.minecraft.client.renderer.WorldRenderer.updateRenderer(WorldRenderer.java:207)

    at net.minecraft.client.renderer.RenderGlobal.updateRenderers(RenderGlobal.java:1618)

    at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1263)

    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1091)

    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1068)

    at net.minecraft.client.Minecraft.run(Minecraft.java:962)

    at net.minecraft.client.main.Main.main(Main.java:164)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

    at GradleStart.main(Unknown Source)

     

     

    A detailed walkthrough of the error, its code path and all known details is as follows:

    ---------------------------------------------------------------------------------------

     

    -- Head --

    Stacktrace:

    at net.minecraft.client.renderer.RenderBlocks.renderBlockPane(RenderBlocks.java:3275)

    at net.minecraft.client.renderer.RenderBlocks.renderBlockByRenderType(RenderBlocks.java:378)

    at net.minecraft.client.renderer.WorldRenderer.updateRenderer(WorldRenderer.java:207)

    at net.minecraft.client.renderer.RenderGlobal.updateRenderers(RenderGlobal.java:1618)

    at net.minecraft.client.renderer.EntityRenderer.renderWorld(EntityRenderer.java:1263)

     

    -- Affected level --

    Details:

    Level name: MpServer

    All players: 1 total; [EntityClientPlayerMP['PegBeard'/418, l='MpServer', x=394.15, y=5.62, z=-48.13]]

    Chunk stats: MultiplayerChunkCache: 70, 70

    Level seed: 0

    Level generator: ID 01 - flat, ver 0. Features enabled: false

    Level generator options:

    Level spawn location: World: (387,4,-56), Chunk: (at 3,0,8 in 24,-4; contains blocks 384,0,-64 to 399,255,-49), Region: (0,-1; contains chunks 0,-32 to 31,-1, blocks 0,0,-512 to 511,255,-1)

    Level time: 978 game time, 978 day time

    Level dimension: 0

    Level storage version: 0x00000 - Unknown?

    Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false)

    Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false

    Forced entities: 30 total; [EntityClientPlayerMP['PegBeard'/418, l='MpServer', x=394.15, y=5.62, z=-48.13], EntitySlime['Slime'/330, l='MpServer', x=392.25, y=4.00, z=-94.99], EntitySlime['Slime'/331, l='MpServer', x=399.45, y=4.00, z=9.81], EntitySlime['Slime'/332, l='MpServer', x=393.43, y=4.00, z=20.43], EntitySheep['Sheep'/336, l='MpServer', x=429.50, y=4.00, z=-83.50], EntitySheep['Sheep'/337, l='MpServer', x=431.22, y=4.00, z=-82.22], EntityCow['Cow'/338, l='MpServer', x=431.34, y=4.00, z=-84.03], EntityCow['Cow'/339, l='MpServer', x=429.50, y=4.00, z=-85.50], EntityCow['Cow'/340, l='MpServer', x=429.13, y=4.00, z=-87.84], EntitySlime['Slime'/276, l='MpServer', x=329.70, y=4.00, z=30.91], EntityCow['Cow'/341, l='MpServer', x=430.41, y=4.00, z=-87.84], EntitySlime['Slime'/342, l='MpServer', x=430.09, y=4.00, z=-41.19], EntitySlime['Slime'/343, l='MpServer', x=422.66, y=4.00, z=26.34], EntityPig['Pig'/347, l='MpServer', x=437.69, y=4.00, z=-80.41], EntityPig['Pig'/348, l='MpServer', x=436.22, y=4.00, z=-82.66], EntityPig['Pig'/349, l='MpServer', x=441.81, y=4.00, z=-87.19], EntitySheep['Sheep'/350, l='MpServer', x=436.50, y=4.00, z=-81.31], EntitySheep['Sheep'/351, l='MpServer', x=432.75, y=4.00, z=-82.28], EntityPig['Pig'/352, l='MpServer', x=441.47, y=4.00, z=-70.19], EntitySlime['Slime'/353, l='MpServer', x=440.34, y=4.00, z=-69.92], EntitySlime['Slime'/354, l='MpServer', x=440.92, y=4.00, z=-17.69], EntitySlime['Slime'/355, l='MpServer', x=443.21, y=4.00, z=-15.37], EntityCow['Cow'/359, l='MpServer', x=460.22, y=4.00, z=-92.50], EntityCow['Cow'/360, l='MpServer', x=461.81, y=4.00, z=-92.50], EntitySlime['Slime'/297, l='MpServer', x=336.47, y=4.00, z=11.72], EntitySlime['Slime'/361, l='MpServer', x=449.97, y=4.00, z=-31.70], EntitySlime['Slime'/362, l='MpServer', x=464.07, y=4.00, z=-9.12], EntitySheep['Sheep'/307, l='MpServer', x=365.13, y=4.00, z=-31.88], EntitySlime['Slime'/318, l='MpServer', x=373.84, y=4.00, z=-20.43], EntitySlime['Slime'/319, l='MpServer', x=368.66, y=4.00, z=11.81]]

    Retry entities: 0 total; []

    Server brand: fml,forge

    Server type: Integrated singleplayer server

    Stacktrace:

    at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:415)

    at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2567)

    at net.minecraft.client.Minecraft.run(Minecraft.java:991)

    at net.minecraft.client.main.Main.main(Main.java:164)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

    at java.lang.reflect.Method.invoke(Unknown Source)

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source)

    at GradleStart.main(Unknown Source)

     

    -- System Details --

    Details:

    Minecraft Version: 1.7.10

    Operating System: Windows 7 (x86) version 6.1

    Java Version: 1.8.0_51, Oracle Corporation

    Java VM Version: Java HotSpot Client VM (mixed mode, sharing), Oracle Corporation

    Memory: 56544648 bytes (53 MB) / 173981696 bytes (165 MB) up to 259522560 bytes (247 MB)

    JVM Flags: 0 total;

    AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

    IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0

    FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.3.1408 4 mods loaded, 4 mods active

    mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available

    FML{7.10.99.99} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.3.1408-1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available

    Forge{10.13.3.1408} [Minecraft Forge] (forgeSrc-1.7.10-10.13.3.1408-1.7.10.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available

    RedstoneEngineering{inDev} [RedstoneEngineering] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available->Available->Available->Available->Available->Available

    GL info: ' Vendor: 'ATI Technologies Inc.' Version: '4.2.12422 Compatibility Profile Context 13.152.0.0' Renderer: 'AMD Radeon HD 8670D'

    Launched Version: 1.7.10

    LWJGL: 2.9.1

    OpenGL: AMD Radeon HD 8670D GL version 4.2.12422 Compatibility Profile Context 13.152.0.0, ATI Technologies Inc.

    GL Caps: Using GL 1.3 multitexturing.

    Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.

    Anisotropic filtering is supported and maximum anisotropy is 16.

    Shaders are available because OpenGL 2.1 is supported.

     

    Is Modded: Definitely; Client brand changed to 'fml,forge'

    Type: Client (map_client.txt)

    Resource Packs: []

    Current Language: English (US)

    Profiler Position: N/A (disabled)

    Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used

    Anisotropic Filtering: Off (1)

     

  12. Based on more than one tutorial, I was under the impression that in "(Material.Armor.GOLDPLATE, 27, 0)" was "amour material, unique model id, armourslot(helmet, boots, etc.)".

    From what you say, I presume, if I change the '27' to '0' my armour would render as vanilla cloth armour? or would it render my specified textures?

     

    I do apologise for what is probably a dumb question, but I'm still fairly new to making an MC mod and just lack some experience.

  13. Armour class

     

    public class ArmorGoldplate extends ItemArmor
    {
        public ArmorGoldplate(ArmorMaterial par1ArmorMaterial, int par2Int, int par3Int)
        {
            super(Material.Armor.GOLDPLATE, par2Int, par3Int);
    	this.setUnlocalizedName(Names.Armor.GOLDPLATE_ARMOR);
            this.setCreativeTab(DungeonTacticsCreativeTab.DUNGEONTACTICS_TAB);
    }
    
    @Override
    public String getUnlocalizedName()
    {
    	return String.format("item.%s%s", Reference.MOD_ID.toLowerCase() + ":", getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
    }
    
    @Override
    public String getUnlocalizedName(ItemStack ItemStack)
    {
    	return String.format("item.%s%s", Reference.MOD_ID.toLowerCase() + ":", getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
    }
    
    protected String getUnwrappedUnlocalizedName(String unlocalizedName)
    {
    	return unlocalizedName.substring(unlocalizedName.indexOf(".") + 1);
    }
    
        @Override
        @SideOnly(Side.CLIENT)
        public void registerIcons(IIconRegister iconRegister)
        {
            itemIcon = iconRegister.registerIcon(this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf(".") + 1));
        }
    
    @Override
    @SideOnly(Side.CLIENT)
    public String getArmorTexture(ItemStack par1ItemStack, Entity par2Entity, int slot, String type)
    {
    	if (par1ItemStack.getItem() == DungeonTacticsItems.goldplateHelmet || par1ItemStack.getItem() == DungeonTacticsItems.goldplateChestplate || par1ItemStack.getItem() == DungeonTacticsItems.goldplateBoots)
    	{
    		return Reference.MOD_ID.toLowerCase() + ":textures/armor/" + Names.Armor.GOLDPLATE_ARMOR + "_layer_1.png";
    	}
    	if (par1ItemStack.getItem() == DungeonTacticsItems.goldplateLeggings);
    	{
    		return Reference.MOD_ID.toLowerCase() + ":textures/armor/" + Names.Armor.GOLDPLATE_ARMOR + "_layer_2.png";
    	}
    }
    }

     

     

    Item register

     

    @GameRegistry.ObjectHolder(Reference.MOD_ID)
    public class DungeonTacticsItems
    {
    public static Item goldplateHelmet = new ArmorGoldplate(Material.Armor.GOLDPLATE, 27, 0).setUnlocalizedName(Names.Armor.GOLDPLATE_HELMET);
    public static Item goldplateChestplate = new ArmorGoldplate(Material.Armor.GOLDPLATE, 28, 1).setUnlocalizedName(Names.Armor.GOLDPLATE_CHESTPLATE);
    public static Item goldplateLeggings = new ArmorGoldplate(Material.Armor.GOLDPLATE, 29, 2).setUnlocalizedName(Names.Armor.GOLDPLATE_LEGGINGS);
    public static Item goldplateBoots = new ArmorGoldplate(Material.Armor.GOLDPLATE, 30, 3).setUnlocalizedName(Names.Armor.GOLDPLATE_BOOTS);
    
    public static void Init()
    {
    	GameRegistry.registerItem(goldplateHelmet, Names.Armor.GOLDPLATE_HELMET);
    	GameRegistry.registerItem(goldplateChestplate, Names.Armor.GOLDPLATE_CHESTPLATE);
    	GameRegistry.registerItem(goldplateLeggings, Names.Armor.GOLDPLATE_LEGGINGS);
    	GameRegistry.registerItem(goldplateBoots, Names.Armor.GOLDPLATE_BOOTS);
    }
    }

     

     

    Main class

     

    @Mod(modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION)
    
    public class DungeonTactics
    {
    
    @Mod.Instance (Reference.MOD_ID)
    public static DungeonTactics instance;
    
    @SidedProxy (clientSide = Reference.CLIENT_PROXY_CLASS, serverSide = Reference.SERVER_PROXY_CLASS)
    public static IProxy proxy;
    
    @Mod.EventHandler
    public void preInitialize (FMLPreInitializationEvent event)
    {
    	FMLCommonHandler.instance().bus().register(event);
        	MinecraftForge.EVENT_BUS.register(event);
        	DungeonTacticsItems.Init();
    }
    
    @Mod.EventHandler
    public void initialize (FMLInitializationEvent event)
    {
    	proxy.registerRenderThings();
    	proxy.registerSounds();
    	DungeonTacticsEntities.Init();
    	DungeonTacticsShapedRecipes.Init();
    	DungeonTacticsShapelessRecipes.Init();
    }
    
    @Mod.EventHandler
    public void postInitialization (FMLPostInitializationEvent event)
    {
    
    }
    }

     

     

    I don't have my own renderer, because none of the tutorials I followed even hinted that I needed one, and I don't call a vanilla renderer specifically for the armour for the same reason.

    I am presuming that is the problem, but I am still unfamiliar with many methods, as I'm still fairly new to MC modding (and never done armour before).

  14. I have followed several tutorials and I have my armour working as intended, the only issue is - when worn, the armour is not being displayed on the player.

    The item icons work properly, and MC recognises each armour piece as either helmet, boots, etc. But I can't work out why the armour is not displayed on the player when worn.

     

    This is the code I am using, based on the tutorials I have followed. This is for 1.7.10 and it is the first time I have tried to do armour.

     

    @Override
    @SideOnly(Side.CLIENT)
    public String getArmorTexture(ItemStack par1ItemStack, Entity par2Entity, int slot, String type)
    {
    	if (par1ItemStack.getItem() == DungeonTacticsItems.goldplateHelmet || par1ItemStack.getItem() == DungeonTacticsItems.goldplateChestplate || par1ItemStack.getItem() == DungeonTacticsItems.goldplateBoots)
    	{
    		return Reference.MOD_ID.toLowerCase() + ":textures/armor/" + Names.Armor.GOLDPLATE_ARMOR + "_layer_1.png";
    	}
    	if (par1ItemStack.getItem() == DungeonTacticsItems.goldplateLeggings);
    	{
    		return Reference.MOD_ID.toLowerCase() + ":textures/armor/" + Names.Armor.GOLDPLATE_ARMOR + "_layer_2.png";
    	}
    }

     

     

    In my client proxy I have 'registerRenderThings', for registering some entities, but none of the tutorials have mentioned using that for rendering the armour on the player. Not sure if that is relevant or not.

     

    Also, I get this in the system log, when I open the inventory with the armour equipped.

     

    [20:14:31] [Client thread/ERROR]: Couldn't render entity

    java.lang.ArrayIndexOutOfBoundsException: 27

    at net.minecraft.client.renderer.entity.RenderBiped.getArmorResource(RenderBiped.java:408) ~[RenderBiped.class:?]

    at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:70) ~[RenderPlayer.class:?]

    at net.minecraft.client.renderer.entity.RenderPlayer.shouldRenderPass(RenderPlayer.java:517) ~[RenderPlayer.class:?]

    at net.minecraft.client.renderer.entity.RendererLivingEntity.doRender(RendererLivingEntity.java:173) [RendererLivingEntity.class:?]

    at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:167) [RenderPlayer.class:?]

    at net.minecraft.client.renderer.entity.RenderPlayer.doRender(RenderPlayer.java:565) [RenderPlayer.class:?]

    at net.minecraft.client.renderer.entity.RenderManager.func_147939_a(RenderManager.java:300) [RenderManager.class:?]

    at net.minecraft.client.renderer.entity.RenderManager.renderEntityWithPosYaw(RenderManager.java:283) [RenderManager.class:?]

    at net.minecraft.client.gui.inventory.GuiInventory.func_147046_a(GuiInventory.java:112) [GuiInventory.class:?]

    at net.minecraft.client.gui.inventory.GuiContainerCreative.drawGuiContainerBackgroundLayer(GuiContainerCreative.java:839) [GuiContainerCreative.class:?]

    at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:93) [GuiContainer.class:?]

    at net.minecraft.client.renderer.InventoryEffectRenderer.drawScreen(InventoryEffectRenderer.java:44) [inventoryEffectRenderer.class:?]

    at net.minecraft.client.gui.inventory.GuiContainerCreative.drawScreen(GuiContainerCreative.java:673) [GuiContainerCreative.class:?]

    at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137) [EntityRenderer.class:?]

    at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1068) [Minecraft.class:?]

    at net.minecraft.client.Minecraft.run(Minecraft.java:962) [Minecraft.class:?]

    at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?]

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_45]

    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_45]

    at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_45]

    at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?]

    at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?]

    at net.minecraftforge.gradle.GradleStartCommon.launch(Unknown Source) [start/:?]

    at GradleStart.main(Unknown Source) [start/:?]

     

  15. To be fair, diesieben07, I am new to Minecraft modding and I still have things to learn - I am doing my best to get by, by looking for answers in vanilla code, but obviously I don't know the best methods, or even all of them.

    That's why I was asking for the best way t do what I wanted to do. I am by no means an idiot just because I am uninformed, so I won't take your reaction personally. But thanks for the pointer in the right direction.

×
×
  • Create New...

Important Information

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