
TheEpicTekkit
Members-
Posts
361 -
Joined
-
Last visited
Everything posted by TheEpicTekkit
-
Anyone know any good tutorials on creating a custom liquid for 1.7.10? I want to add a creosote oil, petroleum, diesel, propane, butane, and tar to my mod. I also need to know how to make the gui of a block be able to store and use liquids (I cant find any tutorials for this).
-
Changing block texture based on Tile entity variable
TheEpicTekkit replied to brady131313's topic in Modder Support
Okya, fair point. -
Changing block texture based on Tile entity variable
TheEpicTekkit replied to brady131313's topic in Modder Support
Okay, nevermind then, this is how i do it, and this is how the vanilla furnace does it though blockRegistry.addObject(61, "furnace", (new BlockFurnace(false)).setHardness(3.5F).setStepSound(soundTypePiston).setBlockName("furnace").setCreativeTab(CreativeTabs.tabDecorations)); blockRegistry.addObject(62, "lit_furnace", (new BlockFurnace(true)).setHardness(3.5F).setStepSound(soundTypePiston).setLightLevel(0.875F).setBlockName("furnace")); -
Changing block texture based on Tile entity variable
TheEpicTekkit replied to brady131313's topic in Modder Support
Look at how they have done this for the vanilla furnace. The isActive variable goes in the block class, not the tileentity class above your constructor in the block class, add this: public final boolean isActive; then make your constructor look something like this: public MachineAlloyCompressor(Material mat, boolean isActive) { super(mat) this.isActive = isActive; } then when you are registering the icons, change TileEntityAlloyCompressor.isActive to this.isActive Also, where you are registering your blocks, you need to put true inside the brackets where you normally set the material on the active version of your block, and false on the idle version. This is because you have a boolean (isActive) in the constructor -
Okay thanks. Now I have found a strange bug. When the durability of the item runs out, the item deletes itself, but stays in the inventory as a ghost item. When i remove the ghost item it is in my inventory, but if i click it, or throw it on the ground, it vanishes. This is annoying because even when the ghost item is in the inventory, the wind turbine still produces power as if there was a real item in the slot.
-
in the tileentity in the updateEntity method, I have added this: ItemStack itemStack; itemStack = this.getStackInSlot(0); if (itemStack != null && itemStack.stackSize > 0) { if (itemStack.getItem() == ItemHandler.itemTurbineRotorIron) { for (int i = 0; i <= itemStack.getMaxDamage(); i++) { itemStack.setItemDamage(i); } } } Should this work?
-
Ok, this would be in my Custom rendered block larger than 1x1x1 pose, but i now for some reason cant see any replies in it even though i know people have replied because the number of replies has increased. So I created a new post. Sorry if that annoys any moderators. I want an item to take damage in my wind turbines inventory if it is in a certain slot of my wind turbine. I want it to take damage every 36 degrees of rotation on the rotor. I have been trying to do this for over an hour now and cant get it working, any attempt has crashed the client when open the inventory of had no effect at all.
-
Okay, so the gag blocks are now working fine, they are in the right place, they have the correct metadata, and they break all the other gag blocks and the wind turbine when broken, and they drop the inventories contents instead of deleting them. In the end, i decided not to have the gag blocks open the wind turbines inventory because it was too complicated. and I thought about it, and thought there wasn't really much point. Though now I have another problem (sorry to inconvenience you with all my problems today) I am trying to make the turbine item inside the wind turbine take damage for every 36 degrees of rotation on the turbine. Any ideas on how I would do this? I have been trying to do this for about an hour now, and I cant get it working. Either what I have done has crashed the game, or simply done absolutely nothing. Another question, would I be putting the method that damages the item in the block class or the tileentity class? I have tried both.
-
Okay, I now have the wind turbine properly adding gag blocks above it, in the right place and with the correct metadata. And the gag blocks when break break all the gag blocks above it and below it including the actual wind turbine. In the end, I decided to only have the inventory accessible from the bottom block instead of all of them. Now, I am trying to make the actual turbine item inside the inventory take damage. I would like it to take 1 damage every rotation of the rotor. I can't get this working either. I cant figure out the proper way of doing this, do I do this from the tileentity, or the block class?
-
now, another thing i cant figure out, is how do I get the wind turbine block to place the gag block, in the onBlockAdded(World world, int x, int y, int z) {... method i have this: super.onBlockAdded(world, x, y, z); for (int i = 0; i < this.height; i++) { world.setBlock(x, y+1+i, z, BlockHandler.gagWindTurbine, i, 2); } (where it says this.height, there is an integer called height and has a value of 8.) Now i want this to place the gag block up to the height of the wind turbine (which it does) but with a different metadata value for each block, currently it only places the same metadata: 0. for the first gag block i want it to place metadata 0, the second i want it to place metadata 1 etc all the way upto 8, so there is 9 blocks with different metadata. This is what my block class looks like: package net.theepictekkit.generator.common.blocks.advanced; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.theepictekkit.generator.GeneratorCreativeTabs; public class BlockGagWindTurbine extends Block { public BlockGagWindTurbine(Material mat) { super(mat); this.setHardness(4.0F); this.setResistance(4.0F); this.setCreativeTab(GeneratorCreativeTabs.Generator); } @Override public int getRenderType() { return -1; } @Override public boolean renderAsNormalBlock() { return false; } @Override public boolean isOpaqueCube() { return false; } @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item itemStack, CreativeTabs tab, List list) { for (int i = 0; i < 8; ++i) { list.add(new ItemStack(itemStack, 1, i)); } } } (I dont want this block to render. Thats why i have the rendering methods in there) Now i have looked at minecrafts wool block to see how they did metadata, and copied the relevant code from that class. I just need the wind turbine to place the correct metadata when placed.
-
Okay, thanks for your help, i'm gonna do this, than update here how it went. And I don't know why I thought the gag blocks needed an individual tileEntity. I just had a derp moment I am gonna do the gag blocks with a different metadata though so that i can set the block bounds based on metadata, so that for example, if you look at the bottom gag block, the block bounds extend 1 block downwards, and 7 blocks up, if you look at the second gag block, the bounds extend 2 blocks down, and 6 up, so it looks like you are looking at the same block all the time.