Everything posted by Jeerdus
-
Problem with GUI texture
Aah! Just found out I had to type my modID lowercased. Stupid me...
-
Problem with GUI texture
Nope. Still doesn't work (it does the same thing)
-
Problem with GUI texture
Good day, I cannot figure out why I always get this error: [WARNING] [Minecraft-Client] Failed to load texture: Cyborg53373_Elementum:/textures/gui/cellingMachineGUI.png java.io.FileNotFoundException: Cyborg53373_Elementum:/textures/gui/cellingMachineGUI.png at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:31) at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:84) at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:41) at elementum.GuiCellingMachine.drawGuiContainerBackgroundLayer(GuiCellingMachine.java:36) at net.minecraft.client.gui.inventory.GuiContainer.drawScreen(GuiContainer.java:111) at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1036) at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:946) at net.minecraft.client.Minecraft.run(Minecraft.java:838) at net.minecraft.client.main.Main.main(Main.java:93) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at net.minecraft.launchwrapper.Launch.launch(Launch.java:131) at net.minecraft.launchwrapper.Launch.main(Launch.java:27) when I open my custom furnace. (but Minecraft doesn't crash) Basicly it doesn't load the texture (there are only the purple-black squares) Here's my GuiCellingMachine: package elementum; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; import org.lwjgl.opengl.GL11; import elementum.Elementum; import elementum.ContainerCellingMachine; import elementum.ElementumGuiHandler; import elementum.TileEntityCellingMachine; import elementum.SlotInputCellingMachine; public class GuiCellingMachine extends GuiContainer { private ResourceLocation tif = new ResourceLocation("Cyborg53373_Elementum","/textures/gui/cellingMachineGUI.png"); private TileEntityCellingMachine inputMachineInventory; public GuiCellingMachine(InventoryPlayer inventoryplayer, TileEntityCellingMachine tileentityCellingMachine) { super(new ContainerCellingMachine(inventoryplayer, tileentityCellingMachine)); inputMachineInventory = tileentityCellingMachine; } protected void drawGuiContainerForegroundLayer(int par1, int par2) { fontRenderer.drawString(StatCollector.translateToLocal("Celling Machine"), 40, 6, 0x404040); fontRenderer.drawString(StatCollector.translateToLocal("Inventory"), 8, (ySize - 96) + 2, 0x404040); } protected void drawGuiContainerBackgroundLayer(float f, int i, int j) { GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); //mc.renderEngine.bindTexture(tif); Minecraft.getMinecraft().getTextureManager().bindTexture(tif); int l = (width - xSize) / 2; int i1 = (height - ySize) / 2; drawTexturedModalRect(l, i1, 0, 0, xSize, ySize); if (inputMachineInventory.isBurning()) { int j1 = inputMachineInventory.getBurnTimeRemainingScaled(12); drawTexturedModalRect(l + 56, (i1 + 36 + 12) - j1, 176, 12 - j1, 14, j1 + 2); } int k1 = inputMachineInventory.getCookProgressScaled(24); drawTexturedModalRect(l + 79, i1 + 34, 176, 14, k1 + 1, 16); } }
-
How to make block drop different item when destroyed with another item?
Well then, how am I supposed to do it?
-
How to make block drop different item when destroyed with another item?
Good day, I have a block and all I would want for it to do is that when I break it with my custom item it should drop different item then it normally drops when you break it with anything else. I tried this: public int idDropped(int id, Random rand, int idDropped, EntityPlayer player) { itemstack = player.getCurrentEquippedItem(); if (itemstack != null) { item = player.getCurrentEquippedItem().getItem(); if(item == Elementum.forgingHammer) return Elementum.cellingMachine.blockID; else return Block.blockIron.blockID; } return idDropped; } But it didn't work. Could anybody help me please?
-
Damaging an item after using in crafting
I have got the item I need to damage after using in a crafting table: package elementum; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.Icon; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; public class ItemForgingHammer extends Item { private ItemStack emptyItem = null; public ItemForgingHammer(int id) { super(id); maxStackSize = 1; setMaxDamage(31); } @Override public boolean hasContainerItem() { return true; } public void setEmptyItem(ItemStack ei) { this.emptyItem = ei; } public boolean doesContainerItemLeaveCraftingGrid(ItemStack par1ItemStack) { return false; } @Override public ItemStack getContainerItemStack(ItemStack stack) { int dmg = stack.getItemDamage(); if (dmg == 32) { return new ItemStack(stack.getItem(), 0, 32); } ItemStack tr = copyStack(stack, 1); tr.setItemDamage(dmg + 2); return tr; } public static ItemStack copyStack(ItemStack stack, int n) { return new ItemStack(stack.itemID, n, stack.getItemDamage()); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.itemIcon = par1IconRegister.registerIcon(Elementum.modid + ":" + this.getUnlocalizedName().substring(5)); } } Here's the crafting recpie: GameRegistry.addRecipe(new ItemStack(ironPlate), new Object[]{ "X","Y", 'X', new ItemStack(Elementum.forgingHammer,1,-1), 'Y', Item.ingotIron }); The problem is that it doesn't want to craft after it's been used only once.
-
Give poison effect when item is in inventory
Thank you for your help I figured it out!
-
Give poison effect when item is in inventory
Good day, I would like to ask someone if they couldn't help me with an item, that gives you poison effect when it is in the inventory.
-
How do I generate blocks like clay
Hmm... strange... I deleted the && corY > 48 bit from the for(int corY=0;corY < 64 && corY > 48; corY++) and it seems that it worked. Anyway, thanks for the help
-
How do I generate blocks like clay
It checks the Y axis.
-
How do I generate blocks like clay
May I ask what's the problem?
-
How do I generate blocks like clay
I played with the code a bit and eventually I got to this: public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { int blockID; int corX; int corZ; for(int corY=0;corY < 64 && corY > 48; corY++) { for (int corX2=0;corX2 <= 16; corX2++){ for (int corZ2=0;corZ2 <= 16; corZ2++){ corX = chunkX*16 + corX2; corZ = chunkZ*16 + corZ2; blockID = world.getBlockId(corX, corY, corZ); if(blockID == Block.blockClay.blockID) { world.setBlock(corX, corY, corZ, Elementum.lithiumClay.blockID); } } } } } But that bloody thing still won't generate
-
How do I generate blocks like clay
Ok, one last problem If I define corX and corZ like this: corX = chunkX*16; corZ = chunkZ*16; Then the block only generates at x:0 of that chunk and z:0 of that chunk. Is there a way to cover up the whole chunk? BTW, here's my code: http://paste.minecraftforge.net/view/4108ea8d
-
How do I generate blocks like clay
Oh, I am so sorry for bothering you. I just realized I commented out "WorldGenLithium worldGen = new WorldGenLithium();" But really, thank you for your help
-
How do I generate blocks like clay
I'm afraid that I'll need a code for that. How I said, I'm not that good in Java
-
How do I generate blocks like clay
Thank you for your help, but now I'm actually looking for a way to randomly replace blocks in the world with chance.
-
How do I generate blocks like clay
I've got idea. I could somehow go around the generation and somehow randomly replace generated Clay in the world. Is there any way to randomly replace blocks with chance in the world?
-
Forge decompiling error, tried everything
Can you post your code by paste.minecraftforge.net?
-
How do I generate blocks like clay
WOO! Somehow figured it out by myself Just had to change it, so it generates in sand, not in dirt Ok, so now I've got a different problem... It only generates once in the world (around spawn)
-
How do I generate blocks like clay
Sorry to still bother you, but I just can't figure it out. My code looks something like this: http://paste.minecraftforge.net/view/cb33f6b2 And it's still not generating.
-
How do I generate blocks like clay
I don't know what to change the par3, par4 and par5 to. http://paste.minecraftforge.net/view/54713356
-
How do I generate blocks like clay
If I do that it starts screaming that it cannot be boolean.
-
How do I generate blocks like clay
I tried implementing IWorldGenerator, but then it want's to add unimplemented methods. I add the "public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider)" method and then I get completely stuck. I don't know what am I supposed to do. I'll give a cookie to someone who helps me with this.
-
How do I generate blocks like clay
I've tried doing that. It says that "The method registerWorldGenerator(IWorldGenerator) in the type GameRegistry is not applicable for the arguments (WorldGenLithium)"
-
How do I generate blocks like clay
Here's the main mod file: (I've removed all the blocks that aren't important) http://paste.minecraftforge.net/view/cade39d3 Here's the Lithium Clay code: http://paste.minecraftforge.net/view/e92fcf86 And finally here's the Lithium Clay Item code: http://paste.minecraftforge.net/view/d41fef46 The WorldGen file is basicly the same as WorldGenClay (only with modified block ids) http://paste.minecraftforge.net/view/834e1813 The problem is that I need to somehow define it in the main mod code for it to load up the WorldGenLithium file.
IPS spam blocked by CleanTalk.