
GamingAndStuffs
Forge Modder-
Posts
12 -
Joined
-
Last visited
Everything posted by GamingAndStuffs
-
Hello ! I want to make a fuel, but I also wanted it to take damage instead of it disappearing every time it gets burnt in a furnace, kind of like the lava crystal from Blood Magic. I've looked around and all I could find was PlayerEvent.ItemSmeltedEvent. Does anyone know how to do this? Thanks!
-
Hello! I have simple question, is there a simple workaround for IInventory.setInventorySlotContents putting ghost items in the inventory, or do I have to set up a packet system or something like that? Thanks! 2 Examples of it: @Override public void updateEntity(){ ArrayList<ItemStack> ores = new ArrayList<ItemStack>(1); for(String oreName : OreDictionary.getOreNames()){ if(oreName.toLowerCase().startsWith("ore")) { ores = ListHelper.combine2(OreDictionary.getOres(oreName), ores); } } if(Tick == 40 && PowerStored > 0){ Tick = 0; int randomInt = 0; Random randomGenerator = new Random(); if(ores.size() > 0) { randomInt = randomGenerator.nextInt(ores.size()); } ItemStack oreToGen = ores.get(randomInt); for(TileEntity entity : TileHelper.getBlockSides(this)){ if(entity instanceof IInventory && end == false){ int size = ((IInventory) entity).getSizeInventory(); for(int i = 0; i < size; i++){ try { if(((IInventory) entity).getStackInSlot(i) != null){ if (((IInventory) entity).getStackInSlot(i).getItem().equals(oreToGen.getItem()) && ((IInventory) entity).getStackInSlot(i).stackSize < ((IInventory) entity).getInventoryStackLimit()) { ((IInventory) entity).getStackInSlot(i).stackSize++; } } else if (((IInventory) entity).getStackInSlot(i) == null) { //HERE ((IInventory) entity).setInventorySlotContents(i, oreToGen); } } catch(NullPointerException e){ e.printStackTrace(); } } this.end = true; } } this.end = false; } Tick++; } And: public void updateInventory(){ System.out.println("1"); for(Recipe recipe : Recipes.techTableRecipes){ System.out.println("2"); int temp = 0; int[] output = new int[9]; output[0] = 0; output[1] = 0; output[2] = 0; output[3] = 0; output[4] = 0; output[5] = 0; output[6] = 0; output[7] = 0; output[8] = 0; for(ItemStack item : recipe.Input){ System.out.println("3"); if(this.getStackInSlot(temp) != null) { if (item.getItem() == this.getStackInSlot(temp).getItem()) { System.out.println("4"); output[temp] = 1; } else { output[temp] = 0; } } else{ if(this.getStackInSlot(temp) == null && item.getItem() == null){ output[temp] = 1; } else { output[temp] = 0; } } temp++; } if(checkOutput(output)){ System.out.println("5"); this.setInventorySlotContents2(0, null); this.setInventorySlotContents2(1, null); this.setInventorySlotContents2(2, null); this.setInventorySlotContents2(3, null); this.setInventorySlotContents2(4, null); this.setInventorySlotContents2(5, null); this.setInventorySlotContents2(6, null); this.setInventorySlotContents2(7, null); this.setInventorySlotContents2(8, null); //HERE this.setInventorySlotContents2(10, recipe.Output);[/b][/u] } } }
-
Different Instances of Tile Entitys in Creative Tab
GamingAndStuffs replied to GamingAndStuffs's topic in Modder Support
Neither Methods Exist in CreativeTabs, are you talking about another class? -
Different Instances of Tile Entitys in Creative Tab
GamingAndStuffs posted a topic in Modder Support
Pretty simple question, I have a battery for a custom energy system. I want to have 2 instances of it in the creative tab I made. One that is full, and one that is empty. The values are both stored in NBT. Here is the code: Tile Entity Class: package com.harry9137.ct.tileentity; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.ChatComponentText; public class TileEntityBattery extends TEPowerRelated { public int PowerStorageMax = 1000; public boolean PowerGen = true; public boolean PowerSrc = true; public TileEntityBattery(int powerconstructor){ this.PowerStored = powerconstructor; } @Override public void updateEntity(){ this.PowerOffering = this.PowerStored; this.PowerRequesting = this.PowerStorageMax - this.PowerStored; //Don't have a display gui yet, so this is my solution Minecraft.getMinecraft().theWorld.getPlayerEntityByName("Harry9137").addChatComponentMessage(new ChatComponentText(Integer.toString(this.PowerStored))); } @Override public void writeToNBT(NBTTagCompound tagCompound) { super.writeToNBT(tagCompound); tagCompound.setInteger("PowerStored", this.PowerStored); } @Override public void readFromNBT(NBTTagCompound tagCompound){ super.readFromNBT(tagCompound); this.PowerStored = tagCompound.getInteger("PowerStored"); } } TEPowerRelated just is TileEntity with a few values(PowerStored, PowerStorageMax, etc) Block Class: package com.harry9137.ct.block; import com.harry9137.ct.CTTab; import com.harry9137.ct.reference.names; import com.harry9137.ct.tileentity.TileEntityBattery; import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public class blockBattery extends blockCT { private int PowerStart; public blockBattery(int powerconstructor) { super(Material.iron); this.PowerStart = powerconstructor; this.setBlockName(names.blocks.blockBattery); this.setCreativeTab(CTTab.CTTab); } @Override public TileEntity createNewTileEntity(World world, int metadata) { return new TileEntityBattery(PowerStart); } @Override public boolean hasTileEntity(int meta){ return true; } } blockCT is just extending Block with a few extra methods Creative Tab Class: public class CTTab { public static final CreativeTabs CTTab = new CreativeTabs(reference.MOD_ID.toLowerCase()) { @Override public Item getTabIconItem() { return modItems.itemCreepLeaf; } }; } Main Class: package com.harry9137.ct; import com.harry9137.ct.client.gui.GuiHandler; import com.harry9137.ct.event.EntityDeathEventHooks; import com.harry9137.ct.event.GameTickEvent; import com.harry9137.ct.event.PlayerLoginHandler; import com.harry9137.ct.handler.ConfigurationHandler; import com.harry9137.ct.init.modBlocks; import com.harry9137.ct.init.modItems; import com.harry9137.ct.proxy.IProxy; import com.harry9137.ct.reference.names; import com.harry9137.ct.reference.reference; import com.harry9137.ct.tileentity.TileEntityTechTable; import com.harry9137.ct.tileentity.TileEntityWire; import com.harry9137.ct.utillity.LogHelper; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.client.Minecraft; import net.minecraftforge.common.MinecraftForge; @Mod(modid = reference.MOD_ID, name = reference.MOD_NAME, version = reference.MOD_VERSION) public class CreepTech { public static SimpleNetworkWrapper snw; @Mod.Instance public static CreepTech INSTANCE; @SidedProxy(clientSide = reference.CLIENT_PROXY_CLASS, serverSide = reference.SERVER_PROXY_CLASS) public static IProxy proxy; @Mod.EventHandler public void preInit(FMLPreInitializationEvent event){ LogHelper.info("Pre-Init Started"); LogHelper.info("Registering Packet Handler"); // snw = NetworkRegistry.INSTANCE.newSimpleChannel(reference.MOD_ID); // snw.registerMessage(PacketHandler.class, WireStatePacket.class, 0, Side.CLIENT); LogHelper.info("Registering Events"); FMLCommonHandler.instance().bus().register(new GameTickEvent()); MinecraftForge.EVENT_BUS.register(new EntityDeathEventHooks()); MinecraftForge.EVENT_BUS.register(new PlayerLoginHandler()); FMLCommonHandler.instance().bus().register(new ConfigurationHandler(event.getSuggestedConfigurationFile())); LogHelper.info("Finished Registering Events"); NetworkRegistry.INSTANCE.registerGuiHandler(this.INSTANCE, new GuiHandler()); LogHelper.info("Registering Items/Blocks"); modItems.init(); modBlocks.init(); LogHelper.info("Finished Registering Items/Blocks"); LogHelper.info("Registering Custom Renderers"); proxy.registerTileRenderers(); LogHelper.info("Pre-Init Complete"); } @Mod.EventHandler public void init(FMLInitializationEvent event){ LogHelper.info("Init Started"); LogHelper.info("Registering Tile Entitys"); GameRegistry.registerTileEntity(TileEntityWire.class, names.blocks.blockWire); GameRegistry.registerTileEntity(TileEntityTechTable.class, names.blocks.blockTechTable); LogHelper.info("Finished Registering Tile Entitys"); LogHelper.info("Init Complete"); } @Mod.EventHandler public void preInti(FMLPostInitializationEvent event){ LogHelper.info("Post-Init Started"); LogHelper.info("Post-Init Complete"); } } Thanks ! -
Slash not detected by render engine
GamingAndStuffs replied to GamingAndStuffs's topic in Modder Support
a: at com.harry9137.ct.client.gui.GuiTechTable.drawGuiContainerBackgroundLayer(GuiTechTable.java:74) [GuiTechTable.class:?], this is line 74 : CreepTech.proxy.bindTexture(new ResourceLocation(reference.MOD_ID, "textures/gui/guiTechTable3.png")); b: public void bindTexture(ResourceLocation location) { getClientInstance().getTextureManager().bindTexture(location); } this is getClientInstance() public Minecraft getClientInstance() { return FMLClientHandler.instance().getClient(); } -
Slash not detected by render engine
GamingAndStuffs replied to GamingAndStuffs's topic in Modder Support
That's not the problem. The problem is that java.io.FileNotFoundException: ct:textures/guiguiTechTable3.png is different than CreepTech.proxy.bindTexture(new ResourceLocation(reference.MOD_ID, "textures/gui/guiTechTable3.png")); -
a: Give the full cmd prompt text b: Maybe update forge? This was happening to me before I updated
-
Hmm... 74: CreepTech.proxy.bindTexture(new ResourceLocation("ct:textures/gui/guiTechTable3.png")); [18:55:18] [Client thread/WARN]: Failed to load texture: ct:textures/guiguiTechTable3.png java.io.FileNotFoundException: ct:textures/guiguiTechTable3.png at net.minecraft.client.resources.FallbackResourceManager.getResource(FallbackResourceManager.java:65) ~[FallbackResourceManager.class:?] at net.minecraft.client.resources.SimpleReloadableResourceManager.getResource(SimpleReloadableResourceManager.java:67) ~[simpleReloadableResourceManager.class:?] at net.minecraft.client.renderer.texture.SimpleTexture.loadTexture(SimpleTexture.java:35) ~[simpleTexture.class:?] at net.minecraft.client.renderer.texture.TextureManager.loadTexture(TextureManager.java:89) [TextureManager.class:?] at net.minecraft.client.renderer.texture.TextureManager.bindTexture(TextureManager.java:45) [TextureManager.class:?] at com.harry9137.ct.proxy.ClientProxy.bindTexture(ClientProxy.java:21) [ClientProxy.class:?] at com.harry9137.ct.client.gui.GuiTechTable.drawGuiContainerBackgroundLayer(GuiTechTable.java:74) [GuiTechTable.class:?] at com.harry9137.ct.client.gui.GuiTechTable.drawScreen(GuiTechTable.java:65) [GuiTechTable.class:?] at net.minecraft.client.renderer.EntityRenderer.updateCameraAndRender(EntityRenderer.java:1137) [EntityRenderer.class:?] at net.minecraft.client.Minecraft.runGameLoop(Minecraft.java:1056) [Minecraft.class:?] at net.minecraft.client.Minecraft.run(Minecraft.java:951) [Minecraft.class:?] at net.minecraft.client.main.Main.main(Main.java:164) [Main.class:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_05] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_05] at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_05] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.11.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.11.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_05] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_05] at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_05] at GradleStart.bounce(GradleStart.java:107) [start/:?] at GradleStart.startClient(GradleStart.java:100) [start/:?] at GradleStart.main(GradleStart.java:55) [start/:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_05] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_05] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_05] at java.lang.reflect.Method.invoke(Method.java:483) ~[?:1.8.0_05] at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134) [idea_rt.jar:?] I have no idea what I did wrong... Thanks!
-
Thanks! Worked Fine
-
Hello ! Today, I have a pretty simple question. I am making a custom crafting table, and want the output slot to be able to be taken out of, but not put in. This is my code for the container: package com.harry9137.ct.client.gui; import com.harry9137.ct.tileentity.TileEntityTechTable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; public class ContainerTechTable extends Container { protected TileEntityTechTable tileEntity; protected IInventory playerinventory; public ContainerTechTable(InventoryPlayer inventoryPlayer, TileEntityTechTable te) { tileEntity = te; playerinventory = inventoryPlayer; for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { addSlotToContainer(new Slot(this.tileEntity, j + i * 3, 62 + j * 18, 17 + i * 18)); } } addSlotToContainer(new Slot(this.tileEntity, 10, getSlotFromInventory(this.tileEntity, .xDisplayPosition + 15, getSlotFromInventory(this.tileEntity, .yDisplayPosition)); bindPlayerInventory(inventoryPlayer); } protected void bindPlayerInventory(InventoryPlayer inventoryPlayer) { for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (int i = 0; i < 9; i++) { addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142)); } } @Override public ItemStack transferStackInSlot(EntityPlayer player, int slot) { ItemStack stack = null; Slot slotObject = (Slot) inventorySlots.get(slot); if (slotObject != null && slotObject.getHasStack()) { ItemStack stackInSlot = slotObject.getStack(); stack = stackInSlot.copy(); if (slot < 9) { if (!this.mergeItemStack(stackInSlot, 0, 35, true)) { return null; } } if (stackInSlot.stackSize == 0) { slotObject.putStack(null); } else { slotObject.onSlotChanged(); } if (stackInSlot.stackSize == stack.stackSize) { return null; } slotObject.onPickupFromSlot(player, stackInSlot); } return stack; } @Override public boolean canInteractWith(EntityPlayer player) { return true; } (Yes I took code from the minecraft forge tutorial, but I have no reason to change it ) Thanks!
-
I just have no idea what i'm doing wrong. The block will place fine, but the method isn't being called public class blockWire extends blockCT { public blockWire(){ super(Material.cloth); this.setBlockName(names.blocks.blockWire); } @Override public TileEntity createNewTileEntity(World world, int metadata) { System.out.println("Y U NO BE CALLED?"); return new TileEntityWire(); } } BlockCT Just extends Block with a few extra methods
-
Hello! I am a beginning modder and I am making a mod called CreepTech. I want to add a extension to the player model for devs and donaters that looks like wings. I want it to appear like the angel wings model in extra utilities by RWTema. I have a technie model of the wings, and the ability to fly, but I have absolutely no idea how to get the wings to render. Thanks! Github for the project: https://github.com/GamingAndStuffs/CreepTech