Everything posted by Moritz
-
Control blocks that can be place in a custom dimension
Your own blocks or vannila blocks? If your own blocks detect at the placing part the dimension id and when the id is not the overworldID (0) then you can tell that the block sets to 0 (equals as not there)
-
[1.4.7]Transfer stack in slot problems [solved]
Hello. I have a big problem. I hope you can help me. The problem is with stack in slot. I made a special machine which is very modular! I mean modularer as From Thermal Expansion (the gui clicking and he get his output/input changed) So the tile works container is ok too but the thing is too modular for me. I do not get the stack in slot finish every time i tried it Crash. Here is the code: (Because i am afraid somebody steal my code i change a view names and things lile that). package bla bla import java.util.Iterator; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import speiger.src.api.common.slots.SlotBlocked; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; public class Container extends Container { private TileEntity tile; private int fuelnow = 0; private int[] progressnow = new int[] {0,0,0,0}; private int energienow = 0; public Container(InventoryPlayer par1, TileEntity par2) { tile = par2; //Input Slots addSlotToContainer(new Slot(par2, 0, 47, 9)); addSlotToContainer(new Slot(par2, 1, 66, 9)); addSlotToContainer(new Slot(par2, 2, 85, 9)); addSlotToContainer(new Slot(par2, 3, 104, 9)); //Output Slots //First Row addSlotToContainer(new SlotBlocked(par2, 4, 47, 53)); addSlotToContainer(new SlotBlocked(par2, 5, 66, 53)); addSlotToContainer(new SlotBlocked(par2, 6, 85, 53)); addSlotToContainer(new SlotBlocked(par2, 7, 104, 53)); //Output Slots //Second Row addSlotToContainer(new SlotBlocked(par2, 8, 47, 73)); addSlotToContainer(new SlotBlocked(par2, 9, 66, 73)); addSlotToContainer(new SlotBlocked(par2, 10, 85, 73)); addSlotToContainer(new SlotBlocked(par2, 11, 104, 73)); //Modul Slots addSlotToContainer(new Slot(par2, 12, 47, 102)); addSlotToContainer(new Slot(par2, 13, 66, 102)); addSlotToContainer(new Slot(par2, 14, 85, 102)); addSlotToContainer(new Slot(par2, 15, 104, 102)); addSlotToContainer(new Slot(par2, 16, 151, 102)); //Fuel Slot addSlotToContainer(new Slot(par2, 17, 8, 102)); int var3; for (var3 = 0; var3 < 3; ++var3) { for (int var4 = 0; var4 < 9; ++var4) { this.addSlotToContainer(new Slot(par1, var4 + var3 * 9 + 9, 8 + var4 * 18, 140 + var3 * 18)); } } for (var3 = 0; var3 < 9; ++var3) { this.addSlotToContainer(new Slot(par1, var3, 8 + var3 * 18, 198)); } } @Override public void detectAndSendChanges() { super.detectAndSendChanges(); Iterator var1 = this.crafters.iterator(); while (var1.hasNext()) { ICrafting var2 = (ICrafting)var1.next(); if(fuelnow != tile.fuel)var2.sendProgressBarUpdate(this, 0, tile.fuel); if(progressnow[0] != tile.progress[0])var2.sendProgressBarUpdate(this, 1, tile.progress[0]); if(progressnow[1] != tile.progress[1])var2.sendProgressBarUpdate(this, 2, tile.progress[1]); if(progressnow[2] != tile.progress[2])var2.sendProgressBarUpdate(this, 3, tile.progress[2]); if(progressnow[3] != tile.progress[3])var2.sendProgressBarUpdate(this, 4, tile.progress[3]); if(energienow != tile.energie)var2.sendProgressBarUpdate(this, 5, tile.energie); } fuelnow = tile.fuel; progressnow[0] = tile.progress[0]; progressnow[1] = tile.progress[1]; progressnow[2] = tile.progress[2]; progressnow[3] = tile.progress[3]; energienow = tile.energie; } @SideOnly(Side.CLIENT) public void updateProgressBar(int par1, int par2) { if(par1 == 0)tile.fuel = par2; if(par1 == 1)tile.progress[0] = par2; if(par1 == 2)tile.progress[1] = par2; if(par1 == 3)tile.progress[2] = par2; if(par1 == 4)tile.progress[3] = par2; if(par1 == 5)tile.energie = par2; } public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { ItemStack var3 = null; Slot var4 = (Slot)this.inventorySlots.get(par2); if (var4 != null && var4.getHasStack()) { ItemStack var5 = var4.getStack(); var3 = var5.copy(); if (par2 >= 4 && <= 12) { if (!this.mergeItemStack(var5, 4, 12, true)) { return null; } var4.onSlotChange(var5, var3); } else if (tile.getRecipeFromModulID(var5, tile.modulID[1-4])//and this here is my problem i just coppied it out of the furnace. { if (FurnaceRecipes.smelting().getSmeltingResult(var5) != null) { if (!this.mergeItemStack(var5, 0, 1, false)) { return null; } } else if (tile.isItemFuel(var5)) { if (!this.mergeItemStack(var5, 17, 18, false)) { return null; } } else if (par2 >= 3 && par2 < 30) { if (!this.mergeItemStack(var5, 30, 39, false)) { return null; } } else if (par2 >= 30 && par2 < 39 && !this.mergeItemStack(var5, 3, 30, false)) { return null; } } else if (!this.mergeItemStack(var5, 3, 39, false)) { return null; } if (var5.stackSize == 0) { var4.putStack((ItemStack)null); } else { var4.onSlotChanged(); } if (var5.stackSize == var3.stackSize) { return null; } var4.onPickupFromSlot(par1EntityPlayer, var5); } return var3; } @Override public boolean canInteractWith(EntityPlayer var1) { return true; } } I had deleted the problem code and i do write fast a new version of it. So my problem is: That its to modular. I have more than one recipe path. Thats the thing i want to do: That items which you shift click (and a modul is in the slot) (and recipes are loaded) transfer into the right slot. Also when its finish that when you shiftclick on the ouput that it transfer it into the player inventory. Also i when you right click on the modul and its a recipe modul than it place it in the first free modulslot it can find. Also when there is a fuelmodul that i place that inside of the fuelslot. I know i give low information and want much help. But i hope you can help me. Can someone help me?
-
Block acting strange with large metadata
Wait a sec. What did you planed what that block does do? I mean maybe you even need no metadata. There is a way to make metadata without making it. I mean like buildcraft pipes. Or my pipes (my mod is hidden). Buildcraft made it like that: When you place the block. The item (pipe) give the block(pipe) his information and where he has to look and to get it. I made it like that: i made a new LiquidPipe which is working (at the moment a little bit buggy because the code is 5 hours old). I made a view functions which alow me to change it. When i rightclick the item a basic pipe will be place (and the block loads his TE). After that (in the same click) the item looks does block is there, does it have a tile, and if that is right is it a pipe? When all this things are true than he looks in the infos of the tile and change a view numbers. Then the click is finish. With that system you safe meta (you can make infinte sub meta with that (submeta is a meta of the meta)). But do not overload it. Because when you make it so complex like eloraam (her mod is awsome but laggy(the covers are to much)) you will create alot of lag. Its ok you can make a big submeta when it changes only 1-2 numbers but when it change rotation, rendering and everything complicatet stuff you should be becarefull. Everything has his price. I hope it helps. and i know i wrote to much but thats me . Speiger
-
Ore/LiquidDictionary Problems (Please Make IT PLEASE)
Thanks.^^ That will help me and all other people^^. Now i can finish my mod (the recipe part) even faster. Thanks again^^"
-
How do i make a new sword?
to code a sword is the on of the easiest things i make. make an new itemclass for it and extends it itemsword: than add these things: setMaxDamage(); getDamageVsEntity(); onHitEntity();//Damage the tool when you hit an entity onDistroyBlock(); //damage the sword when it distroy its block and thats it. Or there is that. A more... elegant solution. I'll admit, I was feeling too lazy to check if ItemSword could be successfully overridden. Yeah but there are better ways to make swords. This kind is the really basic easiest form i made. I do think enchants do work. And repair to. zoomx19 you should really learn how to use minecraft efficent to do not ask these kind of questions. I have problems too. but my real problem is. I ask a question and befor someone answer i have the anser find out bye myself. When you see the problem try to read classes of minecraft and whats more important from other mods. Make yourself an ModSource Lib (with all Versions from oldest to newest) thats the way i do and if i have a question i look at their source. And in every case i find an answer. or when was my last question? i think it was something with redstone problems but that i find out by myself. its only a hint^^" Thats it. Bye
-
Ore/LiquidDictionary Problems (Please Make IT PLEASE)
Thats right i want a list of ores. ForgeForum made a list of Item/BlockIDs why the could not make an ore/liquidDictionary list which everyone can download (like an textdata) and everyone who adds something with an mod can poste it there. (Only ores and liquids). at the moment i read it from Mekanismen and IC2 source. But that does not help really because they do not offer all blocks. ^^" Thats kinda sucks. I asked for the list a view moths ago where i was a noob in modding (now i am making pipes and co). but how good i am at the moment does not really interesst. The only thing i think is important make a ore/liquidDictionary List.
-
Ore/LiquidDictionary Problems (Please Make IT PLEASE)
First of all im still using 1.4.7. Second part i know how to get all ores. But i made my own macerrator and i do not want to get all ores at ones. I want a list of all ores without installing the mods itself. So that i can plan my things. i mean like this function. for(ItemStack ore : OreDictionary.getOres("copperOre")) { if(ore != null) { Macerrator.getRecipes().addRecipe(ore.itemID, ore.getItemDamage(), new ItemStack(Item.copperDust, 2)); } } i mean a list like it was before in 1.0. there was a list of names in the oredictionaryclass. like that: "Most used ares are these: oreCopper, oreTin, oreSilver, uraniumDrop, oreNikolite, and and and" but this is no longer implemented. and it makes people who does not have the connections to other modders very hard to get compatible. Stupid thing to delete that (Small but good) list.
-
3 input furnace?
it is easier to write your own furnace. By the way i did not read the full thread thats why i could be wrong but i have an old source code of an special furnace: Special things: 3 inputslots fuelbarrel, and an extra slot (i think it was for modules) its a dirty code but its easy to understand. it does not make much lag but it could be a smaler code. here is my old 1.2.5 code: TileEntity: package spmod.dynamictools.common.tileentities; import spmod.dynamictools.common.lib.DTNames; import spmod.dynamictools.common.recipes.AdvancedToolMakerRecipe; import cpw.mods.fml.common.Side; import cpw.mods.fml.common.asm.SideOnly; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.src.Block; import net.minecraft.src.BlockFurnace; import net.minecraft.src.EntityPlayer; import net.minecraft.src.FurnaceRecipes; import net.minecraft.src.IInventory; import net.minecraft.src.Item; import net.minecraft.src.ItemBlock; import net.minecraft.src.ItemHoe; import net.minecraft.src.ItemStack; import net.minecraft.src.ItemSword; import net.minecraft.src.ItemTool; import net.minecraft.src.Material; import net.minecraft.src.NBTTagCompound; import net.minecraft.src.NBTTagList; import net.minecraft.src.TileEntity; public class TileAdvWorkbench extends TileEntity implements IInventory { private ItemStack[] advSlots = new ItemStack[6]; public int fuel = 0; public int heat = 0; public int progress = 0; public TileAdvWorkbench() { } @Override public int getSizeInventory() { return advSlots.length; } @Override public ItemStack getStackInSlot(int par1) { return advSlots[par1]; } @SideOnly(Side.CLIENT) public int getFuel(int par1) { return fuel * par1 / 240000; } @SideOnly(Side.CLIENT) public boolean isBurning() { return heat > 0; } @SideOnly(Side.CLIENT) public boolean hasFuel() { return fuel > 0; } @SideOnly(Side.CLIENT) public boolean isWorking() { return isPowered(); } @SideOnly(Side.CLIENT) public boolean canWork() { return heat > 2000; } @SideOnly(Side.CLIENT) public int getHeat(int par1) { return heat * par1 / 5300; } @SideOnly(Side.CLIENT) public int getProgress(int par1) { return progress * par1 / 100; } public ItemStack decrStackSize(int par1, int par2) { if (this.advSlots[par1] != null) { ItemStack var3; if (this.advSlots[par1].stackSize <= par2) { var3 = this.advSlots[par1]; this.advSlots[par1] = null; return var3; } else { var3 = this.advSlots[par1].splitStack(par2); if (this.advSlots[par1].stackSize == 0) { this.advSlots[par1] = null; } return var3; } } else { return null; } } public ItemStack getStackInSlotOnClosing(int par1) { if (this.advSlots[par1] != null) { ItemStack var2 = this.advSlots[par1]; this.advSlots[par1] = null; return var2; } else { return null; } } public void setInventorySlotContents(int par1, ItemStack par2ItemStack) { this.advSlots[par1] = par2ItemStack; if (par2ItemStack != null && par2ItemStack.stackSize > this.getInventoryStackLimit()) { par2ItemStack.stackSize = this.getInventoryStackLimit(); } } @Override public String getInvName() { return DTNames.AdvToolbenchName; } @Override public int getInventoryStackLimit() { return 64; } @Override public boolean isUseableByPlayer(EntityPlayer var1) { return true; } @Override public void openChest(){ } @Override public void closeChest(){ } public void readFromNBT(NBTTagCompound par1NBTTagCompound) { super.readFromNBT(par1NBTTagCompound); NBTTagList var2 = par1NBTTagCompound.getTagList("Items"); this.advSlots = new ItemStack[this.getSizeInventory()]; for (int var3 = 0; var3 < var2.tagCount(); ++var3) { NBTTagCompound var4 = (NBTTagCompound)var2.tagAt(var3); byte var5 = var4.getByte("Slot"); if (var5 >= 0 && var5 < this.advSlots.length) { this.advSlots[var5] = ItemStack.loadItemStackFromNBT(var4); } } this.fuel = par1NBTTagCompound.getInteger("Fuel"); this.heat = par1NBTTagCompound.getInteger("Heat"); this.progress = par1NBTTagCompound.getInteger("Progress"); } /** * Writes a tile entity to NBT. */ public void writeToNBT(NBTTagCompound par1NBTTagCompound) { super.writeToNBT(par1NBTTagCompound); par1NBTTagCompound.setInteger("Fuel", this.fuel); par1NBTTagCompound.setInteger("Heat", this.heat); par1NBTTagCompound.setInteger("Progress", this.progress); NBTTagList var2 = new NBTTagList(); for (int var3 = 0; var3 < this.advSlots.length; ++var3) { if (this.advSlots[var3] != null) { NBTTagCompound var4 = new NBTTagCompound(); var4.setByte("Slot", (byte)var3); this.advSlots[var3].writeToNBT(var4); var2.appendTag(var4); } } par1NBTTagCompound.setTag("Items", var2); } public void updateEntity() { boolean update = false; if(heat > 0 && fuel == 0) { --heat; update = true; } else if(heat <= 2000 && fuel > 0&& isPowered()) { fuel -= 5; heat += 1; update = true; } else if(heat > 2000 && fuel > 0 && heat < 5000 && isPowered()) { fuel--; heat++; update = true; } else if(!isPowered() && heat > 0) { heat--; update = true; } else { } if(fuel < 100000) { if(advSlots[0] != null && this.isFuel(advSlots[0])) { fuel = fuel + addFuel(advSlots[0]); --advSlots[0].stackSize; update = true; if (this.advSlots[0].stackSize == 0) { this.advSlots[0] = this.advSlots[0].getItem().getContainerItemStack(advSlots[0]); } } else if(advSlots[0] != null && isBoostFuel(advSlots[0])) { fuel = fuel - (addBoostFuel(advSlots[0]) * 2); if(fuel < 0) { fuel = 0; } heat = heat + addBoostFuel(advSlots[0]); --advSlots[0].stackSize; update = true; if(this.advSlots[0].stackSize == 0) { this.advSlots[0] = this.advSlots[0].getItem().getContainerItemStack(advSlots[0]); } } else if(advSlots[0] != null && isExtraFuel(advSlots[0]) && heat > 2000) { fuel = fuel + addExtraFuel(advSlots[0]); heat = heat - (addExtraFuel(advSlots[0]) * 3); --advSlots[0].stackSize; update = true; if(this.advSlots[0].stackSize == 0) { this.advSlots[0] = this.advSlots[0].getItem().getContainerItemStack(advSlots[0]); } } } if(canSmeltVanillaThings()) { ++progress; if(progress > 100) { progress = 0; smeltVanilla(); update = true; } } if(update == true) { this.onInventoryChanged(); } } public static boolean isExtraFuel(ItemStack par1) { return addExtraFuel(par1) > 0; } public static boolean isFuel(ItemStack par1) { return addFuel(par1) > 0; } public static boolean isBoostFuel(ItemStack par1) { return addBoostFuel(par1) > 0; } public static int addBoostFuel(ItemStack par1) { if(par1 == null) { return 0; } int any = par1.getItem().shiftedIndex; Item item = par1.getItem(); int metaItem = par1.getItemDamage(); if(par1.getItem() instanceof ItemBlock && Block.blocksList[any] != null) { Block block = Block.blocksList[any]; } if(item == item.bucketLava) { return 2000; } return GameRegistry.getFuelValue(par1); } public static int addExtraFuel(ItemStack par1) { if(par1 == null) { return 0; } int any = par1.getItem().shiftedIndex; Item item = par1.getItem(); int metaItem = par1.getItemDamage(); if(par1.getItem() instanceof ItemBlock && Block.blocksList[any] != null) { Block block = Block.blocksList[any]; if(block == block.cobblestone || block == block.cobblestoneMossy) { return 500; } } return GameRegistry.getFuelValue(par1); } public static int addFuel(ItemStack par1) { if(par1 == null) { return 0; } int any = par1.getItem().shiftedIndex; Item item = par1.getItem(); int metaItem = par1.getItemDamage(); if(par1.getItem() instanceof ItemBlock && Block.blocksList[any] != null) { Block block = Block.blocksList[any]; if(block == block.wood) { return 25; } if(block == block.sapling) { return 2; } if(block == block.planks) { return 25; } } if(item == item.coal) { return 1000; } return GameRegistry.getFuelValue(par1); } public boolean canSmeltVanillaThings() { if(canProgress() == true || canProgress2() == true || canProgress3() == true) { return true; } else { return false; } } public boolean canProgress2() { if(advSlots[3] == null) { return false; } else { ItemStack par1 = AdvancedToolMakerRecipe.smelting().getCookResult(advSlots[3]); if (par1 == null) return false; if (this.advSlots[5] == null) return true; if (!this.advSlots[5].isItemEqual(par1)) return false; int result = advSlots[5].stackSize + par1.stackSize; return (result <= getInventoryStackLimit() && result <= par1.getMaxStackSize()); } } public boolean canProgress3() { if(advSlots[4] == null) { return false; } else { ItemStack par1 = AdvancedToolMakerRecipe.smelting().getCookResult(advSlots[4]); if (par1 == null) return false; if (this.advSlots[5] == null) return true; if (!this.advSlots[5].isItemEqual(par1)) return false; int result = advSlots[5].stackSize + par1.stackSize; return (result <= getInventoryStackLimit() && result <= par1.getMaxStackSize()); } } public boolean canProgress() { if(advSlots[2] == null) { return false; } else { ItemStack par1 = AdvancedToolMakerRecipe.smelting().getCookResult(advSlots[2]); if (par1 == null) return false; if (this.advSlots[5] == null) return true; if (!this.advSlots[5].isItemEqual(par1)) return false; int result = advSlots[5].stackSize + par1.stackSize; return (result <= getInventoryStackLimit() && result <= par1.getMaxStackSize()); } } public void smeltVanilla() { smeltVanilla1(); smeltVanilla2(); smeltVanilla3(); } public void smeltVanilla3() { if(canProgress3()) { ItemStack par1 = AdvancedToolMakerRecipe.smelting().getCookResult(advSlots[4]); if (this.advSlots[5] == null) { this.advSlots[5] = par1.copy(); } else if (this.advSlots[5].isItemEqual(par1)) { advSlots[5].stackSize += par1.stackSize; } --advSlots[4].stackSize; if (advSlots[4].stackSize <= 0) { this.advSlots[4] = null; } } } public void smeltVanilla2() { if(canProgress2()) { ItemStack par1 = AdvancedToolMakerRecipe.smelting().getCookResult(advSlots[3]); if (this.advSlots[5] == null) { this.advSlots[5] = par1.copy(); } else if (this.advSlots[5].isItemEqual(par1)) { advSlots[5].stackSize += par1.stackSize; } --advSlots[3].stackSize; if (advSlots[3].stackSize <= 0) { this.advSlots[3] = null; } } } public void smeltVanilla1() { if(canProgress()) { ItemStack par1 = AdvancedToolMakerRecipe.smelting().getCookResult(advSlots[2]); if (this.advSlots[5] == null) { this.advSlots[5] = par1.copy(); } else if (this.advSlots[5].isItemEqual(par1)) { advSlots[5].stackSize += par1.stackSize; } --advSlots[2].stackSize; if (advSlots[2].stackSize <= 0) { this.advSlots[2] = null; } } } public boolean isPowered() { return this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord); } } Gui package spmod.dynamictools.client.gui; import java.awt.Button; import org.lwjgl.opengl.GL11; import cpw.mods.fml.common.Side; import cpw.mods.fml.common.asm.SideOnly; import spmod.dynamictools.common.tileentities.TileAdvWorkbench; import spmod.dynamictools.common.container.ContainerAdvToolbench; import spmod.dynamictools.common.lib.DTNames; import net.minecraft.src.EntityPlayer; import net.minecraft.src.GuiButton; import net.minecraft.src.GuiContainer; import net.minecraft.src.InventoryPlayer; import net.minecraft.src.StatCollector; import net.minecraft.src.World; @SideOnly(Side.CLIENT) public class GuiAdvToolbench extends GuiContainer { private TileAdvWorkbench tile; int par5 = 175; int par6 = 165; public GuiAdvToolbench(InventoryPlayer par1, TileAdvWorkbench par2) { super(new ContainerAdvToolbench(par1, par2)); tile = par2; } protected void drawGuiContainerForegroundLayer() { this.fontRenderer.drawString(DTNames.AdvToolbenchName, 28, 6, 4210752); this.fontRenderer.drawString(StatCollector.translateToLocal("container.inventory"), 8, this.ySize - 96 + 2, 4210752); } protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) { int var4 = this.mc.renderEngine.getTexture("/spmod/dynamictools/textures/gui/advancedworkbench.png"); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); this.mc.renderEngine.bindTexture(var4); int var5 = (this.width - this.xSize) / 2; int var6 = (this.height - this.ySize) / 2; this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize); int var7; if(tile.isWorking()) { this.drawTexturedModalRect(var5 + 49, var6 + 68, 176, 77, 11, 5); } if (this.tile.hasFuel()) { var7 = this.tile.getFuel(100); this.drawTexturedModalRect(var5 + 11, var6 + 76 - var7, 176, 73 - var7, 4, var7 + 2); } if (this.tile.isBurning()) { var7 = this.tile.getHeat(12); this.drawTexturedModalRect(var5 + 25, var6 + 42 + 12 - var7, 176, 12 - var7, 14, var7 + 2); } var7 = this.tile.getProgress(24); this.drawTexturedModalRect(var5 + 90, var6 + 32, 176, 14, var7 + 1, 16); } } Container package spmod.dynamictools.common.container; import java.util.Iterator; import cpw.mods.fml.common.Side; import cpw.mods.fml.common.asm.SideOnly; import net.minecraft.src.Container; import net.minecraft.src.EntityPlayer; import net.minecraft.src.FurnaceRecipes; import net.minecraft.src.ICrafting; import net.minecraft.src.InventoryPlayer; import net.minecraft.src.ItemStack; import net.minecraft.src.Slot; import net.minecraft.src.SlotFurnace; import net.minecraft.src.TileEntityFurnace; import spmod.dynamictools.common.tileentities.TileAdvWorkbench; public class ContainerAdvToolbench extends Container { private TileAdvWorkbench tile; private int fuelnow = 0; private int heatnow = 0; private int progressnow = 0; public ContainerAdvToolbench(InventoryPlayer par1, TileAdvWorkbench par2) { tile = par2; addSlotToContainer(new Slot(par2, 0, 24, 60)); //fuelslot addSlotToContainer(new Slot(par2, 1, 7, 10)); // recipe slot addSlotToContainer(new Slot(par2, 2, 55, 31)); // input 1 addSlotToContainer(new Slot(par2, 3, 80, 10)); // input 2 addSlotToContainer(new Slot(par2, 4, 81, 54)); // input 3 addSlotToContainer(new SlotFurnace(par1.player, par2, 5, 128, 32)); //output int var3; for (var3 = 0; var3 < 3; ++var3) { for (int var4 = 0; var4 < 9; ++var4) { this.addSlotToContainer(new Slot(par1, var4 + var3 * 9 + 9, 8 + var4 * 18, 84 + var3 * 18)); } } for (var3 = 0; var3 < 9; ++var3) { this.addSlotToContainer(new Slot(par1, var3, 8 + var3 * 18, 142)); } } public void updateCraftingResults() { super.updateCraftingResults(); Iterator var1 = this.crafters.iterator(); while (var1.hasNext()) { ICrafting var2 = (ICrafting)var1.next(); if (this.fuelnow != this.tile.fuel) { var2.updateCraftingInventoryInfo(this, 0, this.tile.fuel); } if (this.heatnow != this.tile.heat) { var2.updateCraftingInventoryInfo(this, 1, this.tile.heat); } if (this.progressnow != this.tile.progress) { var2.updateCraftingInventoryInfo(this, 2, this.tile.progress); } } this.fuelnow = this.tile.fuel; this.heatnow = this.tile.heat; this.progressnow = this.tile.progress; } @SideOnly(Side.CLIENT) public void updateProgressBar(int par1, int par2) { if (par1 == 0) { this.tile.fuel = par2; } if (par1 == 1) { this.tile.heat = par2; } if (par1 == 2) { this.tile.progress = par2; } } @Override public boolean canInteractWith(EntityPlayer var1) { return true; } public ItemStack transferStackInSlot(int par1) { ItemStack var2 = null; Slot var3 = (Slot)this.inventorySlots.get(par1); if (var3 != null && var3.getHasStack()) { ItemStack var4 = var3.getStack(); var2 = var4.copy(); if (par1 == 2) { if (!this.mergeItemStack(var4, 3, 39, true)) { return null; } var3.onSlotChange(var4, var2); } else if (par1 != 1 && par1 != 0) { if (FurnaceRecipes.smelting().getSmeltingResult(var4) != null) { if (!this.mergeItemStack(var4, 2, 1, false)) { return null; } } else if (TileEntityFurnace.isItemFuel(var4)) { if (!this.mergeItemStack(var4, 0, 2, false)) { return null; } } else if (par1 >= 3 && par1 < 30) { if (!this.mergeItemStack(var4, 30, 39, false)) { return null; } } else if (par1 >= 30 && par1 < 39 && !this.mergeItemStack(var4, 3, 30, false)) { return null; } } else if (!this.mergeItemStack(var4, 3, 39, false)) { return null; } if (var4.stackSize == 0) { var3.putStack((ItemStack)null); } else { var3.onSlotChanged(); } if (var4.stackSize == var2.stackSize) { return null; } var3.onPickupFromSlot(var4); } return var2; } } Block package spmod.dynamictools.common.blocks; import java.util.List; import net.minecraft.src.Block; import net.minecraft.src.BlockContainer; import net.minecraft.src.CreativeTabs; import net.minecraft.src.EntityLiving; import net.minecraft.src.EntityPlayer; import net.minecraft.src.ItemStack; import net.minecraft.src.Material; import net.minecraft.src.MathHelper; import net.minecraft.src.TileEntity; import net.minecraft.src.World; import net.minecraftforge.common.ForgeDirection; import spmod.api.common.lib.DTTextures; import spmod.dynamictools.DynamicTools; import spmod.dynamictools.common.tileentities.TileAdvWorkbench; import spmod.dynamictools.common.tileentities.TileCobbleStorage; import spmod.dynamictools.common.config.DTBlocks; import spmod.dynamictools.common.lib.DTGuis; public class BlockAdvancedToolbench extends BlockContainer { boolean isPowered = false; public static DTTextures id; public BlockAdvancedToolbench(int id) { super(id, Material.rock); setHardness(1.0F); setResistance(5.0F); this.setCreativeTab(CreativeTabs.tabFood); if(isPowered) { setLightValue(2.0F); } } public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3) { par3.add(new ItemStack(par1, 1, 0)); par3.add(new ItemStack(par1, 1, 1)); } public boolean onBlockActivated(World par1, int par2, int par3, int par4, EntityPlayer par5, int par6, float par7, float par8, float par9) { if(par5.isSneaking()) { return false; } if(!par1.isRemote) { int meta = par1.getBlockMetadata(par2, par3, par4); if(meta == 0) { par5.openGui(DynamicTools.instance, DTGuis.advancedtoolworkbench, par1, par2, par3, par4); return true; } else if(meta == 1) { par5.openGui(DynamicTools.instance, DTGuis.cobblestorage, par1, par2, par3, par4); return true; } else { return true; } } return true; } public void onNeighborBlockChange(World par1World, int par2, int par3, int par4, int par5) { int meta = par1World.getBlockMetadata(par2, par3, par4); if(meta == 0) { if(isPowered && !par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { isPowered = false; } else if (!this.isPowered && par1World.isBlockIndirectlyGettingPowered(par2, par3, par4)) { isPowered = true; } } } public int getBlockTextureFromSideAndMetadata(int side, int meta) { if(meta == 0) { if(side == 0 || side == 1) { return id.ADT0; } else if(side == 2) // front { if(isPowered) { return id.ADT2; } else { return id.ADT1; } } else if(side == 3) { return id.ADT3; } else if(side == 4) { return id.ADT4; } else { return id.ADT5; } } else if(meta == 1) { return 100; } else { return 256; } } @Override public TileEntity createNewTileEntity(World world, int meta) { if(meta == 0) { return new TileAdvWorkbench(); } else if(meta == 1) { return new TileCobbleStorage(); } else { return null; } } @Override public TileEntity createNewTileEntity(World var1) { return null; } } a view things to know i didnt know at that time how to make stack in slot. it works but i crashes the game. and the tile Cobblestorage is nothing else as a cobblechest. But thats not the part of interest. I hope i can help you with that.
-
How do i make a new sword?
to code a sword is the on of the easiest things i make. make an new itemclass for it and extends it itemsword: than add these things: setMaxDamage(); getDamageVsEntity(); onHitEntity();//Damage the tool when you hit an entity onDistroyBlock(); //damage the sword when it distroy its block and thats it.
-
Ore/LiquidDictionary Problems (Please Make IT PLEASE)
Hello. I have problems with the dictionaries. The problem is i never find a list of the names. and i do not want to decomplie 50 mods to find my name thats kinda ignore me. Thats why i ask does anybody has a list with all liquidNames and Orenames for the easy finding of ores and liquids (i know bad english but i am mad with that.) Answer would be nice
-
[1.4]Render problem
I fixed The problem. I Reranged the model when his facing goes up or down.
-
[1.4]Render problem
Here are pictures. With that you understand better what i mean Facing 0 (Down) https://www.dropbox.com/s/ih3lqcwpiym90hf/Tiny%20Hopper%20Facing%200.bmp?m Facing 1 (UP) https://www.dropbox.com/s/r5vd18a7a8z2c1m/Tiny%20Hopper%20Facing%201.bmp?m Facing 2 (Front) https://www.dropbox.com/s/6j24yn19u1bon8i/Tiny%20Hopper%20Facing%202.bmp?m Facing 3 (West) https://www.dropbox.com/s/dblrx4cd0kew25c/Tiny%20Hopper%20Facing%203.bmp?m Facing 4 (South) https://www.dropbox.com/s/qyv5e9py0afz7b7/Tiny%20Hopper%20Facing%204.bmp?m Facing 5 (East) https://www.dropbox.com/s/3xrbk9pat35ndkm/Tiny%20Hopper%20Facing%205.bmp?m So what is the problem?
-
[1.4]Render problem
Hello. I have A Render Bug/Problem. The actually code is working but the problem is i want to make a XYZ Rotation and when i make a Y Rotation the block (texture not the block itself) stays x/z + 1 and y + 1 from his normal place. Here is my code: Moddel Hopper package speiger.src.tinychest.client.models; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelHopper extends ModelBase { //fields ModelRenderer Top; ModelRenderer Kanal; ModelRenderer Bottom; ModelRenderer Seite_Back; ModelRenderer Seite_Front; ModelRenderer Seite_Rechts; ModelRenderer Seite_Links; public ModelHopper() { textureWidth = 64; textureHeight = 64; Top = new ModelRenderer(this, 0, 0); Top.addBox(0F, 0F, 0F, 16, 6, 16); Top.setRotationPoint(-8F, 24F, 2F); Top.setTextureSize(64, 32); Top.mirror = true; setRotation(Top, 1.570796F, 0F, 0F); Kanal = new ModelRenderer(this, 0, 24); Kanal.addBox(0F, 0F, 0F, 3, 8, 3); Kanal.setRotationPoint(-1.5F, 17.5F, -6F); Kanal.setTextureSize(64, 32); Kanal.mirror = true; setRotation(Kanal, 1.570796F, 0F, 0F); Bottom = new ModelRenderer(this, 16, 24); Bottom.addBox(0F, 0F, 0F, 10, 1, 10); Bottom.setRotationPoint(-5F, 21F, -8F); Bottom.setTextureSize(64, 32); Bottom.mirror = true; setRotation(Bottom, 1.570796F, 0F, 0F); Seite_Back = new ModelRenderer(this, 25, 40); Seite_Back.addBox(0F, 0F, 0F, 10, 1, 1); Seite_Back.setRotationPoint(-5F, 21F, -7F); Seite_Back.setTextureSize(64, 32); Seite_Back.mirror = true; setRotation(Seite_Back, 1.570796F, 0F, 0F); Seite_Front = new ModelRenderer(this, 0, 40); Seite_Front.addBox(0F, 0F, 0F, 10, 1, 1); Seite_Front.setRotationPoint(-5F, 12F, -7F); Seite_Front.setTextureSize(64, 32); Seite_Front.mirror = true; setRotation(Seite_Front, 1.570796F, 0F, 0F); Seite_Rechts = new ModelRenderer(this, 0, 47); Seite_Rechts.addBox(0F, 0F, 0F, 1, 1, ; Seite_Rechts.setRotationPoint(-5F, 20F, -7F); Seite_Rechts.setTextureSize(64, 32); Seite_Rechts.mirror = true; setRotation(Seite_Rechts, 1.570796F, 0F, 0F); Seite_Links = new ModelRenderer(this, 21, 47); Seite_Links.addBox(0F, 0F, 0F, 1, 1, ; Seite_Links.setRotationPoint(4F, 20F, -7F); Seite_Links.setTextureSize(64, 32); Seite_Links.mirror = true; setRotation(Seite_Links, 1.570796F, 0F, 0F); } public void render(float size) { Top.render(size); Kanal.render(size); Bottom.render(size); Seite_Back.render(size); Seite_Front.render(size); Seite_Rechts.render(size); Seite_Links.render(size); } public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5) { super.render(entity, f, f1, f2, f3, f4, f5); setRotationAngles(f, f1, f2, f3, f4, f5, entity); Top.render(f5); Kanal.render(f5); Bottom.render(f5); Seite_Back.render(f5); Seite_Front.render(f5); Seite_Rechts.render(f5); Seite_Links.render(f5); } private void setRotation(ModelRenderer model, float x, float y, float z) { model.rotateAngleX = x; model.rotateAngleY = y; model.rotateAngleZ = z; } public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity f6) { super.setRotationAngles(f, f1, f2, f3, f4, f5, f6); } } RenderHopper package speiger.src.tinychest.client.render; import org.lwjgl.opengl.GL11; import speiger.src.tinychest.client.models.ModelHopper; import speiger.src.tinychest.common.tileentity.TileEntityBasicTinyHopper; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; public class RenderHopper extends TileEntitySpecialRenderer { private ModelHopper hopper = new ModelHopper(); public RenderHopper() { } @Override public void renderTileEntityAt(TileEntity var1, double var2, double var4, double var6, float var8) { renderHopper((TileEntityBasicTinyHopper)var1, var2, var4, var6, 1F); } private void renderHopper(TileEntityBasicTinyHopper par1, double par2, double par3, double par4, float par5) { GL11.glPushMatrix(); GL11.glTranslatef((float) par2 + 0.5f, (float) par3 + 1.5f, (float) par4 + 0.5f); bindTextureByName("/speiger/src/tinychest/textures/ModelHopper.png"); switch(par1.getFacing()) { case 0: GL11.glRotatef(-90, 1F, 0F, 0F); break; case 1: GL11.glRotatef(90, 1F, 0F, 0F); break; case 2: GL11.glRotatef(0, 0.0F, 1.0F, 0.0F); break; case 3: GL11.glRotatef(180, 0.0F, 1.0F, 0.0F); break; case 4: GL11.glRotatef(90, 0.0F, 1.0F, 0.0F); break; case 5: GL11.glRotatef(270, 0.0F, 1.0F, 0.0F); break; } GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F); hopper.render(0.0625F); GL11.glPopMatrix(); } } So what is the problem??
-
Tell Whether an Item is Enchanted...
diesieben07 There is a function in ItemStack. public boolean isItemEnchanted() SirJshreder with this function you can check inside items and machines if an item is enchanted ^^
-
Redstone is buggy!
sry then i made a minderror here par5 == side sorry but you have the code package speiger.src.tinychest.common.blocks; import java.util.List; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import speiger.src.api.common.addonslib.tinychest.TinyChestIDs; import speiger.src.tinychest.TinyChest; import speiger.src.tinychest.common.core.TinyChestCore; import speiger.src.tinychest.common.tileentity.TileEntityAdvancedTinyChest; import speiger.src.tinychest.common.tileentity.TileEntityBasicTinyChest; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestAcht; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestDrei; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestEins; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestFunf; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestNeun; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestSechs; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestSieben; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestVier; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestZwei; import speiger.src.tinychest.common.tileentity.advanced.SpecailTinyChest; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockAdvTinyChest extends BlockContainer { private static TinyChestIDs tiny; public BlockAdvTinyChest(int id) { super(id, Material.iron); this.setCreativeTab(TinyChest.tinyChest); } @SideOnly(Side.CLIENT) @Override public int getBlockTexture(IBlockAccess var1, int var2, int var3, int var4, int side) { int meta = var1.getBlockMetadata(var2, var3, var4); TileEntityAdvancedTinyChest tile = (TileEntityAdvancedTinyChest)var1.getBlockTileEntity(var2, var3, var4); if(side == tile.getFacing()) { if(meta == 0) return 11; else if(meta == 1) return 12; else if(meta == 2) return 13; else if(meta == 3) return 14; else if(meta == 4) return 15; else if(meta == 5) return 16; else if(meta == 6) return 17; else if(meta == 7) return 18; else if(meta == return 19; else if(meta == 9) return 22; else return 0; } else if(side == 0 || side == 1) { return 21; } else { return 20; } } @Override public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLiving var5) { if (!var1.isRemote) { TileEntityAdvancedTinyChest var6 = (TileEntityAdvancedTinyChest)var1.getBlockTileEntity(var2, var3, var4); if (var5 == null) { var6.setFacing(2); } else { int var7 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; switch (var7) { case 0: var6.setFacing(2); break; case 1: var6.setFacing(5); break; case 2: var6.setFacing(3); break; case 3: var6.setFacing(4); } } } } public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3) { par3.add(new ItemStack(par1, 1, 0)); par3.add(new ItemStack(par1, 1, 1)); par3.add(new ItemStack(par1, 1, 2)); par3.add(new ItemStack(par1, 1, 3)); par3.add(new ItemStack(par1, 1, 4)); par3.add(new ItemStack(par1, 1, 5)); par3.add(new ItemStack(par1, 1, 6)); par3.add(new ItemStack(par1, 1, 7)); par3.add(new ItemStack(par1, 1, ); par3.add(new ItemStack(par1, 1, 9)); } public boolean canProvidePower() { return true; } public boolean isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { return this.isProvidingWeakPower(par1IBlockAccess, par2, par3, par4, par5); } public boolean isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { return isPoweringTo(par1IBlockAccess, par2, par3, par4, par5); } public boolean isPoweringTo(IBlockAccess par1, int par2, int par3, int par4, int par5) { TileEntityAdvancedTinyChest tile = (TileEntityAdvancedTinyChest)par1.getBlockTileEntity(par2, par3, par4); if(tile.isFull()) return par5 == 1; if(tile.isEmpty()) return par5 == 0; else return false; } public boolean onBlockActivated(World par1, int par2, int par3, int par4, EntityPlayer par5, int par6, float par7, float par8, float par9) { if(par5.isSneaking()) return false; if(!par1.isRemote) { int meta = par1.getBlockMetadata(par2, par3, par4); int id = 0; if(meta == 0)id = tiny.advtinychestguieins; else if(meta == 1)id = tiny.advtinychestguizwei; else if(meta == 2)id = tiny.advtinychestguidrei; else if(meta == 3)id = tiny.advtinychestguivier; else if(meta == 4)id = tiny.advtinychestguifunf; else if(meta == 5)id = tiny.advtinychestguisechs; else if(meta == 6)id = tiny.advtinychestguisieben; else if(meta == 7)id = tiny.advtinychestguiacht; else if(meta == 8)id = tiny.advtinychestguineun; else if(meta == 9)id = tiny.speacialtinychestid; TileEntityAdvancedTinyChest tile = (TileEntityAdvancedTinyChest)par1.getBlockTileEntity(par2, par3, par4); if(tile != null) { par5.openGui(TinyChest.instance, id, par1, par2, par3, par4); return true; } } return true; } @Override public TileEntity createNewTileEntity(World var1) { return null; } public TileEntity createNewTileEntity(World var1, int meta) { if(meta == 0) { return new AdvancedTinyChestEins(); } else if(meta == 1) { return new AdvancedTinyChestZwei(); } else if(meta == 2) { return new AdvancedTinyChestDrei(); } else if(meta == 3) { return new AdvancedTinyChestVier(); } else if(meta == 4) { return new AdvancedTinyChestFunf(); } else if(meta == 5) { return new AdvancedTinyChestSechs(); } else if(meta == 6) { return new AdvancedTinyChestSieben(); } else if(meta == 7) { return new AdvancedTinyChestAcht(); } else if(meta == { return new AdvancedTinyChestNeun(); } else if(meta == 9) { return new SpecailTinyChest(); } return null; } public void updateTick(World world, int i, int j, int k, Random random) { notifyNeighbors(world, i, j, k); world.scheduleBlockUpdate(i, j, k, blockID, tickRate()); } public void onBlockDestroyedByPlayer(World world, int i, int j, int k, int l) { notifyNeighbors(world, i, j, k); } public void notifyNeighbors(World world, int i, int j, int k) { world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID); world.notifyBlocksOfNeighborChange(i, j + 1, k, blockID); world.notifyBlocksOfNeighborChange(i - 1, j, k, blockID); world.notifyBlocksOfNeighborChange(i + 1, j, k, blockID); world.notifyBlocksOfNeighborChange(i, j, k - 1, blockID); world.notifyBlocksOfNeighborChange(i, j, k + 1, blockID); } public void onBlockAdded(World world, int i, int j, int k) { if(world.getBlockMetadata(i, j, k) == 0) { super.onBlockAdded(world, i, j, k); } world.scheduleBlockUpdate(i, j, k, blockID, tickRate()); } public int tickRate() { return 1; } } There is my full tiny chest code^^ Sry about the minderror^^
-
Redstone is buggy!
Yeah the compiler says all is ok and on top is the result here my full advtinychest code (its not on the latest update but i didn't change anything on the redstone part) package speiger.src.tinychest.common.blocks; import java.util.List; import java.util.Random; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import speiger.src.api.common.addonslib.tinychest.TinyChestIDs; import speiger.src.tinychest.TinyChest; import speiger.src.tinychest.common.core.TinyChestCore; import speiger.src.tinychest.common.tileentity.TileEntityAdvancedTinyChest; import speiger.src.tinychest.common.tileentity.TileEntityBasicTinyChest; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestAcht; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestDrei; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestEins; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestFunf; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestNeun; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestSechs; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestSieben; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestVier; import speiger.src.tinychest.common.tileentity.advanced.AdvancedTinyChestZwei; import speiger.src.tinychest.common.tileentity.advanced.SpecailTinyChest; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class BlockAdvTinyChest extends BlockContainer { private static TinyChestIDs tiny; public BlockAdvTinyChest(int id) { super(id, Material.iron); this.setCreativeTab(TinyChest.tinyChest); } @SideOnly(Side.CLIENT) @Override public int getBlockTexture(IBlockAccess var1, int var2, int var3, int var4, int side) { int meta = var1.getBlockMetadata(var2, var3, var4); TileEntityAdvancedTinyChest tile = (TileEntityAdvancedTinyChest)var1.getBlockTileEntity(var2, var3, var4); if(side == tile.getFacing()) { if(meta == 0) return 11; else if(meta == 1) return 12; else if(meta == 2) return 13; else if(meta == 3) return 14; else if(meta == 4) return 15; else if(meta == 5) return 16; else if(meta == 6) return 17; else if(meta == 7) return 18; else if(meta == return 19; else if(meta == 9) return 22; else return 0; } else if(side == 0 || side == 1) { return 21; } else { return 20; } } @Override public void onBlockPlacedBy(World var1, int var2, int var3, int var4, EntityLiving var5) { if (!var1.isRemote) { TileEntityAdvancedTinyChest var6 = (TileEntityAdvancedTinyChest)var1.getBlockTileEntity(var2, var3, var4); if (var5 == null) { var6.setFacing(2); } else { int var7 = MathHelper.floor_double((double)(var5.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3; switch (var7) { case 0: var6.setFacing(2); break; case 1: var6.setFacing(5); break; case 2: var6.setFacing(3); break; case 3: var6.setFacing(4); } } } } public void getSubBlocks(int par1, CreativeTabs par2CreativeTabs, List par3) { par3.add(new ItemStack(par1, 1, 0)); par3.add(new ItemStack(par1, 1, 1)); par3.add(new ItemStack(par1, 1, 2)); par3.add(new ItemStack(par1, 1, 3)); par3.add(new ItemStack(par1, 1, 4)); par3.add(new ItemStack(par1, 1, 5)); par3.add(new ItemStack(par1, 1, 6)); par3.add(new ItemStack(par1, 1, 7)); par3.add(new ItemStack(par1, 1, ); par3.add(new ItemStack(par1, 1, 9)); } public boolean canProvidePower() { return true; } public boolean isProvidingStrongPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { return this.isProvidingWeakPower(par1IBlockAccess, par2, par3, par4, par5); } public boolean isProvidingWeakPower(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) { return isPoweringTo(par1IBlockAccess, par2, par3, par4, par5); } public boolean isPoweringTo(IBlockAccess par1, int par2, int par3, int par4, int par5) { TileEntityAdvancedTinyChest tile = (TileEntityAdvancedTinyChest)par1.getBlockTileEntity(par2, par3, par4); if(tile.isFull()) return par5 == 1; if(tile.isEmpty()) return par5 == 0; else return false; } public boolean onBlockActivated(World par1, int par2, int par3, int par4, EntityPlayer par5, int par6, float par7, float par8, float par9) { if(par5.isSneaking()) return false; if(!par1.isRemote) { int meta = par1.getBlockMetadata(par2, par3, par4); int id = 0; if(meta == 0)id = tiny.advtinychestguieins; else if(meta == 1)id = tiny.advtinychestguizwei; else if(meta == 2)id = tiny.advtinychestguidrei; else if(meta == 3)id = tiny.advtinychestguivier; else if(meta == 4)id = tiny.advtinychestguifunf; else if(meta == 5)id = tiny.advtinychestguisechs; else if(meta == 6)id = tiny.advtinychestguisieben; else if(meta == 7)id = tiny.advtinychestguiacht; else if(meta == 8)id = tiny.advtinychestguineun; else if(meta == 9)id = tiny.speacialtinychestid; TileEntityAdvancedTinyChest tile = (TileEntityAdvancedTinyChest)par1.getBlockTileEntity(par2, par3, par4); if(tile != null) { par5.openGui(TinyChest.instance, id, par1, par2, par3, par4); return true; } } return true; } @Override public TileEntity createNewTileEntity(World var1) { return null; } public TileEntity createNewTileEntity(World var1, int meta) { if(meta == 0) { return new AdvancedTinyChestEins(); } else if(meta == 1) { return new AdvancedTinyChestZwei(); } else if(meta == 2) { return new AdvancedTinyChestDrei(); } else if(meta == 3) { return new AdvancedTinyChestVier(); } else if(meta == 4) { return new AdvancedTinyChestFunf(); } else if(meta == 5) { return new AdvancedTinyChestSechs(); } else if(meta == 6) { return new AdvancedTinyChestSieben(); } else if(meta == 7) { return new AdvancedTinyChestAcht(); } else if(meta == { return new AdvancedTinyChestNeun(); } else if(meta == 9) { return new SpecailTinyChest(); } return null; } public void updateTick(World world, int i, int j, int k, Random random) { notifyNeighbors(world, i, j, k); world.scheduleBlockUpdate(i, j, k, blockID, tickRate()); } public void onBlockDestroyedByPlayer(World world, int i, int j, int k, int l) { notifyNeighbors(world, i, j, k); } public void notifyNeighbors(World world, int i, int j, int k) { world.notifyBlocksOfNeighborChange(i, j - 1, k, blockID); world.notifyBlocksOfNeighborChange(i, j + 1, k, blockID); world.notifyBlocksOfNeighborChange(i - 1, j, k, blockID); world.notifyBlocksOfNeighborChange(i + 1, j, k, blockID); world.notifyBlocksOfNeighborChange(i, j, k - 1, blockID); world.notifyBlocksOfNeighborChange(i, j, k + 1, blockID); } public void onBlockAdded(World world, int i, int j, int k) { if(world.getBlockMetadata(i, j, k) == 0) { super.onBlockAdded(world, i, j, k); } world.scheduleBlockUpdate(i, j, k, blockID, tickRate()); } public int tickRate() { return 1; } }
-
Redstone is buggy!
public boolean isStrongPoweringTo(World par1, int par2, int par3, int par4, int par5) { return isPoweringTo(par1, par2, par3, par4, par5); } public boolean isWeakPoweringTo(World par1, int par2, int par3, int par4, int par5) { return isPoweringTo(par1, par2, par3, par4, par5); } public boolean isPoweringTo(World par1, int x, int y, int z, int side) { TileEntityAdvTinyChest tile = (TileEntityAdvTinyChest)par1.getBlockTileEntity(x, y, z); if(tile.isFull())return par5 == 0; else if(tile.isEmpty())return par5 == 1; else return false; } public boolean canProvidePower() { return true; } This is the code with that i make the signal. So how can i solve my problem?
-
Redstone is buggy!
As redstonetorch/block/repeater/wire. My block is powerring the block next to my block and that is not what i want^^ I want a normal redstonesignal like a mfsu mfsu but in a special direcition. If full: Redstone signal on top else if Empty: Redstone signal on bottom else return false;
-
Redstone is buggy!
As redstonetorch/block/repeater/wire. My block is powerring the block next to my block and that is not what i want^^ I want a normal redstonesignal like a mfsu mfsu but in a special direcition. If full: Redstone signal on top else if Empty: Redstone signal on bottom else return false;
-
Redstone
I did. I used the repeater, redstonetorch, redstonewire, pipe, redalloywire, mfsu as blueprint (i don't know the actually word what i wanna use but blueprint is ok.)
-
Redstone
I did. I used the repeater, redstonetorch, redstonewire, pipe, redalloywire, mfsu as blueprint (i don't know the actually word what i wanna use but blueprint is ok.)
-
Redstone is buggy!
First at all i do not need to make my material to a circuit. I tried that but it came the same result. That you cant view my code is because i deleted the source from github. Second: What the first picture is showen how my block is powering other blocks. But what i want is that my block act as a normal redstonesignalprovider. Thats why i made the second pic with the redstone torch. I mean my block is powerring the block which is touching my block block
-
Redstone is buggy!
First at all i do not need to make my material to a circuit. I tried that but it came the same result. That you cant view my code is because i deleted the source from github. Second: What the first picture is showen how my block is powering other blocks. But what i want is that my block act as a normal redstonesignalprovider. Thats why i made the second pic with the redstone torch. I mean my block is powerring the block which is touching my block block
-
How to use tools in a crafting recipe
EE3 (Equilant Exchange 3) Does have the easiest way i know: Look at this mod. These Classes Are important: ModItems ItemMiniumstone Look what he is doing with ContainerItem. I mean these functions are needed: ModItems: SetContainerItem, ItemMiniumStone: GetContainerItemStack with that you should get what you need^^
-
How to use tools in a crafting recipe
EE3 (Equilant Exchange 3) Does have the easiest way i know: Look at this mod. These Classes Are important: ModItems ItemMiniumstone Look what he is doing with ContainerItem. I mean these functions are needed: ModItems: SetContainerItem, ItemMiniumStone: GetContainerItemStack with that you should get what you need^^
IPS spam blocked by CleanTalk.