Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

EmperorZelos

Members
  • Joined

  • Last visited

Everything posted by EmperorZelos

  1. I am so pissed off now it was that simple! It worked now, thank you! I got a strange anomoly where it constantly adds my new block but I'll see what causes that!
  2. Aahh now I get it! I'll try it tomorrow after I get a nights sleep!
  3. Okey, I am not understanding you perfeclty...or at all for that manner. Sorry if I am a bit ignorant here package aerosteam.container; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import aerosteam.crafting.AnvilSmithManager; import aerosteam.items.ItemsAS; import aerosteam.tileentity.TileEntityAnvil; import aerosteam.tileentity.TileEntitySmelter; 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.IInventory; import net.minecraft.inventory.InventoryCraftResult; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.inventory.Slot; import net.minecraft.inventory.SlotCrafting; import net.minecraft.inventory.SlotFurnace; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.world.World; public class ContainerAnvil extends Container { private TileEntityAnvil anvil; private World worldObj; private int posX; private int posY; private int posZ; public InventoryCrafting craftMatrix; public IInventory craftResult; public ContainerAnvil(InventoryPlayer inventory,TileEntityAnvil tileentity, World world, int x, int y, int z){ this.anvil=tileentity; craftMatrix = new InventoryCrafting(this, 2,3); craftResult = new InventoryCraftResult(); worldObj=world; this.posX=x; this.posY=y; this.posZ=z; //Hammer slot this.addSlotToContainer(new Slot(tileentity,0,116,13)); for (int i = 0; i<2;i++){ for (int j = 0; j<3;j++){ this.addSlotToContainer(new Slot(craftMatrix,(i*3+j),21+18*j,33+18*i)); } } this.addSlotToContainer(new SlotCrafting(inventory.player, craftMatrix,craftResult, 1,136,42)); for(int i=0; i<3;i++){ for(int j=0; j<9;j++){ this.addSlotToContainer(new Slot(inventory,j+i*9+9,7+18*j+1,83+18*i+1 )); } } for(int i=0;i<9;i++){ this.addSlotToContainer(new Slot(inventory,i,8+18*i,142)); } onCraftMatrixChanged(craftMatrix); } public void onCraftMatrixChanged(IInventory inventory){ //System.out.println("Craft Change"); Slot slot = (Slot)this.inventorySlots.get(0); if (slot != null && slot.getHasStack()){ Item item = slot.getStack().getItem(); if (slot.getStack().getItem() != null){ if (slot.getStack().getItem() == ItemsAS.hammerBronze){ //System.out.println("has hammer"); craftResult.setInventorySlotContents(7, AnvilSmithManager.getInstance().findMatchingRecipe(craftMatrix,worldObj)); } } } //System.out.println("Done matching"); } @Override public boolean canInteractWith(EntityPlayer player) { return player.getDistanceSq((double)posX +0.5D, (double)posY+0.5D, (double)posZ+0.5D)<64.0D; } public void addCraftingToCrafter (ICrafting icraft){ super.addCraftingToCrafters(icraft); //icraft.sendProgressBarUpdate(this, 0, this.anvil.cookTime); } public void detectAndSendChanges (){ super.detectAndSendChanges(); for (int i=0; i<this.crafters.size();i++){ ICrafting icraft = (ICrafting) this.crafters.get(i); //if(this.lastCookTime != this.anvil.cookTime){ //icraft.sendProgressBarUpdate(this, 0, this.anvil.burnTime); //} } //this.lastCookTime = this.smelter.cookTime; } @SideOnly(Side.CLIENT) public void updateProgressBar (int slot, int newValue) { //if (slot==0) this.anvil.burnTime=newValue; } public ItemStack transferStackInSlot(EntityPlayer player, int i) { ItemStack itemstack = null; Slot slot = (Slot)this.inventorySlots.get(i); if (slot != null && slot.getHasStack()) { ItemStack itemstack1 = slot.getStack(); itemstack = itemstack1.copy(); if (i == 3) { if (!this.mergeItemStack(itemstack1, 4, 39, true)) { return null; } slot.onSlotChange(itemstack1, itemstack); } else if (i != 1 && i != 0 && i != 2) { if (FurnaceRecipes.smelting().getSmeltingResult(itemstack1) != null) { if (!this.mergeItemStack(itemstack1, 1, 2, false)) { return null; } } else if (TileEntityFurnace.isItemFuel(itemstack1)) { if (!this.mergeItemStack(itemstack1, 0, 3, false)) { return null; } } else if (i >= 3 && i < 30) { if (!this.mergeItemStack(itemstack1, 30, 39, false)) { return null; } } else if (i >= 30 && i < 39 && !this.mergeItemStack(itemstack1, 4, 30, false)) { return null; } } else if (!this.mergeItemStack(itemstack1, 4, 39, false)) { return null; } if (itemstack1.stackSize == 0) { slot.putStack((ItemStack)null); } else { slot.onSlotChanged(); } if (itemstack1.stackSize == itemstack.stackSize) { return null; } slot.onPickupFromSlot(player, itemstack1); } return itemstack; } public void onContainerClosed(EntityPlayer p_75134_1_) { super.onContainerClosed(p_75134_1_); if (!this.worldObj.isRemote) { for (int i = 0; i < 6; ++i) { ItemStack itemstack = this.craftMatrix.getStackInSlotOnClosing(i); if (itemstack != null) { p_75134_1_.dropPlayerItemWithRandomChoice(itemstack, false); } } } } } This is the code for the conatiner, let's try getting this in a manner so I can understand, which parts of these needs to be repalced by what exacly?
  4. Replaced my headline with this, not much but thinking i did some misspelling but I'll post it for you to see @EventHandler public void preInit(FMLInitializationEvent event) { BlocksAS.Init(); PipeBlocks.Init(); ItemsAS.Init(); FMLCommonHandler.instance().bus().register(new AnvilSmithingHandler()); //ItemsAS.Init(); } @EventHandler public void init(FMLInitializationEvent event) { //stuff NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler()); BiomesAS.init(); RecipeRemover.removeRecipe(); CraftingRecipes.addRecipes(); //Steam stuff Fluid steam = new Fluid("steam").setGaseous(true).setViscosity(100).setTemperature(400).setDensity(100); FluidRegistry.registerFluid(steam); steamRegistered = FluidRegistry.isFluidRegistered("steam"); //GameRegistry.registerFuelHandler(new FuelHandler()); //Generate world GameRegistry.registerWorldGenerator(eventWorldGen, 0); //Renders neoProxy.registerRenderThings(); } package aerosteam.blocks; import aerosteam.AeroSteam; import aerosteam.SoftMetalOre; import aerosteam.items.ItemsAS; import aerosteam.steam.DeviceSteamPipeAngled; import aerosteam.steam.DeviceSteamPipeStraight; import aerosteam.tileentity.TileEntityAnvil; import aerosteam.tileentity.TileEntityBarrel; import aerosteam.tileentity.TileEntityBoiler; import aerosteam.tileentity.TileEntityFermentBarrel; import aerosteam.tileentity.TileEntityMelter; import aerosteam.tileentity.TileEntitySmelter; import aerosteam.tileentity.TileEntitySteamPipeAngled; import aerosteam.tileentity.TileEntitySteamPipeStraight; import aerosteam.tileentity.TileEntitySteamTank; import aerosteam.tileentity.TileEntityTransaltitude; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; public class BlocksAS { //blocks public static Block oreCopper; public static Block oreTin; public static Block oreZinc; public static Block orePurplum; public static Block oreSilver; public static Block oreSaltpeter; public static Block pyrite; public static Block barrel; //Devices public static Block deviceSmelterIdle; public static Block deviceSmelterActive; public static Block deviceMelterIdle; public static Block deviceMelterActive; public static Block deviceBoilerIdle; public static Block deviceBoilerActive; public static Block deviceAnvilBronzeX; public static Block deviceAnvilBronzeZ; public static Block deviceTransaltitude; public static Block deviceGrinder; public static Block deviceExplosive; //--Steam-- public static Block deviceSteamTank; public static void Init() { registerBlocks(); } private static void registerBlocks() { CreativeTabs aeroTab=AeroSteam.aeroTab; //Blocks oreCopper = new SoftMetalOre(1).setBlockName("Copper Ore") .setCreativeTab(aeroTab) .setBlockTextureName(AeroSteam.MODID + ":" + "OreCopper") .setHardness(3) .setStepSound(Block.soundTypeStone) ; GameRegistry.registerBlock(oreCopper, "Copper Ore"); LanguageRegistry.addName(oreCopper, "Copper Ore"); oreTin = new SoftMetalOre(2).setBlockName("Tin Ore") .setCreativeTab(aeroTab) .setBlockTextureName(AeroSteam.MODID + ":" + "OreTin") .setHardness(3) .setStepSound(Block.soundTypeStone) ; GameRegistry.registerBlock(oreTin, "Tin Ore"); LanguageRegistry.addName(oreTin, "Tin Ore"); oreZinc = new SoftMetalOre(3).setBlockName("Zinc Ore") .setCreativeTab(aeroTab) .setBlockTextureName(AeroSteam.MODID + ":" + "OreZinc") .setHardness(3) .setStepSound(Block.soundTypeStone) ; GameRegistry.registerBlock(oreZinc, "Zinc Ore"); LanguageRegistry.addName(oreZinc, "Zinc Ore"); oreSilver = new SoftMetalOre(6).setBlockName("Silver Ore") .setCreativeTab(aeroTab) .setBlockTextureName(AeroSteam.MODID + ":" + "OreSilver") .setHardness(3) .setStepSound(Block.soundTypeStone) ; GameRegistry.registerBlock(oreSilver, "Silver Ore"); LanguageRegistry.addName(oreSilver, "Silver Ore"); orePurplum = new SoftMetalOre(5).setBlockName("Purplum Ore") .setCreativeTab(aeroTab) .setBlockTextureName(AeroSteam.MODID + ":" + "OrePurplum") .setHardness(3) .setStepSound(Block.soundTypeStone) ; GameRegistry.registerBlock(orePurplum, "Purplum Ore"); LanguageRegistry.addName(orePurplum, "Purplum Ore"); pyrite = new SoftMetalOre(4).setBlockName("Pyrite") .setCreativeTab(AeroSteam.aeroTab) .setBlockTextureName(AeroSteam.MODID + ":" + "Pyrite") .setHardness(4) .setStepSound(Block.soundTypeStone) ; GameRegistry.registerBlock(pyrite, "Pyrite"); LanguageRegistry.addName(pyrite, "Pyrite"); oreSaltpeter = new SoftMetalOre(7).setBlockName("Saltpeter Ore") .setCreativeTab(AeroSteam.aeroTab) .setBlockTextureName(AeroSteam.MODID + ":" + "OreSaltpeter") .setHardness(4) .setStepSound(Block.soundTypeStone) ; GameRegistry.registerBlock(oreSaltpeter, "Saltpeter Ore"); LanguageRegistry.addName(oreSaltpeter, "Saltpeter Ore"); //Devices //--Smelter-- deviceSmelterIdle = new DeviceSmelter(false) .setBlockName("SmelterIdle") .setHardness(5) .setCreativeTab(aeroTab); deviceSmelterActive = new DeviceSmelter(true) .setBlockName("SmelterActive") .setHardness(5) .setLightLevel(0.625F); GameRegistry.registerBlock(deviceSmelterIdle, "SmelterIdle"); GameRegistry.registerBlock(deviceSmelterActive, "SmelterActive"); LanguageRegistry.addName(deviceSmelterIdle, "Smelter"); LanguageRegistry.addName(deviceSmelterActive, "Smelter"); GameRegistry.registerTileEntity(TileEntitySmelter.class,"Smelter"); //--Melter-- deviceMelterIdle = new DeviceMelter(false) .setBlockName("MelterIdle") .setHardness(5) .setCreativeTab(aeroTab); deviceMelterActive = new DeviceMelter(true) .setBlockName("MelterActive") .setHardness(5) .setLightLevel(0.625F); GameRegistry.registerBlock(deviceMelterIdle, "MelterIdle"); GameRegistry.registerBlock(deviceMelterActive, "MelterActive"); LanguageRegistry.addName(deviceMelterIdle, "Melter"); LanguageRegistry.addName(deviceMelterActive, "Melter"); GameRegistry.registerTileEntity(TileEntityMelter.class,"Melter"); //--Boiler-- deviceBoilerIdle = new DeviceBoiler(false) .setBlockName("BoilerIdle") .setHardness(5) .setCreativeTab(AeroSteam.aeroTab); deviceBoilerActive = new DeviceBoiler(true) .setBlockName("BoilerActive") .setHardness(5) .setLightLevel(0.625F); GameRegistry.registerBlock(deviceBoilerIdle, "BoilerIdle"); GameRegistry.registerBlock(deviceBoilerActive, "BoilerActive"); LanguageRegistry.addName(deviceBoilerIdle, "Boiler"); LanguageRegistry.addName(deviceBoilerActive, "Boiler"); GameRegistry.registerTileEntity(TileEntityBoiler.class,"Boiler"); deviceSteamTank = new DeviceSteamTank().setBlockName("Steam Tank"); GameRegistry.registerBlock(deviceSteamTank, "Steam Tank"); GameRegistry.registerTileEntity(TileEntitySteamTank.class,"Steam Tank"); LanguageRegistry.addName(deviceSteamTank, "Steam Tank"); deviceAnvilBronzeX = new DeviceAnvilBronze(1).setBlockName("BronzeAnvil"); GameRegistry.registerBlock(deviceAnvilBronzeX, "BronzeAnvilX"); LanguageRegistry.addName(deviceAnvilBronzeX, "Bronze Anvil"); deviceAnvilBronzeZ = new DeviceAnvilBronze(3).setBlockName("BronzeAnvil"); GameRegistry.registerBlock(deviceAnvilBronzeZ, "BronzeAnvilZ"); LanguageRegistry.addName(deviceAnvilBronzeZ, "Bronze Anvil"); GameRegistry.registerTileEntity(TileEntityAnvil.class,"deviceAnvilBronze"); deviceTransaltitude = new DeviceTransaltitude().setBlockName("Transaltituder"); GameRegistry.registerBlock(deviceTransaltitude, "Transaltituder"); LanguageRegistry.addName(deviceTransaltitude, "Transaltituder"); GameRegistry.registerTileEntity(TileEntityTransaltitude.class,"Transaltituder"); barrel = new DeviceBarrel().setBlockName("Barrel"); GameRegistry.registerBlock(barrel, "Barrel"); GameRegistry.registerTileEntity(TileEntityBarrel.class,"Barrel"); LanguageRegistry.addName(barrel, "Barrel"); deviceExplosive = new DeviceExplosive().setBlockName("Explosive"); GameRegistry.registerBlock(deviceExplosive, "Explosive"); LanguageRegistry.addName(deviceExplosive, "Explosive"); } }
  5. I tried that but it did nothing :<
  6. so a class that extends slots use the function there but how do I call it into the main container?
  7. Okey, I don't quite get it I got tileentity, container, block and GUI class for my Anvil, do I need to create another class called custom slots? Any tutorial I can read?
  8. Gladly! This is the main one, the other one called pipes is identeical in structure package aerosteam.blocks; import aerosteam.AeroSteam; import aerosteam.SoftMetalOre; import aerosteam.items.ItemsAS; import aerosteam.steam.DeviceSteamPipeAngled; import aerosteam.steam.DeviceSteamPipeStraight; import aerosteam.tileentity.TileEntityAnvil; import aerosteam.tileentity.TileEntityBarrel; import aerosteam.tileentity.TileEntityBoiler; import aerosteam.tileentity.TileEntityFermentBarrel; import aerosteam.tileentity.TileEntityMelter; import aerosteam.tileentity.TileEntitySmelter; import aerosteam.tileentity.TileEntitySteamPipeAngled; import aerosteam.tileentity.TileEntitySteamPipeStraight; import aerosteam.tileentity.TileEntitySteamTank; import aerosteam.tileentity.TileEntityTransaltitude; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; public class BlocksAS { //blocks public static Block oreCopper; public static Block oreTin; public static Block oreZinc; public static Block orePurplum; public static Block oreSilver; public static Block oreSaltpeter; public static Block pyrite; public static Block barrel; //Devices public static Block deviceSmelterIdle; public static Block deviceSmelterActive; public static Block deviceMelterIdle; public static Block deviceMelterActive; public static Block deviceBoilerIdle; public static Block deviceBoilerActive; public static Block deviceAnvilBronzeX; public static Block deviceAnvilBronzeZ; public static Block deviceTransaltitude; public static Block deviceGrinder; public static Block deviceExplosive; //--Steam-- public static Block deviceSteamTank; public static void Init() { registerBlocks(); } private static void registerBlocks() { CreativeTabs aeroTab=AeroSteam.aeroTab; //Blocks oreCopper = new SoftMetalOre(1).setBlockName("Copper Ore") .setCreativeTab(aeroTab) .setBlockTextureName(AeroSteam.MODID + ":" + "OreCopper") .setHardness(3) .setStepSound(Block.soundTypeStone) ; GameRegistry.registerBlock(oreCopper, "Copper Ore"); LanguageRegistry.addName(oreCopper, "Copper Ore"); oreTin = new SoftMetalOre(2).setBlockName("Tin Ore") .setCreativeTab(aeroTab) .setBlockTextureName(AeroSteam.MODID + ":" + "OreTin") .setHardness(3) .setStepSound(Block.soundTypeStone) ; GameRegistry.registerBlock(oreTin, "Tin Ore"); LanguageRegistry.addName(oreTin, "Tin Ore"); oreZinc = new SoftMetalOre(3).setBlockName("Zinc Ore") .setCreativeTab(aeroTab) .setBlockTextureName(AeroSteam.MODID + ":" + "OreZinc") .setHardness(3) .setStepSound(Block.soundTypeStone) ; GameRegistry.registerBlock(oreZinc, "Zinc Ore"); LanguageRegistry.addName(oreZinc, "Zinc Ore"); oreSilver = new SoftMetalOre(6).setBlockName("Silver Ore") .setCreativeTab(aeroTab) .setBlockTextureName(AeroSteam.MODID + ":" + "OreSilver") .setHardness(3) .setStepSound(Block.soundTypeStone) ; GameRegistry.registerBlock(oreSilver, "Silver Ore"); LanguageRegistry.addName(oreSilver, "Silver Ore"); orePurplum = new SoftMetalOre(5).setBlockName("Purplum Ore") .setCreativeTab(aeroTab) .setBlockTextureName(AeroSteam.MODID + ":" + "OrePurplum") .setHardness(3) .setStepSound(Block.soundTypeStone) ; GameRegistry.registerBlock(orePurplum, "Purplum Ore"); LanguageRegistry.addName(orePurplum, "Purplum Ore"); pyrite = new SoftMetalOre(4).setBlockName("Pyrite") .setCreativeTab(AeroSteam.aeroTab) .setBlockTextureName(AeroSteam.MODID + ":" + "Pyrite") .setHardness(4) .setStepSound(Block.soundTypeStone) ; GameRegistry.registerBlock(pyrite, "Pyrite"); LanguageRegistry.addName(pyrite, "Pyrite"); oreSaltpeter = new SoftMetalOre(7).setBlockName("Saltpeter Ore") .setCreativeTab(AeroSteam.aeroTab) .setBlockTextureName(AeroSteam.MODID + ":" + "OreSaltpeter") .setHardness(4) .setStepSound(Block.soundTypeStone) ; GameRegistry.registerBlock(oreSaltpeter, "Saltpeter Ore"); LanguageRegistry.addName(oreSaltpeter, "Saltpeter Ore"); //Devices //--Smelter-- deviceSmelterIdle = new DeviceSmelter(false) .setBlockName("SmelterIdle") .setHardness(5) .setCreativeTab(aeroTab); deviceSmelterActive = new DeviceSmelter(true) .setBlockName("SmelterActive") .setHardness(5) .setLightLevel(0.625F); GameRegistry.registerBlock(deviceSmelterIdle, "SmelterIdle"); GameRegistry.registerBlock(deviceSmelterActive, "SmelterActive"); LanguageRegistry.addName(deviceSmelterIdle, "Smelter"); LanguageRegistry.addName(deviceSmelterActive, "Smelter"); GameRegistry.registerTileEntity(TileEntitySmelter.class,"Smelter"); //--Melter-- deviceMelterIdle = new DeviceMelter(false) .setBlockName("MelterIdle") .setHardness(5) .setCreativeTab(aeroTab); deviceMelterActive = new DeviceMelter(true) .setBlockName("MelterActive") .setHardness(5) .setLightLevel(0.625F); GameRegistry.registerBlock(deviceMelterIdle, "MelterIdle"); GameRegistry.registerBlock(deviceMelterActive, "MelterActive"); LanguageRegistry.addName(deviceMelterIdle, "Melter"); LanguageRegistry.addName(deviceMelterActive, "Melter"); GameRegistry.registerTileEntity(TileEntityMelter.class,"Melter"); //--Boiler-- deviceBoilerIdle = new DeviceBoiler(false) .setBlockName("BoilerIdle") .setHardness(5) .setCreativeTab(AeroSteam.aeroTab); deviceBoilerActive = new DeviceBoiler(true) .setBlockName("BoilerActive") .setHardness(5) .setLightLevel(0.625F); GameRegistry.registerBlock(deviceBoilerIdle, "BoilerIdle"); GameRegistry.registerBlock(deviceBoilerActive, "BoilerActive"); LanguageRegistry.addName(deviceBoilerIdle, "Boiler"); LanguageRegistry.addName(deviceBoilerActive, "Boiler"); GameRegistry.registerTileEntity(TileEntityBoiler.class,"Boiler"); deviceSteamTank = new DeviceSteamTank().setBlockName("Steam Tank"); GameRegistry.registerBlock(deviceSteamTank, "Steam Tank"); GameRegistry.registerTileEntity(TileEntitySteamTank.class,"Steam Tank"); LanguageRegistry.addName(deviceSteamTank, "Steam Tank"); deviceAnvilBronzeX = new DeviceAnvilBronze(1).setBlockName("BronzeAnvil"); GameRegistry.registerBlock(deviceAnvilBronzeX, "BronzeAnvilX"); LanguageRegistry.addName(deviceAnvilBronzeX, "Bronze Anvil"); deviceAnvilBronzeZ = new DeviceAnvilBronze(3).setBlockName("BronzeAnvil"); GameRegistry.registerBlock(deviceAnvilBronzeZ, "BronzeAnvilZ"); LanguageRegistry.addName(deviceAnvilBronzeZ, "Bronze Anvil"); GameRegistry.registerTileEntity(TileEntityAnvil.class,"deviceAnvilBronze"); deviceTransaltitude = new DeviceTransaltitude().setBlockName("Transaltituder"); GameRegistry.registerBlock(deviceTransaltitude, "Transaltituder"); LanguageRegistry.addName(deviceTransaltitude, "Transaltituder"); GameRegistry.registerTileEntity(TileEntityTransaltitude.class,"Transaltituder"); barrel = new DeviceBarrel().setBlockName("Barrel"); GameRegistry.registerBlock(barrel, "Barrel"); GameRegistry.registerTileEntity(TileEntityBarrel.class,"Barrel"); LanguageRegistry.addName(barrel, "Barrel"); deviceExplosive = new DeviceExplosive().setBlockName("Explosive"); GameRegistry.registerBlock(deviceExplosive, "Explosive"); LanguageRegistry.addName(deviceExplosive, "Explosive"); } }
  9. Now we're getting somewhere! is it in the container, tileentity or which part is it located in?
  10. @SidedProxy(clientSide="aerosteam.proxy.ClientProxy",serverSide = "aerosteam.proxy.CommonProxy") public static CommonProxy neoProxy; @EventHandler public void preInit(FMLInitializationEvent event) { BlocksAS.Init(); PipeBlocks.Init(); ItemsAS.Init(); FMLCommonHandler.instance().bus().register(new AnvilSmithingHandler()); //ItemsAS.Init(); } @EventHandler public void init(FMLInitializationEvent event) { //stuff NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler()); BiomesAS.init(); RecipeRemover.removeRecipe(); CraftingRecipes.addRecipes(); //Steam stuff Fluid steam = new Fluid("steam").setGaseous(true).setViscosity(100).setTemperature(400).setDensity(100); FluidRegistry.registerFluid(steam); steamRegistered = FluidRegistry.isFluidRegistered("steam"); //GameRegistry.registerFuelHandler(new FuelHandler()); //Generate world GameRegistry.registerWorldGenerator(eventWorldGen, 0); //Renders neoProxy.registerRenderThings(); } I ahve this currently and it still crashes, it is in preInit as far as I can tell
  11. I can also add that while it doesn't cause instant crash, all recipies for custom blocks causes crash when the recipe has been fullfilled in the crafting table.
  12. EntityItem splosion = new EntityItem(world,(double)((float)x),(double)((float)y),(double)((float)z), new ItemStack(Blocks.dirt,1,0)); world.spawnEntityInWorld(splosion); world.createExplosion(splosion, (double)x, (double)y, (double)z, 15.0F, true); world.removeEntity(splosion); This is the code I use for random explosions I want, create an entity of some blkock (here dirt) in the world at x,y,z. then creates the entity, explodes and then removes it quickly.
  13. world.createExplosion(splosion, (double)x, (double)y, (double)z, 15.0F, true); the 15.0F is what determined the explosion size, when you reach 50 and higher the explosion lags and starts looking utter shite
  14. don't make the explosion too big, they look utter shtie when too big
  15. If it helps @EventHandler public void preInit(FMLInitializationEvent event) { BlocksAS.Init(); PipeBlocks.Init(); FMLCommonHandler.instance().bus().register(new AnvilSmithingHandler()); //ItemsAS.Init(); } @EventHandler public void init(FMLInitializationEvent event) { //stuff NetworkRegistry.INSTANCE.registerGuiHandler(this, new GuiHandler()); BiomesAS.init(); ItemsAS.Init(); RecipeRemover.removeRecipe(); CraftingRecipes.addRecipes(); //Steam stuff Fluid steam = new Fluid("steam").setGaseous(true).setViscosity(100).setTemperature(400).setDensity(100); FluidRegistry.registerFluid(steam); steamRegistered = FluidRegistry.isFluidRegistered("steam"); //GameRegistry.registerFuelHandler(new FuelHandler()); //Generate world GameRegistry.registerWorldGenerator(eventWorldGen, 0); //Renders neoProxy.registerRenderThings(); } }
  16. The issue is mostly I have no idea what function to use such that when someone grabs the item they craft that it damages the hammer that is placed in the item slot for the hammer (that I have fixed). Just want a guidance on what function would be suitible or if there is a way to call forth which tileentity from there that is being used.
  17. I doubt that ist he case as the recipie should be initiated after but here it is! how stupid am I? ---- Minecraft Crash Report ---- // Ouch. That hurt Time: 2014-09-12 12:26 Description: Initializing game java.lang.NullPointerException: Initializing game at net.minecraft.item.crafting.CraftingManager.addRecipe(CraftingManager.java:236) at cpw.mods.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:233) at cpw.mods.fml.common.registry.GameRegistry.addRecipe(GameRegistry.java:228) at aerosteam.crafting.CraftingRecipes.addRecipes(CraftingRecipes.java:14) at aerosteam.AeroSteam.init(AeroSteam.java:107) 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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) 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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) 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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288) at net.minecraft.client.Minecraft.startGame(Minecraft.java:596) at net.minecraft.client.Minecraft.run(Minecraft.java:941) at net.minecraft.client.main.Main.main(Main.java:164) 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:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) 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 GradleStart.bounce(GradleStart.java:107) at GradleStart.startClient(GradleStart.java:100) at GradleStart.main(GradleStart.java:55) A detailed walkthrough of the error, its code path and all known details is as follows: --------------------------------------------------------------------------------------- -- Head -- Stacktrace: at net.minecraft.item.crafting.CraftingManager.addRecipe(CraftingManager.java:236) at cpw.mods.fml.common.registry.GameRegistry.addShapedRecipe(GameRegistry.java:233) at cpw.mods.fml.common.registry.GameRegistry.addRecipe(GameRegistry.java:228) at aerosteam.crafting.CraftingRecipes.addRecipes(CraftingRecipes.java:14) at aerosteam.AeroSteam.init(AeroSteam.java:107) 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 cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:513) 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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:208) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:187) 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 com.google.common.eventbus.EventSubscriber.handleEvent(EventSubscriber.java:74) at com.google.common.eventbus.SynchronizedEventSubscriber.handleEvent(SynchronizedEventSubscriber.java:47) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:322) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:304) at com.google.common.eventbus.EventBus.post(EventBus.java:275) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:118) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:691) at cpw.mods.fml.client.FMLClientHandler.finishMinecraftLoading(FMLClientHandler.java:288) at net.minecraft.client.Minecraft.startGame(Minecraft.java:596) -- Initialization -- Details: Stacktrace: at net.minecraft.client.Minecraft.run(Minecraft.java:941) at net.minecraft.client.main.Main.main(Main.java:164) 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:134) at net.minecraft.launchwrapper.Launch.main(Launch.java:28) 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 GradleStart.bounce(GradleStart.java:107) at GradleStart.startClient(GradleStart.java:100) at GradleStart.main(GradleStart.java:55) -- System Details -- Details: Minecraft Version: 1.7.10 Operating System: Windows 7 (amd64) version 6.1 Java Version: 1.8.0_11, Oracle Corporation Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation Memory: 759567632 bytes (724 MB) / 1037959168 bytes (989 MB) up to 1037959168 bytes (989 MB) JVM Flags: 3 total; -Xincgc -Xmx1024M -Xms1024M AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0 FML: MCP v9.05 FML v7.10.18.1180 Minecraft Forge 10.13.0.1180 4 mods loaded, 4 mods active mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) Unloaded->Constructed->Pre-initialized->Initialized FML{7.10.18.1180} [Forge Mod Loader] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized Forge{10.13.0.1180} [Minecraft Forge] (forgeSrc-1.7.10-10.13.0.1180.jar) Unloaded->Constructed->Pre-initialized->Initialized AeroSteam{1.0} [AeroSteam] (bin) Unloaded->Constructed->Pre-initialized->Errored Launched Version: 1.7.10 LWJGL: 2.9.1 OpenGL: GeForce GT 610/PCIe/SSE2 GL version 4.4.0, NVIDIA Corporation GL Caps: Using GL 1.3 multitexturing. Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported. Anisotropic filtering is supported and maximum anisotropy is 16. Shaders are available because OpenGL 2.1 is supported. Is Modded: Definitely; Client brand changed to 'fml,forge' Type: Client (map_client.txt) Resource Packs: [] Current Language: English (US) Profiler Position: N/A (disabled) Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used Anisotropic Filtering: Off (1)
  18. I am making blocks and such and naturally I need crafting recipes. GameRegistry.addRecipe(new ItemStack(BlocksAS.deviceAnvilBronzeX),new Object[]{" ","BBB", " BB",'B',ItemsAS.ingotbronze}); GameRegistry.addRecipe(new ItemStack(PipeBlocks.deviceAngledSteamPipeXn0),new Object[]{" "," P", " P ",'P',BlocksAS.barrel}); GameRegistry.addRecipe(new ItemStack(ItemsAS.hammerBronze),new Object[]{" B "," S ", " S ",'B',ItemsAS.ingotbronze,'S',Items.stick}); GameRegistry.addRecipe(new ItemStack(BlocksAS.deviceBoilerIdle),new Object[]{"CCC","CFC", "CCC",'F',Blocks.furnace,'C',ItemsAS.ingotbronze}); GameRegistry.addRecipe(new ItemStack(BlocksAS.deviceSmelterIdle),new Object[]{"SSS","CSC", "SCS",'S',Blocks.cobblestone,'C',ItemsAS.ingotcopper}); is the code for registering them All of them work perfectly, except the pipe one GameRegistry.addRecipe(new ItemStack(PipeBlocks.deviceAngledSteamPipeXn0),new Object[]{" "," P", " P ",'P',BlocksAS.barrel}); This one, I have played around and I have noticed it is the {" "," P", " P ",'P',BlocksAS.barrel} part that screws me over, the moment I put a custom block there, not custom item, but custom block, it screws me over, what could be causing this?
  19. well no, it is an anvil because it involves metal wowrk but it does nothing that the original anvil does, it is basicly just a crafting table for metals
  20. Hello, I am trying to make an anvil that utilizes a hammer to craft items, I have managed so far making it only appear if the hammer is put into the correct slot but I am currently struggling with finding a way to damage the hammer when an item is being crafted. I have looked into this and sure enough it reacts when I make something public void onCrafting(PlayerEvent.ItemCraftedEvent e) { System.out.println(e.crafting.getDisplayName()); } which is all fine but I cannot think of a way to go from there ensuring it is only the anvil crafting it reacts to, I cannot find something I can use to have it say "yes it is an anvil I am crafting from", and the tileentity x,y,z, if I could get that the rest oughta work, is there some way from here to get it so? Or is there a better way to approch this?
  21. the steam one really is the only one, it seems to be working I just get multiple values
  22. Sure, an example of where it has occured package aerosteam.tileentity; import java.util.Random; import aerosteam.AeroSteam; import aerosteam.SteamFuel; import aerosteam.blocks.DeviceBoiler; import aerosteam.recipes.AlloyRecipes; import aerosteam.steam.ISteamContainment; import aerosteam.steam.ISteamTransporter; import cpw.mods.fml.common.registry.GameRegistry; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.FurnaceRecipes; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTank; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidHandler; public class TileEntityBoiler extends TileEntity implements IFluidHandler, ISidedInventory, ISteamTransporter, ISteamContainment{ private String localizedName; private static final int[] slot_m1= new int[]{0}; private static final int[] slot_m2= new int[]{1}; private static final int[] slot_fuel= new int[]{2}; private static final int[] slot_alloy= new int[]{3}; private ItemStack[] slots=new ItemStack [4]; //amount of stacks the item uses public static int ratioSteamWater=2; public static int boilSpeed=3; public int burnTime; public int temperature; public static int maxtmp=1000; public int burnTemperature; public int steam; public static int maxsteam=6000; public int water; public int condense; public static int maxwater=6000; public int currentItemBurnTime; public FluidTank myTank = new FluidTank(new FluidStack(FluidRegistry.WATER, 1), 10000); //Steam stuff //Ordinary stuff public void setGuiDisplayName(String DisplayName) { this.localizedName=DisplayName; } public String getInventoryName(){ return this.hasCustomInventoryName()? this.localizedName:"container.boiler"; } public boolean hasCustomInventoryName(){ return this.localizedName != null && this.localizedName.length()> 0; } public int getSizeInventory(){ return this.slots.length; } @Override public ItemStack getStackInSlot(int i) { return this.slots[i]; } @Override public ItemStack decrStackSize(int i1, int i2) { if(this.slots[i1] != null){ ItemStack itemstack; if(this.slots[i1].stackSize <= i2){ itemstack =this.slots[i1]; this.slots[i1]=null; return itemstack; }else{ itemstack =this.slots[i1].splitStack(i2); if(this.slots[i1].stackSize==0){ this.slots[i1]=null; } return itemstack; } }else{ return null; } } @Override public ItemStack getStackInSlotOnClosing(int i) { if(this.slots[i] != null){ ItemStack itemstack =this.slots[i]; this.slots[i]=null; return itemstack; } return null; } @Override public void setInventorySlotContents(int i, ItemStack itemstack) { this.slots[i]=itemstack; if(itemstack != null &&itemstack.stackSize>this.getInventoryStackLimit()){ itemstack.stackSize=this.getInventoryStackLimit(); } } @Override public int getInventoryStackLimit() { return 64; } @Override public boolean isUseableByPlayer(EntityPlayer player) { return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) != this ? false:player.getDistanceSq((double)this.xCoord+0.5D, (double)this.yCoord+0.5D, (double)this.zCoord+0.5D) < 64.0D; } public void openInventory() {} public void closeInventory() {} @Override public boolean isItemValidForSlot(int i, ItemStack stack) { return i==0 && isItemFuel(stack) ? true:i==3?false:true; } public boolean isItemFuel(ItemStack stack) { return getItemBurnTime(stack)>0; } private static int getItemBurnTime(ItemStack stack){ if(stack==null){ return 0; }else{ Item item=stack.getItem(); if(item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air){ } if(item==Items.coal) return 1800; } return 0; } private int getItem (ItemStack stack) { if(stack==null){ return 0; }else{ Item item=stack.getItem(); if(item instanceof ItemBlock && Block.getBlockFromItem(item) != Blocks.air){ Block block=Block.getBlockFromItem(item); //blook fuels } } return GameRegistry.getFuelValue(stack); } public boolean isBurning(){ return this.burnTime>0; } public boolean isBoiling(){ return this.temperature==this.maxtmp; } public boolean canBoil(){ if (slots[1]==null){ return false; } ItemStack itemstack = slots[1]; if (slots[1].getItem() == Items.water_bucket) { return true; }else{ return false; } } public int condenseRate(int tmp){ return 10+tmp/100; } public void updateEntity(){ boolean flag = this.isBurning(); boolean flag1 = false; Random generator = new Random(); if(this.isBurning()){ this.burnTime--; if(this.temperature < this.maxtmp ){ this.temperature++; } }else if(this.temperature > 0){ int rnd = generator.nextInt(2) + 2; this.temperature -= rnd; //this.decrSteam(1); if(this.temperature<0)this.temperature=0; } if (this.temperature < this.maxtmp && this.steam > 0 && this.water < this.maxwater){ this.condense++; if(this.condense >= condenseRate(this.temperature)){ this.condense=0; this.steam-=this.ratioSteamWater; if(this.steam < 0) this.steam=0; this.water++; } } if(!this.worldObj.isRemote){ if(this.burnTime == 0 ){ this.currentItemBurnTime=getItemBurnTime(this.slots[0]); this.burnTime=getItemBurnTime(this.slots[0]); if(this.isBurning()){ System.out.println("Burnflag" + flag); System.out.println("Burntime increased"); flag1=true; if(this.slots[0]!=null){ this.slots[0].stackSize--; if(this.slots[0].stackSize == 0) this.slots[0]=this.slots[0].getItem().getContainerItem(this.slots[0]); } } } if (canBoil()){ this.water+=1000; slots[1]=new ItemStack(Items.bucket); } if (isBurning() && isBoiling() && this.water>0 ){ if(this.burnTime % this.boilSpeed == 0){ this.water--; this.steam+=this.ratioSteamWater; } } } if(flag!=this.isBurning()){ DeviceBoiler.updateBoilerBlockState(this.burnTime>0,this.worldObj,this.xCoord,this.yCoord,this.zCoord); System.out.println("Statechanged"); } if(flag1){ this.markDirty(); } } @Override public int[] getAccessibleSlotsFromSide(int p_94128_1_) { return null; } @Override public boolean canInsertItem(int i, ItemStack stack, int j) { return this.isItemValidForSlot(i, stack); } @Override public boolean canExtractItem(int i, ItemStack stack,int j) { return j != 0 || i!= 1 || stack.getItem()==Items.bucket; } public int getBurnTimeRemainingScaled(int i){ return this.burnTime*i/this.currentItemBurnTime; } public int getTemperatureScaled(int i){ return this.temperature*i/this.maxtmp; } public int getWaterScaled(int i){ return this.water*i/this.maxwater; } public int getSteamScaled(int i){ return this.steam*i/this.maxsteam; } @Override public int fill(ForgeDirection from, FluidStack resource, boolean doFill) { return this.myTank.fill(resource, doFill); } @Override public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain) { // TODO Auto-generated method stub return null; } @Override public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain) { // TODO Auto-generated method stub return null; } @Override public boolean canFill(ForgeDirection from, Fluid fluid) { // TODO Auto-generated method stub return false; } @Override public boolean canDrain(ForgeDirection from, Fluid fluid) { // TODO Auto-generated method stub return false; } @Override public FluidTankInfo[] getTankInfo(ForgeDirection from) { // TODO Auto-generated method stub return null; } @Override public float getPressure() { return ((float) this.getSteam())/((float)this.getCapacity()); } @Override public boolean canInsert(ForgeDirection paramForgeDirection) { return true; } @Override public int getCapacity() { return 5000; } @Override public int getSteam() { //System.out.println("Boiler Steam: " + this.steam); return this.steam; } @Override public void explode() { // TODO Auto-generated method stub } @Override public void insertSteam(int amount) { this.steam += amount; } @Override public void decrSteam(int paramInt) { this.steam -= paramInt; } @Override public boolean doesConnect(ForgeDirection paramForgeDirection) { return true; } @Override public boolean acceptsGauge(ForgeDirection paramForgeDirection) { return false; } public void readFromNBT(NBTTagCompound nbt){ super.readFromNBT(nbt); NBTTagList list=nbt.getTagList("Items",10); this.slots=new ItemStack[this.getSizeInventory()]; for(int i=0; i<list.tagCount();i++){ NBTTagCompound compound = (NBTTagCompound) list.getCompoundTagAt(i); byte b=compound.getByte("Slot"); if (b>=0 && b<this.slots.length){ this.slots[b]=ItemStack.loadItemStackFromNBT(compound); } } this.burnTime=(int)nbt.getShort("BurnTime"); this.temperature=(int)nbt.getShort("Temperature"); this.water=(int)nbt.getShort("Water"); this.steam=(int)nbt.getShort("Steam"); this.currentItemBurnTime=(int)nbt.getShort("CurrentItemBurnTime"); if(nbt.hasKey("CustomName")){ this.localizedName=nbt.getString("CustomName"); } } public void writeToNBT(NBTTagCompound nbt){ super.writeToNBT(nbt); nbt.setShort("BurnTime",(short)this.burnTime); nbt.setShort("Temperature",(short)this.temperature); nbt.setShort("Water",(short)this.water); nbt.setShort("Steam",(short)this.steam); nbt.setShort("CurrentItemBurnTime",(short)this.currentItemBurnTime); NBTTagList list = new NBTTagList(); for(int i=0; i<this.slots.length;i++){ if(this.slots[i] != null){ NBTTagCompound compound=new NBTTagCompound(); compound.setByte("Slot",(byte)i); this.slots[i].writeToNBT(compound); list.appendTag(compound); } } nbt.setTag("Items",list); if(this.hasCustomInventoryName()){ nbt.setString("CustomName",this.localizedName); } } @Override public void changeSteam(int amount) { //System.out.println("Boiler had steam of: " + this.steam + ", was given amount:" + amount); this.steam += amount; //System.out.println("so now it has: " + this.steam); } }
  23. well that accounts for all but that sometimes the client one would have considerbly lower non-zero values aswell
  24. But they give different values, one tends to be empty with no values

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.