Jump to content

Heltrato

Members
  • Posts

    261
  • Joined

  • Last visited

Everything posted by Heltrato

  1. Whuuuuuuuuuuuuuuuuuuuuuuuttttttttttt????????????????????????????????? Why how why is there no safest hack to do with that? Also i stumbled across this tutorial its pretty much he just made variable with regards the IAttribute system
  2. Then i shall create custom Attribute then?
  3. Okay, i think i got the ISpecialArmor now, only 3 important methods, the display,properties,apply.. And somehow its additive to the EnumArmorMaterial. One last additional question... - Why is that the maximum health for every mob is only 1024? (in previous MC Version we can go way higher than that am if not mistaken ). Is there a way i can exceed it?
  4. 1.) Is it possible i could run "Damage Indicator" mod for my eclipse workspace? 2.) How is ISpecialArmor implement and what are the important methods (can explain how? )
  5. I hope i can make my english more understandble. Sorry for my late reply, but apparently we didnt use capablity for the quest system.. What we did is we use JsonElement for our save data and just define it in the class (urghhh how can i explain it ) anyways here is our Mission Class
  6. So i was having this issue, when a player dies and completing our quest system his savestate becomes the null making him spawn on void. So my hypothesis to fix this problem is looking up for some forge hooks regarding the "Respawn" Button
  7. Hello uhm i am encountering a bug atm in my mod and so far i figure it out that one of my conditions is lacking whether a player dies and how many time it dies inside the dimension so my question is this What class where i look in which related to: 1.) When a player dies inside a dimension 2.) Count player deaths inside a dimension.
  8. Bump. So here what i did a created a custom particle extending Particle at my new dev 1.11.2. should i just use Minecraft.getMinecraft.effectRender.addEffect(Particle); to spawn it?
  9. Anyone knows better which one should i prefer? A render using Tesseletor/Renderers or just Particles?
  10. Hello everyone is there any docs or tutorial for custom particles that at least compatible for 1.11 and such? My idea is to create a bunch of particle lava casted from a mouth (entity) and fires like a beam..
  11. This is the log that appears any quick help? 2017-07-03 19:23:36,736 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream [19:23:36] [main/INFO]: Extra: [] [19:23:36] [main/INFO]: Running with arguments: [--userProperties, {}, --assetsDir, C:/Users/user/.gradle/caches/minecraft/assets, --assetIndex, 1.11, --accessToken{REDACTED}, --version, 1.11, --tweakClass, net.minecraftforge.fml.common.launcher.FMLTweaker, --tweakClass, net.minecraftforge.gradle.tweakers.CoremodTweaker] [19:23:36] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [19:23:36] [main/INFO]: Using primary tweak class name net.minecraftforge.fml.common.launcher.FMLTweaker [19:23:36] [main/INFO]: Loading tweak class name net.minecraftforge.gradle.tweakers.CoremodTweaker [19:23:36] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLTweaker [19:23:36] [main/INFO]: Forge Mod Loader version 13.19.1.2189 for Minecraft 1.11 loading [19:23:36] [main/INFO]: Java is Java HotSpot(TM) 64-Bit Server VM, version 1.8.0_102, running on Windows 10:amd64:10.0, installed at C:\Program Files\Java\jre1.8.0_102 [19:23:36] [main/INFO]: Managed to load a deobfuscated Minecraft name- we are in a deobfuscated environment. Skipping runtime deobfuscation [19:23:37] [main/INFO]: Calling tweak class net.minecraftforge.gradle.tweakers.CoremodTweaker [19:23:37] [main/INFO]: Injecting location in coremod net.minecraftforge.fml.relauncher.FMLCorePlugin [19:23:37] [main/INFO]: Injecting location in coremod net.minecraftforge.classloading.FMLForgePlugin [19:23:37] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [19:23:37] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [19:23:37] [main/INFO]: Loading tweak class name net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [19:23:37] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [19:23:37] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLInjectionAndSortingTweaker [19:23:37] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [19:23:37] [main/ERROR]: The binary patch set is missing. Either you are in a development environment, or things are not going to work! [19:23:40] [main/ERROR]: FML appears to be missing any signature data. This is not a good thing [19:23:40] [main/INFO]: Calling tweak class net.minecraftforge.fml.relauncher.CoreModManager$FMLPluginWrapper [19:23:40] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.FMLDeobfTweaker [19:23:41] [main/INFO]: Calling tweak class net.minecraftforge.gradle.tweakers.AccessTransformerTweaker [19:23:41] [main/INFO]: Loading tweak class name net.minecraftforge.fml.common.launcher.TerminalTweaker [19:23:41] [main/INFO]: Calling tweak class net.minecraftforge.fml.common.launcher.TerminalTweaker [19:23:41] [main/INFO]: Launching wrapped minecraft {net.minecraft.client.main.Main} 2017-07-03 19:23:42,878 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream 2017-07-03 19:23:42,945 WARN Unable to instantiate org.fusesource.jansi.WindowsAnsiOutputStream [19:23:43] [Client thread/INFO]: Setting user: Player810 [19:23:45] [Client thread/ERROR]: Unable to launch java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102] at net.minecraft.launchwrapper.Launch.launch(Launch.java:135) [launchwrapper-1.12.jar:?] at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [launchwrapper-1.12.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_102] at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102] at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_102] at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_102] at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [start/:?] at GradleStart.main(GradleStart.java:26) [start/:?] Caused by: java.lang.ExceptionInInitializerError at net.minecraft.item.ItemStack.getItem(ItemStack.java:160) ~[ItemStack.class:?] at net.minecraft.item.ItemStack.isEmpty(ItemStack.java:140) ~[ItemStack.class:?] at net.minecraft.item.ItemStack.updateEmptyState(ItemStack.java:114) ~[ItemStack.class:?] at net.minecraft.item.ItemStack.<init>(ItemStack.java:108) ~[ItemStack.class:?] at net.minecraft.item.ItemStack.<init>(ItemStack.java:95) ~[ItemStack.class:?] at net.minecraft.item.ItemStack.<init>(ItemStack.java:92) ~[ItemStack.class:?] at net.minecraft.item.ItemStack.<init>(ItemStack.java:87) ~[ItemStack.class:?] at net.minecraft.item.ItemStack.<clinit>(ItemStack.java:52) ~[ItemStack.class:?] at net.minecraft.creativetab.CreativeTabs.<init>(CreativeTabs.java:143) ~[CreativeTabs.class:?] at net.minecraft.creativetab.CreativeTabs$1.<init>(CreativeTabs.java:22) ~[CreativeTabs$1.class:?] at net.minecraft.creativetab.CreativeTabs.<clinit>(CreativeTabs.java:21) ~[CreativeTabs.class:?] at net.minecraft.block.BlockStone.<init>(SourceFile:23) ~[BlockStone.class:?] at net.minecraft.block.Block.registerBlocks(Block.java:2098) ~[Block.class:?] at net.minecraft.init.Bootstrap.register(Bootstrap.java:491) ~[Bootstrap.class:?] at net.minecraft.client.Minecraft.<init>(Minecraft.java:340) ~[Minecraft.class:?] at net.minecraft.client.main.Main.main(SourceFile:124) ~[Main.class:?] ... 12 more Caused by: java.lang.IllegalStateException: Invalid Block requested: stone at net.minecraft.init.Blocks.getRegisteredBlock(SourceFile:264) ~[Blocks.class:?] at net.minecraft.init.Blocks.<clinit>(SourceFile:23) ~[Blocks.class:?] at net.minecraft.item.ItemStack.getItem(ItemStack.java:160) ~[ItemStack.class:?] at net.minecraft.item.ItemStack.isEmpty(ItemStack.java:140) ~[ItemStack.class:?] at net.minecraft.item.ItemStack.updateEmptyState(ItemStack.java:114) ~[ItemStack.class:?] at net.minecraft.item.ItemStack.<init>(ItemStack.java:108) ~[ItemStack.class:?] at net.minecraft.item.ItemStack.<init>(ItemStack.java:95) ~[ItemStack.class:?] at net.minecraft.item.ItemStack.<init>(ItemStack.java:92) ~[ItemStack.class:?] at net.minecraft.item.ItemStack.<init>(ItemStack.java:87) ~[ItemStack.class:?] at net.minecraft.item.ItemStack.<clinit>(ItemStack.java:52) ~[ItemStack.class:?] at net.minecraft.creativetab.CreativeTabs.<init>(CreativeTabs.java:143) ~[CreativeTabs.class:?] at net.minecraft.creativetab.CreativeTabs$1.<init>(CreativeTabs.java:22) ~[CreativeTabs$1.class:?] at net.minecraft.creativetab.CreativeTabs.<clinit>(CreativeTabs.java:21) ~[CreativeTabs.class:?] at net.minecraft.block.BlockStone.<init>(SourceFile:23) ~[BlockStone.class:?] at net.minecraft.block.Block.registerBlocks(Block.java:2098) ~[Block.class:?] at net.minecraft.init.Bootstrap.register(Bootstrap.java:491) ~[Bootstrap.class:?] at net.minecraft.client.Minecraft.<init>(Minecraft.java:340) ~[Minecraft.class:?] at net.minecraft.client.main.Main.main(SourceFile:124) ~[Main.class:?] ... 12 more Exception in thread "Client thread" [19:23:45] [Client thread/INFO]: [STDERR]: java.lang.reflect.InvocationTargetException [19:23:45] [Client thread/INFO]: [STDERR]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [19:23:45] [Client thread/INFO]: [STDERR]: at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) [19:23:45] [Client thread/INFO]: [STDERR]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) [19:23:45] [Client thread/INFO]: [STDERR]: at java.lang.reflect.Method.invoke(Unknown Source) [19:23:45] [Client thread/INFO]: [STDERR]: at net.minecraftforge.gradle.GradleStartCommon.launch(GradleStartCommon.java:97) [19:23:45] [Client thread/INFO]: [STDERR]: at GradleStart.main(GradleStart.java:26) [19:23:45] [Client thread/INFO]: [STDERR]: Caused by: net.minecraftforge.fml.relauncher.FMLSecurityManager$ExitTrappedException [19:23:45] [Client thread/INFO]: [STDERR]: at net.minecraftforge.fml.relauncher.FMLSecurityManager.checkPermission(FMLSecurityManager.java:49) [19:23:45] [Client thread/INFO]: [STDERR]: at java.lang.SecurityManager.checkExit(Unknown Source) [19:23:45] [Client thread/INFO]: [STDERR]: at java.lang.Runtime.exit(Unknown Source) [19:23:45] [Client thread/INFO]: [STDERR]: at java.lang.System.exit(Unknown Source) [19:23:45] [Client thread/INFO]: [STDERR]: at net.minecraft.launchwrapper.Launch.launch(Launch.java:138) [19:23:45] [Client thread/INFO]: [STDERR]: at net.minecraft.launchwrapper.Launch.main(Launch.java:28) [19:23:45] [Client thread/INFO]: [STDERR]: ... 6 more
  12. helpful tip use variables Vec3d vecPoint = new Vec3d(fill up 3 paramaters here);
  13. So i was planning to create an indestructible (or unmineable ) block and player can get certain random items while mining during a random ticks maybe? or a random chance while mining. Anyone have an advice where to look? especially is there an event that points out when during when a player is mining a block.
  14. When i drop the item it was supposed to render like a realistic one (literral the item lies in the ground not the one rotating around) in 1.7.10 it was in RenderItem case ENTITY but in 1.11 it is modifed in .json and is probably case GROUND but that doesnt work
  15. I was wondering why does my 3d item or modelled items whenever i dropped them on ground they render as they normal items (you know the item that rotates around ). I tried modifying the GROUND but it does not help. Any advice??
  16. After fixing the openRightClick on the Block Hunter Bench, now im trying to make everything work but the output is causing now the crash which leads to the nbt ``` [14:41:03] [Server thread/ERROR] [FML]: A TileEntity type mhfc.net.common.tile.TileHunterBench has throw an exception trying to write state. It will not persist. Report this to the mod author java.lang.NullPointerException at mhfc.net.common.tile.TileHunterBench.writeToNBT(TileHunterBench.java:435) ~[TileHunterBench.class:?] at net.minecraft.world.chunk.storage.AnvilChunkLoader.writeChunkToNBT(AnvilChunkLoader.java:418) [AnvilChunkLoader.class:?] at net.minecraft.world.chunk.storage.AnvilChunkLoader.saveChunk(AnvilChunkLoader.java:191) [AnvilChunkLoader.class:?] at net.minecraft.world.gen.ChunkProviderServer.saveChunkData(ChunkProviderServer.java:209) [ChunkProviderServer.class:?] at net.minecraft.world.gen.ChunkProviderServer.saveChunks(ChunkProviderServer.java:237) [ChunkProviderServer.class:?] at net.minecraft.world.WorldServer.saveAllChunks(WorldServer.java:1069) [WorldServer.class:?] at net.minecraft.server.MinecraftServer.saveAllWorlds(MinecraftServer.java:425) [MinecraftServer.class:?] at net.minecraft.server.integrated.IntegratedServer.saveAllWorlds(IntegratedServer.java:238) [IntegratedServer.class:?] at net.minecraft.server.integrated.IntegratedServer.tick(IntegratedServer.java:141) [IntegratedServer.class:?] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:547) [MinecraftServer.class:?] at java.lang.Thread.run(Unknown Source) [?:1.8.0_102] ``` I somehow cant understand the throw state. Any advice?
  17. EntityAIMoveToBlock Maybe try modifying that and use BlockPos?
  18. Copy the vanilla package.info it will pop out warnings.
  19. Shit! looks like my team found a fix and its all in TileCraftingBench all along !!!! fak it Thank you for telling us the ItemStack.NULL. *phew Anyways here it is
  20. Yes it does wait up Container Hunter Bench package mhfc.net.client.container; import mhfc.net.client.gui.slot.SlotHunterBench; import mhfc.net.common.core.registry.MHFCBlockRegistry; import mhfc.net.common.crafting.MHFCCraftingManager; import mhfc.net.common.tile.TileHunterBench; 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.InventoryCraftResult; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class ContainerHunterBench extends Container { public InventoryCrafting craftMatrix = new InventoryCrafting(this, 3, 5); public IInventory craftResult = new InventoryCraftResult(); private World worldObj; private int posX; private int posY; private int posZ; public ContainerHunterBench(InventoryPlayer par1InventoryPlayer, World par2World, TileHunterBench tileEntity, int x,int y,int z) { this.worldObj = par2World; this.posX = x; this.posY = y; this.posZ = z; this.addSlotToContainer( new SlotHunterBench( par1InventoryPlayer.player, this.craftMatrix, this.craftResult, 0, 124 + 8, 35 + 1)); int var6; int var7; for (var6 = 0; var6 < 5; ++var6) { for (var7 = 0; var7 < 3; ++var7) { this.addSlotToContainer(new Slot(this.craftMatrix, var7 + var6 * 3, 30 + var7 * 18, var6 * 18 + 15)); } } for (var6 = 0; var6 < 3; ++var6) { for (var7 = 0; var7 < 9; ++var7) { this.addSlotToContainer( new Slot(par1InventoryPlayer, var7 + var6 * 9 + 9, 158 + var7 * 18, var6 * 18 + 15)); } } for (var6 = 0; var6 < 9; ++var6) { this.addSlotToContainer(new Slot(par1InventoryPlayer, var6, 158 + var6 * 18, 84)); } for (var6 = 0; var6 < 7; ++var6) { Slot s = new Slot(tileEntity, var6 + 3, var6 * 18 + 229, 28) { @Override public boolean isItemValid(ItemStack stack) { return false; } @Override public boolean canTakeStack(EntityPlayer p) { return false; } }; this.addSlotToContainer(s); } for (var6 = 0; var6 < 7; ++var6) { this.addSlotToContainer(new Slot(tileEntity, var6 + 10, var6 * 18 + 229, 191) { }); } this.addSlotToContainer(new Slot(tileEntity, TileHunterBench.resultSlot, 280, 146) { @Override public boolean isItemValid(ItemStack stack) { return false; } }); this.addSlotToContainer(new Slot(tileEntity, TileHunterBench.fuelSlot, 354, 168)); this.addSlotToContainer(new Slot(tileEntity, TileHunterBench.outputSlot, 335, 146)); for (var6 = 0; var6 < 4; ++var6) { for (var7 = 0; var7 < 9; ++var7) { this.addSlotToContainer(new Slot(par1InventoryPlayer, var7 + var6 * 9, 7 + var6 * 18, var7 * 18 + 28)); } } this.onCraftMatrixChanged(this.craftMatrix); } @Override public void onCraftMatrixChanged(IInventory par1IInventory) { this.craftResult.setInventorySlotContents(0,MHFCCraftingManager.getInstance().findMatchingRecipe(this.craftMatrix, this.worldObj)); } @Override public boolean canInteractWith(EntityPlayer par1EntityPlayer) { return this.worldObj.getBlockState(new BlockPos(this.posX, this.posY, this.posZ)) .getBlock() != MHFCBlockRegistry.getRegistry().mhfcblockhunterbench ? false : par1EntityPlayer.getDistanceSq(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D) <= 64.0D; } @Override public void onContainerClosed(EntityPlayer par1EntityPlayer) { super.onContainerClosed(par1EntityPlayer); if (!this.worldObj.isRemote) { for (int i = 0; i < 15; ++i) { ItemStack itemstack = this.craftMatrix.getStackInSlot(i); if (itemstack != null) { par1EntityPlayer.dropItem(itemstack, false); } } } } @Override public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2) { ItemStack var3 = null; Slot var4 = this.inventorySlots.get(par2); if (var4 != null && var4.getHasStack()) { ItemStack var5 = var4.getStack(); var3 = var5.copy(); if (par2 == 0) { if (!this.mergeItemStack(var5, 10, 46, true)) { return null; } var4.onSlotChange(var5, var3); } else if (par2 >= 10 && par2 < 37) { if (!this.mergeItemStack(var5, 37, 46, false)) { return null; } } else if (par2 >= 37 && par2 < 46) { if (!this.mergeItemStack(var5, 10, 37, false)) { return null; } } else if (!this.mergeItemStack(var5, 10, 46, false)) { return null; } if (var5.getCount() == 0) { var4.putStack((ItemStack) null); } else { var4.onSlotChanged(); } if (var5.getCount() == var3.getCount()) { return null; } var4.onTake(par1EntityPlayer, var5); } return var3; } @Override public boolean canMergeSlot(ItemStack par1ItemStack, Slot par2Slot) { return par2Slot.inventory != this.craftResult && super.canMergeSlot(par1ItemStack, par2Slot); } } Tile Entity package mhfc.net.common.tile; import mhfc.net.common.core.registry.MHFCEquipementRecipeRegistry; import mhfc.net.common.crafting.recipes.equipment.EquipmentRecipe; import mhfc.net.common.crafting.recipes.equipment.EquipmentRecipe.RecipeType; import mhfc.net.common.index.ResourceInterface; import mhfc.net.common.network.PacketPipeline; import mhfc.net.common.network.message.bench.MessageBeginCrafting; import mhfc.net.common.network.message.bench.MessageBenchRefreshRequest; import mhfc.net.common.network.message.bench.MessageCancelRecipe; import mhfc.net.common.network.message.bench.MessageCraftingUpdate; import mhfc.net.common.network.message.bench.MessageSetRecipe; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFurnace; import net.minecraft.util.ITickable; import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextComponentTranslation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; public class TileHunterBench extends TileEntity implements ITickable, IInventory, TileMHFCUpdateStream { public static final int outputSlot = 2; public static final int fuelSlot = 0; public static final int resultSlot = 1; private ItemStack fuelStack; private ItemStack resultStack; private ItemStack[] recipeStacks; private ItemStack[] inputStacks; private ItemStack outputStack; /** * How hot the furnace currently is */ volatile private int heatStrength; /** * How hot the fire produced by the currently burning item is */ volatile private int heatFromItem; /** * How long the furnace stays hot */ volatile private int heatLength; /** * How long the furnace stayed hot initially with the burning item */ private int heatLengthInit; /** * How long the current item has been smelting */ volatile private int itemSmeltDuration; /** * The selected recipe */ private EquipmentRecipe recipe; /** * If the recipe is currently worked on */ volatile private boolean workingMHFCBench; public TileHunterBench() { recipeStacks = new ItemStack[7]; inputStacks = new ItemStack[recipeStacks.length]; workingMHFCBench = false; heatLengthInit = 1; } @Override public int getSizeInventory() { return recipeStacks.length + inputStacks.length + 3; } @Override public void update() { if (heatLength > 0) { --heatLength; heatStrength = getNewHeat(heatStrength, heatFromItem); if (TileHunterBench.this.workingMHFCBench && recipe != null && heatStrength >= recipe.getRequiredHeat()) { ++itemSmeltDuration; } } else { if (fuelStack != null && TileHunterBench.this.workingMHFCBench) { heatLength = TileEntityFurnace.getItemBurnTime(fuelStack); heatLengthInit = heatLength; heatFromItem = getItemHeat(fuelStack); decrStackSize(fuelSlot, 1); if (!world.isRemote) { sendUpdateCraft(); } } else { heatStrength = getNewHeat(heatStrength, 0); } } if (recipe != null && itemSmeltDuration >= recipe.getDuration()) { finishRecipe(); } } private void finishRecipe() { if (world.isRemote) { return; } inputStacks = new ItemStack[inputStacks.length]; outputStack = resultStack.copy(); workingMHFCBench = false; itemSmeltDuration = 0; sendUpdateCraft(); } /** * Forces the client to end the crafting and put the stack into the output slot. Unused * * @param stack */ @SideOnly(Side.CLIENT) public void forceEndCrafting(ItemStack stack) { outputStack = stack; inputStacks = new ItemStack[inputStacks.length]; TileHunterBench.this.workingMHFCBench = false; itemSmeltDuration = 0; } public boolean isWorking() { return TileHunterBench.this.workingMHFCBench; } public void changeRecipe(EquipmentRecipe recipe) { if (world.isRemote) { sendSetRecipe(recipe); } if (recipe != this.recipe) { cancelRecipe(); setRecipe(recipe); } } protected void setRecipe(EquipmentRecipe recipe) { if (recipe == null) { recipeStacks = new ItemStack[7]; this.recipe = null; resultStack = null; } else { resultStack = recipe.getRecipeOutput(); this.recipe = recipe; setIngredients(recipe); } } public void setIngredients(EquipmentRecipe recipe) { this.recipeStacks = recipe.getRequirements(7); } public static int getItemHeat(ItemStack itemStack) { if (itemStack == null) { return 0; } if (itemStack.getItem() == Item.getItemById(327)) { return 1000; } return 200; } private int getNewHeat(int heatOld, int heatAim) { int diff = heatAim - heatOld; // Some math to confuse the hell out of everyone reading this double change = Math.ceil(Math.log(Math.abs(diff) + 1.0)); return heatOld + (int) (Math.ceil(change / 3.0) * Math.signum(diff)); } @Override public ItemStack decrStackSize(int slot, int count) { markDirty(); if (count <= 0) { return null; } // FIXME: can do that better... if (slot > recipeStacks.length + 2) { ItemStack stack = inputStacks[slot - recipeStacks.length - 3]; if (stack == null) { return null; } cancelRecipe(); if (count > stack.getCount()) { count = stack.getCount(); } if (count == stack.getCount()) { inputStacks[slot - recipeStacks.length - 3] = null; return stack; } return stack.splitStack(count); } if (slot > 2) { return null; // You cant get anything from the recipe slots } else if (slot == outputSlot) { if (outputStack == null) { return null; } if (count > outputStack.getCount()) { count = outputStack.getCount(); } if (count == outputStack.getCount()) { ItemStack fuel = outputStack; outputStack = null; return fuel; } return outputStack.splitStack(count); } else if (slot == resultSlot) { return null; } else { if (fuelStack == null) { return null; } if (count > fuelStack.getCount()) { count = fuelStack.getCount(); } if (count == fuelStack.getCount()) { ItemStack fuel = fuelStack; fuelStack = null; return fuel; } return fuelStack.splitStack(count); } } /** * Resets all working progress but leaves the recipe set */ public void cancelRecipe() { if (world.isRemote) { sendCancelRecipe(); } TileHunterBench.this.workingMHFCBench = false; itemSmeltDuration = 0; } @Override public ItemStack removeStackFromSlot(int index) { ItemStack stack = getStackInSlot(index); setInventorySlotContents(index, null); return stack; } @Override public ItemStack getStackInSlot(int i) { if (i < 0 || i >= getSizeInventory()) { return null; } else if (i >= recipeStacks.length + 3) { return inputStacks[i - 3 - recipeStacks.length]; } else if (i >= 3) { return recipeStacks[i - 3]; } else if (i == outputSlot) { return outputStack; } else if (i == resultSlot) { return resultStack; } else { return fuelStack; } } @Override public void setInventorySlotContents(int i, ItemStack itemstack) { if (i < 0 || i >= getSizeInventory()) { return; } if (i >= recipeStacks.length + 3) { inputStacks[i - recipeStacks.length - 3] = itemstack; } else if (i >= 3) { recipeStacks[i - 3] = itemstack; } else if (i == outputSlot) { outputStack = itemstack; } else if (i == resultSlot) { resultStack = itemstack; } else if (i == fuelSlot) { fuelStack = itemstack; } markDirty(); } public boolean isInvNameLocalized() { return false; } @Override public boolean isEmpty() { for (ItemStack stack : inputStacks) { if (!stack.isEmpty()) { return false; } } return true; } @Override public int getInventoryStackLimit() { return 64; } @Override public boolean isUsableByPlayer(EntityPlayer entityplayer) { return getDistanceSq(entityplayer.posX, entityplayer.posY, entityplayer.posZ) <= 64.0f; } @Override public boolean isItemValidForSlot(int i, ItemStack itemstack) { return (i == fuelSlot && TileEntityFurnace.isItemFuel(itemstack)) || (i > recipeStacks.length + 2 && i < recipeStacks.length * 2 + 3); } @Override public ITextComponent getDisplayName() { return new TextComponentTranslation(getName()); } public boolean beginCrafting() { if (world.isRemote) { sendBeginCraft(); } if (canBeginCrafting()) { TileHunterBench.this.workingMHFCBench = true; } return TileHunterBench.this.workingMHFCBench; } @SideOnly(Side.CLIENT) private void sendBeginCraft() { PacketPipeline.networkPipe.sendToServer(new MessageBeginCrafting(this)); } @SideOnly(Side.CLIENT) private void sendSetRecipe(EquipmentRecipe recipeToSend) { PacketPipeline.networkPipe.sendToServer(new MessageSetRecipe(this, recipeToSend)); } @SideOnly(Side.CLIENT) private void sendCancelRecipe() { PacketPipeline.networkPipe.sendToServer(new MessageCancelRecipe(this)); } @Override public void refreshState() { if (world.isRemote) { PacketPipeline.networkPipe.sendToServer(new MessageBenchRefreshRequest(this)); } } private void sendUpdateCraft() { PacketPipeline.networkPipe.sendToAll(new MessageCraftingUpdate(this)); } public boolean canBeginCrafting() { return (recipe != null) && matchesInputOutput() && (outputStack == null); } protected boolean matchesInputOutput() { for (int i = 0; i < inputStacks.length; i++) { if (!ItemStack.areItemStacksEqual(inputStacks[i], recipeStacks[i])) { return false; } } return true; } public int getHeatStrength() { return heatStrength; } public int getBurningItemHeat() { return heatFromItem; } public int getHeatLength() { return heatLength; } public int getHeatLengthOriginal() { return heatLengthInit; } public int getItemSmeltDuration() { return itemSmeltDuration; } @Override public void readFromNBT(NBTTagCompound nbtTag) { super.readFromNBT(nbtTag); readCustomUpdate(nbtTag); NBTTagList items = nbtTag.getTagList("Items", 10); for (int a = 0; a < items.tagCount(); a++) { NBTTagCompound stack = items.getCompoundTagAt(a); byte id = stack.getByte("Slot"); if (id >= 0 && id < getSizeInventory()) { setInventorySlotContents(id, new ItemStack(stack)); } } } @Override public NBTTagCompound writeToNBT(NBTTagCompound nbtTag) { nbtTag = super.writeToNBT(nbtTag); storeCustomUpdate(nbtTag); NBTTagList itemsStored = new NBTTagList(); for (int a = 0; a < getSizeInventory(); a++) { ItemStack s = getStackInSlot(a); if (s != null) { NBTTagCompound tag = new NBTTagCompound(); tag.setByte("Slot", (byte) a); s.writeToNBT(tag); itemsStored.appendTag(tag); } } nbtTag.setTag("Items", itemsStored); return nbtTag; } public EquipmentRecipe getRecipe() { return recipe; } private static final String heatStrID = "heatStrength"; private static final String heatFromItemID = "heatFromItem"; private static final String heatLengthID = "heatLength"; private static final String heatLengthInitID = "heatLengthInit"; private static final String itemSmeltDurationID = "itemSmeltDuration"; private static final String workingID = "workingID"; private static final String recipeTypeID = "recipeType"; private static final String recipeIDID = "recipeID"; @Override public void storeCustomUpdate(NBTTagCompound nbtTag) { nbtTag.setInteger(heatStrID, heatStrength); nbtTag.setInteger(heatFromItemID, heatFromItem); nbtTag.setInteger(heatLengthID, heatLength); nbtTag.setInteger(heatLengthInitID, heatLengthInit); nbtTag.setInteger(itemSmeltDurationID, itemSmeltDuration); nbtTag.setBoolean(workingID, TileHunterBench.this.workingMHFCBench); RecipeType type = recipe != null ? recipe.getRecipeType() : RecipeType.MHFC; int recipeID = MHFCEquipementRecipeRegistry.getIDFor(recipe); nbtTag.setInteger(recipeTypeID, type.ordinal()); nbtTag.setInteger(recipeIDID, recipeID); } @Override public void readCustomUpdate(NBTTagCompound nbtTag) { heatStrength = nbtTag.getInteger(heatStrID); heatFromItem = nbtTag.getInteger(heatFromItemID); heatLength = nbtTag.getInteger(heatLengthID); heatLengthInit = nbtTag.getInteger(heatLengthInitID); itemSmeltDuration = nbtTag.getInteger(itemSmeltDurationID); TileHunterBench.this.workingMHFCBench = nbtTag.getBoolean(workingID); int irecType = nbtTag.getInteger(recipeTypeID); int recId = nbtTag.getInteger(recipeIDID); RecipeType recType = RecipeType.values()[irecType]; setRecipe(MHFCEquipementRecipeRegistry.getRecipeFor(recId, recType)); } @Override public String getName() { return "container" + ResourceInterface.block_hunterbench_name; } @Override public boolean hasCustomName() { return false; } @Override public void openInventory(EntityPlayer player) {} @Override public void closeInventory(EntityPlayer player) {} @Override public void clear() { for (int i = 0; i < getSizeInventory(); ++i) { removeStackFromSlot(i); } } @Override public int getField(int id) { throw new IllegalArgumentException("No such field: " + id); } @Override public void setField(int id, int value) { throw new IllegalArgumentException("No such field: " + id); } @Override public int getFieldCount() { return 0; } } I dont have my own inventory crafting i uses vanilla.
  21. I dont know if the slotIndex has a null value. all has a range from 0 - 99
  22. Sorry Late reply i just took a nap anyways here is the progress. I added the conditions and as far as my searching for nulls this is what i found Inside inventorySlots>elementData>[0..99]>[0](which is the Hunter Bench>inventory>stackresults etc.
  23. I able to bypass the world load by disabling the line and enabiling as soon as i right click the block. Now i see a NULL at defaultElement then i set it as ItemStack.EMPTY.
×
×
  • Create New...

Important Information

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