diff --git a/src/main/java/com/elytradev/infraredstone/InfraRedstone.java b/src/main/java/com/elytradev/infraredstone/InfraRedstone.java index 432cc3e..3bdadb3 100644 --- a/src/main/java/com/elytradev/infraredstone/InfraRedstone.java +++ b/src/main/java/com/elytradev/infraredstone/InfraRedstone.java @@ -2,6 +2,7 @@ import com.elytradev.concrete.network.NetworkContext; import com.elytradev.infraredstone.container.OscillatorContainer; +import com.elytradev.infraredstone.logic.IEncoderScannable; import com.elytradev.infraredstone.logic.network.PacketButtonClick; import com.elytradev.infraredstone.tile.TileEntityOscillator; import com.elytradev.concrete.inventory.IContainerInventoryHolder; @@ -9,7 +10,6 @@ import com.elytradev.infraredstone.block.ModBlocks; import com.elytradev.infraredstone.client.InRedTab; import com.elytradev.infraredstone.item.ModItems; -import com.elytradev.infraredstone.logic.IInfraComparator; import com.elytradev.infraredstone.logic.IInfraRedstone; import com.elytradev.infraredstone.logic.InRedLogic; import com.elytradev.infraredstone.logic.impl.InfraComparatorSerializer; @@ -58,8 +58,8 @@ public class InfraRedstone { @CapabilityInject(IInfraRedstone.class) public static final Capability CAPABILITY_IR = null; - @CapabilityInject(IInfraComparator.class) - public static final Capability CAPABILITY_IR_COMPARATOR = null; + @CapabilityInject(IEncoderScannable.class) + public static final Capability CAPABILITY_IR_COMPARATOR = null; static { FluidRegistry.enableUniversalBucket(); @@ -77,7 +77,7 @@ public void preInit(FMLPreInitializationEvent event) { CONTEXT.register(PacketButtonClick.class); CapabilityManager.INSTANCE.register(IInfraRedstone.class, new InfraRedstoneSerializer(), InfraRedstoneHandler::new); - CapabilityManager.INSTANCE.register(IInfraComparator.class, new InfraComparatorSerializer(), InfraRedstoneHandler::new); + CapabilityManager.INSTANCE.register(IEncoderScannable.class, new InfraComparatorSerializer(), InfraRedstoneHandler::new); MinecraftForge.EVENT_BUS.register(InRedRecipes.class); MinecraftForge.EVENT_BUS.register(InRedLogic.class); diff --git a/src/main/java/com/elytradev/infraredstone/logic/IInfraComparator.java b/src/main/java/com/elytradev/infraredstone/logic/IEncoderScannable.java similarity index 89% rename from src/main/java/com/elytradev/infraredstone/logic/IInfraComparator.java rename to src/main/java/com/elytradev/infraredstone/logic/IEncoderScannable.java index fc321ae..90ab22b 100644 --- a/src/main/java/com/elytradev/infraredstone/logic/IInfraComparator.java +++ b/src/main/java/com/elytradev/infraredstone/logic/IEncoderScannable.java @@ -3,7 +3,7 @@ /** * This Capability describes an "inspection" signal value to InfraComparators. */ -public interface IInfraComparator { +public interface IEncoderScannable { /** * @return a value from 0-63 depending on the state of your object. * It may be helpful to format the value in binaru: `0b00_0000` diff --git a/src/main/java/com/elytradev/infraredstone/logic/ISimpleInfraComparator.java b/src/main/java/com/elytradev/infraredstone/logic/ISimpleEncoderScannable.java similarity index 76% rename from src/main/java/com/elytradev/infraredstone/logic/ISimpleInfraComparator.java rename to src/main/java/com/elytradev/infraredstone/logic/ISimpleEncoderScannable.java index acd3e50..2f2082a 100644 --- a/src/main/java/com/elytradev/infraredstone/logic/ISimpleInfraComparator.java +++ b/src/main/java/com/elytradev/infraredstone/logic/ISimpleEncoderScannable.java @@ -6,12 +6,12 @@ import net.minecraft.world.World; /** - * Version of IInfraComparator that can be implemented by non-TE Blocks. + * Version of IEncoderScannable that can be implemented by non-TE Blocks. */ -public interface ISimpleInfraComparator { +public interface ISimpleEncoderScannable { /** - * Has extra information from the standard IInfraComparator to compensate for not having a TE + * Has extra information from the standard IEncoderScannable to compensate for not having a TE * @param world the current world. * @param pos the position of your object. * @param state the current blockstate of your object. diff --git a/src/main/java/com/elytradev/infraredstone/logic/impl/InfraComparatorSerializer.java b/src/main/java/com/elytradev/infraredstone/logic/impl/InfraComparatorSerializer.java index d1dbda4..f4791f0 100644 --- a/src/main/java/com/elytradev/infraredstone/logic/impl/InfraComparatorSerializer.java +++ b/src/main/java/com/elytradev/infraredstone/logic/impl/InfraComparatorSerializer.java @@ -1,6 +1,6 @@ package com.elytradev.infraredstone.logic.impl; -import com.elytradev.infraredstone.logic.IInfraComparator; +import com.elytradev.infraredstone.logic.IEncoderScannable; import net.minecraft.nbt.NBTBase; import net.minecraft.util.EnumFacing; @@ -9,13 +9,13 @@ /** * Don't use. Comparator readers don't store any data. */ -public class InfraComparatorSerializer implements Capability.IStorage{ +public class InfraComparatorSerializer implements Capability.IStorage{ @Override - public NBTBase writeNBT(Capability capability, IInfraComparator instance, EnumFacing side) { + public NBTBase writeNBT(Capability capability, IEncoderScannable instance, EnumFacing side) { return null; } @Override - public void readNBT(Capability capability, IInfraComparator instance, EnumFacing side, NBTBase nbt) { + public void readNBT(Capability capability, IEncoderScannable instance, EnumFacing side, NBTBase nbt) { } } diff --git a/src/main/java/com/elytradev/infraredstone/logic/impl/InfraRedstoneHandler.java b/src/main/java/com/elytradev/infraredstone/logic/impl/InfraRedstoneHandler.java index 45596ae..b18c64c 100644 --- a/src/main/java/com/elytradev/infraredstone/logic/impl/InfraRedstoneHandler.java +++ b/src/main/java/com/elytradev/infraredstone/logic/impl/InfraRedstoneHandler.java @@ -1,9 +1,9 @@ package com.elytradev.infraredstone.logic.impl; -import com.elytradev.infraredstone.logic.IInfraComparator; +import com.elytradev.infraredstone.logic.IEncoderScannable; import com.elytradev.infraredstone.logic.IInfraRedstone; -public class InfraRedstoneHandler implements IInfraRedstone, IInfraComparator { +public class InfraRedstoneHandler implements IInfraRedstone, IEncoderScannable { public static final IInfraRedstone ALWAYS_OFF = new IInfraRedstone() { @Override public int getSignalValue() { return 0; } diff --git a/src/main/java/com/elytradev/infraredstone/tile/TileEntityEncoder.java b/src/main/java/com/elytradev/infraredstone/tile/TileEntityEncoder.java index 81d0d0f..ffb2731 100644 --- a/src/main/java/com/elytradev/infraredstone/tile/TileEntityEncoder.java +++ b/src/main/java/com/elytradev/infraredstone/tile/TileEntityEncoder.java @@ -4,9 +4,9 @@ import com.elytradev.infraredstone.block.BlockBase; import com.elytradev.infraredstone.block.BlockEncoder; import com.elytradev.infraredstone.block.ModBlocks; -import com.elytradev.infraredstone.logic.IInfraComparator; +import com.elytradev.infraredstone.logic.IEncoderScannable; import com.elytradev.infraredstone.logic.IMultimeterProbe; -import com.elytradev.infraredstone.logic.ISimpleInfraComparator; +import com.elytradev.infraredstone.logic.ISimpleEncoderScannable; import com.elytradev.infraredstone.logic.InRedLogic; import com.elytradev.infraredstone.logic.impl.InfraRedstoneHandler; import com.google.common.base.Predicates; @@ -41,10 +41,10 @@ public void update() { EnumFacing back = state.getValue(BlockEncoder.FACING).getOpposite(); BlockPos backPos = this.getPos().offset(back); IBlockState quantify = world.getBlockState(backPos); - if (quantify instanceof IInfraComparator) { - signal.setNextSignalValue(((IInfraComparator) quantify).getComparatorValue()); - } else if (quantify instanceof ISimpleInfraComparator) { - signal.setNextSignalValue(((ISimpleInfraComparator) quantify).getComparatorValue(world, backPos, quantify, back.getOpposite())); + if (quantify instanceof IEncoderScannable) { + signal.setNextSignalValue(((IEncoderScannable) quantify).getComparatorValue()); + } else if (quantify instanceof ISimpleEncoderScannable) { + signal.setNextSignalValue(((ISimpleEncoderScannable) quantify).getComparatorValue(world, backPos, quantify, back.getOpposite())); } else if (quantify.hasComparatorInputOverride()) { signal.setNextSignalValue(4*quantify.getComparatorInputOverride(world, backPos)); } else {