Jump to content

Failender

Forge Modder
  • Posts

    1091
  • Joined

  • Last visited

Everything posted by Failender

  1. if u have the index of the iron ingot access the player inventory and decrement the iron ingot stack. after that call player.inventory.addItemStack
  2. create a super class like "MyMessageForAllMyTiles", write all the data that EVERY of ur tiles have ( let it implement IMessage ofc) after that you can inherit from that class and have much less effort. or you make one big message that supports all your tileentites and send one number for the "id" of each tileentity for switch case issues
  3. Hey everyone, I made a knife that looses durability when cutting stuff. The problem is I need the recipe to work with the damage knife. I think there was a wildcare value you could add to make it accept damaged items, but I cant remember nor find it GameRegistry.addShapedRecipe(new ItemStack(SurvivalItems.slicedChicken, 4), "KC", 'K', new ItemStack(SurvivalItems.knife,1,WILDCARDVALUE), 'C', SurvivalItems.slicedChicken);
  4. dude I meant you should define what you mean with location -.- drawTexturedModalRect(x, y, textureX, textureY, width, height);
  5. Well I did some research. Im gonna bet ten bucks its this public static boolean areItemStackTagsEqual(ItemStack stackA, ItemStack stackB) { return stackA == null && stackB == null ? true : (stackA != null && stackB != null ? (stackA.stackTagCompound == null && stackB.stackTagCompound != null ? false : stackA.stackTagCompound == null || stackA.stackTagCompound.equals(stackB.stackTagCompound)) : false); } So. If you say stackA.compound=stackB.compound you should be able to merge them no problem. But if you do that you could also create your own routine that checks every item inside a player inventory, compare the tagCompounds, and if they are "nearly equal" set the slot of the first stack to null and increment the second one stacksize. Maybe ill do some research tomorrow
  6. Well. How about we leave everything how it is :'D Thank you very much sir!
  7. I think the diamond is there because you are adding it everytime you create a new inventory..? new InventoryKeyring(player.getHeldItem()).setInventorySlotContents(0, new ItemStack(Items.diamond, 4));
  8. Hey everyone, I have some data written to the nbt of every ItemFood. That works fine. What I want is to be able to merge itemstacks, even if the nbt is different. I have an value written to the stacks nbt called "creationdate", and I would be fine merging the stack everytime the creationdates difference isnt more then 20. Is there a way to do that? Greetz Fail
  9. Well you are never saving your data to the itemstacks'nbt. override onContainerClosed and save your inventory to the itemstacks nbt there
  10. The class of your block should be for your block only. The registration of renderer should be in the clientproxy. The registration of the block itself should be in your main mod class or a class that collects all your blocks sorted There is no reason to keep a public static Block alloy_furnace in your class Look up naming conventions for java, your class name is malformed
  11. I dont know which tutorial you watched for modding. But this is truely NOT the way. Please watch a basic tutorial for setting up your mod and registering blocks and then come back.
  12. Well I know nothing about that, sorry
  13. You would need a separate class for that. You will need taht anyway if ur furnace should cook anything
  14. What the hell is invStack? Please dont tell me that you are comparing an itemsack and an item and expect it to be equals
  15. well you need to make your block orientable. package de.busybeever.survivaloverhaul.blocks; import de.busybeever.survivaloverhaul.SurvivalOverhaul; import de.busybeever.survivaloverhaul.tileentity.TileEntitySaltCooker; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.properties.IProperty; import net.minecraft.block.properties.PropertyDirection; import net.minecraft.block.state.BlockState; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemBucket; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidStack; public class SaltCooker extends Block{ public static final PropertyDirection FACING = PropertyDirection.create("facing", EnumFacing.Plane.HORIZONTAL); public SaltCooker() { super(Material.rock); setCreativeTab(SurvivalOverhaul.survivalTab); setUnlocalizedName("saltcooker"); this.setDefaultState(blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH)); } @Override public IBlockState getStateForEntityRender(IBlockState state) { return getDefaultState().withProperty(FACING, EnumFacing.SOUTH); } @Override public IBlockState getStateFromMeta(int meta) { EnumFacing facing = EnumFacing.getFront(meta); if(facing.getAxis()==EnumFacing.Axis.Y) { facing=EnumFacing.NORTH; } return getDefaultState().withProperty(FACING, facing); } @Override public int getMetaFromState(IBlockState state) { return ((EnumFacing) state.getValue(FACING)).getIndex(); } @Override protected BlockState createBlockState() { return new BlockState(this, new IProperty[]{FACING}); } @Override public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) { return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); } } [nobbc] [/nobbc]
  16. Use spoiler/code tags PLEASE. this is my blockstate. You are never defining thbe variants And my models/block
  17. Hmm im not sure. Could you specifiy "not properly? Is it a lot a bit? You are not taking the players eye position, but that shouldnt make that much of a difference
  18. Well. You shouldnt be copy pasting code without knowing what its doing
×
×
  • Create New...

Important Information

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