Jump to content

MrProg

Members
  • Posts

    69
  • Joined

  • Last visited

Everything posted by MrProg

  1. It's in EntityPlayer class and I used it for getting the amount of time the player has been in bed for when an event could be triggered doing a bunch of things with the player such as take and give things from their inventories.
  2. Hi, Im updating an event with forge and it works well and all but when I go to use it on a server it doesn't work since sleepTimer has been changed to a private variable. Anyone have any suggestions of what maybe I can replace with this?
  3. Yeah that's what I thought but I wanted to make sure if there were any other way I didn't know of.
  4. So basically I have 10 items under one id/item using metadata. How can I get commonItem:9 to use bFull3D but have the others stay rendered like normal items? Here is my commonItem class if needed: public class ItemCommonItem extends ItemBaseItem{ public ItemCommonItem() { super(); this.setHasSubtypes(true); this.setMaxDamage(0); } @SideOnly(Side.CLIENT) private IIcon[] icons; @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister par1IconRegister) { icons = new IIcon[10]; for(int i = 0; i < icons.length; i++) { icons[i] = par1IconRegister.registerIcon(Wintercraft.modid + ":" + (this.getUnlocalizedName().substring(5)) + i); } } public IIcon getIconFromDamage(int par1) { return icons[par1]; } @SideOnly(Side.CLIENT) public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) { for (int x = 0; x < 10; x++) { par3List.add(new ItemStack(this, 1, x)); } } public static final String[] names = new String[] {"0", "1", "2", "3","4","5","6","7","8","9"}; public String getUnlocalizedName(ItemStack par1ItemStack) { int i = MathHelper.clamp_int(par1ItemStack.getItemDamage(), 0, 15); return super.getUnlocalizedName() + "." + names[i]; } }
  5. Oh wow you're right. I cleaned it up a bit, now the item is completely invisible which my guess is because there's nothing in INVENTORY yet. package wintercraft.render.item; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; import org.lwjgl.opengl.GL11; import cpw.mods.fml.client.FMLClientHandler; import wintercraft.Wintercraft; import wintercraft.render.models.ModelOrnament; public class ItemOrnamentRenderer implements IItemRenderer { private static RenderItem renderItem = new RenderItem(); protected ModelOrnament model; public ItemOrnamentRenderer() { model = new ModelOrnament(); } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch (type) { case EQUIPPED: return true; case EQUIPPED_FIRST_PERSON: return true; case ENTITY: return true; case INVENTORY: return true; default: return false; } } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return false; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch (type) { case EQUIPPED_FIRST_PERSON: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(Wintercraft.modid.toLowerCase(), "textures/blocks/ornament" + item.getItemDamage() + ".png")); GL11.glRotatef(0.0f, 0.0F, -0.0F, -1.0F); GL11.glRotatef(0.0f, 0.0F, -0.0F, 1.0F); GL11.glRotatef(40.0f, 0.0F, -0.0F, 1.0F); GL11.glTranslatef(0.6F, -0.9F, -0.3F); float scale1 = 1.5F; GL11.glScalef(scale1, scale1, scale1); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); }break; case ENTITY: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(Wintercraft.modid.toLowerCase(), "textures/blocks/ornament" + item.getItemDamage() + ".png")); GL11.glRotatef(0.0f, 0.0F, -0.0F, -1.0F); GL11.glRotatef(0.0f, 0.0F, -0.0F, 1.0F); GL11.glRotatef(0.0f, 0.0F, -0.0F, 1.0F); GL11.glTranslatef(-0.025F,-0.7F, 0F); float scale1 = 1.0F; GL11.glScalef(scale1, scale1, scale1); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); }break; case EQUIPPED: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(Wintercraft.modid.toLowerCase(), "textures/blocks/ornament" + item.getItemDamage() + ".png")); GL11.glRotatef(0.0f, 0.0F, -0.0F, -1.0F); GL11.glRotatef(0.0f, 0.0F, -0.0F, 1.0F); GL11.glRotatef(40.0f, 0.0F, -0.0F, 1.0F); GL11.glTranslatef(0.3F, -0.65F, -0.1F); float scale1 = 1.0F; GL11.glScalef(scale1, scale1, scale1); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); }break; case INVENTORY: { }break; default: break; } } }
  6. Like this, correct? GameRegistry.registerBlock(ornament, ItemOrnamentBlock.class, "ornamentItem");
  7. I've updated to the latest and it still doesn't work
  8. I'm using forge-1.7.10-10.13.0.1180 but I will try updating it to the latest soon.
  9. Thanks, I already had one though and doing it your way doesn't seem to change anything either. ItemBlock public class ItemOrnamentBlock extends ItemBlock { final static String[] subBlocks = new String[]{"RedOrnament","GreenOrnament","BlueOrnament"}; public ItemOrnamentBlock(Block par1) { super(par1); setHasSubtypes(true); } public String getUnlocalizedName(ItemStack itemstack) { int i = itemstack.getItemDamage(); if(i < 0 || i >= subBlocks.length){ i = 0; } return super.getUnlocalizedName() + "." + subBlocks[i]; } public int getMetadata(int par1) { return par1; } }
  10. Yeah sorry for not including the rest but here it is: Ornamanet Renderer public class OrnamentRenderer extends TileEntitySpecialRenderer { static final float scale = (float)(1.0 / 16.0); private ModelOrnament model; public OrnamentRenderer() { model = new ModelOrnament(); } @Override public void renderTileEntityAt(TileEntity var1, double x, double y, double z, float tick) { this.renderAModelAt((TileEntityOrnament)var1, x, y, z, tick); } public void renderAModelAt(TileEntityOrnament tileentity1, double x, double y, double z, float f) { GL11.glPushMatrix(); GL11.glTranslated((float)x + 0.5F, (float)y, (float)z + 0.5F); this.bindTexture(new ResourceLocation(Wintercraft.modid.toLowerCase(), "textures/blocks/ornament" + tileentity1.getBlockMetadata() + ".png")); GL11.glPushMatrix(); model.render(0.0625F); GL11.glPopMatrix(); GL11.glPopMatrix(); } } Item Renderer - Ornament public class ItemOrnamentRenderer implements IItemRenderer { protected ModelOrnament model; public ItemOrnamentRenderer() { model = new ModelOrnament(); } @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch (type) { case EQUIPPED: return true; case EQUIPPED_FIRST_PERSON: return true; case ENTITY: return true; default: return false; } } @Override public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) { return false; } @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { switch (type) { case EQUIPPED_FIRST_PERSON: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(Wintercraft.modid.toLowerCase(), "textures/blocks/ornament" + item.getItemDamage() + ".png")); GL11.glRotatef(0.0f, 0.0F, -0.0F, -1.0F); GL11.glRotatef(0.0f, 0.0F, -0.0F, 1.0F); GL11.glRotatef(40.0f, 0.0F, -0.0F, 1.0F); GL11.glTranslatef(0.6F, -0.9F, -0.3F); float scale1 = 1.5F; GL11.glScalef(scale1, scale1, scale1); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } default: break; } switch (type) { case ENTITY: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(Wintercraft.modid.toLowerCase(), "textures/blocks/ornament" + item.getItemDamage() + ".png")); GL11.glRotatef(0.0f, 0.0F, -0.0F, -1.0F); GL11.glRotatef(0.0f, 0.0F, -0.0F, 1.0F); GL11.glRotatef(0.0f, 0.0F, -0.0F, 1.0F); GL11.glTranslatef(-0.025F,-0.7F, 0F); float scale1 = 1.0F; GL11.glScalef(scale1, scale1, scale1); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } default: break; } switch (type) { case EQUIPPED: { GL11.glPushMatrix(); Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(Wintercraft.modid.toLowerCase(), "textures/blocks/ornament" + item.getItemDamage() + ".png")); GL11.glRotatef(0.0f, 0.0F, -0.0F, -1.0F); GL11.glRotatef(0.0f, 0.0F, -0.0F, 1.0F); GL11.glRotatef(40.0f, 0.0F, -0.0F, 1.0F); GL11.glTranslatef(0.3F, -0.65F, -0.1F); float scale1 = 1.0F; GL11.glScalef(scale1, scale1, scale1); model.render((Entity) data[1], 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0625F); GL11.glPopMatrix(); } default: break; } } } Client Proxy public class ClientProxy extends CommonProxy{ @Override public void registerRenderThings() { //Red Candle ClientRegistry.bindTileEntitySpecialRenderer(TileEntityCandle.class, new CandleRenderer()); //Red Ornament ClientRegistry.bindTileEntitySpecialRenderer(TileEntityOrnament.class, new OrnamentRenderer()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(WinterBlocks.ornament), new ItemOrnamentRenderer()); //Head ClientRegistry.bindTileEntitySpecialRenderer(TileEntitySnowManHead.class, new SnowManHeadRenderer()); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(WinterBlocks.snowManHead), new ItemSnowManHeadRenderer()); RenderingRegistry.registerBlockHandler(2105, RenderFreezer.INSTANCE); } } Now the problem isn't seeing the texture when I hold it but the texture when it's in my inventory, here's a screenshot to kinda show what I mean:
  11. Hello again. I seem to have some trouble with this block having metadata. It's setup to have 3 blocks, a red, green, and blue ornament but for some reason when they all use the same texture in-game (ornamentItem0.png) instead of the others using their textures of ornamentItem1.png and ornamentItem2.png . Here's my ornament block code: http://pastebin.com/VgfD7Byj Could it because I'm using a custom model for it? The model itself selects the correct texture for each one by the way. It's only the texture when you hold it in your hand that's messed up.
  12. Yeah true. I'll try reworking this some other way. Thanks for the help/tips though.
  13. I know this doesn't have anything to do with your last response but I have looked into it. Shouldn't this work? public class FreezerRecipes { private static final FreezerRecipes smeltingBase = new FreezerRecipes(); //I changed this List to ItemStack instead of Integer. private HashMap<List<ItemStack>, ItemStack> metaSmeltingList = new HashMap<List<ItemStack>, ItemStack>(); private Map smeltingList = new HashMap(); private HashMap<List<Integer>, Float> metaExperience = new HashMap<List<Integer>, Float>(); /** * Used to call methods addInscribing and getInscribingResult. */ public static final FreezerRecipes smelting() { return smeltingBase; } /** * Adds all recipes to the HashMap */ private FreezerRecipes() { this.addSmelting(Arrays.asList(new ItemStack(Items.water_bucket, 1, 0),new ItemStack(Items.water_bucket, 1, 0)), new ItemStack(Blocks.ice, 4, 0), 0.2F); } public void addSmelting(List<ItemStack> items, ItemStack out, float experience) { smeltingList.put(items, out); metaExperience.put(Arrays.asList(Item.getIdFromItem(out.getItem()), out.getItemDamage()), experience); } /** * Used to get the resulting ItemStack form a source ItemStack * @param item The Source ItemStack * @return The result ItemStack */ public ItemStack getSmeltingResult(ItemStack item, ItemStack item2) { if (item==null||item2==null) { return null; } ItemStack ret = (ItemStack)metaSmeltingList.get(Arrays.asList(item, item.getItemDamage(), item2, item2.getItemDamage())); if (ret != null) { return ret; } return (ItemStack)smeltingList.get(item); } /** * Grabs the amount of base experience for this item to give when pulled from the furnace slot. */ public float getExperience(ItemStack item) { if (item == null || item.getItem() == null) { return 0; } float ret = -1; // value returned by "item.getItem().getSmeltingExperience(item);" when item doesn't specify experience to give if (ret < 0 && metaExperience.containsKey(Arrays.asList(item, item.getItemDamage()))) { ret = metaExperience.get(Arrays.asList(item, item.getItemDamage())); } return (ret < 0 ? 0 : ret); } public Map<List<ItemStack>, ItemStack> getMetaInscribingList() { return metaSmeltingList; } } If there is no alternate way of doing this than I will go return to looking further into maps.
  14. I do that but then get this error message: The method addSmelting(List<Integer>, ItemStack, float) in the type FreezerRecipes is not applicable for the arguments (List<Object>, ItemStack, float) at: this.addSmelting(Arrays.asList(Item.bucketWater.itemID, 0, Item.bucketWater.itemID, 0), new ItemStack(Block.ice.blockID, 4, 0), 0.2F);
  15. Hello, I'm in the middle of updating my mod and the furnace seems to be working except for when it comes to the recipes. I'm a little stumped when trying to update this part and I'm not sure what to do since Minecraft now isn't based on IDs and such. Here's the code I'm working with: package wintercraft.helper.gui; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class FreezerRecipes { private static final FreezerRecipes smeltingBase = new FreezerRecipes(); private HashMap<List<Integer>, ItemStack> metaSmeltingList = new HashMap<List<Integer>, ItemStack>(); private Map smeltingList = new HashMap(); private HashMap<List<Integer>, Float> metaExperience = new HashMap<List<Integer>, Float>(); /** * Used to call methods addInscribing and getInscribingResult. */ public static final FreezerRecipes smelting() { return smeltingBase; } /** * Adds all recipes to the HashMap */ private FreezerRecipes() { //this.addSmelting(Arrays.asList(Item.sugar.itemID, 0, Item.bucketMilk.itemID, 0), new ItemStack(Items.commonItem.itemID, 4, 1), 0.3F); //this.addSmelting(Arrays.asList(Items.commonItem.itemID, 1, Item.dyePowder.itemID, 3), new ItemStack(Items.commonItem.itemID, 1, 2), 0.3F); this.addSmelting(Arrays.asList(Item.bucketWater.itemID, 0, Item.bucketWater.itemID, 0), new ItemStack(Block.ice.blockID, 4, 0), 0.2F); //this.addSmelting(Arrays.asList(Items.commonItem.itemID, 1, Item.dyePowder.itemID, 1), new ItemStack(Items.commonItem.itemID, 1, 3), 0.3F); //this.addSmelting(Arrays.asList(Items.commonItem.itemID, 1, Item.cookie.itemID, 0), new ItemStack(Items.commonItem.itemID, 1, 4), 0.3F); //this.addSmelting(Arrays.asList(Items.commonItem.itemID, 1, Item.magmaCream.itemID, 0), new ItemStack(Items.commonItem.itemID, 1, 5), 0.3F); //this.addSmelting(Arrays.asList(Items.rockySnowball.itemID, 0, Items.rockySnowball.itemID, 0), new ItemStack(Items.iceBall.itemID, 2, 0), 0.2F); //this.addSmelting(Arrays.asList(Items.iceChunk.itemID, 0, Items.iceGem.itemID, 0), new ItemStack(Items.iceGem.itemID, 1, 1), 0.7F); //this.addSmelting(Arrays.asList(Items.iceChunk.itemID, 0, Block.stone.blockID, 0), new ItemStack(Blocks.icedStone.blockID, 1, 0), 0.4F); //this.addSmelting(Arrays.asList(Items.iceChunk.itemID, 0, Item.ingotIron.itemID, 0), new ItemStack(Items.iceIngot.itemID, 1, 0), 0.4F); //this.addSmelting(Arrays.asList(Items.iceChunk.itemID, 0, Item.diamond.itemID, 0), new ItemStack(Items.iceCrystal.itemID, 1, 0), 0.4F); } public void addSmelting(List<Integer> items, ItemStack out, float experience) { metaSmeltingList.put(items, out); metaExperience.put(Arrays.asList(out.itemID, out.getItemDamage()), experience); } /** * Used to get the resulting ItemStack form a source ItemStack * @param item The Source ItemStack * @return The result ItemStack */ public ItemStack getSmeltingResult(ItemStack item, ItemStack item2) { if (item==null||item2==null) { return null; } ItemStack ret = (ItemStack)metaSmeltingList.get(Arrays.asList(item.itemID, item.getItemDamage(), item2.itemID, item2.getItemDamage())); if (ret != null) { return ret; } return (ItemStack)smeltingList.get(Integer.valueOf(item.itemID)); } /** * Grabs the amount of base experience for this item to give when pulled from the furnace slot. */ public float getExperience(ItemStack item) { if (item == null || item.getItem() == null) { return 0; } float ret = -1; // value returned by "item.getItem().getSmeltingExperience(item);" when item doesn't specify experience to give if (ret < 0 && metaExperience.containsKey(Arrays.asList(item.itemID, item.getItemDamage()))) { ret = metaExperience.get(Arrays.asList(item.itemID, item.getItemDamage())); } return (ret < 0 ? 0 : ret); } public Map<List<Integer>, ItemStack> getMetaInscribingList() { return metaSmeltingList; } } or here: http://pastebin.com/RA4BFWwe What I'm really having trouble with is the 'addSmelting' method and how I'd go about fixing that. The rest I can manage. If you need anything else just say so and thank you for any help that can provided.
  16. Alright I'll see what I can do with that, thanks.
  17. I want to add a dontator like benefit feature where if you donate, a hat that I have in the mod will be gold rather than red. The problem is that if you're a donator, you see your hat and everyone else's as gold and if youre not a donator you see your and everyone else's hat as red or at least I tried doing it. So is there a way where every player on a server will see a donator's hat as gold even if they're not a donator and they're will stay red? I know Aether II developers did something like that with Moa textures so it must be possible. Thanks! My current code for the Hat to swap textures: public class ArmorSantaHat extends ItemArmor { public ArmorSantaHat(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { super(par1, par2EnumArmorMaterial, par3, par4); this.setCreativeTab(Wintercraft.WintercraftTab); } public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add("\u00a75[WIP]"); par3List.add("\u00a7o\u00a77Not Completely Finished Yet"); } @Override public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type) { if (stack.itemID == Items.santaHat.itemID && ConnectionHandler.userSpecial == true) { return "wintercraft:santaHat_2.png"; } else if (stack.itemID == Items.santaHat.itemID && ConnectionHandler.userSpecial == false) { return "wintercraft:santaHat_1.png"; } return null; } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon(Wintercraft.modid + ":" + this.getUnlocalizedName().substring(5)); } @Override @SideOnly(Side.CLIENT) public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) { ModelBiped armorModel = null; if(itemStack != null){ if(itemStack.getItem() instanceof ArmorSantaHat){ int type = ((ItemArmor)itemStack.getItem()).armorType; if(type == 1 || type == 3){ armorModel = Wintercraft.proxy.getArmorModel(0); }else{ armorModel = Wintercraft.proxy.getArmorModel(1); } if(armorModel != null){ armorModel.bipedHead.showModel = armorSlot == 0; armorModel.isSneak = entityLiving.isSneaking(); armorModel.isRiding = entityLiving.isRiding(); armorModel.isChild = entityLiving.isChild(); armorModel.heldItemRight = entityLiving.getCurrentItemOrArmor(0) != null ? 1 :0; if(entityLiving instanceof EntityPlayer){ armorModel.aimedBow =((EntityPlayer)entityLiving).getItemInUseDuration() > 2; } return armorModel; } } } return null; } }
  18. Okay this will be a bit hard to explain but here I go. I have a block (a gift block) that when you right-click it with an item it gets saved into the block until it's broken and then that item you just stored will pop into your inventory. The only problem is that, if you have one block placed and store something in it and then you place a second gift block down, they act as the same block. So if I put something in the first block, and when I break the second block I get the contents from the first block. So if anyone could please help me that would be great! Thanks! Gift Block Code public class BlockGift extends BlockBaseBlock{ private String giftGiver = "This gift is empty."; private static int giftID; private static int giftMeta; private static int giftStack; @SideOnly(Side.CLIENT) private Icon iconPresentTop; @SideOnly(Side.CLIENT) private Icon iconPresentBottom; public BlockGift(int par1, Material par2Material) { super(par1, par2Material); } @Override public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if(!par5EntityPlayer.worldObj.isRemote && par5EntityPlayer.isSneaking() == true){ par5EntityPlayer.addChatMessage(giftGiver); } if(!par5EntityPlayer.worldObj.isRemote && par5EntityPlayer.isSneaking() == false && par5EntityPlayer.getCurrentItemOrArmor(0) != null && giftStack == 0){ giftID = par5EntityPlayer.getCurrentEquippedItem().itemID; giftMeta = par5EntityPlayer.getCurrentEquippedItem().getItemDamage(); giftStack = par5EntityPlayer.getCurrentEquippedItem().stackSize; giftGiver = "Gift from: " + par5EntityPlayer.username; par5EntityPlayer.getCurrentEquippedItem().stackSize -= par5EntityPlayer.getCurrentEquippedItem().stackSize; } else { if(!par5EntityPlayer.worldObj.isRemote){ par5EntityPlayer.addChatMessage("This gift is full!"); } } return true; } public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { par1World.playSoundAtEntity(par6EntityPlayer, "wintercraft:rip", 1F, 1F); if(!par6EntityPlayer.worldObj.isRemote){ par6EntityPlayer.addChatMessage(giftGiver); } giftGiver = "This gift is empty."; par6EntityPlayer.inventory.addItemStackToInventory(new ItemStack(giftID, giftStack, giftMeta)); giftID = 0; giftMeta = 0; giftStack = 0; } @Override public int idDropped(int par1, Random par2Random, int par3) { return 0; } @SideOnly(Side.CLIENT) /** * From the specified side and block metadata retrieves the blocks texture. Args: side, metadata */ public Icon getIcon(int par1, int par2) { return par1 == 1 ? this.iconPresentTop : (par1 == 0 ? this.iconPresentBottom : this.blockIcon); } public Icon getBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { if (par5 == 1) { return this.iconPresentTop; } else if (par5 == 0) { return this.iconPresentBottom; } else { return this.blockIcon; } } @SideOnly(Side.CLIENT) /** * When this method is called, your block should register all the icons it needs with the given IconRegister. This * is the only chance you get to register icons. */ public void registerIcons(IconRegister par1IconRegister) { //Trying Something making it easier to make dirt blocks this.blockIcon = par1IconRegister.registerIcon(Wintercraft.modid + ":" + this.getUnlocalizedName().substring(5) + "_side"); this.iconPresentTop = par1IconRegister.registerIcon(Wintercraft.modid + ":" + this.getUnlocalizedName().substring(5) + "_top"); this.iconPresentBottom = par1IconRegister.registerIcon(Wintercraft.modid + ":" + this.getUnlocalizedName().substring(5) + "_side"); } protected boolean canSilkHarvest() { return true; } }
  19. Awesome! Thanks, now everything works just as I needed!
  20. Awesome! It works ! But the only thing that still is a problem is that the game crashes when you right-click it with an empty hand. Here is the Crash Report: java.lang.NullPointerException 2013-12-08 01:20:37 [iNFO] [sTDERR] at wintercraft.blocks.BlockCandle.onBlockActivated(BlockCandle.java:119) 2013-12-08 01:20:37 [iNFO] [sTDERR] at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:371) 2013-12-08 01:20:37 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1390) 2013-12-08 01:20:37 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1868) 2013-12-08 01:20:37 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:910) 2013-12-08 01:20:37 [iNFO] [sTDERR] at net.minecraft.client.Minecraft.run(Minecraft.java:838) 2013-12-08 01:20:37 [iNFO] [sTDERR] at net.minecraft.client.main.Main.main(Main.java:93) 2013-12-08 01:20:37 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-12-08 01:20:37 [iNFO] [sTDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-12-08 01:20:37 [iNFO] [sTDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-12-08 01:20:37 [iNFO] [sTDERR] at java.lang.reflect.Method.invoke(Unknown Source) 2013-12-08 01:20:37 [iNFO] [sTDERR] at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) 2013-12-08 01:20:37 [iNFO] [sTDERR] at net.minecraft.launchwrapper.Launch.main(Launch.java:27) 2013-12-08 01:20:37 [iNFO] [sTDOUT] ---- Minecraft Crash Report ---- 2013-12-08 01:20:37 [iNFO] [sTDOUT] // You're mean. 2013-12-08 01:20:37 [iNFO] [sTDOUT] 2013-12-08 01:20:37 [iNFO] [sTDOUT] Time: 12/8/13 1:20 AM 2013-12-08 01:20:37 [iNFO] [sTDOUT] Description: Unexpected error 2013-12-08 01:20:37 [iNFO] [sTDOUT] 2013-12-08 01:20:37 [iNFO] [sTDOUT] java.lang.NullPointerException 2013-12-08 01:20:37 [iNFO] [sTDOUT] at wintercraft.blocks.BlockCandle.onBlockActivated(BlockCandle.java:119) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:371) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1390) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.runTick(Minecraft.java:1868) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:910) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.run(Minecraft.java:838) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.client.main.Main.main(Main.java:93) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.main(Launch.java:27) 2013-12-08 01:20:37 [iNFO] [sTDOUT] 2013-12-08 01:20:37 [iNFO] [sTDOUT] 2013-12-08 01:20:37 [iNFO] [sTDOUT] A detailed walkthrough of the error, its code path and all known details is as follows: 2013-12-08 01:20:37 [iNFO] [sTDOUT] --------------------------------------------------------------------------------------- 2013-12-08 01:20:37 [iNFO] [sTDOUT] 2013-12-08 01:20:37 [iNFO] [sTDOUT] -- Head -- 2013-12-08 01:20:37 [iNFO] [sTDOUT] Stacktrace: 2013-12-08 01:20:37 [iNFO] [sTDOUT] at wintercraft.blocks.BlockCandle.onBlockActivated(BlockCandle.java:119) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.client.multiplayer.PlayerControllerMP.onPlayerRightClick(PlayerControllerMP.java:371) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.clickMouse(Minecraft.java:1390) 2013-12-08 01:20:37 [iNFO] [sTDOUT] 2013-12-08 01:20:37 [iNFO] [sTDOUT] -- Affected level -- 2013-12-08 01:20:37 [iNFO] [sTDOUT] Details: 2013-12-08 01:20:37 [iNFO] [sTDOUT] Level name: MpServer 2013-12-08 01:20:37 [iNFO] [sTDOUT] All players: 1 total; [EntityClientPlayerMP['Player498'/265, l='MpServer', x=-203.73, y=70.62, z=221.20]] 2013-12-08 01:20:37 [iNFO] [sTDOUT] Chunk stats: MultiplayerChunkCache: 190 2013-12-08 01:20:37 [iNFO] [sTDOUT] Level seed: 0 2013-12-08 01:20:37 [iNFO] [sTDOUT] Level generator: ID 00 - default, ver 1. Features enabled: false 2013-12-08 01:20:37 [iNFO] [sTDOUT] Level generator options: 2013-12-08 01:20:37 [iNFO] [sTDOUT] Level spawn location: World: (-236,64,240), Chunk: (at 4,4,0 in -15,15; contains blocks -240,0,240 to -225,255,255), Region: (-1,0; contains chunks -32,0 to -1,31, blocks -512,0,0 to -1,255,511) 2013-12-08 01:20:37 [iNFO] [sTDOUT] Level time: 72344 game time, 72344 day time 2013-12-08 01:20:37 [iNFO] [sTDOUT] Level dimension: 0 2013-12-08 01:20:37 [iNFO] [sTDOUT] Level storage version: 0x00000 - Unknown? 2013-12-08 01:20:37 [iNFO] [sTDOUT] Level weather: Rain time: 0 (now: false), thunder time: 0 (now: false) 2013-12-08 01:20:37 [iNFO] [sTDOUT] Level game mode: Game mode: creative (ID 1). Hardcore: false. Cheats: false 2013-12-08 01:20:37 [iNFO] [sTDOUT] Forced entities: 87 total; [EntitySkeleton['Skeleton'/137, l='MpServer', x=-217.50, y=14.00, z=190.50], EntityBat['Bat'/136, l='MpServer', x=-210.50, y=32.06, z=177.82], EntitySkeleton['Skeleton'/139, l='MpServer', x=-220.22, y=17.00, z=196.25], EntitySpider['Spider'/138, l='MpServer', x=-213.28, y=16.00, z=192.28], EntityCreeper['Creeper'/141, l='MpServer', x=-211.66, y=17.47, z=192.97], EntitySkeleton['Skeleton'/140, l='MpServer', x=-214.53, y=18.00, z=198.64], EntityCreeper['Creeper'/143, l='MpServer', x=-209.50, y=17.00, z=209.50], EntityZombie['Zombie'/142, l='MpServer', x=-218.50, y=17.00, z=193.50], EntityZombie['Zombie'/129, l='MpServer', x=-214.31, y=45.00, z=143.84], EntityCow['Cow'/135, l='MpServer', x=-222.53, y=67.00, z=154.50], EntityBat['Bat'/152, l='MpServer', x=-198.25, y=23.10, z=158.50], EntityZombie['Zombie'/153, l='MpServer', x=-195.16, y=50.00, z=157.50], EntityZombie['Zombie'/154, l='MpServer', x=-204.88, y=19.00, z=164.75], EntityZombie['Zombie'/155, l='MpServer', x=-198.72, y=52.00, z=161.04], EntitySpider['Spider'/156, l='MpServer', x=-202.82, y=12.14, z=200.09], EntityBat['Bat'/157, l='MpServer', x=-203.48, y=12.28, z=199.99], EntityCreeper['Creeper'/158, l='MpServer', x=-200.50, y=19.00, z=199.50], EntityBat['Bat'/159, l='MpServer', x=-207.29, y=17.81, z=198.78], EntityClientPlayerMP['Player498'/265, l='MpServer', x=-203.73, y=70.62, z=221.20], EntityCreeper['Creeper'/144, l='MpServer', x=-213.50, y=17.00, z=208.50], EntityCow['Cow'/145, l='MpServer', x=-223.41, y=63.00, z=300.34], EntityCreeper['Creeper'/151, l='MpServer', x=-199.52, y=24.10, z=158.50], EntitySkeleton['Skeleton'/169, l='MpServer', x=-188.50, y=17.00, z=153.50], EntitySquid['Squid'/175, l='MpServer', x=-178.31, y=58.96, z=171.60], EntitySquid['Squid'/174, l='MpServer', x=-180.54, y=57.37, z=168.46], EntityBat['Bat'/163, l='MpServer', x=-192.54, y=14.72, z=284.53], EntityBat['Bat'/162, l='MpServer', x=-197.25, y=58.10, z=208.75], EntityCreeper['Creeper'/161, l='MpServer', x=-204.50, y=37.00, z=219.50], EntityZombie['Zombie'/160, l='MpServer', x=-204.53, y=55.00, z=202.91], EntitySquid['Squid'/186, l='MpServer', x=-170.17, y=58.38, z=169.70], EntitySkeleton['Skeleton'/187, l='MpServer', x=-175.50, y=15.00, z=204.50], EntitySkeleton['Skeleton'/184, l='MpServer', x=-168.50, y=15.00, z=170.50], EntityBat['Bat'/185, l='MpServer', x=-165.52, y=13.65, z=170.41], EntityBat['Bat'/190, l='MpServer', x=-165.37, y=41.19, z=242.78], EntityBat['Bat'/191, l='MpServer', x=-164.59, y=40.64, z=243.26], EntityZombie['Zombie'/188, l='MpServer', x=-162.50, y=41.00, z=238.50], EntitySkeleton['Skeleton'/189, l='MpServer', x=-163.16, y=41.00, z=229.66], EntityCreeper['Creeper'/178, l='MpServer', x=-185.38, y=21.00, z=210.09], EntitySquid['Squid'/176, l='MpServer', x=-179.78, y=60.38, z=172.74], EntitySkeleton['Skeleton'/177, l='MpServer', x=-180.22, y=15.00, z=205.38], EntityBat['Bat'/205, l='MpServer', x=-158.54, y=18.78, z=248.64], EntityBat['Bat'/204, l='MpServer', x=-144.47, y=19.10, z=233.75], EntitySpider['Spider'/201, l='MpServer', x=-146.26, y=24.01, z=219.72], EntityCreeper['Creeper'/200, l='MpServer', x=-144.94, y=22.00, z=221.69], EntitySquid['Squid'/203, l='MpServer', x=-157.53, y=56.00, z=210.53], EntityZombie['Zombie'/202, l='MpServer', x=-159.50, y=44.00, z=218.50], EntityCreeper['Creeper'/197, l='MpServer', x=-156.47, y=28.00, z=149.00], EntityCreeper['Creeper'/196, l='MpServer', x=-153.50, y=27.00, z=145.50], EntitySpider['Spider'/199, l='MpServer', x=-159.50, y=37.00, z=145.00], EntitySpider['Spider'/198, l='MpServer', x=-154.03, y=27.00, z=147.78], EntityCreeper['Creeper'/193, l='MpServer', x=-160.69, y=37.00, z=295.94], EntityZombie['Zombie'/192, l='MpServer', x=-175.59, y=14.00, z=281.94], EntityCreeper['Creeper'/195, l='MpServer', x=-152.31, y=27.00, z=147.53], EntitySkeleton['Skeleton'/194, l='MpServer', x=-159.50, y=37.00, z=143.31], EntityCow['Cow'/85, l='MpServer', x=-281.19, y=63.00, z=212.75], EntityZombie['Zombie'/220, l='MpServer', x=-136.50, y=15.00, z=249.50], EntityBat['Bat'/84, l='MpServer', x=-275.43, y=24.73, z=218.56], EntityZombie['Zombie'/221, l='MpServer', x=-135.50, y=15.00, z=247.50], EntityChicken['Chicken'/87, l='MpServer', x=-279.24, y=63.00, z=212.29], EntityMinecartChest['entity.MinecartChest.name'/222, l='MpServer', x=-142.50, y=19.50, z=251.50], EntitySkeleton['Skeleton'/223, l='MpServer', x=-137.66, y=25.00, z=258.63], EntitySkeleton['Skeleton'/216, l='MpServer', x=-134.50, y=29.00, z=173.50], EntityCow['Cow'/83, l='MpServer', x=-275.94, y=69.00, z=174.38], EntitySpider['Spider'/218, l='MpServer', x=-136.50, y=19.00, z=234.50], EntityZombie['Zombie'/219, l='MpServer', x=-140.50, y=19.00, z=234.50], EntityPig['Pig'/89, l='MpServer', x=-273.97, y=63.00, z=229.06], EntityCow['Cow'/88, l='MpServer', x=-280.41, y=63.00, z=230.44], EntityCow['Cow'/91, l='MpServer', x=-277.16, y=63.00, z=288.44], EntityCow['Cow'/90, l='MpServer', x=-281.28, y=64.00, z=249.28], EntityPig['Pig'/102, l='MpServer', x=-256.69, y=65.00, z=166.53], EntityCow['Cow'/103, l='MpServer', x=-259.97, y=63.00, z=206.97], EntitySkeleton['Skeleton'/100, l='MpServer', x=-268.97, y=12.01, z=161.47], EntityPig['Pig'/101, l='MpServer', x=-265.19, y=67.00, z=173.13], EntityCow['Cow'/108, l='MpServer', x=-263.63, y=63.00, z=250.91], EntityBat['Bat'/106, l='MpServer', x=-265.52, y=24.49, z=217.55], EntityCreeper['Creeper'/107, l='MpServer', x=-264.50, y=28.00, z=224.50], EntityCow['Cow'/104, l='MpServer', x=-259.47, y=63.00, z=194.53], EntitySpider['Spider'/224, l='MpServer', x=-131.63, y=41.00, z=302.28], EntityCow['Cow'/105, l='MpServer', x=-266.25, y=64.00, z=196.50], EntityCreeper['Creeper'/118, l='MpServer', x=-248.50, y=20.00, z=224.50], EntityCreeper['Creeper'/117, l='MpServer', x=-245.50, y=27.00, z=229.69], EntityCreeper['Creeper'/116, l='MpServer', x=-246.44, y=27.00, z=228.97], EntityCreeper['Creeper'/115, l='MpServer', x=-254.50, y=28.00, z=223.50], EntityChicken['Chicken'/114, l='MpServer', x=-254.44, y=64.00, z=202.56], EntityCow['Cow'/113, l='MpServer', x=-251.75, y=64.00, z=155.78], EntitySkeleton['Skeleton'/123, l='MpServer', x=-239.50, y=20.00, z=179.50], EntityZombie['Zombie'/243, l='MpServer', x=-125.50, y=15.00, z=243.50]] 2013-12-08 01:20:37 [iNFO] [sTDOUT] Retry entities: 0 total; [] 2013-12-08 01:20:37 [iNFO] [sTDOUT] Server brand: fml,forge 2013-12-08 01:20:37 [iNFO] [sTDOUT] Server type: Integrated singleplayer server 2013-12-08 01:20:37 [iNFO] [sTDOUT] Stacktrace: 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.client.multiplayer.WorldClient.addWorldInfoToCrashReport(WorldClient.java:440) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.addGraphicsAndWorldToCrashReport(Minecraft.java:2312) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.client.Minecraft.run(Minecraft.java:863) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.client.main.Main.main(Main.java:93) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at java.lang.reflect.Method.invoke(Unknown Source) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) 2013-12-08 01:20:37 [iNFO] [sTDOUT] at net.minecraft.launchwrapper.Launch.main(Launch.java:27) 2013-12-08 01:20:37 [iNFO] [sTDOUT] 2013-12-08 01:20:37 [iNFO] [sTDOUT] -- System Details -- 2013-12-08 01:20:37 [iNFO] [sTDOUT] Details: 2013-12-08 01:20:37 [iNFO] [sTDOUT] Minecraft Version: 1.6.4 2013-12-08 01:20:37 [iNFO] [sTDOUT] Operating System: Windows 7 (amd64) version 6.1 2013-12-08 01:20:37 [iNFO] [sTDOUT] Java Version: 1.7.0_21, Oracle Corporation 2013-12-08 01:20:37 [iNFO] [sTDOUT] Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation 2013-12-08 01:20:37 [iNFO] [sTDOUT] Memory: 1808830464 bytes (1725 MB) / 2087452672 bytes (1990 MB) up to 2087452672 bytes (1990 MB) 2013-12-08 01:20:37 [iNFO] [sTDOUT] JVM Flags: 3 total; -Xincgc -Xmx2024M -Xms2024M 2013-12-08 01:20:37 [iNFO] [sTDOUT] AABB Pool Size: 22931 (1284136 bytes; 1 MB) allocated, 2 (112 bytes; 0 MB) used 2013-12-08 01:20:37 [iNFO] [sTDOUT] Suspicious classes: FML and Forge are installed 2013-12-08 01:20:37 [iNFO] [sTDOUT] IntCache: cache: 15, tcache: 0, allocated: 3, tallocated: 63 2013-12-08 01:20:37 [iNFO] [sTDOUT] FML: MCP v8.11 FML v6.4.31.935 Minecraft Forge 9.11.1.935 5 mods loaded, 5 mods active 2013-12-08 01:20:37 [iNFO] [sTDOUT] mcp{8.09} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available 2013-12-08 01:20:37 [iNFO] [sTDOUT] FML{6.4.31.935} [Forge Mod Loader] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available 2013-12-08 01:20:37 [iNFO] [sTDOUT] Forge{9.11.1.935} [Minecraft Forge] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available 2013-12-08 01:20:37 [iNFO] [sTDOUT] EnchantedWoodlands{0.0.1} [EnchantedWoodlands] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available 2013-12-08 01:20:37 [iNFO] [sTDOUT] Wintercraft{1.0.2} [Wintercraft] (bin) Unloaded->Constructed->Pre-initialized->Initialized->Post-initialized->Available->Available->Available->Available 2013-12-08 01:20:37 [iNFO] [sTDOUT] Launched Version: 1.6 2013-12-08 01:20:37 [iNFO] [sTDOUT] LWJGL: 2.9.0 2013-12-08 01:20:37 [iNFO] [sTDOUT] OpenGL: AMD Radeon HD 7900 Series GL version 4.3.12458 Compatibility Profile Context 13.200.16.0, ATI Technologies Inc. 2013-12-08 01:20:37 [iNFO] [sTDOUT] Is Modded: Definitely; Client brand changed to 'fml,forge' 2013-12-08 01:20:37 [iNFO] [sTDOUT] Type: Client (map_client.txt) 2013-12-08 01:20:37 [iNFO] [sTDOUT] Resource Pack: Default 2013-12-08 01:20:37 [iNFO] [sTDOUT] Current Language: English (US) 2013-12-08 01:20:37 [iNFO] [sTDOUT] Profiler Position: N/A (disabled) 2013-12-08 01:20:37 [iNFO] [sTDOUT] Vec3 Pool Size: 5650 (316400 bytes; 0 MB) allocated, 19 (1064 bytes; 0 MB) used 2013-12-08 01:20:37 [iNFO] [sTDOUT] #@!@# Game crashed! Crash report saved to: #@!@# C:\Users\Robert\Desktop\forge 2.1\mcp\jars\.\crash-reports\crash-2013-12-08_01.20.37-client.txt AL lib: (EE) alc_cleanup: 1 device not closed
  21. The problem with that is, that any dye can be used when I only want red and also the game crashes if it's anything else
  22. I'm trying to make it when you hold red dye and right-click on a candle it turns into a red candle but it doesn't work when I have it check the current Item, only works when I have it simply right-clicked. ItemStack redDye = new ItemStack(Item.dyePowder, 1, 1); ItemStack test; public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { int blockMeta = par1World.getBlockMetadata(par2, par3, par4); if (blockMeta == 0){ par5EntityPlayer.inventory.hasItemStack(redDye); test = par5EntityPlayer.getCurrentEquippedItem(); System.out.println(test); if(par5EntityPlayer.getCurrentEquippedItem() == redDye){ par1World.setBlockMetadataWithNotify(par2, par3, par4, 1, Blocks.candle.blockID); } } return false; }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.