From f8465b50712dd0fa0f00d1791e1370f5ed59b657 Mon Sep 17 00:00:00 2001 From: Boblet Date: Mon, 15 Jul 2024 13:11:13 +0200 Subject: [PATCH] flixes --- changelog | 35 +++---------------- gradle.properties | 2 +- .../java/com/hbm/inventory/RecipesCommon.java | 5 +++ .../inventory/recipes/ArcFurnaceRecipes.java | 16 +++++---- .../java/com/hbm/items/tool/ItemWandD.java | 10 +++--- src/main/java/com/hbm/lib/RefStrings.java | 2 +- .../tileentity/IControlReceiverFilter.java | 34 ++++++++++++++++++ .../java/com/hbm/tileentity/IFilterable.java | 17 --------- .../machine/TileEntityMachineAutocrafter.java | 25 ++++--------- .../storage/TileEntityMassStorage.java | 17 ++------- .../network/TileEntityCraneExtractor.java | 14 ++------ .../network/TileEntityCraneGrabber.java | 14 ++------ .../network/TileEntityCraneRouter.java | 14 ++------ .../network/TileEntityDroneRequester.java | 15 ++------ .../network/TileEntityRadioTorchCounter.java | 15 ++------ 15 files changed, 79 insertions(+), 156 deletions(-) create mode 100644 src/main/java/com/hbm/tileentity/IControlReceiverFilter.java delete mode 100644 src/main/java/com/hbm/tileentity/IFilterable.java diff --git a/changelog b/changelog index 701632f26f..2b3c5937fa 100644 --- a/changelog +++ b/changelog @@ -1,33 +1,8 @@ -## Added -* Powered Floodlight - * Uses 100HE/t to create light - * Casts 15 rays in a wide beam with a maximum length of 64 blocks, each beam creates a spot with light level 15 - * Floodlight can be mounted on any side and angled in any direction, angles snap to 5° increments - * Angles can be adjusted after placing with a screwdriver - ## Changed -* Changed bedrock ore processing time in the electrolyzer to 60 ticks -* RF converters have been reworked - * The conversion ratio from HE to RF is now 5:1 (instead of 1:4), HE is no longer way more powerful (in order to compensate for the much higher HE output starting with the first generators and becoming increasingly absurd with nuclear power) - * Converters have an internal buffer again, effectively limiting throughput. The internal buffer is 1MRF and 5MHE. - * The input energy buffer has a loss of 5% of its (unused) current level per tick, which means chaining up converters can not be abused to create earlygame super capacitors - * The loss only takes effect once the input buffer can no longer empty into the output buffer, i.e. when energy demand is too low for the input - * The buffer also fixes a bug where the HE to RF converter often behaves weirdly with certain mods, either outright destroying energy ot creating infinite energy - * HE to RF converters now by default have the connection priority of LOW, only feeding into RF networks when all other energy consumers are sufficiently supplied. This can still be changed by using diodes - * Converters now have configurable conversion rates as well as input decay per tick -* The SILEX is now fully deterministic - * Output is no longer random, instead there is now a "recipe index" which is incremented after each operation, choosing a new next output - * This means that the order of outputs for any given input is fixed, and outputs are guaranteed to happen based on the recipe's total weight (most recipes have a total output weight of 100 for simplicity's sake, meaning after 100 operations the output pattern repeats, and all outputs are guaranteed to be picked) -* Simplified the assembler recipes for the SILEX, FEL and all energy storage blocks (no more random wires and single ingots, fewer duplicate materials) -* Turrets will now only lock onto missiles if they are descending (i.e. negative Y speed), which means that launching a missile close to a turret will not cause the turret to immediately shoot it -* The fusion reactor's byproducts are now created by delay and not by chance, making the output predictable -* Tritium-based fusion fuels now have a higher byproduct output rate (900 ticks instead of 1200) +* Automatic crafting tables will no longer accept stacks with a stack size higher than 1 via automation, items will still accumulate and form stacks inside the crafting table, however inserters/hoppers may not transfer larger stacks in a single operation + * This ensures that the items get spread out as intended instead of the inserter just placing the entire stack into one slot and then leaving the other slots empty ## Fixed -* Fixed issue where the NEI universal handler can not correctly display more than 4 outputs (now supports up to 8, which should cover all possible electrolyzer cases too) -* Fixed the metal electrolysis duration variable not being part of the config -* Removed the global energy transfer cap (only per-machine caps apply now), fixing issues where FENSUs in buffer mode would not charge past 10THE, and constantly void energy if above that threshold -* Fixed a bug where the power transfer would sometimes have leftovers due to rounding errors which are send but not used up, effectively creating small amounts of energy out of nothing -* Fixed ZIRNOX space checks omitting the top portion -* Fixed RBMK flames and mini nuke flashes being affected by fog, turning them into glowing squares when viewed at a distance -* Fixed crash caused by brimstone mines being launched from dispensers \ No newline at end of file +* Fixed crash caused by null entries in the furnace recipe list being picked up by the arc furnace +* Fixed crash caused by the automatic crafting table's input when pattern slots are empty +* Fixed crash caused by the automatic crafting table's output (pattern info was accessed OOB) \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 9e002c1f04..673607d5a4 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ mod_version=1.0.27 # Empty build number makes a release type -mod_build_number=5026 +mod_build_number=5027 credits=HbMinecraft,\ \ rodolphito (explosion algorithms),\ diff --git a/src/main/java/com/hbm/inventory/RecipesCommon.java b/src/main/java/com/hbm/inventory/RecipesCommon.java index 91ba503038..b9f428c980 100644 --- a/src/main/java/com/hbm/inventory/RecipesCommon.java +++ b/src/main/java/com/hbm/inventory/RecipesCommon.java @@ -111,6 +111,11 @@ public static class ComparableStack extends AStack { public int meta; public ComparableStack(ItemStack stack) { + if(stack == null) { + this.item = ModItems.nothing; + this.stacksize = 1; + return; + } this.item = stack.getItem(); this.stacksize = stack.stackSize; this.meta = stack.getItemDamage(); diff --git a/src/main/java/com/hbm/inventory/recipes/ArcFurnaceRecipes.java b/src/main/java/com/hbm/inventory/recipes/ArcFurnaceRecipes.java index bc46fe6484..dcbd4f018f 100644 --- a/src/main/java/com/hbm/inventory/recipes/ArcFurnaceRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/ArcFurnaceRecipes.java @@ -110,13 +110,15 @@ public void registerDefaults() { ItemStack input = (ItemStack) entry.getKey(); ItemStack output = (ItemStack) entry.getValue(); - ComparableStack comp = new ComparableStack(input); - if(OreDictManager.arcSmeltable.contains(comp) || OreDictManager.arcSmeltable.contains(new ComparableStack(output))) { - ArcFurnaceRecipe recipe = recipes.get(comp); - if(recipe == null) recipe = new ArcFurnaceRecipe(); - if(recipe.solidOutput == null) { - recipe.solid(output.copy()); - recipes.put(comp, recipe); + if(input != null && output != null) { + ComparableStack comp = new ComparableStack(input); + if(OreDictManager.arcSmeltable.contains(comp) || OreDictManager.arcSmeltable.contains(new ComparableStack(output))) { + ArcFurnaceRecipe recipe = recipes.get(comp); + if(recipe == null) recipe = new ArcFurnaceRecipe(); + if(recipe.solidOutput == null) { + recipe.solid(output.copy()); + recipes.put(comp, recipe); + } } } } diff --git a/src/main/java/com/hbm/items/tool/ItemWandD.java b/src/main/java/com/hbm/items/tool/ItemWandD.java index c57a326676..e890a3def6 100644 --- a/src/main/java/com/hbm/items/tool/ItemWandD.java +++ b/src/main/java/com/hbm/items/tool/ItemWandD.java @@ -3,13 +3,15 @@ import java.util.List; import com.hbm.lib.Library; -import com.hbm.world.dungeon.Silo; +import com.hbm.world.gen.component.Component; +import com.hbm.world.gen.component.CivilianFeatures.RuralHouse1; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import net.minecraft.world.gen.structure.StructureBoundingBox; public class ItemWandD extends Item { @@ -33,13 +35,13 @@ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer pla //PollutionHandler.incrementPollution(world, pos.blockX, pos.blockY, pos.blockZ, PollutionType.SOOT, 15); - /*int i = pos.blockX >> 4; + int i = pos.blockX >> 4; int j = pos.blockZ >> 4; i = (i << 4) + 8; j = (j << 4) + 8; Component comp = new RuralHouse1(world.rand, i, j); - comp.addComponentParts(world, world.rand, new StructureBoundingBox(i, j, i + 32, j + 32));*/ + comp.addComponentParts(world, world.rand, new StructureBoundingBox(i, j, i + 32, j + 32)); /*TimeAnalyzer.startCount("setBlock"); world.setBlock(pos.blockX, pos.blockY, pos.blockZ, Blocks.dirt); @@ -77,8 +79,6 @@ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer pla EntityNukeTorex.statFac(world, pos.blockX, pos.blockY + 1, pos.blockZ, 150); }*/ - new Silo().generate(world, world.rand, pos.blockX, pos.blockY + 1, pos.blockZ); - /*EntityTracker entitytracker = ((WorldServer) world).getEntityTracker(); IntHashMap map = ReflectionHelper.getPrivateValue(EntityTracker.class, entitytracker, "trackedEntityIDs", "field_72794_c"); EntityTrackerEntry entry = (EntityTrackerEntry) map.lookup(torex.getEntityId()); diff --git a/src/main/java/com/hbm/lib/RefStrings.java b/src/main/java/com/hbm/lib/RefStrings.java index 3f559f8794..eb963eb3da 100644 --- a/src/main/java/com/hbm/lib/RefStrings.java +++ b/src/main/java/com/hbm/lib/RefStrings.java @@ -3,7 +3,7 @@ public class RefStrings { public static final String MODID = "hbm"; public static final String NAME = "Hbm's Nuclear Tech Mod"; - public static final String VERSION = "1.0.27 BETA (5026)"; + public static final String VERSION = "1.0.27 BETA (5027)"; //HBM's Beta Naming Convention: //V T (X) //V -> next release version diff --git a/src/main/java/com/hbm/tileentity/IControlReceiverFilter.java b/src/main/java/com/hbm/tileentity/IControlReceiverFilter.java new file mode 100644 index 0000000000..691066ac73 --- /dev/null +++ b/src/main/java/com/hbm/tileentity/IControlReceiverFilter.java @@ -0,0 +1,34 @@ +package com.hbm.tileentity; + +import com.hbm.interfaces.IControlReceiver; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; + +public interface IControlReceiverFilter extends IControlReceiver { + + void nextMode(int i); + + @Override + public default void receiveControl(NBTTagCompound data) { + if(data.hasKey("slot")) { + setFilterContents(data); + } + } + + /** + * Expects the implementor to be a tile entity and an IInventory + * @param nbt + */ + public default void setFilterContents(NBTTagCompound nbt) { + TileEntity tile = (TileEntity) this; + IInventory inv = (IInventory) this; + int slot = nbt.getInteger("slot"); + inv.setInventorySlotContents(slot, new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta"))); + nextMode(slot); + tile.getWorldObj().markTileEntityChunkModified(tile.xCoord, tile.yCoord, tile.zCoord, tile); + } +} diff --git a/src/main/java/com/hbm/tileentity/IFilterable.java b/src/main/java/com/hbm/tileentity/IFilterable.java deleted file mode 100644 index c42e1d559c..0000000000 --- a/src/main/java/com/hbm/tileentity/IFilterable.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.hbm.tileentity; - -import com.hbm.interfaces.IControlReceiver; -import net.minecraft.nbt.NBTTagCompound; - -public interface IFilterable extends IControlReceiver { - void nextMode(int i); - - @Override - default void receiveControl(NBTTagCompound data) { - if(data.hasKey("slot")){ - setFilterContents(data); - } - } - - void setFilterContents(NBTTagCompound nbt); -} diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAutocrafter.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAutocrafter.java index 11e9dabfad..883d5da9da 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAutocrafter.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAutocrafter.java @@ -7,11 +7,9 @@ import com.hbm.inventory.gui.GUIAutocrafter; import com.hbm.lib.Library; import com.hbm.module.ModulePatternMatcher; -import com.hbm.tileentity.IFilterable; +import com.hbm.tileentity.IControlReceiverFilter; import com.hbm.tileentity.IGUIProvider; import com.hbm.tileentity.TileEntityMachineBase; -import com.hbm.util.BufferUtil; -import com.hbm.util.ItemStackUtil; import api.hbm.energymk2.IEnergyReceiverMK2; import cpw.mods.fml.relauncher.Side; @@ -22,7 +20,6 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryCrafting; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; @@ -31,7 +28,7 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityMachineAutocrafter extends TileEntityMachineBase implements IEnergyReceiverMK2, IGUIProvider, IFilterable { +public class TileEntityMachineAutocrafter extends TileEntityMachineBase implements IEnergyReceiverMK2, IGUIProvider, IControlReceiverFilter { public List recipes = new ArrayList(); @@ -188,10 +185,8 @@ public boolean canExtractItem(int i, ItemStack stack, int j) { if(i > 9 && i < 19) { ItemStack filter = slots[i - 10]; - if(filter == null) return true; - - return !matcher.isValidForFilter(filter, i, stack); + return !matcher.isValidForFilter(filter, i - 10, stack); } return false; @@ -200,8 +195,8 @@ public boolean canExtractItem(int i, ItemStack stack, int j) { @Override public boolean isItemValidForSlot(int slot, ItemStack stack) { - //automatically prohibit any stacked item with a container - if(stack.stackSize > 1 && stack.getItem().hasContainerItem(stack)) + //automatically prohibit any stacked item, items can only be added one by one + if(stack.stackSize > 1) return false; //only allow insertion for the nine recipe slots @@ -216,6 +211,7 @@ public boolean isItemValidForSlot(int slot, ItemStack stack) { List validSlots = new ArrayList(); for(int i = 0; i < 9; i++) { ItemStack filter = slots[i]; + if(filter == null) return true; if(matcher.isValidForFilter(filter, i, stack)) { validSlots.add(i + 10); @@ -346,13 +342,4 @@ public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int public boolean hasPermission(EntityPlayer player) { return Vec3.createVectorHelper(xCoord - player.posX, yCoord - player.posY, zCoord - player.posZ).lengthVector() < 20; } - @Override - public void setFilterContents(NBTTagCompound nbt) { - int slot = nbt.getInteger("slot"); - setInventorySlotContents( - slot, - new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta"))); - nextMode(slot); - markChanged(); - } } diff --git a/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMassStorage.java b/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMassStorage.java index 62b11e16a8..6db2f555ff 100644 --- a/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMassStorage.java +++ b/src/main/java/com/hbm/tileentity/machine/storage/TileEntityMassStorage.java @@ -1,10 +1,9 @@ package com.hbm.tileentity.machine.storage; -import com.hbm.interfaces.IControlReceiver; import com.hbm.inventory.container.ContainerMassStorage; import com.hbm.inventory.gui.GUIMassStorage; import com.hbm.items.ModItems; -import com.hbm.tileentity.IFilterable; +import com.hbm.tileentity.IControlReceiverFilter; import com.hbm.tileentity.INBTPacketReceiver; import cpw.mods.fml.relauncher.Side; @@ -12,13 +11,12 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.Vec3; import net.minecraft.world.World; -public class TileEntityMassStorage extends TileEntityCrateBase implements INBTPacketReceiver, IFilterable { +public class TileEntityMassStorage extends TileEntityCrateBase implements INBTPacketReceiver, IControlReceiverFilter { private int stack = 0; public boolean output = false; @@ -165,6 +163,7 @@ public void nextMode(int i) { @Override public void receiveControl(NBTTagCompound data) { + if(data.hasKey("provide") && slots[1] != null) { if(this.getStockpile() == 0) { @@ -197,16 +196,6 @@ public void receiveControl(NBTTagCompound data) { } } - @Override - public void setFilterContents(NBTTagCompound nbt) { - int slot = nbt.getInteger("slot"); - setInventorySlotContents( - slot, - new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta"))); - nextMode(slot); - markDirty(); - } - @Override public boolean canInsertItem(int i, ItemStack itemStack, int j) { return !this.isLocked() && i == 0 && (this.getType() == null || (getType().isItemEqual(itemStack) && ItemStack.areItemStackTagsEqual(itemStack, getType()))); diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityCraneExtractor.java b/src/main/java/com/hbm/tileentity/network/TileEntityCraneExtractor.java index f8017a3754..628b3946c2 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityCraneExtractor.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityCraneExtractor.java @@ -7,7 +7,7 @@ import com.hbm.inventory.gui.GUICraneExtractor; import com.hbm.items.ModItems; import com.hbm.module.ModulePatternMatcher; -import com.hbm.tileentity.IFilterable; +import com.hbm.tileentity.IControlReceiverFilter; import com.hbm.tileentity.IGUIProvider; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -18,7 +18,6 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -27,7 +26,7 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGUIProvider, IControlReceiver, IFilterable { +public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGUIProvider, IControlReceiver, IControlReceiverFilter { public boolean isWhitelist = false; public ModulePatternMatcher matcher; @@ -257,13 +256,4 @@ public void receiveControl(NBTTagCompound data) { setFilterContents(data); } } - @Override - public void setFilterContents(NBTTagCompound nbt) { - int slot = nbt.getInteger("slot"); - setInventorySlotContents( - slot, - new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta"))); - nextMode(slot); - markChanged(); - } } diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityCraneGrabber.java b/src/main/java/com/hbm/tileentity/network/TileEntityCraneGrabber.java index c72b64820b..26ed150eae 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityCraneGrabber.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityCraneGrabber.java @@ -7,7 +7,7 @@ import com.hbm.inventory.gui.GUICraneGrabber; import com.hbm.items.ModItems; import com.hbm.module.ModulePatternMatcher; -import com.hbm.tileentity.IFilterable; +import com.hbm.tileentity.IControlReceiverFilter; import com.hbm.tileentity.IGUIProvider; import com.hbm.util.InventoryUtil; @@ -19,7 +19,6 @@ import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -30,7 +29,7 @@ import java.util.List; -public class TileEntityCraneGrabber extends TileEntityCraneBase implements IGUIProvider, IFilterable { +public class TileEntityCraneGrabber extends TileEntityCraneBase implements IGUIProvider, IControlReceiverFilter { public boolean isWhitelist = false; public ModulePatternMatcher matcher; @@ -200,13 +199,4 @@ public void receiveControl(NBTTagCompound data) { setFilterContents(data); } } - @Override - public void setFilterContents(NBTTagCompound nbt) { - int slot = nbt.getInteger("slot"); - setInventorySlotContents( - slot, - new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta"))); - nextMode(slot); - markChanged(); - } } diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityCraneRouter.java b/src/main/java/com/hbm/tileentity/network/TileEntityCraneRouter.java index 70fc9e46db..6568f113b2 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityCraneRouter.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityCraneRouter.java @@ -3,7 +3,7 @@ import com.hbm.inventory.container.ContainerCraneRouter; import com.hbm.inventory.gui.GUICraneRouter; import com.hbm.module.ModulePatternMatcher; -import com.hbm.tileentity.IFilterable; +import com.hbm.tileentity.IControlReceiverFilter; import com.hbm.tileentity.IGUIProvider; import com.hbm.tileentity.TileEntityMachineBase; @@ -12,13 +12,12 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.Vec3; import net.minecraft.world.World; -public class TileEntityCraneRouter extends TileEntityMachineBase implements IGUIProvider, IFilterable { +public class TileEntityCraneRouter extends TileEntityMachineBase implements IGUIProvider, IControlReceiverFilter { public ModulePatternMatcher[] patterns = new ModulePatternMatcher[6]; //why did i make six matchers??? public int[] modes = new int[6]; @@ -134,13 +133,4 @@ public void receiveControl(NBTTagCompound data) { setFilterContents(data); } } - @Override - public void setFilterContents(NBTTagCompound nbt) { - int slot = nbt.getInteger("slot"); - setInventorySlotContents( - slot, - new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta"))); - nextMode(slot); - markChanged(); - } } diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityDroneRequester.java b/src/main/java/com/hbm/tileentity/network/TileEntityDroneRequester.java index 0fb1b82bb3..faa21f6152 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityDroneRequester.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityDroneRequester.java @@ -9,7 +9,7 @@ import com.hbm.inventory.container.ContainerDroneRequester; import com.hbm.inventory.gui.GUIDroneRequester; import com.hbm.module.ModulePatternMatcher; -import com.hbm.tileentity.IFilterable; +import com.hbm.tileentity.IControlReceiverFilter; import com.hbm.tileentity.IGUIProvider; import com.hbm.tileentity.INBTPacketReceiver; import com.hbm.tileentity.network.RequestNetwork.PathNode; @@ -21,14 +21,13 @@ import net.minecraft.client.gui.GuiScreen; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; -public class TileEntityDroneRequester extends TileEntityRequestNetworkContainer implements INBTPacketReceiver, IGUIProvider, IFilterable { +public class TileEntityDroneRequester extends TileEntityRequestNetworkContainer implements INBTPacketReceiver, IGUIProvider, IControlReceiverFilter { public ModulePatternMatcher matcher; @@ -131,14 +130,4 @@ public PathNode createNode(BlockPos pos) { public boolean hasPermission(EntityPlayer player) { return Vec3.createVectorHelper(xCoord - player.posX, yCoord - player.posY, zCoord - player.posZ).lengthVector() < 20; } - - @Override - public void setFilterContents(NBTTagCompound nbt) { - int slot = nbt.getInteger("slot"); - setInventorySlotContents( - slot, - new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta"))); - nextMode(slot); - markChanged(); - } } diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityRadioTorchCounter.java b/src/main/java/com/hbm/tileentity/network/TileEntityRadioTorchCounter.java index f079806c4a..4b4e188035 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityRadioTorchCounter.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityRadioTorchCounter.java @@ -1,19 +1,18 @@ package com.hbm.tileentity.network; import com.hbm.module.ModulePatternMatcher; -import com.hbm.tileentity.IFilterable; +import com.hbm.tileentity.IControlReceiverFilter; import com.hbm.tileentity.TileEntityMachineBase; import com.hbm.util.Compat; 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.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityRadioTorchCounter extends TileEntityMachineBase implements IFilterable { +public class TileEntityRadioTorchCounter extends TileEntityMachineBase implements IControlReceiverFilter { public String[] channel; public int[] lastCount; @@ -132,14 +131,4 @@ public void receiveControl(NBTTagCompound data) { setFilterContents(data); } } - @Override - public void setFilterContents(NBTTagCompound nbt) { - int slot = nbt.getInteger("slot"); - setInventorySlotContents( - slot, - new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta"))); - nextMode(slot); - markChanged(); - } - }