diff --git a/1.12/gradle.properties b/1.12/gradle.properties index 57d8755..0128884 100644 --- a/1.12/gradle.properties +++ b/1.12/gradle.properties @@ -4,4 +4,4 @@ org.gradle.jvmargs=-Xmx8G version_minecraft=1.12.2 version_forge=14.23.5.2768 version_jei=4.10.0.198 -version_engineersdecor=1.0.5 +version_engineersdecor=1.0.6 diff --git a/1.12/meta/update.json b/1.12/meta/update.json index 4612750..9786b11 100644 --- a/1.12/meta/update.json +++ b/1.12/meta/update.json @@ -1,6 +1,8 @@ { "homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/", "1.12.2": { + "1.0.6": "[R] Release based on v1.0.6-b1. Release-to-release changes: * Fixed FML remapping issue (COULD CAUSE CRASHES). * Small waste incinerator added. * Lang files updated/corrections. * Metal ladder easier to break.\n[A] Added factory dropper (config:experimental).\n[C] Thx to abdurraslan for the detailed issue #25.", + "1.0.6-b1": "[A] Added small waste incinerator (delayed fifo-buffered item disposal).\n[M] Fixed item/block name capitalization (by Voxelo).\n[M] Metal ladders are easier to break/harvest.\n[F] Fixed FML remapping issue by using dedicated IItemHandler instances.", "1.0.5": "[R] Release based on v1.0.5-b1. Release-to-release changes: * Small electrical passthrough-furnace added. * Passive fluid accumulator added. * Config options added. * Sign plates added. * Minor bug fixes.\n[A] Added sign \"Electrical hazzard\"/\"Caution hot wire\".\n[A] Added sign \"Caution dangerous there\" (skull/bones).", "1.0.5-b1": "[A] Added passive fluid accumulator.\n[A] Added small electrical passthrough-furnace.\n[F] Fixed version check URL.\n[M] Opt-out config options for valves, passive fluid accumulator, and furni.", "1.0.4": "[R] Release based on v1.0.4-b9. Release-to-release changes: * Crafting table: Quick crafting history re-fab, JEI integration. * Rendering improvements and issue fixes (stairs, ambient occlusion, optifine, etc). * Walls with texture variations. * Thin/thick steel poles with support feet/heads. * Horizontal steel double-T support beams added. * Fluid pipe valves added: Check valve, redstone controlled valve, analog redstone controlled valve. Support pressurized transfer. * Tool tip documentation (CTRL-SHIFT) for stairs added. * Internal code cleanups. * Recipes tuned.\n[E] Added pass-through electrical furnace (experimental, see config).", @@ -35,7 +37,7 @@ "1.0.0-b1": "[A] Initial structure.\n[A] Added clinker bricks and clinker brick stairs.\n[A] Added slag bricks and slag brick stairs.\n[A] Added metal rung ladder.\n[A] Added staggered metal steps ladder.\n[A] Added treated wood ladder.\n[A] Added treated wood pole.\n[A] Added treated wood table." }, "promos": { - "1.12.2-recommended": "1.0.5", - "1.12.2-latest": "1.0.5" + "1.12.2-recommended": "1.0.6", + "1.12.2-latest": "1.0.6" } } \ No newline at end of file diff --git a/1.12/readme.md b/1.12/readme.md index 1a9342e..b9ed8e2 100644 --- a/1.12/readme.md +++ b/1.12/readme.md @@ -10,6 +10,21 @@ Mod sources for Minecraft version 1.12.2. ---- ## Revision history + ------------------------------------------------------------------- + - v1.0.6 [R] Release based on v1.0.6-b1. Release-to-release changes: + * Fixed FML remapping issue (COULD CAUSE CRASHES). + * Small waste incinerator added. + * Lang files updated/corrections. + * Metal ladder easier to break. + ------------------------------------------------------------------- + [A] Added factory dropper (config:experimental). + [C] Thx to abdurraslan for the detailed issue #25. + + - v1.0.6-b1 [A] Added small waste incinerator (delayed fifo-buffered item disposal). + [M] Fixed item/block name capitalization (by Voxelo). + [M] Metal ladders are easier to break/harvest. + [F] Fixed FML remapping issue by using dedicated IItemHandler instances. + ------------------------------------------------------------------- - v1.0.5 [R] Release based on v1.0.5-b1. Release-to-release changes: * Small electrical passthrough-furnace added. diff --git a/1.12/src/main/java/wile/engineersdecor/ModEngineersDecor.java b/1.12/src/main/java/wile/engineersdecor/ModEngineersDecor.java index 5d70363..141bd39 100644 --- a/1.12/src/main/java/wile/engineersdecor/ModEngineersDecor.java +++ b/1.12/src/main/java/wile/engineersdecor/ModEngineersDecor.java @@ -155,6 +155,7 @@ public class ModEngineersDecor public static final int GUIID_SMALL_LAB_FURNACE = 213102; public static final int GUIID_ELECTRICAL_LAB_FURNACE = 213103; public static final int GUIID_SMALL_WASTE_INCINERATOR = 213104; + public static final int GUIID_FACTORY_DROPPER = 213105; @Override public Object getServerGuiElement(final int guiid, final EntityPlayer player, final World world, int x, int y, int z) @@ -166,6 +167,7 @@ public class ModEngineersDecor case GUIID_SMALL_LAB_FURNACE: return BlockDecorFurnace.getServerGuiElement(player, world, pos, te); case GUIID_ELECTRICAL_LAB_FURNACE: return BlockDecorFurnaceElectrical.getServerGuiElement(player, world, pos, te); case GUIID_SMALL_WASTE_INCINERATOR: return BlockDecorWasteIncinerator.getServerGuiElement(player, world, pos, te); + case GUIID_FACTORY_DROPPER: return BlockDecorDropper.getServerGuiElement(player, world, pos, te); } return null; } @@ -181,10 +183,10 @@ public class ModEngineersDecor case GUIID_SMALL_LAB_FURNACE: return BlockDecorFurnace.getClientGuiElement(player, world, pos, te); case GUIID_ELECTRICAL_LAB_FURNACE: return BlockDecorFurnaceElectrical.getClientGuiElement(player, world, pos, te); case GUIID_SMALL_WASTE_INCINERATOR: return BlockDecorWasteIncinerator.getClientGuiElement(player, world, pos, te); + case GUIID_FACTORY_DROPPER: return BlockDecorDropper.getClientGuiElement(player, world, pos, te); } return null; } - } @Mod.EventBusSubscriber diff --git a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorCraftingTable.java b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorCraftingTable.java index 8d225cb..0a04d0b 100644 --- a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorCraftingTable.java +++ b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorCraftingTable.java @@ -73,8 +73,7 @@ public class BlockDecorCraftingTable extends BlockDecorDirected } @Override - @SuppressWarnings("deprecation") - public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) { return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()); } @Override diff --git a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorDropper.java b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorDropper.java new file mode 100644 index 0000000..6d6142b --- /dev/null +++ b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorDropper.java @@ -0,0 +1,908 @@ +/* + * @file BlockDecorDropper.java + * @author Stefan Wilhelm (wile) + * @copyright (C) 2019 Stefan Wilhelm + * @license MIT (see https://opensource.org/licenses/MIT) + * + * Dropper factory automation suitable. + */ +package wile.engineersdecor.blocks; + +import net.minecraftforge.items.wrapper.SidedInvWrapper; +import wile.engineersdecor.ModEngineersDecor; +import wile.engineersdecor.detail.Networking; +import net.minecraft.block.properties.PropertyBool; +import net.minecraft.block.state.BlockStateContainer; +import net.minecraft.block.Block; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.block.state.IBlockState; +import net.minecraft.block.BlockDoor; +import net.minecraft.world.World; +import net.minecraft.world.Explosion; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.item.*; +import net.minecraft.inventory.*; +import net.minecraft.init.SoundEvents; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.*; +import net.minecraft.util.math.AxisAlignedBB; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.MathHelper; +import net.minecraft.util.math.Vec3d; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.TextComponentTranslation; +import net.minecraftforge.common.capabilities.Capability; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.io.IOException; +import java.util.Arrays; + +public class BlockDecorDropper extends BlockDecorDirected +{ + public static final PropertyBool OPEN = BlockDoor.OPEN; + + public BlockDecorDropper(@Nonnull String registryName, long config, @Nullable Material material, float hardness, float resistance, @Nullable SoundType sound, @Nonnull AxisAlignedBB unrotatedAABB) + { super(registryName, config, material, hardness, resistance, sound, unrotatedAABB); } + + @Override + protected BlockStateContainer createBlockState() + { return new BlockStateContainer(this, FACING, OPEN); } + + @Override + public IBlockState getStateFromMeta(int meta) + { return super.getStateFromMeta(meta).withProperty(OPEN, (meta & 0x8)!=0); } + + @Override + public int getMetaFromState(IBlockState state) + { return super.getMetaFromState(state) | (state.getValue(OPEN) ? 0x8 : 0x0); } + + @Override + public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) + { return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer, hand).withProperty(OPEN, false); } + + @Override + @SuppressWarnings("deprecation") + public boolean hasComparatorInputOverride(IBlockState state) + { return true; } + + @Override + @SuppressWarnings("deprecation") + public int getComparatorInputOverride(IBlockState blockState, World world, BlockPos pos) + { return Container.calcRedstone(world.getTileEntity(pos)); } + + @Override + public boolean hasTileEntity(IBlockState state) + { return true; } + + @Nullable + public TileEntity createTileEntity(World world, IBlockState state) + { return new BlockDecorDropper.BTileEntity(); } + + @Override + public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) + { + if(world.isRemote) return; + if((!stack.hasTagCompound()) || (!stack.getTagCompound().hasKey("inventory"))) return; + NBTTagCompound inventory_nbt = stack.getTagCompound().getCompoundTag("inventory"); + if(inventory_nbt.isEmpty()) return; + final TileEntity te = world.getTileEntity(pos); + if(!(te instanceof BlockDecorDropper.BTileEntity)) return; + ((BlockDecorDropper.BTileEntity)te).readnbt(inventory_nbt, false); + ((BlockDecorDropper.BTileEntity)te).markDirty(); + } + + @Override + public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) + { + if(world.isRemote) return true; + TileEntity te = world.getTileEntity(pos); + if(!(te instanceof BTileEntity)) return super.removedByPlayer(state, world, pos, player, willHarvest); + ItemStack stack = new ItemStack(this, 1); + NBTTagCompound inventory_nbt = new NBTTagCompound(); + ItemStackHelper.saveAllItems(inventory_nbt, ((BTileEntity)te).stacks_, false); + if(!inventory_nbt.isEmpty()) { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setTag("inventory", inventory_nbt); + stack.setTagCompound(nbt); + } + world.spawnEntity(new EntityItem(world, pos.getX()+0.5, pos.getY()+0.5, pos.getZ()+0.5, stack)); + world.setBlockToAir(pos); + world.removeTileEntity(pos); + return false; + } + + @Override + public void onBlockExploded(World world, BlockPos pos, Explosion explosion) + { + if(world.isRemote) return; + TileEntity te = world.getTileEntity(pos); + if(!(te instanceof BTileEntity)) return; + for(ItemStack stack: ((BTileEntity)te).stacks_) { + if(!stack.isEmpty()) world.spawnEntity(new EntityItem(world, pos.getX(), pos.getY(), pos.getZ(), stack)); + } + ((BTileEntity)te).reset(); + super.onBlockExploded(world, pos, explosion); + } + + @Override + public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) + { + if(world.isRemote) return true; + player.openGui(ModEngineersDecor.instance, ModEngineersDecor.GuiHandler.GUIID_FACTORY_DROPPER, world, pos.getX(), pos.getY(), pos.getZ()); + return true; + } + + @Override + public void neighborChanged(IBlockState state, World world, BlockPos pos, Block block, BlockPos neighborPos) + { + if(!(world instanceof World) || (((World) world).isRemote)) return; + TileEntity te = world.getTileEntity(pos); + if(!(te instanceof BTileEntity)) return; + ((BTileEntity)te).block_updated(); + } + + //-------------------------------------------------------------------------------------------------------------------- + // ModEngineersDecor.GuiHandler connectors + //-------------------------------------------------------------------------------------------------------------------- + + public static Object getServerGuiElement(final EntityPlayer player, final World world, final BlockPos pos, final TileEntity te) + { return (te instanceof BTileEntity) ? (new BContainer(player.inventory, world, pos, (BTileEntity)te)) : null; } + + public static Object getClientGuiElement(final EntityPlayer player, final World world, final BlockPos pos, final TileEntity te) + { return (te instanceof BTileEntity) ? (new BGui(player.inventory, world, pos, (BTileEntity)te)) : null; } + + //-------------------------------------------------------------------------------------------------------------------- + // GUI + //-------------------------------------------------------------------------------------------------------------------- + + @SideOnly(Side.CLIENT) + private static class BGui extends GuiContainer + { + private final BTileEntity te; + + public BGui(InventoryPlayer playerInventory, World world, BlockPos pos, BTileEntity te) + { super(new BContainer(playerInventory, world, pos, te)); this.te = te; } + + @Override + public void initGui() + { super.initGui(); } + + @Override + public void drawScreen(int mouseX, int mouseY, float partialTicks) + { + drawDefaultBackground(); + super.drawScreen(mouseX, mouseY, partialTicks); + renderHoveredToolTip(mouseX, mouseY); + } + + @Override + protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException + { + super.mouseClicked(mouseX, mouseY, mouseButton); + BContainer container = (BContainer)inventorySlots; + if(container.fields_.length != 16) return; + int mx = mouseX - getGuiLeft(), my = mouseY - getGuiTop(); + if(!isPointInRegion(114, 1, 61, 79, mouseX, mouseY)) { + return; + } else if(isPointInRegion(130, 10, 12, 25, mouseX, mouseY)) { + int force_percent = 100 - MathHelper.clamp(((my-10)*100)/25, 0, 100); + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setInteger("drop_speed", force_percent); + Networking.PacketTileNotify.sendToServer(te, nbt); + } else if(isPointInRegion(145, 10, 25, 25, mouseX, mouseY)) { + int xdev = MathHelper.clamp( (int)Math.round(((double)((mx-157) * 100)) / 12), -100, 100); + int ydev = MathHelper.clamp(-(int)Math.round(((double)((my- 22) * 100)) / 12), -100, 100); + if(Math.abs(xdev) < 9) xdev = 0; + if(Math.abs(ydev) < 9) ydev = 0; + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setInteger("drop_xdev", xdev); + nbt.setInteger("drop_ydev", ydev); + Networking.PacketTileNotify.sendToServer(te, nbt); + } else if(isPointInRegion(129, 40, 44, 10, mouseX, mouseY)) { + int ndrop = (mx-135); + if(ndrop < -1) { + ndrop = container.fields_[4] - 1; // - + } else if(ndrop >= 34) { + ndrop = container.fields_[4] + 1; // + + } else { + ndrop = MathHelper.clamp(1+ndrop, 1, BTileEntity.MAX_DROP_COUNT); // slider + } + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setInteger("drop_count", ndrop); + Networking.PacketTileNotify.sendToServer(te, nbt); + } else if(isPointInRegion(129, 50, 44, 10, mouseX, mouseY)) { + int period = (mx-135); + if(period < -1) { + period = container.fields_[6] - 1; // - + } else if(period >= 34) { + period = container.fields_[6] + 1; // + + } else { + period = (int)(0.5 + ((100.0 * period)/34)); + } + period = MathHelper.clamp(period, 0, 100); + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setInteger("drop_period", period); + Networking.PacketTileNotify.sendToServer(te, nbt); + } else if(isPointInRegion(114, 51, 9, 9, mouseX, mouseY)) { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setInteger("manual_rstrigger", 1); + Networking.PacketTileNotify.sendToServer(te, nbt); + } else if(isPointInRegion(162, 66, 7, 9, mouseX, mouseY)) { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setInteger("manual_trigger", 1); + Networking.PacketTileNotify.sendToServer(te, nbt); + } else if(isPointInRegion(132, 66, 9, 9, mouseX, mouseY)) { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setInteger("drop_logic", container.fields_[5] ^ BTileEntity.DROPLOGIC_FILTER_ANDGATE); + Networking.PacketTileNotify.sendToServer(te, nbt); + } else if(isPointInRegion(148, 66, 9, 9, mouseX, mouseY)) { + NBTTagCompound nbt = new NBTTagCompound(); + nbt.setInteger("drop_logic", container.fields_[5] ^ BTileEntity.DROPLOGIC_EXTERN_ANDGATE); + Networking.PacketTileNotify.sendToServer(te, nbt); + } + } + + @Override + protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) + { + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + mc.getTextureManager().bindTexture(new ResourceLocation(ModEngineersDecor.MODID, "textures/gui/factory_dropper_gui.png")); + final int x0=getGuiLeft(), y0=getGuiTop(), w=getXSize(), h=getYSize(); + drawTexturedModalRect(x0, y0, 0, 0, w, h); + BContainer container = (BContainer)inventorySlots; + if(container.fields_.length != 16) return; // no init, no cake. + // active drop slot + { + int drop_slot_index = container.fields_[15]; + if((drop_slot_index < 0) || (drop_slot_index >= 16)) drop_slot_index = 0; + int x = (x0+9+((drop_slot_index % 6) * 18)); + int y = (y0+5+((drop_slot_index / 6) * 17)); + drawTexturedModalRect(x, y, 180, 45, 18, 18); + } + // filter LEDs + { + for(int i=0; i<3; ++i) { + int xt = 180 + (6 * container.fields_[12+i]), yt = 38; + int x = x0 + 31 + (i * 36), y = y0 + 65; + drawTexturedModalRect(x, y, xt, yt, 6, 6); + } + } + // force adjustment + { + int hy = 2 + (((100-container.fields_[0]) * 21) / 100); + int x = x0+135, y = y0+12, xt = 181; + int yt = 4 + (23-hy); + drawTexturedModalRect(x, y, xt, yt, 3, hy); + } + // angle adjustment + { + int x = x0 + 157 - 3 + ((container.fields_[1] * 12) / 100); + int y = y0 + 22 - 3 - ((container.fields_[2] * 12) / 100); + drawTexturedModalRect(x, y, 180, 30, 7, 7); + } + // drop count + { + int x = x0 + 134 - 2 + (container.fields_[4]); + int y = y0 + 45; + drawTexturedModalRect(x, y, 190, 31, 5, 5); + } + // drop period + { + int px = ((container.fields_[6] * 34) / 100); + int x = x0 + 134 - 2 + MathHelper.clamp(px, 0, 33); + int y = y0 + 56; + drawTexturedModalRect(x, y, 190, 31, 5, 5); + } + // redstone input + { + if(container.fields_[11] != 0) { + drawTexturedModalRect(x0+114, y0+51, 189, 18, 9, 9); + } + } + // trigger logic + { + int filter_gate_offset = ((container.fields_[5] & BTileEntity.DROPLOGIC_FILTER_ANDGATE) != 0) ? 11 : 0; + int extern_gate_offset = ((container.fields_[5] & BTileEntity.DROPLOGIC_EXTERN_ANDGATE) != 0) ? 11 : 0; + drawTexturedModalRect(x0+132, y0+66, 179+filter_gate_offset, 66, 9, 9); + drawTexturedModalRect(x0+148, y0+66, 179+extern_gate_offset, 66, 9, 9); + } + // drop timer running indicator + { + if((container.fields_[9] > BTileEntity.DROP_PERIOD_OFFSET) && ((System.currentTimeMillis() % 1000) < 500)) { + drawTexturedModalRect(x0+149, y0+51, 201, 39, 3, 3); + } + } + } + } + + //-------------------------------------------------------------------------------------------------------------------- + // container + //-------------------------------------------------------------------------------------------------------------------- + + public static class BContainer extends Container + { + private static final int PLAYER_INV_START_SLOTNO = BTileEntity.NUM_OF_SLOTS; + private final World world; + private final BlockPos pos; + private final EntityPlayer player; + private final BTileEntity te; + private int fields_[] = new int[16]; + + public BContainer(InventoryPlayer playerInventory, World world, BlockPos pos, BTileEntity te) + { + this.player = playerInventory.player; + this.world = world; + this.pos = pos; + this.te = te; + int i=-1; + // input slots (stacks 0 to 11) + for(int y=0; y<2; ++y) { + for(int x=0; x<6; ++x) { + int xpos = 10+x*18, ypos = 6+y*17; + addSlotToContainer(new Slot(te, ++i, xpos, ypos)); + } + } + // filter slots (stacks 12 to 14) + addSlotToContainer(new Slot(te, ++i, 19, 48)); + addSlotToContainer(new Slot(te, ++i, 55, 48)); + addSlotToContainer(new Slot(te, ++i, 91, 48)); + // player slots + for(int x=0; x<9; ++x) { + addSlotToContainer(new Slot(playerInventory, x, 8+x*18, 144)); // player slots: 0..8 + } + for(int y=0; y<3; ++y) { + for(int x=0; x<9; ++x) { + addSlotToContainer(new Slot(playerInventory, x+y*9+9, 8+x*18, 86+y*18)); // player slots: 9..35 + } + } + } + + public BlockPos getPos() + { return pos; } + + @Override + public void addListener(IContainerListener listener) + { super.addListener(listener); listener.sendAllWindowProperties(this, te); } + + @Override + public void detectAndSendChanges() + { + super.detectAndSendChanges(); + for(int il=0; il= fields_.length)) return; + fields_[id] = value; + te.setField(id, value); + } + + @Override + public boolean canInteractWith(EntityPlayer player) + { return (world.getBlockState(pos).getBlock() instanceof BlockDecorDropper) && (player.getDistanceSq(pos) <= 64); } + + @Override + public ItemStack transferStackInSlot(EntityPlayer player, int index) + { + Slot slot = inventorySlots.get(index); + if((slot==null) || (!slot.getHasStack())) return ItemStack.EMPTY; + ItemStack slot_stack = slot.getStack(); + ItemStack transferred = slot_stack.copy(); + if((index>=0) && (index= PLAYER_INV_START_SLOTNO) && (index <= PLAYER_INV_START_SLOTNO+36)) { + // Player slot + if(!mergeItemStack(slot_stack, 0, BTileEntity.INPUT_SLOTS_SIZE, false)) return ItemStack.EMPTY; + } else { + // invalid slot + return ItemStack.EMPTY; + } + if(slot_stack.isEmpty()) { + slot.putStack(ItemStack.EMPTY); + } else { + slot.onSlotChanged(); + } + if(slot_stack.getCount() == transferred.getCount()) return ItemStack.EMPTY; + slot.onTake(player, slot_stack); + return transferred; + } + } + + //-------------------------------------------------------------------------------------------------------------------- + // Tile entity + //-------------------------------------------------------------------------------------------------------------------- + + public static class BTileEntity extends TileEntity implements ITickable, ISidedInventory, Networking.IPacketReceiver + { + public static final int TICK_INTERVAL = 32; + public static final int NUM_OF_SLOTS = 15; + public static final int INPUT_SLOTS_FIRST = 0; + public static final int INPUT_SLOTS_SIZE = 12; + public static final int CTRL_SLOTS_FIRST = INPUT_SLOTS_SIZE; + public static final int CTRL_SLOTS_SIZE = 3; + public static final int SHUTTER_CLOSE_DELAY = 40; + public static final int MAX_DROP_COUNT = 32; + public static final int DROP_PERIOD_OFFSET = 10; + /// + public static final int DROPLOGIC_FILTER_ANDGATE = 0x1; + public static final int DROPLOGIC_EXTERN_ANDGATE = 0x2; + public static final int DROPLOGIC_SILENT_DROP = 0x4; + public static final int DROPLOGIC_SILENT_OPEN = 0x8; + /// + private int filter_matches_[] = new int[CTRL_SLOTS_SIZE]; + private int open_timer_ = 0; + private int drop_timer_ = 0; + private boolean triggered_ = false; + private boolean block_power_signal_ = false; + private boolean block_power_updated_ = false; + private int drop_speed_ = 10; + private int drop_noise_ = 0; + private int drop_xdev_ = 0; + private int drop_ydev_ = 0; + private int drop_count_ = 1; + private int drop_logic_ = 0; + private int drop_period_ = 20; + private int drop_slot_index_ = 0; + private int tick_timer_ = 0; + protected NonNullList stacks_; + + public static void on_config(int cooldown_ticks) + { + // ModEngineersDecor.logger.info("Config factory dropper:"); + } + + public BTileEntity() + { reset(); } + + protected void reset() + { + stacks_ = NonNullList.withSize(NUM_OF_SLOTS, ItemStack.EMPTY); + block_power_signal_ = false; + block_power_updated_ = false; + drop_count_ = 1; + drop_period_ = 20; + drop_logic_ = DROPLOGIC_EXTERN_ANDGATE; + for(int i=0; iwithSize(NUM_OF_SLOTS, ItemStack.EMPTY); + ItemStackHelper.loadAllItems(nbt, stacks_); + while(stacks_.size() < NUM_OF_SLOTS) stacks_.add(ItemStack.EMPTY); + block_power_signal_ = nbt.getBoolean("powered"); + open_timer_ = nbt.getInteger("open_timer"); + drop_speed_ = nbt.getInteger("drop_speed"); + drop_noise_ = nbt.getInteger("drop_noise"); + drop_xdev_ = nbt.getInteger("drop_xdev"); + drop_ydev_ = nbt.getInteger("drop_ydev"); + drop_slot_index_ = nbt.getInteger("drop_slot_index"); + drop_count_ = MathHelper.clamp(nbt.getInteger("drop_count"), 1, MAX_DROP_COUNT); + drop_logic_ = nbt.getInteger("drop_logic"); + drop_period_ = nbt.getInteger("drop_period"); + } + + protected void writenbt(NBTTagCompound nbt, boolean update_packet) + { + ItemStackHelper.saveAllItems(nbt, stacks_); + nbt.setBoolean("powered", block_power_signal_); + nbt.setInteger("open_timer", open_timer_); + nbt.setInteger("drop_speed", drop_speed_); + nbt.setInteger("drop_noise", drop_noise_); + nbt.setInteger("drop_xdev", drop_xdev_); + nbt.setInteger("drop_ydev", drop_ydev_); + nbt.setInteger("drop_slot_index", drop_slot_index_); + nbt.setInteger("drop_count", drop_count_); + nbt.setInteger("drop_logic", drop_logic_); + nbt.setInteger("drop_period", drop_period_); + } + + public void block_updated() + { + // RS power check, both edges + boolean powered = world.isBlockPowered(pos); + if(block_power_signal_ != powered) block_power_updated_ = true; + block_power_signal_ = powered; + tick_timer_ = 1; + } + + public boolean is_input_slot(int index) + { return (index >= INPUT_SLOTS_FIRST) && (index < (INPUT_SLOTS_FIRST+INPUT_SLOTS_SIZE)); } + + // TileEntity ------------------------------------------------------------------------------ + + @Override + public boolean shouldRefresh(World world, BlockPos pos, IBlockState os, IBlockState ns) + { return (os.getBlock() != ns.getBlock()) || (!(ns.getBlock() instanceof BlockDecorDropper)); } + + @Override + public void readFromNBT(NBTTagCompound nbt) + { super.readFromNBT(nbt); readnbt(nbt, false); } + + @Override + public NBTTagCompound writeToNBT(NBTTagCompound nbt) + { super.writeToNBT(nbt); writenbt(nbt, false); return nbt; } + + // IWorldNamable --------------------------------------------------------------------------- + + @Override + public String getName() + { final Block block=getBlockType(); return (block!=null) ? (block.getTranslationKey() + ".name") : (""); } + + @Override + public boolean hasCustomName() + { return false; } + + @Override + public ITextComponent getDisplayName() + { return new TextComponentTranslation(getName(), new Object[0]); } + + // IInventory ------------------------------------------------------------------------------ + + @Override + public int getSizeInventory() + { return stacks_.size(); } + + @Override + public boolean isEmpty() + { for(ItemStack stack: stacks_) { if(!stack.isEmpty()) return false; } return true; } + + @Override + public ItemStack getStackInSlot(int index) + { return (index < getSizeInventory()) ? stacks_.get(index) : ItemStack.EMPTY; } + + @Override + public ItemStack decrStackSize(int index, int count) + { return ItemStackHelper.getAndSplit(stacks_, index, count); } + + @Override + public ItemStack removeStackFromSlot(int index) + { return ItemStackHelper.getAndRemove(stacks_, index); } + + @Override + public void setInventorySlotContents(int index, ItemStack stack) + { + stacks_.set(index, stack); + if(stack.getCount() > getInventoryStackLimit()) stack.setCount(getInventoryStackLimit()); + if(tick_timer_ > 8) tick_timer_ = 8; + markDirty(); + } + + @Override + public int getInventoryStackLimit() + { return 64; } + + @Override + public void markDirty() + { super.markDirty(); } + + @Override + public boolean isUsableByPlayer(EntityPlayer player) + { return ((world.getTileEntity(pos) == this) && (player.getDistanceSq(pos.getX()+0.5d, pos.getY()+0.5d, pos.getZ()+0.5d) <= 64.0d)); } + + @Override + public void openInventory(EntityPlayer player) + {} + + @Override + public void closeInventory(EntityPlayer player) + { markDirty(); } + + @Override + public boolean isItemValidForSlot(int index, ItemStack stack) + { return true; } + + @Override + public int getField(int id) + { + switch(id) { + case 0: return drop_speed_; + case 1: return drop_xdev_; + case 2: return drop_ydev_; + case 3: return drop_noise_; + case 4: return drop_count_; + case 5: return drop_logic_; + case 6: return drop_period_; + case 9: return drop_timer_; + case 10: return open_timer_; + case 11: return block_power_signal_ ? 1 : 0; + case 12: return filter_matches_[0]; + case 13: return filter_matches_[1]; + case 14: return filter_matches_[2]; + case 15: return drop_slot_index_; + default: return 0; + } + } + + @Override + public void setField(int id, int value) + { + switch(id) { + case 0: drop_speed_ = MathHelper.clamp(value, 0, 100); return; + case 1: drop_xdev_ = MathHelper.clamp(value, -100, 100); return; + case 2: drop_ydev_ = MathHelper.clamp(value, -100, 100); return; + case 3: drop_noise_ = MathHelper.clamp(value, 0, 100); return; + case 4: drop_count_ = MathHelper.clamp(value, 1, MAX_DROP_COUNT); return; + case 5: drop_logic_ = value; return; + case 6: drop_period_ = MathHelper.clamp(value, 0, 100); return; + case 9: drop_timer_ = MathHelper.clamp(value, 0, 400); return; + case 10: open_timer_ = MathHelper.clamp(value, 0, 400); return; + case 11: block_power_signal_ = (value != 0); return; + case 12: filter_matches_[0] = (value & 0x3); return; + case 13: filter_matches_[1] = (value & 0x3); return; + case 14: filter_matches_[2] = (value & 0x3); return; + case 15: drop_slot_index_ = MathHelper.clamp(value, INPUT_SLOTS_FIRST, INPUT_SLOTS_FIRST+INPUT_SLOTS_SIZE-1); return; + default: return; + } + } + + @Override + public int getFieldCount() + { return 16; } + + @Override + public void clear() + { stacks_.clear(); } + + // ISidedInventory ---------------------------------------------------------------------------- + + private final IItemHandler item_handler_ = new SidedInvWrapper(this, EnumFacing.UP); + private static final int[] SIDED_INV_SLOTS; + static { + SIDED_INV_SLOTS = new int[INPUT_SLOTS_SIZE]; + for(int i=0; i cap, EnumFacing facing) + { return (cap==CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) || super.hasCapability(cap, facing); } + + @Override + @SuppressWarnings("unchecked") + @Nullable + public T getCapability(Capability capability, @Nullable EnumFacing facing) + { + if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return (T)item_handler_; + return super.getCapability(capability, facing); + } + + // IPacketReceiver ------------------------------------------------------------------------------- + + @Override + public void onServerPacketReceived(NBTTagCompound nbt) + {} + + @Override + public void onClientPacketReceived(EntityPlayer player, NBTTagCompound nbt) + { + if(nbt.hasKey("drop_speed")) drop_speed_ = MathHelper.clamp(nbt.getInteger("drop_speed"), 0, 100); + if(nbt.hasKey("drop_xdev")) drop_xdev_ = MathHelper.clamp(nbt.getInteger("drop_xdev"), -100, 100); + if(nbt.hasKey("drop_ydev")) drop_ydev_ = MathHelper.clamp(nbt.getInteger("drop_ydev"), -100, 100); + if(nbt.hasKey("drop_count")) drop_count_ = MathHelper.clamp(nbt.getInteger("drop_count"), 1, MAX_DROP_COUNT); + if(nbt.hasKey("drop_period")) drop_period_ = MathHelper.clamp(nbt.getInteger("drop_period"), 0, 100); + if(nbt.hasKey("drop_logic")) drop_logic_ = nbt.getInteger("drop_logic"); + if(nbt.hasKey("manual_rstrigger") && (nbt.getInteger("manual_rstrigger")!=0)) { block_power_signal_=true; block_power_updated_=true; tick_timer_=1; } + if(nbt.hasKey("manual_trigger") && (nbt.getInteger("manual_trigger")!=0)) { tick_timer_ = 1; triggered_ = true; } + markDirty(); + } + + // ITickable and aux methods --------------------------------------------------------------------- + + private static void drop(World world, BlockPos pos, EnumFacing facing, ItemStack stack, int speed_percent, int xdeviation, int ydeviation, int noise_percent) + { + final double ofs = facing==EnumFacing.DOWN ? 0.8 : 0.7; + Vec3d v0 = new Vec3d(facing.getXOffset(), facing.getYOffset(), facing.getZOffset()); + final EntityItem ei = new EntityItem(world, (pos.getX()+0.5)+(ofs*v0.x), (pos.getY()+0.5)+(ofs*v0.y), (pos.getZ()+0.5)+(ofs*v0.z), stack); + if((xdeviation != 0) || (ydeviation != 0)) { + double vdx = 1e-2 * MathHelper.clamp(xdeviation, -100, 100); + double vdy = 1e-2 * MathHelper.clamp(ydeviation, -100, 100); + switch(facing) { // switch-case faster than coorsys fwd transform + case DOWN: v0 = v0.add( vdx, 0, vdy); break; // down/up: use xz + case NORTH: v0 = v0.add( vdx, vdy, 0); break; + case SOUTH: v0 = v0.add(-vdx, vdy, 0); break; + case EAST: v0 = v0.add(0, vdy, vdx); break; + case WEST: v0 = v0.add(0, vdy, -vdx); break; + case UP: v0 = v0.add( vdx, 0, vdy); break; + } + } + if(noise_percent > 0) { + v0 = v0.add( + ((world.rand.nextDouble()-0.5) * 1e-3 * noise_percent), + ((world.rand.nextDouble()-0.5) * 1e-3 * noise_percent), + ((world.rand.nextDouble()-0.5) * 1e-3 * noise_percent) + ); + } + if(speed_percent < 5) speed_percent = 5; + double speed = 1e-2 * speed_percent; + if(noise_percent > 0) speed += (world.rand.nextDouble()-0.5) * 1e-4 * noise_percent; + v0 = v0.normalize().scale(speed); + ei.motionX = v0.x; + ei.motionY = v0.y; + ei.motionZ = v0.z; + world.spawnEntity(ei); + } + + @Nullable + IBlockState update_blockstate() + { + IBlockState state = world.getBlockState(pos); + if(!(state.getBlock() instanceof BlockDecorDropper)) return null; + boolean open = (open_timer_ > 0); + if(state.getValue(OPEN) != open) { + state = state.withProperty(OPEN, open); + world.setBlockState(pos, state, 2|16); + if((drop_logic_ & DROPLOGIC_SILENT_OPEN) == 0) { + if(open) { + world.playSound(null, pos, SoundEvents.BLOCK_WOODEN_TRAPDOOR_OPEN, SoundCategory.BLOCKS, 0.08f, 3f); + } else { + world.playSound(null, pos, SoundEvents.BLOCK_WOODEN_TRAPDOOR_CLOSE, SoundCategory.BLOCKS, 0.08f, 3f); + } + } + } + return state; + } + + private static int next_slot(int i) + { return (i 0) && ((--drop_timer_) == 0)) markDirty(); + if(--tick_timer_ > 0) return; + tick_timer_ = TICK_INTERVAL; + boolean dirty = block_power_updated_; + boolean redstone_trigger = (block_power_signal_ && block_power_updated_); + boolean filter_trigger; + boolean trigger; + int filter_trigger_slots[] = {-1,-1,-1}; + // Trigger logic + { + boolean droppable_slot_found = false; + for(int i=INPUT_SLOTS_FIRST; i<(INPUT_SLOTS_FIRST+INPUT_SLOTS_SIZE); ++i) { + if(stacks_.get(i).getCount() >= drop_count_) { droppable_slot_found = true; break; } + } + int filter_nset = 0; + // From filters / inventory checks + { + int last_filter_matches_[] = filter_matches_.clone(); + boolean slot_assigned = false; + for(int ci=0; ci 0) ++filter_nset; + if(filter_matches_[i] > 1) ++nmatched; + if(filter_matches_[i] != last_filter_matches_[i]) dirty = true; + } + filter_trigger = ((filter_nset >0) && (nmatched > 0)); + if(((drop_logic_ & DROPLOGIC_FILTER_ANDGATE) != 0) && (nmatched != filter_nset)) filter_trigger = false; + } + // gates + { + if(filter_nset > 0) { + trigger = ((drop_logic_ & DROPLOGIC_EXTERN_ANDGATE) != 0) ? (filter_trigger && redstone_trigger) : (filter_trigger || redstone_trigger); + } else { + trigger = redstone_trigger; + } + if(triggered_) { triggered_ = false; trigger = true; } + if(!droppable_slot_found) { + if(open_timer_> 10) open_timer_ = 10; // override if dropping is not possible at all. + } else if(trigger || filter_trigger || redstone_trigger) { + open_timer_ = SHUTTER_CLOSE_DELAY; + } + } + // edge detection for next cycle + if(trigger) { + boolean tr = world.isBlockPowered(pos); + block_power_updated_ = (block_power_signal_ != tr); + block_power_signal_ = tr; + dirty = true; + } + } + // block state update + final IBlockState state = update_blockstate(); + if(state == null) { block_power_signal_= false; return; } + // dispense action + if(trigger) { + // drop stack for non-filter triggers + if(!filter_trigger) { + Arrays.fill(filter_trigger_slots,-1); + for(int i=0; i= INPUT_SLOTS_SIZE) drop_slot_index_ = 0; + int ic = drop_slot_index_; + drop_slot_index_ = next_slot(drop_slot_index_); + ItemStack ds = stacks_.get(ic); + if((!ds.isEmpty()) && (ds.getCount() >= drop_count_)) { + filter_trigger_slots[0] = ic; + break; + } + } + } + // drop action + if(drop_timer_ <= 0) { + boolean dropped = false; + for(int i = 0; i < filter_trigger_slots.length; ++i) { + if(filter_trigger_slots[i] < 0) continue; + ItemStack ds = stacks_.get(filter_trigger_slots[i]); + if(ds.getCount() >= drop_count_) { + ItemStack drop_stack = ds.splitStack(drop_count_); + if(!drop_stack.isEmpty()) { + dirty = true; + drop(world, pos, state.getValue(FACING), drop_stack, drop_speed_, drop_xdev_, drop_ydev_, drop_noise_); + dropped = true; + } + } + } + // cooldown + if(dropped) drop_timer_ = DROP_PERIOD_OFFSET + drop_period_ * 2; // 0.1s time base -> 100%===10s + // drop sound + if(dropped && ((drop_logic_ & DROPLOGIC_SILENT_DROP) == 0)) { + world.playSound(null, pos, SoundEvents.BLOCK_CLOTH_STEP, SoundCategory.BLOCKS, 0.1f, 4f); + } + // advance to next nonempty slot. + for(int i = 0; i < INPUT_SLOTS_SIZE; ++i) { + if(!stacks_.get(drop_slot_index_).isEmpty()) break; + drop_slot_index_ = next_slot(drop_slot_index_); + } + } + } + if(dirty) markDirty(); + if(trigger && (tick_timer_ > 10)) tick_timer_ = 10; + } + } +} diff --git a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorFurnace.java b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorFurnace.java index 6bb7c42..ff66b3d 100644 --- a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorFurnace.java +++ b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorFurnace.java @@ -79,8 +79,7 @@ public class BlockDecorFurnace extends BlockDecorDirected { return (state.getValue(FACING).getHorizontalIndex() & 0x3) | (state.getValue(LIT) ? 4 : 0); } @Override - @SuppressWarnings("deprecation") - public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) { return getDefaultState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()).withProperty(LIT, false); } @Override @@ -453,12 +452,6 @@ public class BlockDecorFurnace extends BlockDecorDirected public static final int AUX_0_SLOT_NO = 9; public static final int AUX_1_SLOT_NO =10; - private static final int[] SLOTS_TOP = new int[] {FIFO_INPUT_1_SLOT_NO}; - private static final int[] SLOTS_BOTTOM = new int[] {FIFO_OUTPUT_1_SLOT_NO}; - private static final int[] SLOTS_SIDES = new int[] {FIFO_FUEL_1_SLOT_NO}; - private final IItemHandler sided_itemhandler_top_ = new SidedInvWrapper(this, EnumFacing.UP); - private final IItemHandler sided_itemhandler_down_ = new SidedInvWrapper(this, EnumFacing.DOWN); - private final IItemHandler sided_itemhandler_sides_ = new SidedInvWrapper(this, EnumFacing.WEST); private static double proc_fuel_efficiency_ = 1.0; private static int proc_speed_interval_ = DEFAULT_SPEED_INTERVAL; private static int boost_energy_consumption = DEFAULT_BOOST_ENERGY * TICK_INTERVAL; @@ -726,6 +719,13 @@ public class BlockDecorFurnace extends BlockDecorDirected // ISidedInventory ---------------------------------------------------------------------------- + private static final int[] SLOTS_TOP = new int[] {FIFO_INPUT_1_SLOT_NO}; + private static final int[] SLOTS_BOTTOM = new int[] {FIFO_OUTPUT_1_SLOT_NO}; + private static final int[] SLOTS_SIDES = new int[] {FIFO_FUEL_1_SLOT_NO}; + private final IItemHandler sided_itemhandler_top_ = new SidedInvWrapper(this, EnumFacing.UP); + private final IItemHandler sided_itemhandler_down_ = new SidedInvWrapper(this, EnumFacing.DOWN); + private final IItemHandler sided_itemhandler_sides_ = new SidedInvWrapper(this, EnumFacing.WEST); + @Override public int[] getSlotsForFace(EnumFacing side) { @@ -747,21 +747,27 @@ public class BlockDecorFurnace extends BlockDecorDirected // IEnergyStorage ---------------------------------------------------------------------------- + @Override public boolean canExtract() { return false; } + @Override public boolean canReceive() { return true; } + @Override public int getMaxEnergyStored() { return boost_energy_consumption; } + @Override public int getEnergyStored() { return boost_energy_; } + @Override public int extractEnergy(int maxExtract, boolean simulate) { return 0; } + @Override public int receiveEnergy(int maxReceive, boolean simulate) { // only speedup support, no buffering, not in nbt -> no markdirty if((boost_energy_ >= boost_energy_consumption) || (maxReceive < boost_energy_consumption)) return 0; diff --git a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorFurnaceElectrical.java b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorFurnaceElectrical.java index 65a73cf..7cec5c3 100644 --- a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorFurnaceElectrical.java +++ b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorFurnaceElectrical.java @@ -273,7 +273,7 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace // Tile entity //-------------------------------------------------------------------------------------------------------------------- - public static class BTileEntity extends BlockDecorFurnace.BTileEntity implements ITickable, ISidedInventory, IEnergyStorage, IItemHandler + public static class BTileEntity extends BlockDecorFurnace.BTileEntity implements ITickable, ISidedInventory, IEnergyStorage { public static final int TICK_INTERVAL = 4; public static final int FIFO_INTERVAL = 20; @@ -429,6 +429,10 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace return changed; } + @Override + public ItemStack getStackInSlot(int index) + { return ((index < 0) || (index >= SIDED_INV_SLOTS.length)) ? ItemStack.EMPTY : stacks_.get(SIDED_INV_SLOTS[index]); } + // ISidedInventory ---------------------------------------------------------------------------- private static final int[] SIDED_INV_SLOTS = new int[] { @@ -450,21 +454,27 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace // IEnergyStorage ---------------------------------------------------------------------------- + @Override public boolean canExtract() { return false; } + @Override public boolean canReceive() { return true; } + @Override public int getMaxEnergyStored() { return MAX_ENERGY_BUFFER; } + @Override public int getEnergyStored() { return energy_stored_; } + @Override public int extractEnergy(int maxExtract, boolean simulate) { return 0; } + @Override public int receiveEnergy(int maxReceive, boolean simulate) { if(energy_stored_ >= MAX_ENERGY_BUFFER) return 0; @@ -476,96 +486,104 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace // IItemHandler -------------------------------------------------------------------------------- - @Override - public int getSlots() - { return SIDED_INV_SLOTS.length; } - - @Override - @Nonnull - public ItemStack getStackInSlot(int index) - { return ((index < 0) || (index >= SIDED_INV_SLOTS.length)) ? ItemStack.EMPTY : stacks_.get(SIDED_INV_SLOTS[index]); } - - @Override - public int getSlotLimit(int index) - { return getInventoryStackLimit(); } - - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) - { return true; } - - @Override - @Nonnull - public ItemStack insertItem(int index, @Nonnull ItemStack stack, boolean simulate) + protected static class BItemHandler implements IItemHandler { - if(stack.isEmpty()) return ItemStack.EMPTY; - if((index < 0) || (index >= SIDED_INV_SLOTS.length)) return ItemStack.EMPTY; - int slotno = SIDED_INV_SLOTS[index]; - ItemStack slotstack = getStackInSlot(slotno); - if(!slotstack.isEmpty()) + private BTileEntity te; + + BItemHandler(BTileEntity te) + { this.te = te; } + + @Override + public int getSlots() + { return SIDED_INV_SLOTS.length; } + + @Override + @Nonnull + public ItemStack getStackInSlot(int index) + { return te.getStackInSlot(index); } + + @Override + public int getSlotLimit(int index) + { return te.getInventoryStackLimit(); } + + @Override + public boolean isItemValid(int slot, @Nonnull ItemStack stack) + { return true; } + + @Override + @Nonnull + public ItemStack insertItem(int index, @Nonnull ItemStack stack, boolean simulate) { - if(slotstack.getCount() >= Math.min(slotstack.getMaxStackSize(), getSlotLimit(index))) return stack; - if(!ItemHandlerHelper.canItemStacksStack(stack, slotstack)) return stack; - if(!canInsertItem(slotno, stack, EnumFacing.UP) || (!isItemValidForSlot(slotno, stack))) return stack; - int n = Math.min(stack.getMaxStackSize(), getSlotLimit(index)) - slotstack.getCount(); - if(stack.getCount() <= n) { - if(!simulate) { - ItemStack copy = stack.copy(); - copy.grow(slotstack.getCount()); - setInventorySlotContents(slotno, copy); - } - return ItemStack.EMPTY; - } else { - stack = stack.copy(); - if(!simulate) { - ItemStack copy = stack.splitStack(n); - copy.grow(slotstack.getCount()); - setInventorySlotContents(slotno, copy); - return stack; + if(stack.isEmpty()) return ItemStack.EMPTY; + if((index < 0) || (index >= SIDED_INV_SLOTS.length)) return ItemStack.EMPTY; + int slotno = SIDED_INV_SLOTS[index]; + ItemStack slotstack = getStackInSlot(slotno); + if(!slotstack.isEmpty()) { + if(slotstack.getCount() >= Math.min(slotstack.getMaxStackSize(), getSlotLimit(index))) return stack; + if(!ItemHandlerHelper.canItemStacksStack(stack, slotstack)) return stack; + if(!te.canInsertItem(slotno, stack, EnumFacing.UP) || (!te.isItemValidForSlot(slotno, stack))) return stack; + int n = Math.min(stack.getMaxStackSize(), getSlotLimit(index)) - slotstack.getCount(); + if(stack.getCount() <= n) { + if(!simulate) { + ItemStack copy = stack.copy(); + copy.grow(slotstack.getCount()); + te.setInventorySlotContents(slotno, copy); + } + return ItemStack.EMPTY; } else { - stack.shrink(n); - return stack; + stack = stack.copy(); + if(!simulate) { + ItemStack copy = stack.splitStack(n); + copy.grow(slotstack.getCount()); + te.setInventorySlotContents(slotno, copy); + return stack; + } else { + stack.shrink(n); + return stack; + } + } + } else { + if(!te.canInsertItem(slotno, stack, EnumFacing.UP) || (!te.isItemValidForSlot(slotno, stack))) return stack; + int n = Math.min(stack.getMaxStackSize(), getSlotLimit(index)); + if(n < stack.getCount()) { + stack = stack.copy(); + if(!simulate) { + te.setInventorySlotContents(slotno, stack.splitStack(n)); + return stack; + } else { + stack.shrink(n); + return stack; + } + } else { + if(!simulate) te.setInventorySlotContents(slotno, stack); + return ItemStack.EMPTY; } } - } else { - if(!canInsertItem(slotno, stack, EnumFacing.UP) || (!isItemValidForSlot(slotno, stack))) return stack; - int n = Math.min(stack.getMaxStackSize(), getSlotLimit(index)); - if(n < stack.getCount()) { - stack = stack.copy(); - if(!simulate) { - setInventorySlotContents(slotno, stack.splitStack(n)); - return stack; - } else { - stack.shrink(n); - return stack; - } + } + + @Override + @Nonnull + public ItemStack extractItem(int index, int amount, boolean simulate) { + if(amount == 0) return ItemStack.EMPTY; + if((index < 0) || (index >= SIDED_INV_SLOTS.length)) return ItemStack.EMPTY; + int slotno = SIDED_INV_SLOTS[index]; + ItemStack stackInSlot = getStackInSlot(slotno); + if(stackInSlot.isEmpty()) return ItemStack.EMPTY; + if(!te.canExtractItem(slotno, stackInSlot, EnumFacing.DOWN)) return ItemStack.EMPTY; + if(simulate) { + if(stackInSlot.getCount() < amount) return stackInSlot.copy(); + ItemStack ostack = stackInSlot.copy(); + ostack.setCount(amount); + return ostack; } else { - if(!simulate) setInventorySlotContents(slotno, stack); - return ItemStack.EMPTY; + ItemStack ostack = te.decrStackSize(slotno, Math.min(stackInSlot.getCount(), amount)); + te.markDirty(); + return ostack; } } } - @Override - @Nonnull - public ItemStack extractItem(int index, int amount, boolean simulate) - { - if(amount == 0) return ItemStack.EMPTY; - if((index < 0) || (index >= SIDED_INV_SLOTS.length)) return ItemStack.EMPTY; - int slotno = SIDED_INV_SLOTS[index]; - ItemStack stackInSlot = getStackInSlot(slotno); - if(stackInSlot.isEmpty()) return ItemStack.EMPTY; - if(!canExtractItem(slotno, stackInSlot, EnumFacing.DOWN)) return ItemStack.EMPTY; - if(simulate) { - if(stackInSlot.getCount() < amount) return stackInSlot.copy(); - ItemStack ostack = stackInSlot.copy(); - ostack.setCount(amount); - return ostack; - } else { - ItemStack ostack = decrStackSize(slotno, Math.min(stackInSlot.getCount(), amount)); - markDirty(); - return ostack; - } - } + protected BItemHandler item_handler_ = new BItemHandler(this); // Capability export ---------------------------------------------------------------------------- @@ -578,11 +596,9 @@ public class BlockDecorFurnaceElectrical extends BlockDecorFurnace @Nullable public T getCapability(Capability capability, @Nullable EnumFacing facing) { - if((capability == CapabilityEnergy.ENERGY) || (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)) { - return ((T)this); - } else { - return super.getCapability(capability, facing); - } + if(capability == CapabilityEnergy.ENERGY) return ((T)this); + if(capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY) return (T)item_handler_; + return super.getCapability(capability, facing); } // ITickable ------------------------------------------------------------------------------------ diff --git a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorLadder.java b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorLadder.java index a6524e5..9c02892 100644 --- a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorLadder.java +++ b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorLadder.java @@ -98,8 +98,7 @@ public class BlockDecorLadder extends BlockLadder { return canAttachTo(world, pos.west(), side) || canAttachTo(world, pos.east(), side) || canAttachTo(world, pos.north(), side) || canAttachTo(world, pos.south(), side); } @Override - @SuppressWarnings("deprecation") - public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) { if(facing.getAxis().isHorizontal() && canAttachTo(world, pos.offset(facing.getOpposite()), facing)) return this.getDefaultState().withProperty(FACING, facing); for(EnumFacing e:EnumFacing.Plane.HORIZONTAL) { diff --git a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorWasteIncinerator.java b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorWasteIncinerator.java index e674434..31dacff 100644 --- a/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorWasteIncinerator.java +++ b/1.12/src/main/java/wile/engineersdecor/blocks/BlockDecorWasteIncinerator.java @@ -70,8 +70,7 @@ public class BlockDecorWasteIncinerator extends BlockDecor { return (state.getValue(LIT) ? 4 : 0); } @Override - @SuppressWarnings("deprecation") - public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) + public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) { return getDefaultState().withProperty(LIT, false); } @Override @@ -304,7 +303,7 @@ public class BlockDecorWasteIncinerator extends BlockDecor // Tile entity //-------------------------------------------------------------------------------------------------------------------- - public static class BTileEntity extends TileEntity implements ITickable, ISidedInventory, IEnergyStorage, IItemHandler + public static class BTileEntity extends TileEntity implements ITickable, ISidedInventory, IEnergyStorage { public static final int TICK_INTERVAL = 20; public static final int ENERGIZED_TICK_INTERVAL = 5; @@ -320,7 +319,7 @@ public class BlockDecorWasteIncinerator extends BlockDecor private int tick_timer_; private int check_timer_; private int energy_stored_; - protected NonNullList stacks_; + protected NonNullList stacks_ = NonNullList.withSize(NUM_OF_SLOTS, ItemStack.EMPTY); public static void on_config(int speed_percent, int fuel_efficiency_percent, int boost_energy_per_tick) { @@ -340,9 +339,10 @@ public class BlockDecorWasteIncinerator extends BlockDecor public void readnbt(NBTTagCompound compound) { - reset(); - ItemStackHelper.loadAllItems(compound, stacks_); - while(stacks_.size() < NUM_OF_SLOTS) stacks_.add(ItemStack.EMPTY); + NonNullList stacks = NonNullList.withSize(NUM_OF_SLOTS, ItemStack.EMPTY); + ItemStackHelper.loadAllItems(compound, stacks); + while(stacks.size() < NUM_OF_SLOTS) stacks.add(ItemStack.EMPTY); + stacks_ = stacks; energy_stored_ = compound.getInteger("Energy"); } @@ -436,7 +436,7 @@ public class BlockDecorWasteIncinerator extends BlockDecor @Override public ItemStack getStackInSlot(int index) - { return (index < getSizeInventory()) ? stacks_.get(index) : ItemStack.EMPTY; } + { return ((index >= 0) && (index < getSizeInventory())) ? stacks_.get(index) : ItemStack.EMPTY; } @Override public ItemStack decrStackSize(int index, int count) @@ -449,8 +449,8 @@ public class BlockDecorWasteIncinerator extends BlockDecor @Override public void setInventorySlotContents(int index, ItemStack stack) { - stacks_.set(index, stack); if(stack.getCount() > getInventoryStackLimit()) stack.setCount(getInventoryStackLimit()); + stacks_.set(index, stack); markDirty(); } @@ -476,7 +476,7 @@ public class BlockDecorWasteIncinerator extends BlockDecor @Override public boolean isItemValidForSlot(int index, ItemStack stack) - { return index==0; } + { return (index==0); } @Override public int getField(int id) @@ -512,21 +512,27 @@ public class BlockDecorWasteIncinerator extends BlockDecor // IEnergyStorage ---------------------------------------------------------------------------- + @Override public boolean canExtract() { return false; } + @Override public boolean canReceive() { return true; } + @Override public int getMaxEnergyStored() { return MAX_ENERGY_BUFFER; } + @Override public int getEnergyStored() { return energy_stored_; } + @Override public int extractEnergy(int maxExtract, boolean simulate) { return 0; } + @Override public int receiveEnergy(int maxReceive, boolean simulate) { if(energy_stored_ >= MAX_ENERGY_BUFFER) return 0; @@ -538,74 +544,89 @@ public class BlockDecorWasteIncinerator extends BlockDecor // IItemHandler -------------------------------------------------------------------------------- - @Override - public int getSlots() - { return 1; } - - @Override - public int getSlotLimit(int index) - { return getInventoryStackLimit(); } - - @Override - public boolean isItemValid(int slot, @Nonnull ItemStack stack) - { return true; } - - @Override - @Nonnull - public ItemStack insertItem(int index, @Nonnull ItemStack stack, boolean simulate) + protected static class BItemHandler implements IItemHandler { - if(stack.isEmpty()) return ItemStack.EMPTY; - if(index != 0) return ItemStack.EMPTY; - int slotno = 0; - ItemStack slotstack = getStackInSlot(slotno); - if(!slotstack.isEmpty()) + private BTileEntity te; + + BItemHandler(BTileEntity te) + { this.te = te; } + + @Override + public int getSlots() + { return 1; } + + @Override + public int getSlotLimit(int index) + { return te.getInventoryStackLimit(); } + + @Override + public boolean isItemValid(int slot, @Nonnull ItemStack stack) + { return true; } + + @Override + @Nonnull + public ItemStack insertItem(int index, @Nonnull ItemStack stack, boolean simulate) { - if(slotstack.getCount() >= Math.min(slotstack.getMaxStackSize(), getSlotLimit(index))) return stack; - if(!ItemHandlerHelper.canItemStacksStack(stack, slotstack)) return stack; - if(!canInsertItem(slotno, stack, EnumFacing.UP) || (!isItemValidForSlot(slotno, stack))) return stack; - int n = Math.min(stack.getMaxStackSize(), getSlotLimit(index)) - slotstack.getCount(); - if(stack.getCount() <= n) { - if(!simulate) { - ItemStack copy = stack.copy(); - copy.grow(slotstack.getCount()); - setInventorySlotContents(slotno, copy); - } - return ItemStack.EMPTY; - } else { - stack = stack.copy(); - if(!simulate) { - ItemStack copy = stack.splitStack(n); - copy.grow(slotstack.getCount()); - setInventorySlotContents(slotno, copy); - return stack; + if(stack.isEmpty()) return ItemStack.EMPTY; + if(index != 0) return ItemStack.EMPTY; + int slotno = 0; + ItemStack slotstack = getStackInSlot(slotno); + if(!slotstack.isEmpty()) + { + if(slotstack.getCount() >= Math.min(slotstack.getMaxStackSize(), getSlotLimit(index))) return stack; + if(!ItemHandlerHelper.canItemStacksStack(stack, slotstack)) return stack; + if(!te.canInsertItem(slotno, stack, EnumFacing.UP) || (!te.isItemValidForSlot(slotno, stack))) return stack; + int n = Math.min(stack.getMaxStackSize(), getSlotLimit(index)) - slotstack.getCount(); + if(stack.getCount() <= n) { + if(!simulate) { + ItemStack copy = stack.copy(); + copy.grow(slotstack.getCount()); + te.setInventorySlotContents(slotno, copy); + } + return ItemStack.EMPTY; } else { - stack.shrink(n); - return stack; - } - } - } else { - if(!canInsertItem(slotno, stack, EnumFacing.UP) || (!isItemValidForSlot(slotno, stack))) return stack; - int n = Math.min(stack.getMaxStackSize(), getSlotLimit(index)); - if(n < stack.getCount()) { - stack = stack.copy(); - if(!simulate) { - setInventorySlotContents(slotno, stack.splitStack(n)); - return stack; - } else { - stack.shrink(n); - return stack; + stack = stack.copy(); + if(!simulate) { + ItemStack copy = stack.splitStack(n); + copy.grow(slotstack.getCount()); + te.setInventorySlotContents(slotno, copy); + return stack; + } else { + stack.shrink(n); + return stack; + } } } else { - if(!simulate) setInventorySlotContents(slotno, stack); - return ItemStack.EMPTY; + if(!te.canInsertItem(slotno, stack, EnumFacing.UP) || (!te.isItemValidForSlot(slotno, stack))) return stack; + int n = Math.min(stack.getMaxStackSize(), getSlotLimit(index)); + if(n < stack.getCount()) { + stack = stack.copy(); + if(!simulate) { + te.setInventorySlotContents(slotno, stack.splitStack(n)); + return stack; + } else { + stack.shrink(n); + return stack; + } + } else { + if(!simulate) te.setInventorySlotContents(slotno, stack); + return ItemStack.EMPTY; + } } } + + @Override + @Nonnull + public ItemStack extractItem(int index, int amount, boolean simulate) + { return ItemStack.EMPTY; } + + @Override + @Nonnull + public ItemStack getStackInSlot(int index) + { return te.getStackInSlot(index); } } - @Override - @Nonnull - public ItemStack extractItem(int index, int amount, boolean simulate) - { return ItemStack.EMPTY; } + private BItemHandler item_handler_ = new BItemHandler(this); // Capability export ---------------------------------------------------------------------------- @@ -619,7 +640,7 @@ public class BlockDecorWasteIncinerator extends BlockDecor public T getCapability(Capability capability, @Nullable EnumFacing facing) { if((facing != null) && (capability == CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)) { - return (T)this; + return (T)item_handler_; } else if(capability == CapabilityEnergy.ENERGY) { return (T)this; } else { diff --git a/1.12/src/main/java/wile/engineersdecor/blocks/ModBlocks.java b/1.12/src/main/java/wile/engineersdecor/blocks/ModBlocks.java index 15f5fb6..dc1ee93 100644 --- a/1.12/src/main/java/wile/engineersdecor/blocks/ModBlocks.java +++ b/1.12/src/main/java/wile/engineersdecor/blocks/ModBlocks.java @@ -12,13 +12,13 @@ */ package wile.engineersdecor.blocks; -import net.minecraft.tileentity.TileEntity; import wile.engineersdecor.ModEngineersDecor; import wile.engineersdecor.detail.ModAuxiliaries; import wile.engineersdecor.detail.ModConfig; import net.minecraft.block.Block; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; +import net.minecraft.tileentity.TileEntity; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.util.ResourceLocation; @@ -56,9 +56,9 @@ public class ModBlocks public static final BlockDecorWall CONCRETE_WALL = new BlockDecorWall("concrete_wall", BlockDecor.CFG_DEFAULT, Material.ROCK, 5f, 20f, SoundType.STONE); - public static final BlockDecorLadder METAL_RUNG_LADDER = new BlockDecorLadder("metal_rung_ladder", 0, Material.IRON, 1.0f, 20f, SoundType.METAL); - public static final BlockDecorLadder METAL_RUNG_STEPS = new BlockDecorLadder("metal_rung_steps", 0, Material.IRON, 1.0f, 20f, SoundType.METAL); - public static final BlockDecorLadder TREATED_WOOD_LADDER = new BlockDecorLadder("treated_wood_ladder", 0, Material.WOOD, 1.0f, 10f, SoundType.WOOD); + public static final BlockDecorLadder METAL_RUNG_LADDER = new BlockDecorLadder("metal_rung_ladder", 0, Material.IRON, 0.5f, 20f, SoundType.METAL); + public static final BlockDecorLadder METAL_RUNG_STEPS = new BlockDecorLadder("metal_rung_steps", 0, Material.IRON, 0.5f, 20f, SoundType.METAL); + public static final BlockDecorLadder TREATED_WOOD_LADDER = new BlockDecorLadder("treated_wood_ladder", 0, Material.WOOD, 0.5f, 10f, SoundType.WOOD); public static final BlockDecorGlassBlock PANZERGLASS_BLOCK = new BlockDecorGlassBlock("panzerglass_block", 0, Material.GLASS, 0.8f, 2000f, SoundType.GLASS); @@ -162,14 +162,15 @@ public class ModBlocks public static final BlockDecorFurnace SMALL_LAB_FURNACE = new BlockDecorFurnace( "small_lab_furnace", - BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_OPPOSITE_PLACEMENT, + BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_OPPOSITE_PLACEMENT| + BlockDecor.CFG_ELECTRICAL, Material.IRON, 0.35f, 15f, SoundType.METAL, ModAuxiliaries.getPixeledAABB(1,0,1, 15,15,16) ); public static final BlockDecorFurnaceElectrical SMALL_ELECTRICAL_FURNACE = new BlockDecorFurnaceElectrical( "small_electrical_furnace", - BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT, + BlockDecor.CFG_CUTOUT|BlockDecor.CFG_HORIZIONTAL|BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_ELECTRICAL, Material.IRON, 0.35f, 15f, SoundType.METAL, ModAuxiliaries.getPixeledAABB(0,0,0, 16,16,16) ); @@ -243,11 +244,18 @@ public class ModBlocks public static final BlockDecorWasteIncinerator SMALL_WASTE_INCINERATOR = new BlockDecorWasteIncinerator( "small_waste_incinerator", - BlockDecor.CFG_DEFAULT, + BlockDecor.CFG_DEFAULT|BlockDecor.CFG_ELECTRICAL, Material.IRON, 0.3f, 15f, SoundType.METAL, ModAuxiliaries.getPixeledAABB(0,0,0, 16,16,16) ); + public static final BlockDecorDropper FACTORY_DROPPER = new BlockDecorDropper( + "factory_dropper", + BlockDecor.CFG_LOOK_PLACEMENT|BlockDecor.CFG_REDSTONE_CONTROLLED, + Material.IRON, 0.3f, 15f, SoundType.METAL, + ModAuxiliaries.getPixeledAABB(0,0,0, 16,16,15) + ); + //-------------------------------------------------------------------------------------------------------------------- //-- Tile entities //-------------------------------------------------------------------------------------------------------------------- @@ -277,6 +285,9 @@ public class ModBlocks private static final TileEntityRegistrationData WASTE_INCINERATOR_TEI = new TileEntityRegistrationData( BlockDecorWasteIncinerator.BTileEntity.class, "te_small_waste_incinerator" ); + private static final TileEntityRegistrationData FACTORY_DROPPER_TEI = new TileEntityRegistrationData( + BlockDecorDropper.BTileEntity.class, "te_factory_dropper" + ); //-------------------------------------------------------------------------------------------------------------------- //-- Registration list @@ -319,12 +330,13 @@ public class ModBlocks STRAIGHT_CHECK_VALVE, STRAIGHT_REDSTONE_VALVE, STRAIGHT_REDSTONE_ANALOG_VALVE, STRAIGHT_PIPE_VALVE_TEI, PASSIVE_FLUID_ACCUMULATOR, PASSIVE_FLUID_ACCUMULATOR_TEI, SMALL_ELECTRICAL_FURNACE, SMALL_ELECTRICAL_FURNACE_TEI, - SIGN_HOTWIRE, SIGN_DANGER + SIGN_HOTWIRE, SIGN_DANGER, + SMALL_WASTE_INCINERATOR, WASTE_INCINERATOR_TEI, }; private static final Object dev_content[] = { SIGN_MINDSTEP, - SMALL_WASTE_INCINERATOR, WASTE_INCINERATOR_TEI + FACTORY_DROPPER, FACTORY_DROPPER_TEI }; //-------------------------------------------------------------------------------------------------------------------- @@ -346,7 +358,7 @@ public class ModBlocks final boolean woor = ModConfig.isWithoutOptOutRegistration(); for(Object e:content) { if(e instanceof Block) { - if((!woor) || (!ModConfig.isOptedOut((Block)e))) { + if((!woor) || (!ModConfig.isOptedOut((Block)e)) || (e==SIGN_MODLOGO)) { registeredBlocks.add((Block) e); } else { ++num_block_registrations_skipped; diff --git a/1.12/src/main/java/wile/engineersdecor/detail/ModConfig.java b/1.12/src/main/java/wile/engineersdecor/detail/ModConfig.java index 1e901f6..cb39c5c 100644 --- a/1.12/src/main/java/wile/engineersdecor/detail/ModConfig.java +++ b/1.12/src/main/java/wile/engineersdecor/detail/ModConfig.java @@ -118,11 +118,23 @@ public class ModConfig @Config.Comment({"Disable check valve, and redstone controlled valves."}) @Config.Name("Without valves") + @Config.RequiresMcRestart public boolean without_valves = false; @Config.Comment({"Disable the passive fluid accumulator."}) @Config.Name("Without fluid accumulator") + @Config.RequiresMcRestart public boolean without_passive_fluid_accumulator = false; + + @Config.Comment({"Disable item disposal/trash/void incinerator device."}) + @Config.Name("Without waste incinerator") + @Config.RequiresMcRestart + public boolean without_waste_incinerator = false; + + @Config.Comment({"Disable decorative sign plates (caution, hazards, etc)."}) + @Config.Name("Without signs") + @Config.RequiresMcRestart + public boolean without_sign_plates = false; } @Config.Comment({ @@ -292,9 +304,11 @@ public class ModConfig if(optout.without_lab_furnace && ((block instanceof BlockDecorFurnace)) && (!(block instanceof BlockDecorFurnaceElectrical))) return true; if(optout.without_electrical_furnace && (block instanceof BlockDecorFurnaceElectrical)) return true; if(optout.without_passive_fluid_accumulator && (block instanceof BlockDecorPassiveFluidAccumulator)) return true; + if(optout.without_waste_incinerator && (block instanceof BlockDecorWasteIncinerator)) return true; if(optout.without_windows && rn.endsWith("_window")) return true; if(optout.without_light_sources && rn.endsWith("_light")) return true; if(optout.without_ladders && (block instanceof BlockDecorLadder)) return true; + if(optout.without_sign_plates && rn.startsWith("sign_")) return true; if(optout.without_walls && rn.endsWith("_wall")) return true; if(optout.without_stairs && rn.endsWith("_stairs")) return true; if(optout.without_valves && rn.contains("_pipe_valve")) return true; diff --git a/1.12/src/main/resources/assets/engineersdecor/blockstates/factory_dropper.json b/1.12/src/main/resources/assets/engineersdecor/blockstates/factory_dropper.json new file mode 100644 index 0000000..7e3175d --- /dev/null +++ b/1.12/src/main/resources/assets/engineersdecor/blockstates/factory_dropper.json @@ -0,0 +1,12 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "engineersdecor:device/factory_dropper_model" + }, + "variants": { + "normal": [{}], + "inventory": [{}], + "facing": { "north":{"y":0}, "south":{"y":180}, "west":{"y":270}, "east":{"y":90}, "up": {"x":-90}, "down": {"x":90} }, + "open": { "false":{}, "true":{ "model": "engineersdecor:device/factory_dropper_model_open" } } + } +} diff --git a/1.12/src/main/resources/assets/engineersdecor/lang/en_us.lang b/1.12/src/main/resources/assets/engineersdecor/lang/en_us.lang index 2f1e8b7..ac3dde1 100644 --- a/1.12/src/main/resources/assets/engineersdecor/lang/en_us.lang +++ b/1.12/src/main/resources/assets/engineersdecor/lang/en_us.lang @@ -5,129 +5,132 @@ # #----------------------------------------------------------------------------------------------------------- itemGroup.tabengineersdecor=Engineer's Decor -engineersdecor.config.title=Engineer's Decor config -engineersdecor.tooltip.hint.extended=§6[§9SHIFT§r More info§6]§r +engineersdecor.config.title=Engineer's Decor Config +engineersdecor.tooltip.hint.extended=§6[§9SHIFT§r More Info§6]§r engineersdecor.tooltip.hint.help=§6[§9CTRL-SHIFT§r Help§6]§r #----------------------------------------------------------------------------------------------------------- # Stone/"ceramic material" based blocks #----------------------------------------------------------------------------------------------------------- -tile.engineersdecor.clinker_brick_block.name=Clinker brick block +tile.engineersdecor.clinker_brick_block.name=Clinker Brick Block tile.engineersdecor.clinker_brick_block.help=§6A brick block with position dependent texture variations.§r\nLooks slightly darker and more color intensive than the vanilla brick block. -tile.engineersdecor.slag_brick_block.name=Slag brick block +tile.engineersdecor.slag_brick_block.name=Slag Brick Block tile.engineersdecor.slag_brick_block.help=§6A gray-brown brick block with position dependent texture variations. -tile.engineersdecor.rebar_concrete.name=Rebar concrete block +tile.engineersdecor.rebar_concrete.name=Rebar Concrete Block tile.engineersdecor.rebar_concrete.help=§6Steel reinforced concrete block.§r Expensive but Creeper-proof like obsidian. -tile.engineersdecor.panzerglass_block.name=Panzer glass block +tile.engineersdecor.panzerglass_block.name=Panzer Glass Block tile.engineersdecor.panzerglass_block.help=§6Reinforced glass block.§r Expensive, explosion-proof. Dark gray tint, faint structural lines visible, multi texture for seemless look. -tile.engineersdecor.rebar_concrete_tile.name=Rebar concrete tile +tile.engineersdecor.rebar_concrete_tile.name=Rebar Concrete Tile tile.engineersdecor.rebar_concrete_tile.help=§6Steel reinforced concrete tile.§r Expensive but Creeper-proof like obsidian. #----------------------------------------------------------------------------------------------------------- -tile.engineersdecor.rebar_concrete_wall.name=Rebar concrete wall +tile.engineersdecor.rebar_concrete_wall.name=Rebar Concrete Wall tile.engineersdecor.rebar_concrete_wall.help=§6Steel reinforced concrete wall.§r Expensive but Creeper-proof like obsidian. -tile.engineersdecor.concrete_wall.name=Concrete wall +tile.engineersdecor.concrete_wall.name=Concrete Wall tile.engineersdecor.concrete_wall.help=§6Wall made of solid concrete. -tile.engineersdecor.clinker_brick_wall.name=Clinker brick wall -tile.engineersdecor.clinker_brick_wall.help=§6Simplistic clinker brick wall. -tile.engineersdecor.slag_brick_wall.name=Slag brick wall -tile.engineersdecor.slag_brick_wall.help=§6Simplistic slag brick wall. +tile.engineersdecor.clinker_brick_wall.name=Clinker Brick Wall +tile.engineersdecor.clinker_brick_wall.help=§6Simplistic Clinker Brick Wall. +tile.engineersdecor.slag_brick_wall.name=Slag Brick Wall +tile.engineersdecor.slag_brick_wall.help=§6Simplistic Slag Brick Wall. #----------------------------------------------------------------------------------------------------------- -tile.engineersdecor.metal_rung_ladder.name=Metal rung ladder +tile.engineersdecor.metal_rung_ladder.name=Metal Rung Ladder tile.engineersdecor.metal_rung_ladder.help=§6Typical industrial wall ladder, consisting of horizontal metal rod rungs.§r Look up/down to climb faster. -tile.engineersdecor.metal_rung_steps.name=Staggered metal steps +tile.engineersdecor.metal_rung_steps.name=Staggered Metal Steps tile.engineersdecor.metal_rung_steps.help=§6Staggered rod rungs affixed to a wall, allowing to climb up, fall down, and so on.§r Look up/down to climb faster. -tile.engineersdecor.treated_wood_ladder.name=Treated wood ladder +tile.engineersdecor.treated_wood_ladder.name=Treated Wood Ladder tile.engineersdecor.treated_wood_ladder.help=§6Weather-proof wooden ladder.§r Look up/down to climb faster. #----------------------------------------------------------------------------------------------------------- -tile.engineersdecor.clinker_brick_stairs.name=Clinker brick stairs +tile.engineersdecor.clinker_brick_stairs.name=Clinker Brick Stairs tile.engineersdecor.clinker_brick_stairs.help=§6Looks slightly darker and more color intensive than the vanilla brick block. -tile.engineersdecor.slag_brick_stairs.name=Clinker brick stairs +tile.engineersdecor.slag_brick_stairs.name=Clinker Brick Stairs tile.engineersdecor.slag_brick_stairs.help=§6Looks slightly darker and more color intensive than the vanilla brick block. -tile.engineersdecor.rebar_concrete_stairs.name=Rebar concrete stairs +tile.engineersdecor.rebar_concrete_stairs.name=Rebar Concrete Stairs tile.engineersdecor.rebar_concrete_stairs.help=§6Steel reinforced concrete stairs.§r Expensive but Creeper-proof like obsidian. -tile.engineersdecor.rebar_concrete_tile_stairs.name=Rebar concrete tile stairs +tile.engineersdecor.rebar_concrete_tile_stairs.name=Rebar Concrete Tile Stairs tile.engineersdecor.rebar_concrete_tile_stairs.help=§6Steel reinforced concrete tile stairs.§r Expensive but Creeper-proof like obsidian. #----------------------------------------------------------------------------------------------------------- -tile.engineersdecor.treated_wood_pole.name=Straight treated wood pole +tile.engineersdecor.treated_wood_pole.name=Straight Treated Wood Pole tile.engineersdecor.treated_wood_pole.help=§6Straight pole fragment with a diameter of a wire relay.§r\n\ Can be useful as alternative to the wire posts if special special lengths are needed, \ or as support for structures. -tile.engineersdecor.treated_wood_pole_head.name=Straight treated wood pole head/foot +tile.engineersdecor.treated_wood_pole_head.name=Straight Treated Wood Pole Head/Foot tile.engineersdecor.treated_wood_pole_head.help=§6Wooden part fitting as foot or head of straight poles. -tile.engineersdecor.treated_wood_pole_support.name=Straight treated wood pole support +tile.engineersdecor.treated_wood_pole_support.name=Straight Treated Wood Pole Support tile.engineersdecor.treated_wood_pole_support.help=§6Heavy duty wooden support part fitting as foot or head of straight poles. -tile.engineersdecor.thick_steel_pole.name=Straight thick steel pole +tile.engineersdecor.thick_steel_pole.name=Straight Thick Steel Pole tile.engineersdecor.thick_steel_pole.help=§6Straight hollow pole fragment (6x6x16) for structural support purposes. -tile.engineersdecor.thin_steel_pole.name=Straight thin steel pole +tile.engineersdecor.thin_steel_pole.name=Straight Thin Steel Pole tile.engineersdecor.thin_steel_pole.help=§6Straight hollow pole fragment (4x4x16) for structural support purposes. -tile.engineersdecor.thin_steel_pole_head.name=Straight thin steel pole head/foot +tile.engineersdecor.thin_steel_pole_head.name=Straight Thin Steel Pole head/foot tile.engineersdecor.thin_steel_pole_head.help=§6Steel part fitting as foot or head of the thin steel pole (4x4x16). -tile.engineersdecor.thick_steel_pole_head.name=Straight thick steel pole head/foot +tile.engineersdecor.thick_steel_pole_head.name=Straight Thick Steel Pole Head/Foot tile.engineersdecor.thick_steel_pole_head.help=§6Steel part fitting as foot or head of the thick steel pole (6x6x16). -tile.engineersdecor.steel_double_t_support.name=Steel double T support +tile.engineersdecor.steel_double_t_support.name=Steel Double T Support tile.engineersdecor.steel_double_t_support.help=§6Horizontal ceiling support bream fragment. #----------------------------------------------------------------------------------------------------------- -tile.engineersdecor.treated_wood_table.name=Treated wood table +tile.engineersdecor.treated_wood_table.name=Treated Wood Table tile.engineersdecor.treated_wood_table.help=§6Robust four-legged wood table.§r Indoor and outdoor use. -tile.engineersdecor.treated_wood_stool.name=Treated wood stool -tile.engineersdecor.treated_wood_stool.help=§6Robust wood stool.§r Indoor and outdoor use. -tile.engineersdecor.treated_wood_crafting_table.name=Treated wood crafting table +tile.engineersdecor.treated_wood_stool.name=Treated Wood Stool +tile.engineersdecor.treated_wood_stool.help=§6Robust Wood Stool.§r Indoor and outdoor use. +tile.engineersdecor.treated_wood_crafting_table.name=Treated Wood Crafting Table tile.engineersdecor.treated_wood_crafting_table.help=§6Robust and weather-proof.§r Eight storage slots, keeps inventory, no vanilla recipe book.\n\ Click up/down arrow buttons for crafting history selection, output slot for item placement, X-button \ to clear crafting grid and history. Shift-click stack: player-to-storage stack transfer when crafting \ grid empty, otherwise player-to-grid stack transfer. Automatically distributes the clicked stack. -tile.engineersdecor.iron_inset_light.name=Inset light +tile.engineersdecor.iron_inset_light.name=Inset Light tile.engineersdecor.iron_inset_light.help=§6Small glowstone light source, sunk into the floor, ceiling or wall.§r\n\ Useful to light up places where electrical light installations are problematic.\ Light level like a torch. -tile.engineersdecor.treated_wood_window.name=Treated wood window +tile.engineersdecor.treated_wood_window.name=Treated Wood Window tile.engineersdecor.treated_wood_window.help=§6Wood framed tripple glazed window. Well insulating.§r Does not connect to adjacent blocks like glass panes. -tile.engineersdecor.treated_wood_windowsill.name=Treated wood window sill +tile.engineersdecor.treated_wood_windowsill.name=Treated Wood Window Sill tile.engineersdecor.treated_wood_windowsill.help=§6Simple window decoration. -tile.engineersdecor.steel_framed_window.name=Steel framed window +tile.engineersdecor.steel_framed_window.name=Steel Framed Window tile.engineersdecor.steel_framed_window.help=§6Steel framed tripple glazed window. Well insulating. §r Does not connect to adjacent blocks like glass panes. #----------------------------------------------------------------------------------------------------------- -tile.engineersdecor.small_lab_furnace.name=Small laboratory furnace +tile.engineersdecor.small_lab_furnace.name=Small Laboratory Furnace tile.engineersdecor.small_lab_furnace.help=§6Small metal cased lab kiln.§r Solid fuel consuming, updraught. \ Slightly hotter and better isolated than a cobblestone furnace, therefore more efficient. \ Two auxiliary slots e.g. for storage. Two stack internal hopper fifos for input, output, \ and fuel. Place an external heater into a aux slot and connect power for electrical \ smelting speed boost. -tile.engineersdecor.small_electrical_furnace.name=Small electrical furnace +tile.engineersdecor.small_electrical_furnace.name=Small Electrical Furnace tile.engineersdecor.small_electrical_furnace.help=§6Small metal cased pass-through furnace.§r \ Automatically draws items from the input side and puts items into the inventory at the output side. \ Items can be inserted or drawn from all sides using hoppers. Implicitly bypasses items that cannot be \ smelted or cooked to the output. Slightly more energy efficient and faster than a heated cobblestone \ furnace. Fifos and feeders transfer whole stacks. Feeders require a bit of power. -tile.engineersdecor.small_waste_incinerator.name=Small waste incinerator +tile.engineersdecor.small_waste_incinerator.name=Small Waste Incinerator tile.engineersdecor.small_waste_incinerator.help=§6Trash with internal fifo slots.§r Items can be inserted on all sides, and are kept until \ there is no space left in the fifo. After that the oldest stack will be incinerated. Apply \ electrical RF/FE power to increase the processing speed. Keeps its inventory when being \ relocated. #----------------------------------------------------------------------------------------------------------- -tile.engineersdecor.straight_pipe_valve.name=Fluid pipe check valve +tile.engineersdecor.straight_pipe_valve.name=Fluid Pipe Check Valve tile.engineersdecor.straight_pipe_valve.help=§6Straight fluid pipe fragment.§r Conducts fluids only in one direction. \ Does not connect to the sides. Reduces flow rate. Sneak to place in reverse direction. -tile.engineersdecor.straight_pipe_valve_redstone.name=Redstone controlled fluid valve +tile.engineersdecor.straight_pipe_valve_redstone.name=Redstone Controlled Fluid Valve tile.engineersdecor.straight_pipe_valve_redstone.help=§6Straight fluid pipe fragment.§r Conducts fluids only in one direction. \ Does not connect to the sides. Sneak to place in reverse direction. \ Blocks if not redstone powered. -tile.engineersdecor.straight_pipe_valve_redstone_analog.name=Redstone analog fluid valve +tile.engineersdecor.straight_pipe_valve_redstone_analog.name=Redstone Analog Fluid Valve tile.engineersdecor.straight_pipe_valve_redstone_analog.help=§6Straight fluid pipe fragment.§r Conducts fluids only in one direction. \ Does not connect to the sides. Sneak to place in reverse direction. \ Blocks if not redstone powered, reduces the flow rate linear from power 1 to 14, \ opens to maximum possible valve flow rate for power 15. -tile.engineersdecor.passive_fluid_accumulator.name=Passive fluid accumulator +tile.engineersdecor.passive_fluid_accumulator.name=Passive Fluid Accumulator tile.engineersdecor.passive_fluid_accumulator.help=§6Vacuum suction based fluid collector.§r Has one output, all other sides are input. \ Drains fluids from adjacent tanks when being drained from the output port by a pump. #----------------------------------------------------------------------------------------------------------- -tile.engineersdecor.sign_decor.name=Sign plate (Engineer's decor) +tile.engineersdecor.factory_dropper.name=Factory Dropper +tile.engineersdecor.factory_dropper.help=§6Dropper suitable for advanced factory automation.§r +#----------------------------------------------------------------------------------------------------------- +tile.engineersdecor.sign_decor.name=Sign Plate (Engineer's decor) tile.engineersdecor.sign_decor.help=§6This should not be craftable or visible in JEI. Used for creative tab and screenshots. -tile.engineersdecor.sign_hotwire.name=Sign "Caution hot wire" +tile.engineersdecor.sign_hotwire.name=Sign "Caution Hot Wire" tile.engineersdecor.sign_hotwire.help=§6Placable on walls (horizontally). -tile.engineersdecor.sign_mindstep.name=Sign "Mind the step" +tile.engineersdecor.sign_mindstep.name=Sign "Mind The Step" tile.engineersdecor.sign_mindstep.help=§6Placable on walls (horizontally). -tile.engineersdecor.sign_danger.name=Sign "Caution really dangerous there" +tile.engineersdecor.sign_danger.name=Sign "Caution Really dangerous there" tile.engineersdecor.sign_danger.help=§6Placable on walls (horizontally). #----------------------------------------------------------------------------------------------------------- diff --git a/1.12/src/main/resources/assets/engineersdecor/lang/ru_ru.lang b/1.12/src/main/resources/assets/engineersdecor/lang/ru_ru.lang index d22c576..31253b9 100644 --- a/1.12/src/main/resources/assets/engineersdecor/lang/ru_ru.lang +++ b/1.12/src/main/resources/assets/engineersdecor/lang/ru_ru.lang @@ -114,6 +114,9 @@ tile.engineersdecor.passive_fluid_accumulator.name=Passive fluid accumulator #tile.engineersdecor.passive_fluid_accumulator.help=§6Vacuum suction based fluid collector.§r Has one output, all other sides are input. \ Drains fluids from adjacent tanks when being drained from the output port by a pump. #----------------------------------------------------------------------------------------------------------- +tile.engineersdecor.factory_dropper.name=Factory dropper +#tile.engineersdecor.factory_dropper.help=§6Dropper suitable for advanced factory automation.§r +#----------------------------------------------------------------------------------------------------------- tile.engineersdecor.sign_decor.name=Sign plate (Engineer's decor logo) #tile.engineersdecor.sign_decor.help=§6This should not be craftable or visible in JEI. Used for creative tab and screenshots. tile.engineersdecor.sign_hotwire.name=Sign "Caution hot wire" diff --git a/1.12/src/main/resources/assets/engineersdecor/models/block/device/factory_dropper_model.json b/1.12/src/main/resources/assets/engineersdecor/models/block/device/factory_dropper_model.json new file mode 100644 index 0000000..f505044 --- /dev/null +++ b/1.12/src/main/resources/assets/engineersdecor/models/block/device/factory_dropper_model.json @@ -0,0 +1,108 @@ +{ + "parent": "block/cube", + "textures": { + "shutter": "engineersdecor:blocks/device/factory_dropper_shutter", + "top": "engineersdecor:blocks/device/factory_dropper_top", + "bottom": "engineersdecor:blocks/device/factory_dropper_bottom", + "side": "engineersdecor:blocks/device/factory_dropper_side", + "particle": "engineersdecor:blocks/device/factory_dropper_side" + }, + "elements": [ + { + "from": [0, 0, 3], + "to": [16, 16, 16], + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#bottom"}, + "east": {"uv": [3, 0, 16, 16], "rotation": 180, "texture": "#side"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#top"}, + "west": {"uv": [3, 0, 16, 16], "texture": "#side"}, + "up": {"uv": [3, 0, 16, 16], "rotation": 90, "texture": "#side"}, + "down": {"uv": [3, 0, 16, 16], "rotation": 270, "texture": "#side"} + } + }, + { + "from": [12, 0, 1], + "to": [16, 16, 3], + "faces": { + "north": {"uv": [0, 0, 4, 16], "texture": "#bottom"}, + "east": {"uv": [1, 0, 3, 16], "rotation": 180, "texture": "#side"}, + "south": {"uv": [12, 0, 16, 16], "texture": "#top"}, + "west": {"uv": [1, 0, 3, 16], "texture": "#side"}, + "up": {"uv": [1, 12, 3, 16], "rotation": 90, "texture": "#side"}, + "down": {"uv": [1, 12, 3, 16], "rotation": 270, "texture": "#side"} + } + }, + { + "from": [0, 0, 1], + "to": [4, 16, 3], + "faces": { + "north": {"uv": [12, 0, 16, 16], "texture": "#bottom"}, + "east": {"uv": [13, 0, 15, 16], "texture": "#side"}, + "south": {"uv": [0, 0, 4, 16], "texture": "#top"}, + "west": {"uv": [1, 0, 3, 16], "texture": "#side"}, + "up": {"uv": [1, 0, 3, 4], "rotation": 90, "texture": "#side"}, + "down": {"uv": [1, 12, 3, 16], "rotation": 270, "texture": "#side"} + } + }, + { + "from": [4, 12, 1], + "to": [12, 16, 3], + "faces": { + "north": {"uv": [4, 0, 12, 4], "texture": "#bottom"}, + "east": {"uv": [13, 0, 15, 4], "texture": "#side"}, + "south": {"uv": [4, 0, 12, 4], "texture": "#top"}, + "west": {"uv": [1, 0, 3, 4], "texture": "#side"}, + "up": {"uv": [1, 4, 3, 12], "rotation": 90, "texture": "#side"}, + "down": {"uv": [4, 13, 12, 15], "texture": "#side"} + } + }, + { + "from": [4, 0, 1], + "to": [12, 4, 3], + "faces": { + "north": {"uv": [4, 12, 12, 16], "texture": "#bottom"}, + "east": {"uv": [13, 12, 15, 16], "texture": "#side"}, + "south": {"uv": [4, 12, 12, 16], "texture": "#top"}, + "west": {"uv": [1, 12, 3, 16], "texture": "#side"}, + "up": {"uv": [4, 1, 12, 3], "texture": "#side"}, + "down": {"uv": [1, 4, 3, 12], "rotation": 270, "texture": "#side"} + } + }, + { + "from": [4, 4, 2], + "to": [8, 12, 3], + "faces": { + "north": {"uv": [8, 4, 12, 12], "texture": "#shutter"}, + "east": {"uv": [13, 4, 14, 12], "texture": "#shutter"}, + "south": {"uv": [4, 4, 8, 12], "texture": "#shutter"}, + "west": {"uv": [2, 4, 3, 12], "texture": "#shutter"}, + "up": {"uv": [4, 2, 8, 3], "texture": "#shutter"}, + "down": {"uv": [4, 13, 8, 14], "texture": "#shutter"} + } + }, + { + "from": [8.25, 4, 2], + "to": [12, 12, 3], + "faces": { + "north": {"uv": [4, 4, 7.75, 12], "texture": "#shutter"}, + "east": {"uv": [13, 4, 14, 12], "texture": "#shutter"}, + "south": {"uv": [8.25, 4, 12, 12], "texture": "#shutter"}, + "west": {"uv": [2, 4, 3, 12], "texture": "#shutter"}, + "up": {"uv": [8.25, 2, 12, 3], "texture": "#shutter"}, + "down": {"uv": [8.25, 13, 12, 14], "texture": "#shutter"} + } + } + ], + "display": { + "ground": { + "scale": [0.2, 0.2, 0.2] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + } +} \ No newline at end of file diff --git a/1.12/src/main/resources/assets/engineersdecor/models/block/device/factory_dropper_model_open.json b/1.12/src/main/resources/assets/engineersdecor/models/block/device/factory_dropper_model_open.json new file mode 100644 index 0000000..94672c1 --- /dev/null +++ b/1.12/src/main/resources/assets/engineersdecor/models/block/device/factory_dropper_model_open.json @@ -0,0 +1,108 @@ +{ + "parent": "block/cube", + "textures": { + "shutter": "engineersdecor:blocks/device/factory_dropper_shutter", + "top": "engineersdecor:blocks/device/factory_dropper_top", + "bottom": "engineersdecor:blocks/device/factory_dropper_bottom", + "side": "engineersdecor:blocks/device/factory_dropper_side", + "particle": "engineersdecor:blocks/device/factory_dropper_side" + }, + "elements": [ + { + "from": [0, 0, 3], + "to": [16, 16, 16], + "faces": { + "north": {"uv": [0, 0, 16, 16], "texture": "#bottom"}, + "east": {"uv": [3, 0, 16, 16], "rotation": 180, "texture": "#side"}, + "south": {"uv": [0, 0, 16, 16], "texture": "#top"}, + "west": {"uv": [3, 0, 16, 16], "texture": "#side"}, + "up": {"uv": [3, 0, 16, 16], "rotation": 90, "texture": "#side"}, + "down": {"uv": [3, 0, 16, 16], "rotation": 270, "texture": "#side"} + } + }, + { + "from": [12, 0, 1], + "to": [16, 16, 3], + "faces": { + "north": {"uv": [0, 0, 4, 16], "texture": "#bottom"}, + "east": {"uv": [1, 0, 3, 16], "rotation": 180, "texture": "#side"}, + "south": {"uv": [12, 0, 16, 16], "texture": "#top"}, + "west": {"uv": [1, 0, 3, 16], "texture": "#side"}, + "up": {"uv": [1, 0, 3, 4], "rotation": 90, "texture": "#side"}, + "down": {"uv": [1, 12, 3, 16], "rotation": 270, "texture": "#side"} + } + }, + { + "from": [0, 0, 1], + "to": [4, 16, 3], + "faces": { + "north": {"uv": [12, 0, 16, 16], "texture": "#bottom"}, + "east": {"uv": [13, 0, 15, 16], "texture": "#side"}, + "south": {"uv": [0, 0, 4, 16], "texture": "#top"}, + "west": {"uv": [1, 0, 3, 16], "texture": "#side"}, + "up": {"uv": [1, 12, 3, 16], "rotation": 90, "texture": "#side"}, + "down": {"uv": [1, 0, 3, 4], "rotation": 270, "texture": "#side"} + } + }, + { + "from": [4, 12, 1], + "to": [12, 16, 3], + "faces": { + "north": {"uv": [4, 0, 12, 4], "texture": "#bottom"}, + "east": {"uv": [13, 0, 15, 4], "texture": "#side"}, + "south": {"uv": [4, 0, 12, 4], "texture": "#top"}, + "west": {"uv": [1, 0, 3, 4], "texture": "#side"}, + "up": {"uv": [1, 4, 3, 12], "rotation": 90, "texture": "#side"}, + "down": {"uv": [4, 13, 12, 15], "texture": "#side"} + } + }, + { + "from": [4, 0, 1], + "to": [12, 4, 3], + "faces": { + "north": {"uv": [4, 12, 12, 16], "texture": "#bottom"}, + "east": {"uv": [13, 12, 15, 16], "texture": "#side"}, + "south": {"uv": [4, 12, 12, 16], "texture": "#top"}, + "west": {"uv": [1, 12, 3, 16], "texture": "#side"}, + "up": {"uv": [4, 1, 12, 3], "texture": "#side"}, + "down": {"uv": [1, 4, 3, 12], "rotation": 270, "texture": "#side"} + } + }, + { + "from": [4, 4, 0], + "to": [5, 12, 3], + "faces": { + "north": {"uv": [11, 4, 12, 12], "texture": "#shutter"}, + "east": {"uv": [13, 4, 16, 12], "texture": "#shutter"}, + "south": {"uv": [4, 4, 5, 12], "texture": "#shutter"}, + "west": {"uv": [0, 4, 3, 12], "texture": "#shutter"}, + "up": {"uv": [4, 0, 5, 3], "texture": "#shutter"}, + "down": {"uv": [4, 13, 5, 16], "texture": "#shutter"} + } + }, + { + "from": [11, 4, 0], + "to": [12, 12, 3], + "faces": { + "north": {"uv": [4, 4, 5, 12], "texture": "#shutter"}, + "east": {"uv": [13, 4, 16, 12], "texture": "#shutter"}, + "south": {"uv": [11, 4, 12, 12], "texture": "#shutter"}, + "west": {"uv": [0, 4, 3, 12], "texture": "#shutter"}, + "up": {"uv": [11, 0, 12, 3], "texture": "#shutter"}, + "down": {"uv": [11, 13, 12, 16], "texture": "#shutter"} + } + } + ], + "display": { + "ground": { + "scale": [0.2, 0.2, 0.2] + }, + "gui": { + "rotation": [30, 225, 0], + "scale": [0.625, 0.625, 0.625] + }, + "fixed": { + "scale": [0.5, 0.5, 0.5] + } + } +} \ No newline at end of file diff --git a/1.12/src/main/resources/assets/engineersdecor/recipes/_constants.json b/1.12/src/main/resources/assets/engineersdecor/recipes/_constants.json index b3294bb..17f17d3 100644 --- a/1.12/src/main/resources/assets/engineersdecor/recipes/_constants.json +++ b/1.12/src/main/resources/assets/engineersdecor/recipes/_constants.json @@ -225,6 +225,10 @@ "ingredient": { "item": "minecraft:furnace", "data": 0 }, "name": "itemFurnace" }, + { + "ingredient": { "item": "minecraft:dropper", "data": 0 }, + "name": "itemDropper" + }, { "ingredient": { "item": "minecraft:paper", "data": 0 }, "name": "paperAny" diff --git a/1.12/src/main/resources/assets/engineersdecor/recipes/factory_dropper_recipe.json b/1.12/src/main/resources/assets/engineersdecor/recipes/factory_dropper_recipe.json new file mode 100644 index 0000000..c298249 --- /dev/null +++ b/1.12/src/main/resources/assets/engineersdecor/recipes/factory_dropper_recipe.json @@ -0,0 +1,33 @@ +{ + "conditions": [ + { + "type": "engineersdecor:grc", + "result": "engineersdecor:factory_dropper", + "required": ["immersiveengineering:material"] + } + ], + "type": "minecraft:crafting_shaped", + "pattern": [ + "WWW", + "WDW", + "WPW" + ], + "key": { + "D": { + "item": "#itemDropper", + "data": 0 + }, + "P": { + "item": "#plateIron", + "data": 0 + }, + "W": { + "item": "#plankTreatedWood", + "data": 0 + } + }, + "result": { + "item": "engineersdecor:factory_dropper", + "count": 1 + } +} diff --git a/1.12/src/main/resources/assets/engineersdecor/textures/blocks/device/factory_dropper_bottom.png b/1.12/src/main/resources/assets/engineersdecor/textures/blocks/device/factory_dropper_bottom.png new file mode 100644 index 0000000..25a96ba Binary files /dev/null and b/1.12/src/main/resources/assets/engineersdecor/textures/blocks/device/factory_dropper_bottom.png differ diff --git a/1.12/src/main/resources/assets/engineersdecor/textures/blocks/device/factory_dropper_shutter.png b/1.12/src/main/resources/assets/engineersdecor/textures/blocks/device/factory_dropper_shutter.png new file mode 100644 index 0000000..077e043 Binary files /dev/null and b/1.12/src/main/resources/assets/engineersdecor/textures/blocks/device/factory_dropper_shutter.png differ diff --git a/1.12/src/main/resources/assets/engineersdecor/textures/blocks/device/factory_dropper_side.png b/1.12/src/main/resources/assets/engineersdecor/textures/blocks/device/factory_dropper_side.png new file mode 100644 index 0000000..96b02bc Binary files /dev/null and b/1.12/src/main/resources/assets/engineersdecor/textures/blocks/device/factory_dropper_side.png differ diff --git a/1.12/src/main/resources/assets/engineersdecor/textures/blocks/device/factory_dropper_top.png b/1.12/src/main/resources/assets/engineersdecor/textures/blocks/device/factory_dropper_top.png new file mode 100644 index 0000000..5606d7e Binary files /dev/null and b/1.12/src/main/resources/assets/engineersdecor/textures/blocks/device/factory_dropper_top.png differ diff --git a/1.12/src/main/resources/assets/engineersdecor/textures/gui/factory_dropper_gui.png b/1.12/src/main/resources/assets/engineersdecor/textures/gui/factory_dropper_gui.png new file mode 100644 index 0000000..7486813 Binary files /dev/null and b/1.12/src/main/resources/assets/engineersdecor/textures/gui/factory_dropper_gui.png differ diff --git a/meta/update.json b/meta/update.json index d0ea261..dad7cae 100644 --- a/meta/update.json +++ b/meta/update.json @@ -1,6 +1,8 @@ { "homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/", "1.12.2": { + "1.0.6": "[R] Release based on v1.0.6-b1. Release-to-release changes: * Fixed FML remapping issue (COULD CAUSE CRASHES). * Small waste incinerator added. * Lang files updated/corrections. * Metal ladder easier to break.\n[A] Added factory dropper (config:experimental).\n[C] Thx to abdurraslan for the detailed issue #25.", + "1.0.6-b1": "[A] Added small waste incinerator (delayed fifo-buffered item disposal).\n[M] Fixed item/block name capitalization (by Voxelo).\n[M] Metal ladders are easier to break/harvest.\n[F] Fixed FML remapping issue by using dedicated IItemHandler instances.", "1.0.5": "[R] Release based on v1.0.5-b1. Release-to-release changes: * Small electrical passthrough-furnace added. * Passive fluid accumulator added. * Config options added. * Sign plates added. * Minor bug fixes.\n[A] Added sign \"Electrical hazzard\"/\"Caution hot wire\".\n[A] Added sign \"Caution dangerous there\" (skull/bones).", "1.0.5-b1": "[A] Added passive fluid accumulator.\n[A] Added small electrical passthrough-furnace.\n[F] Fixed version check URL.\n[M] Opt-out config options for valves, passive fluid accumulator, and furni.", "1.0.4": "[R] Release based on v1.0.4-b9. Release-to-release changes: * Crafting table: Quick crafting history re-fab, JEI integration. * Rendering improvements and issue fixes (stairs, ambient occlusion, optifine, etc). * Walls with texture variations. * Thin/thick steel poles with support feet/heads. * Horizontal steel double-T support beams added. * Fluid pipe valves added: Check valve, redstone controlled valve, analog redstone controlled valve. Support pressurized transfer. * Tool tip documentation (CTRL-SHIFT) for stairs added. * Internal code cleanups. * Recipes tuned.\n[E] Added pass-through electrical furnace (experimental, see config).", @@ -44,8 +46,8 @@ "1.0.0-a1": "[A] Initial port to 1.13.2 with Forge beta." }, "promos": { - "1.12.2-recommended": "1.0.5", - "1.12.2-latest": "1.0.5", + "1.12.2-recommended": "1.0.6", + "1.12.2-latest": "1.0.6", "1.13.2-recommended": "", "1.13.2-latest": "1.0.4-b3" }