From b4fde39a3390ae222ea90998c8da08ca8760e75b Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 8 May 2016 21:09:58 +0200 Subject: [PATCH] Item Phantom Networks, part 1 --- .../mod/blocks/BlockItemViewer.java | 31 + .../mod/blocks/BlockLaserRelay.java | 7 +- .../mod/blocks/InitBlocks.java | 6 +- .../mod/creative/CreativeTab.java | 2 + .../mod/inventory/ContainerDrill.java | 2 +- .../mod/items/ItemLaserWrench.java | 3 +- .../mod/misc/LaserRelayConnectionHandler.java | 40 - .../mod/tile/TileEntityBase.java | 4 +- .../mod/tile/TileEntityInventoryBase.java | 18 +- .../mod/tile/TileEntityItemViewer.java | 163 ++++ .../mod/tile/TileEntityLaserRelay.java | 147 ++- .../mod/tile/TileEntityPhantomItemface.java | 5 - .../blockstates/blockLaserRelayItem.json | 19 + .../assets/actuallyadditions/lang/en_US.lang | 4 +- .../models/block/blockLaserRelayItem.json | 880 ++++++++++++++++++ .../blocks/models/modelLaserRelayItem.png | Bin 0 -> 279 bytes 16 files changed, 1240 insertions(+), 91 deletions(-) create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewer.java create mode 100644 src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java create mode 100644 src/main/resources/assets/actuallyadditions/blockstates/blockLaserRelayItem.json create mode 100644 src/main/resources/assets/actuallyadditions/models/block/blockLaserRelayItem.json create mode 100644 src/main/resources/assets/actuallyadditions/textures/blocks/models/modelLaserRelayItem.png diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewer.java new file mode 100644 index 000000000..139007ade --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockItemViewer.java @@ -0,0 +1,31 @@ +package de.ellpeck.actuallyadditions.mod.blocks; + +import de.ellpeck.actuallyadditions.mod.blocks.base.BlockContainerBase; +import de.ellpeck.actuallyadditions.mod.tile.TileEntityItemViewer; +import net.minecraft.block.SoundType; +import net.minecraft.block.material.Material; +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class BlockItemViewer extends BlockContainerBase{ + + public BlockItemViewer(String name){ + super(Material.ROCK, name); + this.setHarvestLevel("pickaxe", 0); + this.setHardness(1.5F); + this.setResistance(10.0F); + this.setSoundType(SoundType.STONE); + } + + @Override + public TileEntity createNewTileEntity(World worldIn, int meta){ + return new TileEntityItemViewer(); + } + + @Override + public EnumRarity getRarity(ItemStack stack){ + return EnumRarity.RARE; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java index 09737b255..579bb611b 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/BlockLaserRelay.java @@ -27,13 +27,16 @@ import net.minecraft.world.World; public class BlockLaserRelay extends BlockContainerBase{ private static final PropertyInteger META = PropertyInteger.create("meta", 0, 5); + private boolean isItem; - public BlockLaserRelay(String name){ + public BlockLaserRelay(String name, boolean isItem){ super(Material.ROCK, name); this.setHarvestLevel("pickaxe", 0); this.setHardness(1.5F); this.setResistance(10.0F); this.setSoundType(SoundType.STONE); + + this.isItem = isItem; } @Override @@ -63,6 +66,6 @@ public class BlockLaserRelay extends BlockContainerBase{ @Override public TileEntity createNewTileEntity(World world, int i){ - return new TileEntityLaserRelay(); + return this.isItem ? new TileEntityLaserRelay.TileEntityLaserRelayItem() : new TileEntityLaserRelay.TileEntityLaserRelayEnergy(); } } \ No newline at end of file diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java index caa146106..60fd1d39e 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/blocks/InitBlocks.java @@ -92,6 +92,8 @@ public class InitBlocks{ public static Block blockRangedCollector; public static Block blockLaserRelay; + public static Block blockLaserRelayItem; + public static Block blockItemViewer; public static Block blockBlackLotus; public static Block blockCrystal; @@ -114,12 +116,14 @@ public class InitBlocks{ public static void init(){ ModUtil.LOGGER.info("Initializing Blocks..."); + blockItemViewer = new BlockItemViewer("blockItemViewer"); blockFireworkBox = new BlockFireworkBox("blockFireworkBox"); blockMiner = new BlockMiner("blockMiner"); blockAtomicReconstructor = new BlockAtomicReconstructor("blockAtomicReconstructor"); blockCrystal = new BlockCrystal("blockCrystal"); blockBlackLotus = new BlockBlackLotus("blockBlackLotus"); - blockLaserRelay = new BlockLaserRelay("blockLaserRelay"); + blockLaserRelay = new BlockLaserRelay("blockLaserRelay", false); + blockLaserRelayItem = new BlockLaserRelay("blockLaserRelayItem", true); blockRangedCollector = new BlockRangedCollector("blockRangedCollector"); blockDirectionalBreaker = new BlockDirectionalBreaker("blockDirectionalBreaker"); blockLeafGenerator = new BlockLeafGenerator("blockLeafGenerator"); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java b/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java index cd9153477..32578b166 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/creative/CreativeTab.java @@ -55,6 +55,8 @@ public class CreativeTab extends CreativeTabs{ this.add(InitBlocks.blockFireworkBox); this.add(InitBlocks.blockLaserRelay); + this.add(InitBlocks.blockLaserRelayItem); + this.add(InitBlocks.blockItemViewer); this.add(InitBlocks.blockAtomicReconstructor); this.add(InitBlocks.blockPhantomface); this.add(InitBlocks.blockPhantomEnergyface); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java index a9277b1e2..a34c2e0a6 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/ContainerDrill.java @@ -244,7 +244,7 @@ public class ContainerDrill extends Container{ } else{ stackAt = this.slots[i].splitStack(j); - if(this.slots[i].stackSize == 0){ + if(this.slots[i].stackSize <= 0){ this.slots[i] = null; } this.markDirty(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java index 743afdce1..2e723e48d 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/items/ItemLaserWrench.java @@ -50,7 +50,8 @@ public class ItemLaserWrench extends ItemBase{ } else{ BlockPos savedPos = ItemPhantomConnector.getStoredPosition(stack); - if(ItemPhantomConnector.getStoredWorld(stack) == world && world.getTileEntity(savedPos) instanceof TileEntityLaserRelay && LaserRelayConnectionHandler.getInstance().addConnection(savedPos, pos)){ + TileEntity savedTile = world.getTileEntity(savedPos); + if(ItemPhantomConnector.getStoredWorld(stack) == world && savedTile instanceof TileEntityLaserRelay && ((TileEntityLaserRelay)savedTile).isItem == ((TileEntityLaserRelay)tile).isItem && LaserRelayConnectionHandler.getInstance().addConnection(savedPos, pos)){ ItemPhantomConnector.clearStorage(stack); ((TileEntityLaserRelay)world.getTileEntity(savedPos)).sendUpdate(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java index 565dd461d..6b6441e23 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/misc/LaserRelayConnectionHandler.java @@ -161,46 +161,6 @@ public class LaserRelayConnectionHandler{ //System.out.println("Merged Two Networks!"); } - public int transferEnergyToReceiverInNeed(World world, BlockPos energyGottenFrom, Network network, int maxTransfer, boolean simulate){ - int transmitted = 0; - //Go through all of the connections in the network - for(ConnectionPair pair : network.connections){ - BlockPos[] relays = new BlockPos[]{pair.firstRelay, pair.secondRelay}; - //Go through both relays in the connection - for(BlockPos relay : relays){ - if(relay != null){ - //Get every side of the relay - for(int i = 0; i <= 5; i++){ - EnumFacing side = WorldUtil.getDirectionBySidesInOrder(i); - //Get the Position at the side - BlockPos pos = WorldUtil.getCoordsFromSide(side, relay, 0); - if(!PosUtil.areSamePos(pos, energyGottenFrom)){ - TileEntity tile = world.getTileEntity(pos); - if(tile instanceof IEnergyReceiver && !(tile instanceof TileEntityLaserRelay)){ - IEnergyReceiver receiver = (IEnergyReceiver)tile; - if(receiver.canConnectEnergy(side.getOpposite())){ - //Transfer the energy (with the energy loss!) - int theoreticalReceived = ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), maxTransfer-transmitted, true); - //The amount of energy lost during a transfer - int deduct = (int)(theoreticalReceived*((double)ConfigIntValues.LASER_RELAY_LOSS.getValue()/100)); - - transmitted += ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), theoreticalReceived-deduct, simulate); - transmitted += deduct; - - //If everything that could be transmitted was transmitted - if(transmitted >= maxTransfer){ - return transmitted; - } - } - } - } - } - } - } - } - return transmitted; - } - public static class ConnectionPair{ public BlockPos firstRelay; diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java index 5cbaa5750..7273cf793 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java @@ -78,11 +78,13 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ GameRegistry.registerTileEntity(TileEntityLeafGenerator.class, ModUtil.MOD_ID+":tileEntityLeafGenerator"); GameRegistry.registerTileEntity(TileEntityDirectionalBreaker.class, ModUtil.MOD_ID+":tileEntityDirectionalBreaker"); GameRegistry.registerTileEntity(TileEntityRangedCollector.class, ModUtil.MOD_ID+":tileEntityRangedCollector"); - GameRegistry.registerTileEntity(TileEntityLaserRelay.class, ModUtil.MOD_ID+":tileEntityLaserRelay"); GameRegistry.registerTileEntity(TileEntityAtomicReconstructor.class, ModUtil.MOD_ID+":tileEntityAtomicReconstructor"); GameRegistry.registerTileEntity(TileEntityMiner.class, ModUtil.MOD_ID+":tileEntityMiner"); GameRegistry.registerTileEntity(TileEntityFireworkBox.class, ModUtil.MOD_ID+":tileEntityFireworkBox"); GameRegistry.registerTileEntity(TileEntityPhantomRedstoneface.class, ModUtil.MOD_ID+":tileEntityPhantomRedstoneface"); + GameRegistry.registerTileEntity(TileEntityLaserRelay.TileEntityLaserRelayItem.class, ModUtil.MOD_ID+":tileEntityLaserRelayItem"); + GameRegistry.registerTileEntity(TileEntityLaserRelay.TileEntityLaserRelayEnergy.class, ModUtil.MOD_ID+":tileEntityLaserRelay"); + GameRegistry.registerTileEntity(TileEntityItemViewer.class, ModUtil.MOD_ID+":tileItemViewer"); } @Override diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java index bd3b368f3..73a6056a2 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityInventoryBase.java @@ -33,8 +33,10 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements this.initializeSlots(slots); - for(int i = 0; i < this.invWrappers.length; i++){ - this.invWrappers[i] = new SidedInvWrapper(this, EnumFacing.values()[i]); + if(this.hasInvWrapperCapabilities()){ + for(int i = 0; i < this.invWrappers.length; i++){ + this.invWrappers[i] = new SidedInvWrapper(this, EnumFacing.values()[i]); + } } } @@ -82,15 +84,11 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements } } - @Override - public void updateEntity(){ - super.updateEntity(); - } - @Override public int[] getSlotsForFace(EnumFacing side){ - if(this.slots.length > 0){ - int[] theInt = new int[this.slots.length]; + int invSize = this.getSizeInventory(); + if(invSize > 0){ + int[] theInt = new int[invSize]; for(int i = 0; i < theInt.length; i++){ theInt[i] = i; } @@ -177,7 +175,7 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements } else{ stackAt = this.slots[i].splitStack(j); - if(this.slots[i].stackSize == 0){ + if(this.slots[i].stackSize <= 0){ this.slots[i] = null; } this.markDirty(); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java new file mode 100644 index 000000000..da5186ba4 --- /dev/null +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityItemViewer.java @@ -0,0 +1,163 @@ +package de.ellpeck.actuallyadditions.mod.tile; + +import de.ellpeck.actuallyadditions.mod.misc.LaserRelayConnectionHandler; +import de.ellpeck.actuallyadditions.mod.util.WorldUtil; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.EnumFacing; +import net.minecraft.util.math.BlockPos; +import net.minecraftforge.items.IItemHandler; +import org.apache.commons.lang3.tuple.Pair; + +import java.util.List; + +public class TileEntityItemViewer extends TileEntityInventoryBase{ + + public TileEntityItemViewer(){ + super(0, "itemViewer"); + } + + private List getItemHandlers(){ + TileEntityLaserRelay.TileEntityLaserRelayItem relay = this.getConnectedRelay(); + if(relay != null){ + LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getInstance().getNetworkFor(relay.getPos()); + if(network != null){ + return relay.getItemHandlersInNetwork(network); + } + } + return null; + } + + private Pair getSwitchedIndexHandler(int i){ + List handlers = this.getItemHandlers(); + int currentI = 0; + if(handlers != null && !handlers.isEmpty()){ + for(IItemHandler handler : handlers){ + int slotAmount = handler.getSlots(); + if(currentI+slotAmount > i){ + return Pair.of(handler, i-currentI); + } + else{ + currentI += slotAmount; + } + } + } + return null; + } + + private TileEntityLaserRelay.TileEntityLaserRelayItem getConnectedRelay(){ + TileEntityLaserRelay.TileEntityLaserRelayItem tileFound = null; + if(this.worldObj != null){ //Why is that even possible..? + for(int i = 0; i <= 5; i++){ + EnumFacing side = WorldUtil.getDirectionBySidesInOrder(i); + BlockPos pos = WorldUtil.getCoordsFromSide(side, this.getPos(), 0); + TileEntity tile = this.worldObj.getTileEntity(pos); + + if(tile instanceof TileEntityLaserRelay.TileEntityLaserRelayItem){ + if(tileFound != null){ + return null; + } + else{ + tileFound = (TileEntityLaserRelay.TileEntityLaserRelayItem)tile; + } + } + } + } + return tileFound; + } + + @Override + public boolean canInsertItem(int index, ItemStack stack, EnumFacing direction){ + return this.isItemValidForSlot(index, stack); + } + + @Override + public boolean canExtractItem(int index, ItemStack stack, EnumFacing direction){ + Pair handler = this.getSwitchedIndexHandler(index); + if(handler != null){ + if(ItemStack.areItemsEqual(handler.getKey().getStackInSlot(handler.getValue()), stack)){ + ItemStack gaveBack = handler.getKey().extractItem(handler.getValue(), stack.stackSize, true); + return gaveBack != null; + } + } + return false; + } + + @Override + public boolean isItemValidForSlot(int index, ItemStack stack){ + Pair handler = this.getSwitchedIndexHandler(index); + if(handler != null){ + ItemStack gaveBack = handler.getKey().insertItem(handler.getValue(), stack, true); + return !ItemStack.areItemStacksEqual(gaveBack, stack); + } + return false; + } + + @Override + public void clear(){ + for(int i = 0; i < this.getSizeInventory(); i++){ + this.removeStackFromSlot(i); + } + } + + @Override + public void setInventorySlotContents(int i, ItemStack stack){ + if(stack != null){ + Pair handler = this.getSwitchedIndexHandler(i); + if(handler != null){ + ItemStack toInsert = stack.copy(); + ItemStack inSlot = handler.getKey().getStackInSlot(handler.getValue()); + if(inSlot != null){ + toInsert.stackSize -= inSlot.stackSize; + } + handler.getKey().insertItem(handler.getValue(), toInsert, false); + } + } + else{ + this.removeStackFromSlot(i); + } + } + + @Override + public int getSizeInventory(){ + int size = 0; + List handlers = this.getItemHandlers(); + if(handlers != null){ + for(IItemHandler handler : handlers){ + size += handler.getSlots(); + } + } + return size; + } + + @Override + public ItemStack getStackInSlot(int i){ + Pair handler = this.getSwitchedIndexHandler(i); + if(handler != null){ + return handler.getKey().getStackInSlot(handler.getValue()); + } + return null; + } + + @Override + public ItemStack decrStackSize(int i, int j){ + Pair handler = this.getSwitchedIndexHandler(i); + if(handler != null){ + return handler.getKey().extractItem(handler.getValue(), j, false); + } + return null; + } + + @Override + public ItemStack removeStackFromSlot(int index){ + Pair handler = this.getSwitchedIndexHandler(index); + if(handler != null){ + ItemStack stackInSlot = handler.getKey().getStackInSlot(handler.getValue()); + if(stackInSlot != null){ + handler.getKey().extractItem(handler.getValue(), stackInSlot.stackSize, false); + } + return stackInSlot; + } + return null; + } +} diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java index d07fe7f0e..0f09451f0 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityLaserRelay.java @@ -21,18 +21,28 @@ import de.ellpeck.actuallyadditions.mod.util.WorldUtil; import io.netty.util.internal.ConcurrentSet; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import net.minecraftforge.items.CapabilityItemHandler; +import net.minecraftforge.items.IItemHandler; -public class TileEntityLaserRelay extends TileEntityBase implements IEnergyReceiver{ +import java.util.ArrayList; +import java.util.List; + +public abstract class TileEntityLaserRelay extends TileEntityBase{ public static final int MAX_DISTANCE = 15; private static final float[] COLOR = new float[]{1F, 0F, 0F}; + private static final float[] COLOR_ITEM = new float[]{139F/255F, 94F/255F, 1F}; - public TileEntityLaserRelay(){ - super("laserRelay"); + public boolean isItem; + + public TileEntityLaserRelay(String name, boolean isItem){ + super(name); + this.isItem = isItem; } @Override @@ -86,7 +96,7 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei if(network != null){ for(LaserRelayConnectionHandler.ConnectionPair aPair : network.connections){ if(aPair.contains(thisPos) && PosUtil.areSamePos(thisPos, aPair.firstRelay)){ - PacketParticle.renderParticlesFromAToB(aPair.firstRelay.getX(), aPair.firstRelay.getY(), aPair.firstRelay.getZ(), aPair.secondRelay.getX(), aPair.secondRelay.getY(), aPair.secondRelay.getZ(), ConfigValues.lessParticles ? 2 : Util.RANDOM.nextInt(6)+1, 0.6F, COLOR, 1F); + PacketParticle.renderParticlesFromAToB(aPair.firstRelay.getX(), aPair.firstRelay.getY(), aPair.firstRelay.getZ(), aPair.secondRelay.getX(), aPair.secondRelay.getY(), aPair.secondRelay.getZ(), ConfigValues.lessParticles ? 2 : Util.RANDOM.nextInt(6)+1, 0.6F, this.isItem ? COLOR_ITEM : COLOR, 1F); } } } @@ -99,34 +109,113 @@ public class TileEntityLaserRelay extends TileEntityBase implements IEnergyRecei LaserRelayConnectionHandler.getInstance().removeRelayFromNetwork(this.pos); } - @Override - public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ - return this.transmitEnergy(WorldUtil.getCoordsFromSide(from, this.pos, 0), maxReceive, simulate); - } + public static class TileEntityLaserRelayItem extends TileEntityLaserRelay{ - @Override - public int getEnergyStored(EnumFacing from){ - return 0; - } - - @Override - public int getMaxEnergyStored(EnumFacing from){ - return 0; - } - - public int transmitEnergy(BlockPos blockFrom, int maxTransmit, boolean simulate){ - int transmitted = 0; - if(maxTransmit > 0){ - LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getInstance().getNetworkFor(this.pos); - if(network != null){ - transmitted = LaserRelayConnectionHandler.getInstance().transferEnergyToReceiverInNeed(this.worldObj, blockFrom, network, Math.min(ConfigIntValues.LASER_RELAY_MAX_TRANSFER.getValue(), maxTransmit), simulate); - } + public TileEntityLaserRelayItem(){ + super("laserRelayItem", true); + } + + public List getItemHandlersInNetwork(LaserRelayConnectionHandler.Network network){ + List handlers = new ArrayList(); + for(LaserRelayConnectionHandler.ConnectionPair pair : network.connections){ + BlockPos[] relays = new BlockPos[]{pair.firstRelay, pair.secondRelay}; + for(BlockPos relay : relays){ + if(relay != null){ + for(int i = 0; i <= 5; i++){ + EnumFacing side = WorldUtil.getDirectionBySidesInOrder(i); + BlockPos pos = WorldUtil.getCoordsFromSide(side, relay, 0); + TileEntity tile = this.worldObj.getTileEntity(pos); + if(tile != null && !(tile instanceof TileEntityItemViewer)){ + IItemHandler handler = tile.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY, side.getOpposite()); + if(handler != null && !handlers.contains(handler)){ + handlers.add(handler); + } + } + } + } + } + } + return handlers; } - return transmitted; } - @Override - public boolean canConnectEnergy(EnumFacing from){ - return true; + public static class TileEntityLaserRelayEnergy extends TileEntityLaserRelay implements IEnergyReceiver{ + + public TileEntityLaserRelayEnergy(){ + super("laserRelay", false); + } + + @Override + public int receiveEnergy(EnumFacing from, int maxReceive, boolean simulate){ + return this.transmitEnergy(WorldUtil.getCoordsFromSide(from, this.pos, 0), maxReceive, simulate); + } + + @Override + public int getEnergyStored(EnumFacing from){ + return 0; + } + + @Override + public int getMaxEnergyStored(EnumFacing from){ + return 0; + } + + public int transmitEnergy(BlockPos blockFrom, int maxTransmit, boolean simulate){ + int transmitted = 0; + if(maxTransmit > 0){ + LaserRelayConnectionHandler.Network network = LaserRelayConnectionHandler.getInstance().getNetworkFor(this.pos); + if(network != null){ + transmitted = this.transferEnergyToReceiverInNeed(blockFrom, network, Math.min(ConfigIntValues.LASER_RELAY_MAX_TRANSFER.getValue(), maxTransmit), simulate); + } + } + return transmitted; + } + + @Override + public boolean canConnectEnergy(EnumFacing from){ + return true; + } + + private int transferEnergyToReceiverInNeed(BlockPos energyGottenFrom, LaserRelayConnectionHandler.Network network, int maxTransfer, boolean simulate){ + int transmitted = 0; + List alreadyChecked = new ArrayList(); + //Go through all of the connections in the network + for(LaserRelayConnectionHandler.ConnectionPair pair : network.connections){ + BlockPos[] relays = new BlockPos[]{pair.firstRelay, pair.secondRelay}; + //Go through both relays in the connection + for(BlockPos relay : relays){ + if(relay != null && !alreadyChecked.contains(relay)){ + alreadyChecked.add(relay); + //Get every side of the relay + for(int i = 0; i <= 5; i++){ + EnumFacing side = WorldUtil.getDirectionBySidesInOrder(i); + //Get the Position at the side + BlockPos pos = WorldUtil.getCoordsFromSide(side, relay, 0); + if(!PosUtil.areSamePos(pos, energyGottenFrom)){ + TileEntity tile = this.worldObj.getTileEntity(pos); + if(tile instanceof IEnergyReceiver && !(tile instanceof TileEntityLaserRelay)){ + IEnergyReceiver receiver = (IEnergyReceiver)tile; + if(receiver.canConnectEnergy(side.getOpposite())){ + //Transfer the energy (with the energy loss!) + int theoreticalReceived = ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), maxTransfer-transmitted, true); + //The amount of energy lost during a transfer + int deduct = (int)(theoreticalReceived*((double)ConfigIntValues.LASER_RELAY_LOSS.getValue()/100)); + + transmitted += ((IEnergyReceiver)tile).receiveEnergy(side.getOpposite(), theoreticalReceived-deduct, simulate); + transmitted += deduct; + + //If everything that could be transmitted was transmitted + if(transmitted >= maxTransfer){ + return transmitted; + } + } + } + } + } + } + } + } + return transmitted; + } } } diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java index 44b407a54..145c3378a 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityPhantomItemface.java @@ -85,11 +85,6 @@ public class TileEntityPhantomItemface extends TileEntityPhantomface{ return null; } - @Override - public String getName(){ - return this.name; - } - public ISidedInventory getSided(){ return this.getInventory() instanceof ISidedInventory ? (ISidedInventory)this.getInventory() : null; } diff --git a/src/main/resources/assets/actuallyadditions/blockstates/blockLaserRelayItem.json b/src/main/resources/assets/actuallyadditions/blockstates/blockLaserRelayItem.json new file mode 100644 index 000000000..122532146 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/blockstates/blockLaserRelayItem.json @@ -0,0 +1,19 @@ +{ + "forge_marker": 1, + "defaults": { + "model": "actuallyadditions:blockLaserRelayItem", + "transform": "forge:default-block" + }, + "variants": { + "normal": [{}], + "inventory": [{}], + "meta": { + "0": { "x": 180 }, + "1": {}, + "2": { "x": 90 }, + "3": { "x": 270 }, + "4": { "x": 90, "y": 270 }, + "5": { "x": 270, "y": 270 } + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/lang/en_US.lang b/src/main/resources/assets/actuallyadditions/lang/en_US.lang index 4b64811c4..cd42519c5 100644 --- a/src/main/resources/assets/actuallyadditions/lang/en_US.lang +++ b/src/main/resources/assets/actuallyadditions/lang/en_US.lang @@ -134,6 +134,8 @@ tile.actuallyadditions.blockChiseledQuartzSlab.name=Chiseled Black Quartz Slab tile.actuallyadditions.blockPillarQuartzWall.name=Black Quartz Pillar Wall tile.actuallyadditions.blockPillarQuartzStair.name=Black Quartz Pillar Stairs tile.actuallyadditions.blockPillarQuartzSlab.name=Black Quartz Pillar Slab +tile.actuallyadditions.blockLaserRelayItem.name=Item Laser Relay +tile.actuallyadditions.blockItemViewer.name=Item Interface #ESD tile.actuallyadditions.blockInputter.name=ESD @@ -440,7 +442,7 @@ tooltip.actuallyadditions.extraInfo.desc=Advanced Info tooltip.actuallyadditions.blockPhantomRange.desc=Range tooltip.actuallyadditions.laser.stored.desc= tooltip.actuallyadditions.laser.connected.desc= -tooltip.actuallyadditions.laser.cantConnect.desc=Can't connect: The relays are either part of the same network, the stored relay doesn't exist anymore or it is too far away! +tooltip.actuallyadditions.laser.cantConnect.desc=Can't connect: The relays are either part of the same network, the stored relay isn't the same type or doesn't exist anymore or it is too far away! tooltip.actuallyadditions.itemBooklet.desc=Or "Booklet", if you will #Gui Information diff --git a/src/main/resources/assets/actuallyadditions/models/block/blockLaserRelayItem.json b/src/main/resources/assets/actuallyadditions/models/block/blockLaserRelayItem.json new file mode 100644 index 000000000..0a39a5a03 --- /dev/null +++ b/src/main/resources/assets/actuallyadditions/models/block/blockLaserRelayItem.json @@ -0,0 +1,880 @@ +{ + "__createdBy": "canitzp", + "ambientocclusion": false, + "textures": { + "particle": "actuallyadditions:blocks/models/modelLaserRelayItem", + "laserRelay": "actuallyadditions:blocks/models/modelLaserRelayItem" + }, + "elements": [ + { + "from": [4,0,4], + "to": [12,1,12], + "faces": { + "up": { + "uv": [0,0,8,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,1,3], + "to": [12,4,4], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,1,12], + "to": [12,4,13], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,11,12], + "to": [12,14,13], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,11,3], + "to": [12,14,4], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,4,2], + "to": [12,5,3], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,10,2], + "to": [12,11,3], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,10,13], + "to": [12,11,14], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,4,13], + "to": [12,5,14], + "faces": { + "up": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [5.5,1,5.5], + "to": [10.5,3,10.5], + "faces": { + "up": { + "uv": [13.5,13.5,16,16], + "texture": "#laserRelay" + }, + "down": { + "uv": [0.0,0.0,5.0,5.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,5,2], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,5,2], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,5,2], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,5,2], + "texture": "#laserRelay" + } + } + }, + { + "from": [7,3,7], + "to": [9,14,9], + "faces": { + "up": { + "uv": [0.0,0.0,2.0,2.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,2.0,2.0], + "texture": "missingtexture" + }, + "west": { + "uv": [14,2,16,7.5], + "texture": "#laserRelay" + }, + "east": { + "uv": [14,2,16,7.5], + "texture": "#laserRelay" + }, + "north": { + "uv": [14,2,16,7.5], + "texture": "#laserRelay" + }, + "south": { + "uv": [14,2,16,7.5], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,14,4], + "to": [12,15,12], + "faces": { + "up": { + "uv": [1,12,5,15], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,8,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [6.5,6.5,6.5], + "to": [9.5,9.5,9.5], + "faces": { + "up": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + }, + "down": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + }, + "west": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + }, + "east": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + }, + "north": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + }, + "south": { + "uv": [14,0,16,2], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,5,2], + "to": [5,10,3], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [11,5,2], + "to": [12,10,3], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [11,5,13], + "to": [12,10,14], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [4,5,13], + "to": [5,10,14], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [3,1,4], + "to": [4,4,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [12,1,4], + "to": [13,4,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [12,11,4], + "to": [13,14,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [3,11,4], + "to": [4,14,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,3], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,3], + "texture": "#laserRelay" + } + } + }, + { + "from": [2,4,4], + "to": [3,5,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [2,10,4], + "to": [3,11,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [13,10,4], + "to": [14,11,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [13,4,4], + "to": [14,5,12], + "faces": { + "up": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "down": { + "uv": [0,0,1,8], + "texture": "#laserRelay" + }, + "west": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,8,1], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,1], + "texture": "#laserRelay" + } + } + }, + { + "from": [2,5,4], + "to": [3,10,5], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [2,5,11], + "to": [3,10,12], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [13,5,11], + "to": [14,10,12], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + }, + { + "from": [13,5,4], + "to": [14,10,5], + "faces": { + "up": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "down": { + "uv": [0.0,0.0,1.0,1.0], + "texture": "missingtexture" + }, + "west": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "east": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "north": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + }, + "south": { + "uv": [0,0,1,5], + "texture": "#laserRelay" + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/actuallyadditions/textures/blocks/models/modelLaserRelayItem.png b/src/main/resources/assets/actuallyadditions/textures/blocks/models/modelLaserRelayItem.png new file mode 100644 index 0000000000000000000000000000000000000000..1d1a654dedcc15ae4d78dab729d87e6f12c98d23 GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}Ea{HEjtmSN z`?>!lvI6;>1s;*b3=DjSK$uZf!>a)($X?><>&pIsk&9nLzjW>z3!sohiEBhjaDG}z zd16s2LqTF@UWr~_YKel0o`Ifaj&YqIP)(_)i(^QHd$NI%(Jz1hGrNk_x#UU@oG51a z{rkH{#TCZId=jMxRxrECI+U|7NZw`f;LuXb*u@<37xx|u&D?y`LF-Mey4&Mr%b zC)ae>yqPG>y2GH2x!|biS{QYAF~d$ZmXGdWLy{K%XQ=yeDQ-)r=|!Le7(8A5T-G@y GGywpZCS3~v literal 0 HcmV?d00001