diff --git a/src/main/java/gregtech/api/GregTechAPI.java b/src/main/java/gregtech/api/GregTechAPI.java index 63facd0db9d..75f1cf5101a 100644 --- a/src/main/java/gregtech/api/GregTechAPI.java +++ b/src/main/java/gregtech/api/GregTechAPI.java @@ -5,7 +5,6 @@ import gregtech.api.block.machines.BlockMachine; import gregtech.api.command.ICommandManager; import gregtech.api.cover.CoverDefinition; -import gregtech.api.cover2.CoverDefinition2; import gregtech.api.event.HighTierEvent; import gregtech.api.gui.UIFactory; import gregtech.api.metatileentity.MetaTileEntity; @@ -64,7 +63,6 @@ public class GregTechAPI { public static final GTControlledRegistry MTE_REGISTRY = new GTControlledRegistry<>(Short.MAX_VALUE); public static final GTControlledRegistry UI_FACTORY_REGISTRY = new GTControlledRegistry<>(Short.MAX_VALUE); public static final GTControlledRegistry COVER_REGISTRY = new GTControlledRegistry<>(Integer.MAX_VALUE); - public static final GTControlledRegistry COVER_REGISTRY_2 = new GTControlledRegistry<>(Integer.MAX_VALUE); public static BlockMachine MACHINE; public static final Map> oreBlockTable = new HashMap<>(); diff --git a/src/main/java/gregtech/api/block/machines/BlockMachine.java b/src/main/java/gregtech/api/block/machines/BlockMachine.java index e0db8224ea2..1febcfd3e56 100644 --- a/src/main/java/gregtech/api/block/machines/BlockMachine.java +++ b/src/main/java/gregtech/api/block/machines/BlockMachine.java @@ -9,8 +9,8 @@ import gregtech.api.block.BlockCustomParticle; import gregtech.api.block.UnlistedIntegerProperty; import gregtech.api.block.UnlistedStringProperty; +import gregtech.api.cover.Cover; import gregtech.api.cover.IFacadeCover; -import gregtech.api.cover2.Cover; import gregtech.api.items.toolitem.ToolClasses; import gregtech.api.items.toolitem.ToolHelper; import gregtech.api.metatileentity.MetaTileEntity; diff --git a/src/main/java/gregtech/api/capability/GregtechTileCapabilities.java b/src/main/java/gregtech/api/capability/GregtechTileCapabilities.java index 44795f5eeaa..d6681895937 100644 --- a/src/main/java/gregtech/api/capability/GregtechTileCapabilities.java +++ b/src/main/java/gregtech/api/capability/GregtechTileCapabilities.java @@ -1,8 +1,7 @@ package gregtech.api.capability; import gregtech.api.capability.impl.AbstractRecipeLogic; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverHolder; +import gregtech.api.cover.CoverHolder; import gregtech.api.metatileentity.multiblock.IMaintenance; import net.minecraftforge.common.capabilities.Capability; import net.minecraftforge.common.capabilities.CapabilityInject; @@ -12,9 +11,6 @@ public class GregtechTileCapabilities { @CapabilityInject(IWorkable.class) public static Capability CAPABILITY_WORKABLE = null; - @CapabilityInject(ICoverable.class) - public static Capability CAPABILITY_COVERABLE = null; - @CapabilityInject(CoverHolder.class) public static Capability CAPABILITY_COVER_HOLDER = null; diff --git a/src/main/java/gregtech/api/capability/SimpleCapabilityManager.java b/src/main/java/gregtech/api/capability/SimpleCapabilityManager.java index fa261bff59e..287892ca8f7 100644 --- a/src/main/java/gregtech/api/capability/SimpleCapabilityManager.java +++ b/src/main/java/gregtech/api/capability/SimpleCapabilityManager.java @@ -1,8 +1,7 @@ package gregtech.api.capability; import gregtech.api.capability.impl.AbstractRecipeLogic; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverHolder; +import gregtech.api.cover.CoverHolder; import gregtech.api.metatileentity.multiblock.IMaintenance; import gregtech.api.terminal.hardware.HardwareProvider; import gregtech.api.worldgen.generator.GTWorldGenCapability; @@ -38,7 +37,6 @@ public static void init() { registerCapabilityWithNoDefault(IEnergyContainer.class); registerCapabilityWithNoDefault(IElectricItem.class); registerCapabilityWithNoDefault(IWorkable.class); - registerCapabilityWithNoDefault(ICoverable.class); registerCapabilityWithNoDefault(CoverHolder.class); registerCapabilityWithNoDefault(IControllable.class); registerCapabilityWithNoDefault(IActiveOutputSide.class); diff --git a/src/main/java/gregtech/api/cover2/Cover.java b/src/main/java/gregtech/api/cover/Cover.java similarity index 99% rename from src/main/java/gregtech/api/cover2/Cover.java rename to src/main/java/gregtech/api/cover/Cover.java index 13a9d7144ed..190c163c4da 100644 --- a/src/main/java/gregtech/api/cover2/Cover.java +++ b/src/main/java/gregtech/api/cover/Cover.java @@ -1,4 +1,4 @@ -package gregtech.api.cover2; +package gregtech.api.cover; import codechicken.lib.raytracer.CuboidRayTraceResult; import codechicken.lib.render.CCRenderState; @@ -32,7 +32,7 @@ public interface Cover { */ @NotNull CoverableView getCoverable(); - @NotNull CoverDefinition2 getDefinition(); + @NotNull CoverDefinition getDefinition(); /** * @return the World containing this cover diff --git a/src/main/java/gregtech/api/cover2/CoverBase.java b/src/main/java/gregtech/api/cover/CoverBase.java similarity index 90% rename from src/main/java/gregtech/api/cover2/CoverBase.java rename to src/main/java/gregtech/api/cover/CoverBase.java index 6c89fb0764a..9c72c96bc7c 100644 --- a/src/main/java/gregtech/api/cover2/CoverBase.java +++ b/src/main/java/gregtech/api/cover/CoverBase.java @@ -1,4 +1,4 @@ -package gregtech.api.cover2; +package gregtech.api.cover; import codechicken.lib.render.CCRenderState; import codechicken.lib.render.pipeline.IVertexOperation; @@ -16,11 +16,11 @@ public abstract class CoverBase implements Cover { - private final CoverDefinition2 definition; + private final CoverDefinition definition; private final CoverableView coverableView; private final EnumFacing attachedSide; - public CoverBase(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, + public CoverBase(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { this.definition = definition; this.coverableView = coverableView; @@ -28,7 +28,7 @@ public CoverBase(@NotNull CoverDefinition2 definition, @NotNull CoverableView co } @Override - public final @NotNull CoverDefinition2 getDefinition() { + public final @NotNull CoverDefinition getDefinition() { return this.definition; } diff --git a/src/main/java/gregtech/api/cover/CoverBehavior.java b/src/main/java/gregtech/api/cover/CoverBehavior.java deleted file mode 100644 index ca2cbe365ba..00000000000 --- a/src/main/java/gregtech/api/cover/CoverBehavior.java +++ /dev/null @@ -1,233 +0,0 @@ -package gregtech.api.cover; - - -import codechicken.lib.raytracer.CuboidRayTraceResult; -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.IVertexOperation; -import codechicken.lib.vec.Cuboid6; -import codechicken.lib.vec.Matrix4; -import com.google.common.collect.Lists; -import gregtech.api.GTValues; -import gregtech.api.gui.IUIHolder; -import gregtech.client.renderer.texture.Textures; -import gregtech.client.renderer.texture.cube.SimpleSidedCubeRenderer.RenderSide; -import gregtech.client.utils.BloomEffectUtil; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.PacketBuffer; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumActionResult; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumHand; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.List; -import java.util.function.Consumer; - -/** - * Represents cover instance attached on the specific side of meta tile entity - * Cover filters out interaction and logic of meta tile entity - *

- * Can implement {@link net.minecraft.util.ITickable} to listen to meta tile entity updates - */ -@SuppressWarnings("unused") -public abstract class CoverBehavior implements IUIHolder { - - private CoverDefinition coverDefinition; - public final ICoverable coverHolder; - public final EnumFacing attachedSide; - private int redstoneSignalOutput; - - public CoverBehavior(ICoverable coverHolder, EnumFacing attachedSide) { - this.coverHolder = coverHolder; - this.attachedSide = attachedSide; - } - - final void setCoverDefinition(CoverDefinition coverDefinition) { - this.coverDefinition = coverDefinition; - } - - public final CoverDefinition getCoverDefinition() { - return coverDefinition; - } - - public final void setRedstoneSignalOutput(int redstoneSignalOutput) { - this.redstoneSignalOutput = redstoneSignalOutput; - coverHolder.notifyBlockUpdate(); - coverHolder.markDirty(); - } - - public final int getRedstoneSignalOutput() { - return redstoneSignalOutput; - } - - public final int getRedstoneSignalInput() { - return coverHolder.getInputRedstoneSignal(attachedSide, true); - } - - public void onRedstoneInputSignalChange(int newSignalStrength) { - } - - public boolean canConnectRedstone() { - return false; - } - - public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) { - if (redstoneSignalOutput > 0) { - tagCompound.setInteger("RedstoneSignal", redstoneSignalOutput); - } - - return tagCompound; - } - - public void readFromNBT(NBTTagCompound tagCompound) { - this.redstoneSignalOutput = tagCompound.getInteger("RedstoneSignal"); - } - - public void writeInitialSyncData(PacketBuffer packetBuffer) { - } - - public void readInitialSyncData(PacketBuffer packetBuffer) { - } - - public void readUpdateData(int id, PacketBuffer packetBuffer) { - } - - public final void writeUpdateData(int id, Consumer writer) { - coverHolder.writeCoverData(this, id, writer); - } - - /** - * Called on server side to check whether cover can be attached to given meta tile entity - * - * @return true if cover can be attached, false otherwise - */ - public abstract boolean canAttach(); - - /** - * Will be called on server side after the cover attachment to the meta tile entity - * Cover can change it's internal state here and it will be synced to client with {@link #writeInitialSyncData(PacketBuffer)} - * - * @param itemStack the item cover was attached from - */ - public void onAttached(ItemStack itemStack) { - } - - public void onAttached(ItemStack itemStack, EntityPlayer player) { - onAttached(itemStack); - } - - public boolean shouldCoverInteractWithOutputside() { - return false; - } - - public ItemStack getPickItem() { - return coverDefinition.getDropItemStack(); - } - - public List getDrops() { - return Lists.newArrayList(getPickItem()); - } - - /** - * Called prior to cover removing on the server side - * Will also be called during machine dismantling, as machine loses installed covers after that - */ - public void onRemoved() { - } - - /** - * @return If the pipe this is placed on should render a connection to the cover - */ - public boolean shouldAutoConnect() { - return true; - } - - /** - * @return If the pipe this is placed on and a pipe on the other side should be able to connect - */ - public boolean canPipePassThrough() { - return false; - } - - public boolean canRenderBackside() { - return true; - } - - public boolean onLeftClick(EntityPlayer entityPlayer, CuboidRayTraceResult hitResult) { - return false; - } - - public EnumActionResult onRightClick(EntityPlayer playerIn, EnumHand hand, CuboidRayTraceResult hitResult) { - return EnumActionResult.PASS; - } - - public EnumActionResult onScrewdriverClick(EntityPlayer playerIn, EnumHand hand, CuboidRayTraceResult hitResult) { - return EnumActionResult.PASS; - } - - public EnumActionResult onSoftMalletClick(EntityPlayer playerIn, EnumHand hand, CuboidRayTraceResult hitResult) { - return EnumActionResult.PASS; - } - - /** - * Will be called for each capability request to meta tile entity - * Cover can override meta tile entity capabilities, modify their values, or deny accessing them - * - * @param defaultValue value of the capability from meta tile entity itself - * @return result capability value external caller will receive - */ - @Nullable - public T getCapability(@Nonnull Capability capability, @Nullable T defaultValue) { - return defaultValue; - } - - /** - * Called on client side to render this cover on the machine's face - * It will be automatically translated to prevent Z-fighting with machine faces - */ - @SideOnly(Side.CLIENT) - public abstract void renderCover(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline, Cuboid6 plateBox, BlockRenderLayer layer); - - @SideOnly(Side.CLIENT) - public boolean canRenderInLayer(BlockRenderLayer renderLayer) { - return renderLayer == BlockRenderLayer.CUTOUT_MIPPED || renderLayer == BloomEffectUtil.getRealBloomLayer(); - } - - @SideOnly(Side.CLIENT) - public void renderCoverPlate(CCRenderState renderState, Matrix4 translation, IVertexOperation[] pipeline, Cuboid6 plateBox, BlockRenderLayer layer) { - TextureAtlasSprite casingSide = getPlateSprite(); - for (EnumFacing coverPlateSide : EnumFacing.VALUES) { - boolean isAttachedSide = attachedSide.getAxis() == coverPlateSide.getAxis(); - if (isAttachedSide || coverHolder.getCoverAtSide(coverPlateSide) == null) { - Textures.renderFace(renderState, translation, pipeline, coverPlateSide, plateBox, casingSide, BlockRenderLayer.CUTOUT_MIPPED); - } - } - } - - @SideOnly(Side.CLIENT) - protected TextureAtlasSprite getPlateSprite() { - return Textures.VOLTAGE_CASINGS[GTValues.LV].getSpriteOnSide(RenderSide.SIDE); - } - - @Override - public final boolean isValid() { - return coverHolder.isValid() && coverHolder.getCoverAtSide(attachedSide) == this; - } - - @Override - public boolean isRemote() { - return coverHolder.getWorld().isRemote; - } - - @Override - public final void markAsDirty() { - coverHolder.markDirty(); - } -} diff --git a/src/main/java/gregtech/api/cover/CoverDefinition.java b/src/main/java/gregtech/api/cover/CoverDefinition.java index c43a28f1026..a69298b329e 100644 --- a/src/main/java/gregtech/api/cover/CoverDefinition.java +++ b/src/main/java/gregtech/api/cover/CoverDefinition.java @@ -4,20 +4,18 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; import net.minecraft.util.ResourceLocation; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.function.BiFunction; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; public final class CoverDefinition { private final ResourceLocation coverId; - private final BiFunction behaviorCreator; + private final CoverCreator coverCreator; private final ItemStack dropItemStack; - public CoverDefinition(ResourceLocation coverId, BiFunction behaviorCreator, @Nonnull ItemStack dropItemStack) { + public CoverDefinition(@NotNull ResourceLocation coverId, @NotNull CoverCreator coverCreator, @NotNull ItemStack dropItemStack) { this.coverId = coverId; - this.behaviorCreator = behaviorCreator; + this.coverCreator = coverCreator; this.dropItemStack = dropItemStack.copy(); } @@ -25,42 +23,44 @@ public CoverDefinition(ResourceLocation coverId, BiFunction coverWriter) { - for (EnumFacing coverSide : EnumFacing.VALUES) { - int id = buf.readVarInt(); - if (id != NO_COVER_ID) { - CoverDefinition definition = CoverDefinition.getCoverByNetworkId(id); - if (definition == null) { - GTLog.logger.warn("Unable to find CoverDefinition for Network ID {} at position {}", id, coverable.getPos()); - } else { - CoverBehavior coverBehavior = definition.createCoverBehavior(coverable, coverSide); - coverBehavior.readInitialSyncData(buf); - coverWriter.accept(coverSide, coverBehavior); - } - } - } - } - - /** - * @param side the side the cover is attached to - * @param behavior the cover's behavior - * @return a writer for a cover's attachment data - */ - @Nonnull - public static Consumer getCoverPlacementCustomDataWriter(@Nonnull EnumFacing side, @Nonnull CoverBehavior behavior) { - return buffer -> { - buffer.writeByte(side.getIndex()); - buffer.writeVarInt(CoverDefinition.getNetworkIdForCover(behavior.getCoverDefinition())); - behavior.writeInitialSyncData(buffer); - }; - } - - /** - * Read a cover's placement customData - * - * @param buf the buffer to read from - * @param coverable the coverable the cover is placed on - * @param coverWriter the operation the coverable uses to store a cover - * @param renderUpdater the operation the coverable uses to schedule render updates - */ - public static void readCoverPlacement(@Nonnull PacketBuffer buf, @Nonnull ICoverable coverable, - @Nonnull BiConsumer coverWriter, - @Nonnull Runnable renderUpdater) { - //cover placement event - EnumFacing placementSide = EnumFacing.VALUES[buf.readByte()]; - int id = buf.readVarInt(); - CoverDefinition coverDefinition = CoverDefinition.getCoverByNetworkId(id); - if (coverDefinition == null) { - GTLog.logger.warn("Unable to find CoverDefinition for Network ID {} at position {}", id, coverable.getPos()); - } else { - CoverBehavior coverBehavior = coverDefinition.createCoverBehavior(coverable, placementSide); - coverWriter.accept(placementSide, coverBehavior); - - coverBehavior.readInitialSyncData(buf); - } - renderUpdater.run(); - } - - /** - * Writes a coverable's covers to NBT - * - * @param tagCompound the tag compound to write to - * @param coverReader the operation the coverable uses to retrieve a stored cover - */ - public static void writeCoverNBT(@Nonnull NBTTagCompound tagCompound, @Nonnull Function coverReader) { - NBTTagList coversList = new NBTTagList(); - for (EnumFacing coverSide : EnumFacing.VALUES) { - CoverBehavior coverBehavior = coverReader.apply(coverSide); - if (coverBehavior != null) { - NBTTagCompound tag = new NBTTagCompound(); - ResourceLocation coverId = coverBehavior.getCoverDefinition().getCoverId(); - tag.setString("CoverId", coverId.toString()); - tag.setByte("Side", (byte) coverSide.getIndex()); - coverBehavior.writeToNBT(tag); - coversList.appendTag(tag); - } - } - tagCompound.setTag("Covers", coversList); - } - - /** - * Reads a coverable's covers from NBT - * - * @param tagCompound the tag compound to read from - * @param coverable the cover to store the covers in - * @param coverWriter the operation the coverable uses to write a stored cover - */ - public static void readCoverNBT(@Nonnull NBTTagCompound tagCompound, @Nonnull ICoverable coverable, - @Nonnull BiConsumer coverWriter) { - NBTTagList coversList = tagCompound.getTagList("Covers", Constants.NBT.TAG_COMPOUND); - for (int index = 0; index < coversList.tagCount(); index++) { - NBTTagCompound tag = coversList.getCompoundTagAt(index); - if (tag.hasKey("CoverId", Constants.NBT.TAG_STRING)) { - EnumFacing coverSide = EnumFacing.VALUES[tag.getByte("Side")]; - ResourceLocation coverLocation = new ResourceLocation(tag.getString("CoverId")); - CoverDefinition coverDefinition = CoverDefinition.getCoverById(coverLocation); - if (coverDefinition == null) { - GTLog.logger.warn("Unable to find CoverDefinition for ResourceLocation {} at position {}", - coverLocation, coverable.getPos()); - } else { - CoverBehavior coverBehavior = coverDefinition.createCoverBehavior(coverable, coverSide); - coverBehavior.readFromNBT(tag); - coverWriter.accept(coverSide, coverBehavior); - } - } - } - } -} diff --git a/src/main/java/gregtech/api/cover2/CoverRayTracer.java b/src/main/java/gregtech/api/cover/CoverRayTracer.java similarity index 98% rename from src/main/java/gregtech/api/cover2/CoverRayTracer.java rename to src/main/java/gregtech/api/cover/CoverRayTracer.java index 0c9f8417652..080da472229 100644 --- a/src/main/java/gregtech/api/cover2/CoverRayTracer.java +++ b/src/main/java/gregtech/api/cover/CoverRayTracer.java @@ -1,4 +1,4 @@ -package gregtech.api.cover2; +package gregtech.api.cover; import codechicken.lib.raytracer.CuboidRayTraceResult; import codechicken.lib.raytracer.RayTracer; diff --git a/src/main/java/gregtech/api/cover2/CoverSaveHandler.java b/src/main/java/gregtech/api/cover/CoverSaveHandler.java similarity index 84% rename from src/main/java/gregtech/api/cover2/CoverSaveHandler.java rename to src/main/java/gregtech/api/cover/CoverSaveHandler.java index 9c4befc8571..14204689a04 100644 --- a/src/main/java/gregtech/api/cover2/CoverSaveHandler.java +++ b/src/main/java/gregtech/api/cover/CoverSaveHandler.java @@ -1,4 +1,4 @@ -package gregtech.api.cover2; +package gregtech.api.cover; import gregtech.api.util.GTLog; import net.minecraft.nbt.NBTTagCompound; @@ -9,6 +9,8 @@ import net.minecraftforge.common.util.Constants; import org.jetbrains.annotations.NotNull; +import java.util.function.BiConsumer; + public final class CoverSaveHandler { public static final int NO_COVER_ID = -1; @@ -25,7 +27,7 @@ public static void writeInitialSyncData(@NotNull PacketBuffer buf, @NotNull Cove for (EnumFacing coverSide : EnumFacing.VALUES) { Cover cover = coverableView.getCoverAtSide(coverSide); if (cover != null) { - buf.writeVarInt(CoverDefinition2.getNetworkIdForCover(cover.getDefinition())); + buf.writeVarInt(CoverDefinition.getNetworkIdForCover(cover.getDefinition())); cover.writeInitialSyncData(buf); } else { // cover was not attached @@ -44,7 +46,7 @@ public static void receiveInitialSyncData(@NotNull PacketBuffer buf, @NotNull Co for (EnumFacing coverSide : EnumFacing.VALUES) { int id = buf.readVarInt(); if (id != NO_COVER_ID) { - CoverDefinition2 definition = CoverDefinition2.getCoverByNetworkId(id); + CoverDefinition definition = CoverDefinition.getCoverByNetworkId(id); if (definition == null) { GTLog.logger.warn("Unable to find CoverDefinition for Network ID {} at position {}", id, coverHolder.getPos()); } else { @@ -59,7 +61,7 @@ public static void receiveInitialSyncData(@NotNull PacketBuffer buf, @NotNull Co /** * Write a cover's placement customData * - * @param coverHolder the CoverHolder to write cover placement data to + * @param coverHolder the CoverHolder to write cover placement data to * @param discriminator the discriminator the CoverableView uses for the operation * @param side the side the cover is attached to * @param cover the cover @@ -68,7 +70,7 @@ public static void writeCoverPlacement(@NotNull CoverHolder coverHolder, int dis @NotNull EnumFacing side, @NotNull Cover cover) { coverHolder.writeCustomData(discriminator, buf -> { buf.writeByte(side.getIndex()); - buf.writeVarInt(CoverDefinition2.getNetworkIdForCover(cover.getDefinition())); + buf.writeVarInt(CoverDefinition.getNetworkIdForCover(cover.getDefinition())); cover.writeInitialSyncData(buf); }); } @@ -83,7 +85,7 @@ public static void readCoverPlacement(@NotNull PacketBuffer buf, @NotNull CoverH //cover placement event EnumFacing placementSide = EnumFacing.VALUES[buf.readByte()]; int id = buf.readVarInt(); - CoverDefinition2 coverDefinition = CoverDefinition2.getCoverByNetworkId(id); + CoverDefinition coverDefinition = CoverDefinition.getCoverByNetworkId(id); if (coverDefinition == null) { GTLog.logger.warn("Unable to find CoverDefinition for Network ID {} at position {}", id, coverHolder.getPos()); } else { @@ -120,24 +122,26 @@ public static void writeCoverNBT(@NotNull NBTTagCompound tagCompound, @NotNull C /** * Reads a CoverableView's covers from NBT * - * @param tagCompound the tag compound to read from - * @param coverHolder the CoverHolder to store the covers in + * @param tagCompound the tag compound to read from + * @param coverHolder the CoverHolder to store the covers in + * @param coverStoreFunction a function to directly store the cover field */ - public static void readCoverNBT(@NotNull NBTTagCompound tagCompound, @NotNull CoverHolder coverHolder) { + public static void readCoverNBT(@NotNull NBTTagCompound tagCompound, @NotNull CoverHolder coverHolder, + @NotNull BiConsumer coverStoreFunction) { NBTTagList coversList = tagCompound.getTagList("Covers", Constants.NBT.TAG_COMPOUND); for (int index = 0; index < coversList.tagCount(); index++) { NBTTagCompound tag = coversList.getCompoundTagAt(index); if (tag.hasKey("CoverId", Constants.NBT.TAG_STRING)) { EnumFacing coverSide = EnumFacing.VALUES[tag.getByte("Side")]; ResourceLocation coverLocation = new ResourceLocation(tag.getString("CoverId")); - CoverDefinition2 coverDefinition = CoverDefinition2.getCoverById(coverLocation); + CoverDefinition coverDefinition = CoverDefinition.getCoverById(coverLocation); if (coverDefinition == null) { GTLog.logger.warn("Unable to find CoverDefinition for ResourceLocation {} at position {}", coverLocation, coverHolder.getPos()); } else { Cover cover = coverDefinition.createCover(coverHolder, coverSide); cover.readFromNBT(tag); - coverHolder.addCover(coverSide, cover); + coverStoreFunction.accept(coverSide, cover); } } } diff --git a/src/main/java/gregtech/api/cover/CoverUIFactory.java b/src/main/java/gregtech/api/cover/CoverUIFactory.java index a18f59ed89d..c937bcadeb1 100644 --- a/src/main/java/gregtech/api/cover/CoverUIFactory.java +++ b/src/main/java/gregtech/api/cover/CoverUIFactory.java @@ -2,8 +2,6 @@ import gregtech.api.GregTechAPI; import gregtech.api.capability.GregtechTileCapabilities; -import gregtech.api.cover2.Cover; -import gregtech.api.cover2.CoverableView; import gregtech.api.gui.ModularUI; import gregtech.api.gui.UIFactory; import gregtech.api.util.GTUtility; diff --git a/src/main/java/gregtech/api/cover2/CoverUtil.java b/src/main/java/gregtech/api/cover/CoverUtil.java similarity index 98% rename from src/main/java/gregtech/api/cover2/CoverUtil.java rename to src/main/java/gregtech/api/cover/CoverUtil.java index cb748d74ffe..2e78461090b 100644 --- a/src/main/java/gregtech/api/cover2/CoverUtil.java +++ b/src/main/java/gregtech/api/cover/CoverUtil.java @@ -1,4 +1,4 @@ -package gregtech.api.cover2; +package gregtech.api.cover; import codechicken.lib.raytracer.IndexedCuboid6; import codechicken.lib.vec.Cuboid6; diff --git a/src/main/java/gregtech/api/cover/CoverWithUI.java b/src/main/java/gregtech/api/cover/CoverWithUI.java index 3316c41a950..be452dd6b69 100644 --- a/src/main/java/gregtech/api/cover/CoverWithUI.java +++ b/src/main/java/gregtech/api/cover/CoverWithUI.java @@ -1,6 +1,5 @@ package gregtech.api.cover; -import gregtech.api.cover2.Cover; import gregtech.api.gui.IUIHolder; import gregtech.api.gui.ModularUI; import net.minecraft.entity.player.EntityPlayer; diff --git a/src/main/java/gregtech/api/cover2/CoverableView.java b/src/main/java/gregtech/api/cover/CoverableView.java similarity index 98% rename from src/main/java/gregtech/api/cover2/CoverableView.java rename to src/main/java/gregtech/api/cover/CoverableView.java index db578b46d77..44e7662c6bd 100644 --- a/src/main/java/gregtech/api/cover2/CoverableView.java +++ b/src/main/java/gregtech/api/cover/CoverableView.java @@ -1,4 +1,4 @@ -package gregtech.api.cover2; +package gregtech.api.cover; import net.minecraft.network.PacketBuffer; import net.minecraft.util.EnumFacing; diff --git a/src/main/java/gregtech/api/cover/ICoverable.java b/src/main/java/gregtech/api/cover/ICoverable.java deleted file mode 100644 index 99fb22ab468..00000000000 --- a/src/main/java/gregtech/api/cover/ICoverable.java +++ /dev/null @@ -1,230 +0,0 @@ -package gregtech.api.cover; - -import codechicken.lib.raytracer.CuboidRayTraceResult; -import codechicken.lib.raytracer.IndexedCuboid6; -import codechicken.lib.raytracer.RayTracer; -import codechicken.lib.render.CCRenderState; -import codechicken.lib.render.pipeline.ColourMultiplier; -import codechicken.lib.render.pipeline.IVertexOperation; -import codechicken.lib.vec.*; -import gregtech.api.pipenet.block.BlockPipe; -import gregtech.api.pipenet.block.BlockPipe.PipeConnectionData; -import gregtech.api.util.GTUtility; -import gregtech.client.utils.RenderUtil; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.network.PacketBuffer; -import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.RayTraceResult; -import net.minecraft.util.math.RayTraceResult.Type; -import net.minecraft.world.World; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import javax.annotation.Nonnull; -import java.util.List; -import java.util.function.Consumer; - -public interface ICoverable { - - Transformation REVERSE_HORIZONTAL_ROTATION = new Rotation(Math.PI, new Vector3(0.0, 1.0, 0.0)).at(Vector3.center); - Transformation REVERSE_VERTICAL_ROTATION = new Rotation(Math.PI, new Vector3(1.0, 0.0, 0.0)).at(Vector3.center); - - World getWorld(); - - BlockPos getPos(); - - long getOffsetTimer(); - - void markDirty(); - - boolean isValid(); - - T getCapability(Capability capability, EnumFacing side); - - boolean placeCoverOnSide(EnumFacing side, ItemStack itemStack, CoverDefinition definition, EntityPlayer player); - - boolean removeCover(EnumFacing side); - - boolean canPlaceCoverOnSide(EnumFacing side); - - CoverBehavior getCoverAtSide(EnumFacing side); - - void writeCoverData(CoverBehavior behavior, int id, Consumer writer); - - int getInputRedstoneSignal(EnumFacing side, boolean ignoreCover); - - ItemStack getStackForm(); - - double getCoverPlateThickness(); - - @SideOnly(Side.CLIENT) - int getPaintingColorForRendering(); - - boolean shouldRenderBackSide(); - - void notifyBlockUpdate(); - - void scheduleRenderUpdate(); - - default boolean hasAnyCover() { - for(EnumFacing facing : EnumFacing.VALUES) - if(getCoverAtSide(facing) != null) - return true; - return false; - } - - @SideOnly(Side.CLIENT) - default void renderCovers(CCRenderState renderState, Matrix4 translation, BlockRenderLayer layer) { - renderState.lightMatrix.locate(getWorld(), getPos()); - double coverPlateThickness = getCoverPlateThickness(); - IVertexOperation[] platePipeline = new IVertexOperation[]{renderState.lightMatrix, new ColourMultiplier(GTUtility.convertRGBtoOpaqueRGBA_CL(getPaintingColorForRendering()))}; - IVertexOperation[] coverPipeline = new IVertexOperation[]{renderState.lightMatrix}; - - for (EnumFacing sideFacing : EnumFacing.values()) { - CoverBehavior coverBehavior = getCoverAtSide(sideFacing); - if (coverBehavior == null) continue; - Cuboid6 plateBox = getCoverPlateBox(sideFacing, coverPlateThickness); - - if (coverBehavior.canRenderInLayer(layer) && coverPlateThickness > 0) { - renderState.preRenderWorld(getWorld(), getPos()); - coverBehavior.renderCoverPlate(renderState, translation, platePipeline, plateBox, layer); - } - - if (coverBehavior.canRenderInLayer(layer)) { - coverBehavior.renderCover(renderState, RenderUtil.adjustTrans(translation, sideFacing, 2), coverPipeline, plateBox, layer); - if (coverPlateThickness == 0.0 && shouldRenderBackSide() && coverBehavior.canRenderBackside()) { - //machine is full block, but still not opaque - render cover on the back side too - Matrix4 backTranslation = translation.copy(); - if (sideFacing.getAxis().isVertical()) { - REVERSE_VERTICAL_ROTATION.apply(backTranslation); - } else { - REVERSE_HORIZONTAL_ROTATION.apply(backTranslation); - } - backTranslation.translate(-sideFacing.getXOffset(), -sideFacing.getYOffset(), -sideFacing.getZOffset()); - coverBehavior.renderCover(renderState, backTranslation, coverPipeline, plateBox, layer); // may need to translate the layer here as well - } - } - } - } - - default void addCoverCollisionBoundingBox(List collisionList) { - double plateThickness = getCoverPlateThickness(); - if (plateThickness > 0.0) { - for (EnumFacing side : EnumFacing.VALUES) { - if (getCoverAtSide(side) != null) { - Cuboid6 coverBox = getCoverPlateBox(side, plateThickness); - CoverSideData coverSideData = new CoverSideData(side); - collisionList.add(new IndexedCuboid6(coverSideData, coverBox)); - } - } - } - } - - static boolean doesCoverCollide(EnumFacing side, List collisionBox, double plateThickness) { - if (side == null) { - return false; - } - if (plateThickness > 0.0) { - Cuboid6 coverPlateBox = getCoverPlateBox(side, plateThickness); - for (Cuboid6 collisionCuboid : collisionBox) { - if (collisionCuboid.intersects(coverPlateBox)) { - //collision box intersects with machine bounding box - - //cover cannot be placed on this side - return true; - } - } - return false; - } - return false; - } - - static EnumFacing rayTraceCoverableSide(ICoverable coverable, EntityPlayer player) { - RayTraceResult result = RayTracer.retraceBlock(coverable.getWorld(), player, coverable.getPos()); - if (result == null || result.typeOfHit != Type.BLOCK) { - return null; - } - return traceCoverSide(result); - } - - class PrimaryBoxData { - public final boolean usePlacementGrid; - - public PrimaryBoxData(boolean usePlacementGrid) { - this.usePlacementGrid = usePlacementGrid; - } - } - - class CoverSideData { - public final EnumFacing side; - - public CoverSideData(EnumFacing side) { - this.side = side; - } - } - - static EnumFacing traceCoverSide(RayTraceResult result) { - if (result instanceof CuboidRayTraceResult) { - CuboidRayTraceResult rayTraceResult = (CuboidRayTraceResult) result; - if (rayTraceResult.cuboid6.data == null) { - return determineGridSideHit(result); - } else if (rayTraceResult.cuboid6.data instanceof CoverSideData) { - return ((CoverSideData) rayTraceResult.cuboid6.data).side; - } else if (rayTraceResult.cuboid6.data instanceof BlockPipe.PipeConnectionData) { - return ((PipeConnectionData) rayTraceResult.cuboid6.data).side; - } else if (rayTraceResult.cuboid6.data instanceof PrimaryBoxData) { - PrimaryBoxData primaryBoxData = (PrimaryBoxData) rayTraceResult.cuboid6.data; - return primaryBoxData.usePlacementGrid ? determineGridSideHit(result) : result.sideHit; - } //unknown hit type, fall through - } - //normal collision ray trace, return side hit - return determineGridSideHit(result); - } - - static EnumFacing determineGridSideHit(RayTraceResult result) { - return GTUtility.determineWrenchingSide(result.sideHit, - (float) (result.hitVec.x - result.getBlockPos().getX()), - (float) (result.hitVec.y - result.getBlockPos().getY()), - (float) (result.hitVec.z - result.getBlockPos().getZ())); - } - - static Cuboid6 getCoverPlateBox(EnumFacing side, double plateThickness) { - switch (side) { - case UP: - return new Cuboid6(0.0, 1.0 - plateThickness, 0.0, 1.0, 1.0, 1.0); - case DOWN: - return new Cuboid6(0.0, 0.0, 0.0, 1.0, plateThickness, 1.0); - case NORTH: - return new Cuboid6(0.0, 0.0, 0.0, 1.0, 1.0, plateThickness); - case SOUTH: - return new Cuboid6(0.0, 0.0, 1.0 - plateThickness, 1.0, 1.0, 1.0); - case WEST: - return new Cuboid6(0.0, 0.0, 0.0, plateThickness, 1.0, 1.0); - case EAST: - return new Cuboid6(1.0 - plateThickness, 0.0, 0.0, 1.0, 1.0, 1.0); - default: - throw new UnsupportedOperationException("Cannot get cover plate box at side " + side); - } - } - - static boolean canPlaceCover(CoverDefinition coverDef, ICoverable coverable) { - for (EnumFacing facing : EnumFacing.VALUES) { - CoverBehavior cover = coverDef.createCoverBehavior(coverable, facing); - if (coverable.canPlaceCoverOnSide(facing) && cover.canAttach()) - return true; - } - return false; - } - - /** - * @param mainHandStack the itemstack held in the player's main hand - * @param offHandStack the itemstack held in the player's off-hand - * @return if the machine grid should be rendered - */ - default boolean canRenderMachineGrid(@Nonnull ItemStack mainHandStack, @Nonnull ItemStack offHandStack) { - return true; - } -} diff --git a/src/main/java/gregtech/api/cover2/CoverDefinition2.java b/src/main/java/gregtech/api/cover2/CoverDefinition2.java deleted file mode 100644 index f9676f27c74..00000000000 --- a/src/main/java/gregtech/api/cover2/CoverDefinition2.java +++ /dev/null @@ -1,67 +0,0 @@ -package gregtech.api.cover2; - -import gregtech.api.GregTechAPI; -import gregtech.api.cover.CoverIO; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -public final class CoverDefinition2 { - - private final ResourceLocation coverId; - private final CoverCreator coverCreator; - private final ItemStack dropItemStack; - - public CoverDefinition2(@NotNull ResourceLocation coverId, @NotNull CoverCreator coverCreator, @NotNull ItemStack dropItemStack) { - this.coverId = coverId; - this.coverCreator = coverCreator; - this.dropItemStack = dropItemStack.copy(); - } - - /** - * @param id the cover's id - * @return the cover associated with the id - */ - public static @Nullable CoverDefinition2 getCoverById(@NotNull ResourceLocation id) { - return GregTechAPI.COVER_REGISTRY_2.getObject(id); - } - - /** - * @param networkId the cover's network id - * @return the cover definition associated with the id - * @see CoverIO for an existing implementation - */ - public static @Nullable CoverDefinition2 getCoverByNetworkId(int networkId) { - return GregTechAPI.COVER_REGISTRY_2.getObjectById(networkId); - } - - /** - * @param definition the cover's definition - * @return the network id associated with the cover - * @see CoverIO for an existing implementation - */ - public static int getNetworkIdForCover(@NotNull CoverDefinition2 definition) { - return GregTechAPI.COVER_REGISTRY_2.getIDForObject(definition); - } - - public @NotNull ResourceLocation getCoverId() { - return coverId; - } - - public @NotNull ItemStack getDropItemStack() { - return dropItemStack.copy(); - } - - public @NotNull Cover createCover(@NotNull CoverableView coverableView, @NotNull EnumFacing side) { - return coverCreator.create(this, coverableView, side); - } - - @FunctionalInterface - public interface CoverCreator { - - @NotNull Cover create(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, - @NotNull EnumFacing attachedSide); - } -} diff --git a/src/main/java/gregtech/api/items/behavior/CoverItemBehavior.java b/src/main/java/gregtech/api/items/behavior/CoverItemBehavior.java index d6fd48d8b58..56901483847 100644 --- a/src/main/java/gregtech/api/items/behavior/CoverItemBehavior.java +++ b/src/main/java/gregtech/api/items/behavior/CoverItemBehavior.java @@ -1,10 +1,10 @@ package gregtech.api.items.behavior; import gregtech.api.capability.GregtechTileCapabilities; -import gregtech.api.cover2.Cover; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverHolder; -import gregtech.api.cover2.CoverRayTracer; +import gregtech.api.cover.Cover; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverHolder; +import gregtech.api.cover.CoverRayTracer; import gregtech.api.items.metaitem.stats.IItemBehaviour; import gregtech.core.advancement.AdvancementTriggers; import net.minecraft.entity.player.EntityPlayer; @@ -23,12 +23,12 @@ */ public class CoverItemBehavior implements IItemBehaviour { - private final CoverDefinition2 definition; + private final CoverDefinition definition; /** * @param definition the Cover this item places */ - public CoverItemBehavior(@NotNull CoverDefinition2 definition) { + public CoverItemBehavior(@NotNull CoverDefinition definition) { this.definition = definition; } @@ -66,7 +66,7 @@ public EnumActionResult onItemUseFirst(EntityPlayer player, @NotNull World world return EnumActionResult.SUCCESS; } - public @NotNull CoverDefinition2 getDefinition() { + public @NotNull CoverDefinition getDefinition() { return definition; } } diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java index e79f7bd0050..f2b2b3a75c1 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntity.java @@ -20,10 +20,7 @@ import gregtech.api.capability.IControllable; import gregtech.api.capability.IEnergyContainer; import gregtech.api.capability.impl.*; -import gregtech.api.cover.CoverBehavior; -import gregtech.api.cover.CoverIO; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.*; +import gregtech.api.cover.*; import gregtech.api.gui.ModularUI; import gregtech.api.items.toolitem.ToolClasses; import gregtech.api.items.toolitem.ToolHelper; @@ -117,7 +114,6 @@ public abstract class MetaTileEntity implements CoverHolder, IVoidable { private boolean wasExploded = false; - private final CoverBehavior[] coverBehaviors = new CoverBehavior[6]; private final EnumMap covers = new EnumMap<>(EnumFacing.class); protected List notifiedItemOutputList = new ArrayList<>(); @@ -478,7 +474,7 @@ else if (playerIn.isSneaking() && playerIn.getHeldItemMainhand().isEmpty()) { */ public final boolean onToolClick(EntityPlayer playerIn, @Nonnull Set toolClasses, EnumHand hand, CuboidRayTraceResult hitResult) { // the side hit from the machine grid - EnumFacing gridSideHit = ICoverable.determineGridSideHit(hitResult); + EnumFacing gridSideHit = CoverRayTracer.determineGridSideHit(hitResult); Cover cover = gridSideHit == null ? null : getCoverAtSide(gridSideHit); // Prioritize covers where they apply (Screwdriver, Soft Mallet) @@ -931,7 +927,7 @@ public void receiveCustomData(int dataId, PacketBuffer buf) { } else if (dataId == COVER_REMOVED_MTE) { //cover removed event EnumFacing placementSide = EnumFacing.VALUES[buf.readByte()]; - this.coverBehaviors[placementSide.getIndex()] = null; + this.covers.remove(placementSide); onCoverPlacementUpdate(); scheduleRenderUpdate(); } else if (dataId == UPDATE_COVER_DATA_MTE) { @@ -1187,7 +1183,7 @@ public NBTTagCompound writeToNBT(NBTTagCompound data) { data.setTag(mteTrait.getName(), mteTrait.serializeNBT()); } - CoverIO.writeCoverNBT(data, (side) -> coverBehaviors[side.getIndex()]); + CoverSaveHandler.writeCoverNBT(data, this); data.setBoolean(TAG_KEY_FRAGILE, isFragile); data.setBoolean(TAG_KEY_MUFFLED, muffled); @@ -1214,7 +1210,7 @@ public void readFromNBT(NBTTagCompound data) { mteTrait.deserializeNBT(traitCompound); } - CoverSaveHandler.readCoverNBT(data, this); + CoverSaveHandler.readCoverNBT(data, this, covers::put); this.isFragile = data.getBoolean(TAG_KEY_FRAGILE); this.muffled = data.getBoolean(TAG_KEY_MUFFLED); } diff --git a/src/main/java/gregtech/api/metatileentity/MetaTileEntityHolder.java b/src/main/java/gregtech/api/metatileentity/MetaTileEntityHolder.java index dcf03e6946a..22c25a71c29 100644 --- a/src/main/java/gregtech/api/metatileentity/MetaTileEntityHolder.java +++ b/src/main/java/gregtech/api/metatileentity/MetaTileEntityHolder.java @@ -12,7 +12,7 @@ import gregtech.api.GregTechAPI; import gregtech.api.block.machines.BlockMachine; import gregtech.api.capability.GregtechDataCodes; -import gregtech.api.cover2.Cover; +import gregtech.api.cover.Cover; import gregtech.api.gui.IUIHolder; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.util.GTLog; diff --git a/src/main/java/gregtech/api/metatileentity/SimpleMachineMetaTileEntity.java b/src/main/java/gregtech/api/metatileentity/SimpleMachineMetaTileEntity.java index 55c7086f4d7..53a83e43d2a 100644 --- a/src/main/java/gregtech/api/metatileentity/SimpleMachineMetaTileEntity.java +++ b/src/main/java/gregtech/api/metatileentity/SimpleMachineMetaTileEntity.java @@ -9,7 +9,7 @@ import gregtech.api.capability.IActiveOutputSide; import gregtech.api.capability.IGhostSlotConfigurable; import gregtech.api.capability.impl.*; -import gregtech.api.cover2.Cover; +import gregtech.api.cover.Cover; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.resources.TextureArea; diff --git a/src/main/java/gregtech/api/pipenet/block/BlockPipe.java b/src/main/java/gregtech/api/pipenet/block/BlockPipe.java index 034556d38dd..5670ae78b43 100644 --- a/src/main/java/gregtech/api/pipenet/block/BlockPipe.java +++ b/src/main/java/gregtech/api/pipenet/block/BlockPipe.java @@ -5,12 +5,10 @@ import codechicken.lib.raytracer.RayTracer; import codechicken.lib.vec.Cuboid6; import gregtech.api.block.BuiltInRenderBlock; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover.ICoverable.CoverSideData; -import gregtech.api.cover.ICoverable.PrimaryBoxData; +import gregtech.api.cover.Cover; +import gregtech.api.cover.CoverHolder; +import gregtech.api.cover.CoverRayTracer; import gregtech.api.cover.IFacadeCover; -import gregtech.api.cover2.Cover; -import gregtech.api.cover2.CoverHolder; import gregtech.api.items.toolitem.ToolClasses; import gregtech.api.items.toolitem.ToolHelper; import gregtech.api.pipenet.IBlockAppearance; @@ -270,10 +268,9 @@ public ItemStack getPickBlock(@Nonnull IBlockState state, @Nonnull RayTraceResul if (pipeTile == null) { return ItemStack.EMPTY; } - if (target instanceof CuboidRayTraceResult) { - CuboidRayTraceResult result = (CuboidRayTraceResult) target; - if (result.cuboid6.data instanceof CoverSideData) { - EnumFacing coverSide = ((CoverSideData) result.cuboid6.data).side; + if (target instanceof CuboidRayTraceResult result) { + if (result.cuboid6.data instanceof CoverRayTracer.CoverSideData coverSideData) { + EnumFacing coverSide = coverSideData.side; Cover cover = pipeTile.getCoverableImplementation().getCoverAtSide(coverSide); return cover == null ? ItemStack.EMPTY : cover.getPickItem(); } @@ -324,17 +321,19 @@ public boolean onPipeActivated(World world, IBlockState state, BlockPos pos, Ent } } - EnumFacing coverSide = ICoverable.traceCoverSide(hit); + EnumFacing coverSide = CoverRayTracer.traceCoverSide(hit); if (coverSide == null) { return activateFrame(world, state, pos, entityPlayer, hand, hit, pipeTile); } - if (!(hit.cuboid6.data instanceof CoverSideData)) { + if (!(hit.cuboid6.data instanceof CoverRayTracer.CoverSideData)) { switch (onPipeToolUsed(world, pos, itemStack, coverSide, pipeTile, entityPlayer, hand)) { - case SUCCESS: + case SUCCESS -> { return true; - case FAIL: + } + case FAIL -> { return false; + } } } @@ -423,7 +422,7 @@ public void onBlockClicked(@Nonnull World worldIn, @Nonnull BlockPos pos, @Nonnu if (pipeTile == null || rayTraceResult == null) { return; } - EnumFacing coverSide = ICoverable.traceCoverSide(rayTraceResult); + EnumFacing coverSide = CoverRayTracer.traceCoverSide(rayTraceResult); Cover cover = coverSide == null ? null : pipeTile.getCoverableImplementation().getCoverAtSide(coverSide); if (cover != null) { @@ -573,7 +572,7 @@ private List getCollisionBox(IBlockAccess world, BlockPos pos, @ // Always add normal collision so player doesn't "fall through" the cable/pipe when // a tool is put in hand, and will still be standing where they were before. - result.add(new IndexedCuboid6(new PrimaryBoxData(true), getSideBox(null, thickness))); + result.add(new IndexedCuboid6(new CoverRayTracer.PrimaryBoxData(true), getSideBox(null, thickness))); for (EnumFacing side : EnumFacing.VALUES) { if ((actualConnections & 1 << side.getIndex()) > 0) { result.add(new IndexedCuboid6(new PipeConnectionData(side), getSideBox(side, thickness))); diff --git a/src/main/java/gregtech/api/pipenet/tile/PipeCoverableImplementation.java b/src/main/java/gregtech/api/pipenet/tile/PipeCoverableImplementation.java index 9fb48ebff8f..4cd5ce3adb1 100644 --- a/src/main/java/gregtech/api/pipenet/tile/PipeCoverableImplementation.java +++ b/src/main/java/gregtech/api/pipenet/tile/PipeCoverableImplementation.java @@ -1,8 +1,8 @@ package gregtech.api.pipenet.tile; -import gregtech.api.cover2.Cover; -import gregtech.api.cover2.CoverHolder; -import gregtech.api.cover2.CoverSaveHandler; +import gregtech.api.cover.Cover; +import gregtech.api.cover.CoverHolder; +import gregtech.api.cover.CoverSaveHandler; import gregtech.api.pipenet.block.BlockPipe; import gregtech.api.util.GTUtility; import gregtech.common.ConfigHolder; @@ -88,7 +88,7 @@ public void onLoad() { } @Override - public final int getInputRedstoneSignal(EnumFacing side, boolean ignoreCover) { + public final int getInputRedstoneSignal(@NotNull EnumFacing side, boolean ignoreCover) { if (!ignoreCover && getCoverAtSide(side) != null) { return 0; //covers block input redstone signal for machine } @@ -235,7 +235,7 @@ public void writeToNBT(NBTTagCompound data) { } public void readFromNBT(NBTTagCompound data) { - CoverSaveHandler.readCoverNBT(data, this); + CoverSaveHandler.readCoverNBT(data, this, covers::put); } @Override diff --git a/src/main/java/gregtech/api/pipenet/tile/TileEntityPipeBase.java b/src/main/java/gregtech/api/pipenet/tile/TileEntityPipeBase.java index a2866dd755b..c6c04cdfd84 100644 --- a/src/main/java/gregtech/api/pipenet/tile/TileEntityPipeBase.java +++ b/src/main/java/gregtech/api/pipenet/tile/TileEntityPipeBase.java @@ -2,7 +2,7 @@ import gregtech.api.GregTechAPI; import gregtech.api.capability.GregtechTileCapabilities; -import gregtech.api.cover2.Cover; +import gregtech.api.cover.Cover; import gregtech.api.metatileentity.SyncedTileEntityBase; import gregtech.api.pipenet.PipeNet; import gregtech.api.pipenet.WorldPipeNet; diff --git a/src/main/java/gregtech/api/util/GTUtility.java b/src/main/java/gregtech/api/util/GTUtility.java index 2996ac0380a..aa418ae2f58 100644 --- a/src/main/java/gregtech/api/util/GTUtility.java +++ b/src/main/java/gregtech/api/util/GTUtility.java @@ -5,7 +5,7 @@ import gregtech.api.GregTechAPI; import gregtech.api.block.machines.MachineItemBlock; import gregtech.api.capability.IMultipleTankHandler; -import gregtech.api.cover2.CoverDefinition2; +import gregtech.api.cover.CoverDefinition; import gregtech.api.items.behavior.CoverItemBehavior; import gregtech.api.items.metaitem.MetaItem; import gregtech.api.items.metaitem.stats.IItemBehaviour; @@ -525,7 +525,7 @@ public static boolean arePosEqual(BlockPos pos1, BlockPos pos2) { return pos1.getX() == pos2.getX() & pos1.getY() == pos2.getY() & pos1.getZ() == pos2.getZ(); } - public static boolean isCoverBehaviorItem(ItemStack itemStack, @Nullable BooleanSupplier hasCoverSupplier, @Nullable Predicate canPlaceCover) { + public static boolean isCoverBehaviorItem(ItemStack itemStack, @Nullable BooleanSupplier hasCoverSupplier, @Nullable Predicate canPlaceCover) { Item item = itemStack.getItem(); if (item instanceof MetaItem) { MetaItem metaItem = (MetaItem) itemStack.getItem(); diff --git a/src/main/java/gregtech/client/renderer/handler/FacadeRenderer.java b/src/main/java/gregtech/client/renderer/handler/FacadeRenderer.java index 5854a7aa7bb..af9e1231e26 100644 --- a/src/main/java/gregtech/client/renderer/handler/FacadeRenderer.java +++ b/src/main/java/gregtech/client/renderer/handler/FacadeRenderer.java @@ -11,7 +11,7 @@ import codechicken.lib.vec.Vector3; import com.google.common.cache.Cache; import com.google.common.cache.CacheBuilder; -import gregtech.api.cover.ICoverable; +import gregtech.api.cover.CoverUtil; import gregtech.api.items.metaitem.MetaItem; import gregtech.api.util.ModCompatibility; import gregtech.client.model.pipeline.VertexLighterFlatSpecial; @@ -82,7 +82,7 @@ public void renderItem(ItemStack rawStack, ItemCameraTransforms.TransformType tr renderState.reset(); renderState.startDrawing(GL11.GL_QUADS, DefaultVertexFormats.ITEM); try { - FacadeRenderer.renderItemCover(renderState, EnumFacing.NORTH.getIndex(), facadeStack, ICoverable.getCoverPlateBox(EnumFacing.NORTH, 2.0 / 16.0)); + FacadeRenderer.renderItemCover(renderState, EnumFacing.NORTH.getIndex(), facadeStack, CoverUtil.getCoverPlateBox(EnumFacing.NORTH, 2.0 / 16.0)); } catch (Throwable ignored) { } renderState.draw(); diff --git a/src/main/java/gregtech/client/renderer/handler/MetaTileEntityTESR.java b/src/main/java/gregtech/client/renderer/handler/MetaTileEntityTESR.java index 9a84824636f..cb4ae1cb528 100644 --- a/src/main/java/gregtech/client/renderer/handler/MetaTileEntityTESR.java +++ b/src/main/java/gregtech/client/renderer/handler/MetaTileEntityTESR.java @@ -2,7 +2,7 @@ import codechicken.lib.render.CCRenderState; import codechicken.lib.vec.Matrix4; -import gregtech.api.cover2.Cover; +import gregtech.api.cover.Cover; import gregtech.api.metatileentity.IFastRenderMetaTileEntity; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.metatileentity.MetaTileEntityHolder; diff --git a/src/main/java/gregtech/client/renderer/pipe/PipeRenderer.java b/src/main/java/gregtech/client/renderer/pipe/PipeRenderer.java index 497d252171e..896777a2c8f 100644 --- a/src/main/java/gregtech/client/renderer/pipe/PipeRenderer.java +++ b/src/main/java/gregtech/client/renderer/pipe/PipeRenderer.java @@ -15,7 +15,7 @@ import codechicken.lib.vec.Translation; import codechicken.lib.vec.Vector3; import codechicken.lib.vec.uv.IconTransformation; -import gregtech.api.cover2.CoverHolder; +import gregtech.api.cover.CoverHolder; import gregtech.api.pipenet.block.BlockPipe; import gregtech.api.pipenet.block.IPipeType; import gregtech.api.pipenet.block.ItemBlockPipe; diff --git a/src/main/java/gregtech/common/ToolEventHandlers.java b/src/main/java/gregtech/common/ToolEventHandlers.java index 9279d3c8412..eb4ccb5707a 100644 --- a/src/main/java/gregtech/common/ToolEventHandlers.java +++ b/src/main/java/gregtech/common/ToolEventHandlers.java @@ -6,8 +6,8 @@ import gregtech.api.capability.GregtechTileCapabilities; import gregtech.api.capability.IElectricItem; import gregtech.api.capability.impl.ElectricItem; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverHolder; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverHolder; import gregtech.api.items.toolitem.IGTTool; import gregtech.api.items.toolitem.ToolClasses; import gregtech.api.items.toolitem.ToolHelper; @@ -297,7 +297,7 @@ private static boolean shouldRenderGridOverlays(@Nonnull IBlockState state, Tile offToolClasses.stream().anyMatch(s -> pipe.isToolEffective(s, state))) return true; BooleanSupplier hasCover = () -> tile instanceof IPipeTile && ((IPipeTile) tile).getCoverableImplementation().hasAnyCover(); - Predicate canCover = coverDef -> { + Predicate canCover = coverDef -> { if (tile instanceof IPipeTile pipeTile) { for (EnumFacing facing : EnumFacing.VALUES) { if (pipeTile.getCoverableImplementation().canConnectRedstone(facing)) { diff --git a/src/main/java/gregtech/common/covers/CoverBehaviors.java b/src/main/java/gregtech/common/covers/CoverBehaviors.java index 6b4646ba979..3d17ec01dcc 100644 --- a/src/main/java/gregtech/common/covers/CoverBehaviors.java +++ b/src/main/java/gregtech/common/covers/CoverBehaviors.java @@ -2,7 +2,7 @@ import gregtech.api.GTValues; import gregtech.api.GregTechAPI; -import gregtech.api.cover2.CoverDefinition2; +import gregtech.api.cover.CoverDefinition; import gregtech.api.items.behavior.CoverItemBehavior; import gregtech.api.items.metaitem.MetaItem.MetaValueItem; import gregtech.api.util.GTLog; @@ -136,7 +136,7 @@ public static void init() { * @param behaviorCreator a function creating the cover behavior */ public static void registerBehavior(@NotNull ResourceLocation coverId, @NotNull MetaValueItem placerItem, - @NotNull CoverDefinition2.CoverCreator behaviorCreator) { + @NotNull CoverDefinition.CoverCreator behaviorCreator) { placerItem.addComponents(new CoverItemBehavior(registerCover(coverId, placerItem, behaviorCreator))); } @@ -148,10 +148,10 @@ public static void registerBehavior(@NotNull ResourceLocation coverId, @NotNull * @param behaviorCreator a function creating the cover behavior * @return the registered cover definition */ - public static @NotNull CoverDefinition2 registerCover(@NotNull ResourceLocation coverId, @NotNull MetaValueItem itemStack, - @NotNull CoverDefinition2.CoverCreator behaviorCreator) { - CoverDefinition2 coverDefinition = new CoverDefinition2(coverId, behaviorCreator, itemStack.getStackForm()); - GregTechAPI.COVER_REGISTRY_2.register(rollingId++, coverId, coverDefinition); + public static @NotNull CoverDefinition registerCover(@NotNull ResourceLocation coverId, @NotNull MetaValueItem itemStack, + @NotNull CoverDefinition.CoverCreator behaviorCreator) { + CoverDefinition coverDefinition = new CoverDefinition(coverId, behaviorCreator, itemStack.getStackForm()); + GregTechAPI.COVER_REGISTRY.register(rollingId++, coverId, coverDefinition); return coverDefinition; } } diff --git a/src/main/java/gregtech/common/covers/CoverConveyor.java b/src/main/java/gregtech/common/covers/CoverConveyor.java index 6b02e0b1214..b0efb78ef6b 100644 --- a/src/main/java/gregtech/common/covers/CoverConveyor.java +++ b/src/main/java/gregtech/common/covers/CoverConveyor.java @@ -9,16 +9,15 @@ import gregtech.api.capability.GregtechTileCapabilities; import gregtech.api.capability.IControllable; import gregtech.api.capability.impl.ItemHandlerDelegate; +import gregtech.api.cover.CoverBase; +import gregtech.api.cover.CoverDefinition; import gregtech.api.cover.CoverWithUI; -import gregtech.api.cover2.CoverBase; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.*; import gregtech.api.metatileentity.MetaTileEntity; import gregtech.api.util.GTTransferUtils; -import gregtech.api.util.IDirtyNotifiable; import gregtech.api.util.ItemStackHashStrategy; import gregtech.client.renderer.texture.Textures; import gregtech.client.renderer.texture.cube.SimpleSidedCubeRenderer; @@ -64,7 +63,7 @@ public class CoverConveyor extends CoverBase implements CoverWithUI, ITickable, private CoverableItemHandlerWrapper itemHandlerWrapper; protected boolean isWorkingAllowed = true; - public CoverConveyor(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, + public CoverConveyor(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide, int tier, int itemsPerSecond) { super(definition, coverableView, attachedSide); this.tier = tier; diff --git a/src/main/java/gregtech/common/covers/CoverCraftingTable.java b/src/main/java/gregtech/common/covers/CoverCraftingTable.java index 4d7b3565344..fd1aca60e5a 100644 --- a/src/main/java/gregtech/common/covers/CoverCraftingTable.java +++ b/src/main/java/gregtech/common/covers/CoverCraftingTable.java @@ -6,10 +6,10 @@ import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; import com.google.common.base.Preconditions; +import gregtech.api.cover.CoverBase; +import gregtech.api.cover.CoverDefinition; import gregtech.api.cover.CoverWithUI; -import gregtech.api.cover2.CoverBase; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.storage.ICraftingStorage; @@ -49,7 +49,7 @@ public class CoverCraftingTable extends CoverBase implements CoverWithUI, ITicka private CraftingRecipeLogic recipeLogic = null; private int itemsCrafted = 0; - public CoverCraftingTable(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverCraftingTable(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/CoverDigitalInterface.java b/src/main/java/gregtech/common/covers/CoverDigitalInterface.java index 5bb10ed2e47..a936a9140ff 100644 --- a/src/main/java/gregtech/common/covers/CoverDigitalInterface.java +++ b/src/main/java/gregtech/common/covers/CoverDigitalInterface.java @@ -8,12 +8,10 @@ import codechicken.lib.vec.Rotation; import gregtech.api.capability.*; import gregtech.api.capability.impl.*; -import gregtech.api.cover.CoverBehavior; +import gregtech.api.cover.CoverBase; +import gregtech.api.cover.CoverDefinition; import gregtech.api.cover.CoverWithUI; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverBase; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.*; @@ -71,7 +69,7 @@ public class CoverDigitalInterface extends CoverBase implements IFastRenderMetaTileEntity, ITickable, CoverWithUI { - public CoverDigitalInterface(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverDigitalInterface(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/CoverDigitalInterfaceWireless.java b/src/main/java/gregtech/common/covers/CoverDigitalInterfaceWireless.java index 5be7e450597..1d7efdb7ee9 100644 --- a/src/main/java/gregtech/common/covers/CoverDigitalInterfaceWireless.java +++ b/src/main/java/gregtech/common/covers/CoverDigitalInterfaceWireless.java @@ -5,9 +5,8 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.api.util.FacingPos; import gregtech.client.renderer.texture.Textures; @@ -31,7 +30,7 @@ public class CoverDigitalInterfaceWireless extends CoverDigitalInterface { private BlockPos remote; - public CoverDigitalInterfaceWireless(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverDigitalInterfaceWireless(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/CoverEnderFluidLink.java b/src/main/java/gregtech/common/covers/CoverEnderFluidLink.java index 96510ea5f85..4161b7eecf5 100644 --- a/src/main/java/gregtech/common/covers/CoverEnderFluidLink.java +++ b/src/main/java/gregtech/common/covers/CoverEnderFluidLink.java @@ -7,10 +7,10 @@ import codechicken.lib.vec.Matrix4; import gregtech.api.capability.GregtechTileCapabilities; import gregtech.api.capability.IControllable; +import gregtech.api.cover.CoverBase; +import gregtech.api.cover.CoverDefinition; import gregtech.api.cover.CoverWithUI; -import gregtech.api.cover2.CoverBase; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.*; @@ -52,7 +52,7 @@ public class CoverEnderFluidLink extends CoverBase implements CoverWithUI, ITick private final FluidTankSwitchShim linkedTank; protected final FluidFilterContainer fluidFilter; - protected CoverEnderFluidLink(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + protected CoverEnderFluidLink(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); this.linkedTank = new FluidTankSwitchShim(VirtualTankRegistry.getTankCreate(makeTankName(), null)); this.fluidFilter = new FluidFilterContainer(this); diff --git a/src/main/java/gregtech/common/covers/CoverFacade.java b/src/main/java/gregtech/common/covers/CoverFacade.java index 97c97e841ae..43625bcb562 100644 --- a/src/main/java/gregtech/common/covers/CoverFacade.java +++ b/src/main/java/gregtech/common/covers/CoverFacade.java @@ -4,10 +4,10 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; +import gregtech.api.cover.CoverBase; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.api.cover.IFacadeCover; -import gregtech.api.cover2.CoverBase; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; import gregtech.client.renderer.handler.FacadeRenderer; import gregtech.common.covers.facade.FacadeHelper; import gregtech.common.items.behaviors.FacadeItem; @@ -31,7 +31,7 @@ public class CoverFacade extends CoverBase implements IFacadeCover { private ItemStack facadeStack = ItemStack.EMPTY; private IBlockState facadeState = Blocks.STONE.getDefaultState(); - public CoverFacade(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, + public CoverFacade(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/CoverFluidFilter.java b/src/main/java/gregtech/common/covers/CoverFluidFilter.java index de391b6c651..cba0149f52a 100644 --- a/src/main/java/gregtech/common/covers/CoverFluidFilter.java +++ b/src/main/java/gregtech/common/covers/CoverFluidFilter.java @@ -6,12 +6,10 @@ import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; import gregtech.api.capability.impl.FluidHandlerDelegate; -import gregtech.api.cover.CoverBehavior; +import gregtech.api.cover.CoverBase; +import gregtech.api.cover.CoverDefinition; import gregtech.api.cover.CoverWithUI; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverBase; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.CycleButtonWidget; @@ -44,7 +42,7 @@ public class CoverFluidFilter extends CoverBase implements CoverWithUI { protected FluidFilterMode filterMode; protected FluidHandlerFiltered fluidHandler; - public CoverFluidFilter(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, + public CoverFluidFilter(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide, String titleLocale, SimpleOverlayRenderer texture, FluidFilter fluidFilter) { super(definition, coverableView, attachedSide); this.filterMode = FluidFilterMode.FILTER_FILL; diff --git a/src/main/java/gregtech/common/covers/CoverFluidRegulator.java b/src/main/java/gregtech/common/covers/CoverFluidRegulator.java index afa4809787e..e6d70dfc2a4 100644 --- a/src/main/java/gregtech/common/covers/CoverFluidRegulator.java +++ b/src/main/java/gregtech/common/covers/CoverFluidRegulator.java @@ -1,9 +1,8 @@ package gregtech.common.covers; import com.google.common.math.IntMath; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.*; @@ -43,7 +42,7 @@ public class CoverFluidRegulator extends CoverPump { protected TransferMode transferMode = TransferMode.TRANSFER_ANY; protected int transferAmount = 0; - public CoverFluidRegulator(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide, int tier, int mbPerTick) { + public CoverFluidRegulator(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide, int tier, int mbPerTick) { super(definition, coverableView, attachedSide, tier, mbPerTick); this.fluidFilter = new FluidFilterContainer(this, this::shouldShowTip, maxFluidTransferRate * 100); } diff --git a/src/main/java/gregtech/common/covers/CoverFluidVoiding.java b/src/main/java/gregtech/common/covers/CoverFluidVoiding.java index 1b0b7d82bd5..758b973df8a 100644 --- a/src/main/java/gregtech/common/covers/CoverFluidVoiding.java +++ b/src/main/java/gregtech/common/covers/CoverFluidVoiding.java @@ -6,8 +6,8 @@ import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; import gregtech.api.capability.GregtechTileCapabilities; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.CycleButtonWidget; @@ -33,7 +33,7 @@ public class CoverFluidVoiding extends CoverPump { protected final NullFluidTank nullFluidTank = new NullFluidTank(); - public CoverFluidVoiding(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverFluidVoiding(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide, 0, Integer.MAX_VALUE); this.isWorkingAllowed = false; this.fluidFilter = new FluidFilterContainer(this, this::shouldShowTip, Integer.MAX_VALUE); diff --git a/src/main/java/gregtech/common/covers/CoverFluidVoidingAdvanced.java b/src/main/java/gregtech/common/covers/CoverFluidVoidingAdvanced.java index 17b3d2d1323..06ce32f3a78 100644 --- a/src/main/java/gregtech/common/covers/CoverFluidVoidingAdvanced.java +++ b/src/main/java/gregtech/common/covers/CoverFluidVoidingAdvanced.java @@ -1,13 +1,11 @@ package gregtech.common.covers; -import codechicken.lib.raytracer.CuboidRayTraceResult; import codechicken.lib.render.CCRenderState; import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.Widget; @@ -17,9 +15,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockRenderLayer; -import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumFacing; -import net.minecraft.util.EnumHand; import net.minecraft.util.math.MathHelper; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.CapabilityFluidHandler; @@ -35,7 +31,7 @@ public class CoverFluidVoidingAdvanced extends CoverFluidVoiding { protected VoidingMode voidingMode = VoidingMode.VOID_ANY; protected int transferAmount = 0; - public CoverFluidVoidingAdvanced(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverFluidVoidingAdvanced(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/CoverInfiniteWater.java b/src/main/java/gregtech/common/covers/CoverInfiniteWater.java index 8146fdc3031..769f8badd93 100644 --- a/src/main/java/gregtech/common/covers/CoverInfiniteWater.java +++ b/src/main/java/gregtech/common/covers/CoverInfiniteWater.java @@ -4,11 +4,9 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; -import gregtech.api.cover.CoverBehavior; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverBase; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverBase; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.client.renderer.texture.Textures; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; @@ -21,7 +19,7 @@ public class CoverInfiniteWater extends CoverBase implements ITickable { - public CoverInfiniteWater(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverInfiniteWater(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/CoverItemFilter.java b/src/main/java/gregtech/common/covers/CoverItemFilter.java index 2092207c690..536c6c8fb74 100644 --- a/src/main/java/gregtech/common/covers/CoverItemFilter.java +++ b/src/main/java/gregtech/common/covers/CoverItemFilter.java @@ -6,12 +6,10 @@ import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; import gregtech.api.capability.impl.ItemHandlerDelegate; -import gregtech.api.cover.CoverBehavior; +import gregtech.api.cover.CoverBase; +import gregtech.api.cover.CoverDefinition; import gregtech.api.cover.CoverWithUI; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverBase; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.CycleButtonWidget; @@ -44,7 +42,7 @@ public class CoverItemFilter extends CoverBase implements CoverWithUI { protected ItemFilterMode filterMode = ItemFilterMode.FILTER_INSERT; protected ItemHandlerFiltered itemHandler; - public CoverItemFilter(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, + public CoverItemFilter(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide, String titleLocale, SimpleOverlayRenderer texture, ItemFilter itemFilter) { super(definition, coverableView, attachedSide); diff --git a/src/main/java/gregtech/common/covers/CoverItemVoiding.java b/src/main/java/gregtech/common/covers/CoverItemVoiding.java index 6927fa587db..7b4cf34aee2 100644 --- a/src/main/java/gregtech/common/covers/CoverItemVoiding.java +++ b/src/main/java/gregtech/common/covers/CoverItemVoiding.java @@ -6,9 +6,8 @@ import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; import gregtech.api.capability.GregtechTileCapabilities; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.CycleButtonWidget; @@ -33,7 +32,7 @@ public class CoverItemVoiding extends CoverConveyor { protected final NullItemHandler nullItemHandler = new NullItemHandler(); - public CoverItemVoiding(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, + public CoverItemVoiding(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide, 0, Integer.MAX_VALUE); this.isWorkingAllowed = false; diff --git a/src/main/java/gregtech/common/covers/CoverItemVoidingAdvanced.java b/src/main/java/gregtech/common/covers/CoverItemVoidingAdvanced.java index 949a7563d6e..0bb0ec9f8a4 100644 --- a/src/main/java/gregtech/common/covers/CoverItemVoidingAdvanced.java +++ b/src/main/java/gregtech/common/covers/CoverItemVoidingAdvanced.java @@ -4,9 +4,8 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.Widget; @@ -29,8 +28,8 @@ public class CoverItemVoidingAdvanced extends CoverItemVoiding { protected VoidingMode voidingMode; - public CoverItemVoidingAdvanced(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, - @NotNull EnumFacing attachedSide) { + public CoverItemVoidingAdvanced(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, + @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); this.voidingMode = VoidingMode.VOID_ANY; this.itemFilterContainer.setMaxStackSize(1); diff --git a/src/main/java/gregtech/common/covers/CoverMachineController.java b/src/main/java/gregtech/common/covers/CoverMachineController.java index 2f9d2135f09..bba0f3cc1f9 100644 --- a/src/main/java/gregtech/common/covers/CoverMachineController.java +++ b/src/main/java/gregtech/common/covers/CoverMachineController.java @@ -7,11 +7,7 @@ import codechicken.lib.vec.Matrix4; import gregtech.api.capability.GregtechTileCapabilities; import gregtech.api.capability.IControllable; -import gregtech.api.cover.CoverWithUI; -import gregtech.api.cover2.Cover; -import gregtech.api.cover2.CoverBase; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.*; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.*; @@ -36,7 +32,7 @@ public class CoverMachineController extends CoverBase implements CoverWithUI { private ControllerMode controllerMode; private final ItemStackHandler displayInventory = new ItemStackHandler(1); - public CoverMachineController(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, + public CoverMachineController(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); this.minRedstoneStrength = 1; diff --git a/src/main/java/gregtech/common/covers/CoverPump.java b/src/main/java/gregtech/common/covers/CoverPump.java index 5ecc8df4316..9740bf90837 100644 --- a/src/main/java/gregtech/common/covers/CoverPump.java +++ b/src/main/java/gregtech/common/covers/CoverPump.java @@ -10,10 +10,10 @@ import gregtech.api.capability.GregtechTileCapabilities; import gregtech.api.capability.IControllable; import gregtech.api.capability.impl.FluidHandlerDelegate; +import gregtech.api.cover.CoverBase; +import gregtech.api.cover.CoverDefinition; import gregtech.api.cover.CoverWithUI; -import gregtech.api.cover2.CoverBase; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.*; @@ -60,7 +60,7 @@ public class CoverPump extends CoverBase implements CoverWithUI, ITickable, ICon protected FluidFilterContainer fluidFilter; protected BucketMode bucketMode = BucketMode.MILLI_BUCKET; - public CoverPump(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, + public CoverPump(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide, int tier, int mbPerTick) { super(definition, coverableView, attachedSide); this.tier = tier; diff --git a/src/main/java/gregtech/common/covers/CoverRoboticArm.java b/src/main/java/gregtech/common/covers/CoverRoboticArm.java index 5b48e3fab61..4c1250ac56e 100644 --- a/src/main/java/gregtech/common/covers/CoverRoboticArm.java +++ b/src/main/java/gregtech/common/covers/CoverRoboticArm.java @@ -4,9 +4,8 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.ModularUI.Builder; @@ -31,7 +30,7 @@ public class CoverRoboticArm extends CoverConveyor { protected TransferMode transferMode; protected int itemsTransferBuffered; - public CoverRoboticArm(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, + public CoverRoboticArm(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide, int tier, int itemsPerSecond) { super(definition, coverableView, attachedSide, tier, itemsPerSecond); this.transferMode = TransferMode.TRANSFER_ANY; diff --git a/src/main/java/gregtech/common/covers/CoverScreen.java b/src/main/java/gregtech/common/covers/CoverScreen.java index 34b6c76095f..2d70d9d4d48 100644 --- a/src/main/java/gregtech/common/covers/CoverScreen.java +++ b/src/main/java/gregtech/common/covers/CoverScreen.java @@ -4,11 +4,9 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; -import gregtech.api.cover.CoverBehavior; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverBase; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverBase; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.client.renderer.texture.Textures; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; @@ -16,7 +14,7 @@ public class CoverScreen extends CoverBase { - public CoverScreen(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverScreen(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/CoverShutter.java b/src/main/java/gregtech/common/covers/CoverShutter.java index b93448ef149..979dd57b361 100644 --- a/src/main/java/gregtech/common/covers/CoverShutter.java +++ b/src/main/java/gregtech/common/covers/CoverShutter.java @@ -7,11 +7,9 @@ import codechicken.lib.vec.Matrix4; import gregtech.api.capability.GregtechTileCapabilities; import gregtech.api.capability.IControllable; -import gregtech.api.cover.CoverBehavior; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverBase; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverBase; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.client.renderer.texture.Textures; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; @@ -26,7 +24,7 @@ public class CoverShutter extends CoverBase implements IControllable { private boolean isWorkingAllowed = true; - public CoverShutter(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, + public CoverShutter(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/CoverSolarPanel.java b/src/main/java/gregtech/common/covers/CoverSolarPanel.java index b243a9b2f56..4e32c83e4dd 100644 --- a/src/main/java/gregtech/common/covers/CoverSolarPanel.java +++ b/src/main/java/gregtech/common/covers/CoverSolarPanel.java @@ -6,11 +6,9 @@ import codechicken.lib.vec.Matrix4; import gregtech.api.capability.GregtechCapabilities; import gregtech.api.capability.IEnergyContainer; -import gregtech.api.cover.CoverBehavior; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverBase; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverBase; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.api.util.GTUtility; import gregtech.client.renderer.texture.Textures; import gregtech.client.renderer.texture.cube.SimpleSidedCubeRenderer; @@ -28,7 +26,7 @@ public class CoverSolarPanel extends CoverBase implements ITickable { private final long EUt; - public CoverSolarPanel(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, + public CoverSolarPanel(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide, long EUt) { super(definition, coverableView, attachedSide); this.EUt = EUt; diff --git a/src/main/java/gregtech/common/covers/CoverStorage.java b/src/main/java/gregtech/common/covers/CoverStorage.java index affe8b32062..ce5a0180392 100644 --- a/src/main/java/gregtech/common/covers/CoverStorage.java +++ b/src/main/java/gregtech/common/covers/CoverStorage.java @@ -5,10 +5,10 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; +import gregtech.api.cover.CoverBase; +import gregtech.api.cover.CoverDefinition; import gregtech.api.cover.CoverWithUI; -import gregtech.api.cover2.CoverBase; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.metatileentity.MetaTileEntity; @@ -31,7 +31,7 @@ public class CoverStorage extends CoverBase implements CoverWithUI { private static final int MAX_HEIGHT = 126; private static final int SLOT_SIZE = 18; - public CoverStorage(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverStorage(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/detector/CoverDetectorActivity.java b/src/main/java/gregtech/common/covers/detector/CoverDetectorActivity.java index 2c04265c55d..dc12154a5e9 100644 --- a/src/main/java/gregtech/common/covers/detector/CoverDetectorActivity.java +++ b/src/main/java/gregtech/common/covers/detector/CoverDetectorActivity.java @@ -6,9 +6,8 @@ import codechicken.lib.vec.Matrix4; import gregtech.api.capability.GregtechTileCapabilities; import gregtech.api.capability.IWorkable; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.client.renderer.texture.Textures; import net.minecraft.util.BlockRenderLayer; import net.minecraft.util.EnumFacing; @@ -17,7 +16,7 @@ public class CoverDetectorActivity extends CoverDetectorBase implements ITickable { - public CoverDetectorActivity(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverDetectorActivity(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/detector/CoverDetectorActivityAdvanced.java b/src/main/java/gregtech/common/covers/detector/CoverDetectorActivityAdvanced.java index c841e3470ef..92db20aa997 100644 --- a/src/main/java/gregtech/common/covers/detector/CoverDetectorActivityAdvanced.java +++ b/src/main/java/gregtech/common/covers/detector/CoverDetectorActivityAdvanced.java @@ -6,9 +6,8 @@ import codechicken.lib.vec.Matrix4; import gregtech.api.capability.GregtechTileCapabilities; import gregtech.api.capability.IWorkable; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.api.util.RedstoneUtil; import gregtech.client.renderer.texture.Textures; import net.minecraft.util.BlockRenderLayer; @@ -17,7 +16,7 @@ public class CoverDetectorActivityAdvanced extends CoverDetectorActivity { - public CoverDetectorActivityAdvanced(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverDetectorActivityAdvanced(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/detector/CoverDetectorBase.java b/src/main/java/gregtech/common/covers/detector/CoverDetectorBase.java index febd4680419..ce66e71af82 100644 --- a/src/main/java/gregtech/common/covers/detector/CoverDetectorBase.java +++ b/src/main/java/gregtech/common/covers/detector/CoverDetectorBase.java @@ -1,11 +1,9 @@ package gregtech.common.covers.detector; import codechicken.lib.raytracer.CuboidRayTraceResult; -import gregtech.api.cover.CoverBehavior; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverBase; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverBase; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.PacketBuffer; @@ -23,7 +21,7 @@ public abstract class CoverDetectorBase extends CoverBase { private boolean isInverted = false; private int redstoneSignalOutput = 0; - public CoverDetectorBase(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, + public CoverDetectorBase(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/detector/CoverDetectorEnergy.java b/src/main/java/gregtech/common/covers/detector/CoverDetectorEnergy.java index d17ffb0aaf7..03496a7ebde 100644 --- a/src/main/java/gregtech/common/covers/detector/CoverDetectorEnergy.java +++ b/src/main/java/gregtech/common/covers/detector/CoverDetectorEnergy.java @@ -6,9 +6,8 @@ import codechicken.lib.vec.Matrix4; import gregtech.api.capability.GregtechCapabilities; import gregtech.api.capability.IEnergyContainer; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.api.util.RedstoneUtil; import gregtech.client.renderer.texture.Textures; import net.minecraft.util.BlockRenderLayer; @@ -18,7 +17,7 @@ public class CoverDetectorEnergy extends CoverDetectorBase implements ITickable { - public CoverDetectorEnergy(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, + public CoverDetectorEnergy(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/detector/CoverDetectorEnergyAdvanced.java b/src/main/java/gregtech/common/covers/detector/CoverDetectorEnergyAdvanced.java index a1760512550..2b86a3c5398 100644 --- a/src/main/java/gregtech/common/covers/detector/CoverDetectorEnergyAdvanced.java +++ b/src/main/java/gregtech/common/covers/detector/CoverDetectorEnergyAdvanced.java @@ -7,9 +7,9 @@ import codechicken.lib.vec.Matrix4; import gregtech.api.capability.GregtechCapabilities; import gregtech.api.capability.IEnergyContainer; +import gregtech.api.cover.CoverDefinition; import gregtech.api.cover.CoverWithUI; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.Widget; @@ -41,7 +41,7 @@ public class CoverDetectorEnergyAdvanced extends CoverDetectorEnergy implements private boolean usePercent = false; private WidgetGroup widgetsToUpdate; - public CoverDetectorEnergyAdvanced(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverDetectorEnergyAdvanced(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/detector/CoverDetectorFluid.java b/src/main/java/gregtech/common/covers/detector/CoverDetectorFluid.java index 7b457d131c4..06e4d200d13 100644 --- a/src/main/java/gregtech/common/covers/detector/CoverDetectorFluid.java +++ b/src/main/java/gregtech/common/covers/detector/CoverDetectorFluid.java @@ -4,8 +4,8 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.api.util.RedstoneUtil; import gregtech.client.renderer.texture.Textures; import net.minecraft.util.BlockRenderLayer; @@ -19,7 +19,7 @@ public class CoverDetectorFluid extends CoverDetectorBase implements ITickable { - public CoverDetectorFluid(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverDetectorFluid(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/detector/CoverDetectorFluidAdvanced.java b/src/main/java/gregtech/common/covers/detector/CoverDetectorFluidAdvanced.java index 3a5054503eb..7e885dd33ad 100644 --- a/src/main/java/gregtech/common/covers/detector/CoverDetectorFluidAdvanced.java +++ b/src/main/java/gregtech/common/covers/detector/CoverDetectorFluidAdvanced.java @@ -5,10 +5,9 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; +import gregtech.api.cover.CoverDefinition; import gregtech.api.cover.CoverWithUI; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.*; @@ -42,7 +41,7 @@ public class CoverDetectorFluidAdvanced extends CoverDetectorFluid implements Co protected FluidFilterContainer fluidFilter; - public CoverDetectorFluidAdvanced(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverDetectorFluidAdvanced(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); this.fluidFilter = new FluidFilterContainer(this); } diff --git a/src/main/java/gregtech/common/covers/detector/CoverDetectorItem.java b/src/main/java/gregtech/common/covers/detector/CoverDetectorItem.java index 45cff8f2633..4a7e68d2f22 100644 --- a/src/main/java/gregtech/common/covers/detector/CoverDetectorItem.java +++ b/src/main/java/gregtech/common/covers/detector/CoverDetectorItem.java @@ -4,9 +4,8 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.api.util.RedstoneUtil; import gregtech.client.renderer.texture.Textures; import net.minecraft.util.BlockRenderLayer; @@ -18,7 +17,7 @@ public class CoverDetectorItem extends CoverDetectorBase implements ITickable { - public CoverDetectorItem(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverDetectorItem(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/covers/detector/CoverDetectorItemAdvanced.java b/src/main/java/gregtech/common/covers/detector/CoverDetectorItemAdvanced.java index 941a1fd3166..dfeb4cc73ca 100644 --- a/src/main/java/gregtech/common/covers/detector/CoverDetectorItemAdvanced.java +++ b/src/main/java/gregtech/common/covers/detector/CoverDetectorItemAdvanced.java @@ -5,10 +5,9 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; +import gregtech.api.cover.CoverDefinition; import gregtech.api.cover.CoverWithUI; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverableView; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.*; @@ -39,7 +38,7 @@ public class CoverDetectorItemAdvanced extends CoverDetectorItem implements Cove private int max = DEFAULT_MAX; protected ItemFilterContainer itemFilter; - public CoverDetectorItemAdvanced(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverDetectorItemAdvanced(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); this.itemFilter = new ItemFilterContainer(this); } diff --git a/src/main/java/gregtech/common/covers/detector/CoverDetectorMaintenance.java b/src/main/java/gregtech/common/covers/detector/CoverDetectorMaintenance.java index 062291938dd..8ed116d2cde 100644 --- a/src/main/java/gregtech/common/covers/detector/CoverDetectorMaintenance.java +++ b/src/main/java/gregtech/common/covers/detector/CoverDetectorMaintenance.java @@ -4,9 +4,8 @@ import codechicken.lib.render.pipeline.IVertexOperation; import codechicken.lib.vec.Cuboid6; import codechicken.lib.vec.Matrix4; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.CoverDefinition2; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.CoverDefinition; +import gregtech.api.cover.CoverableView; import gregtech.api.metatileentity.multiblock.IMaintenance; import gregtech.client.renderer.texture.Textures; import gregtech.common.ConfigHolder; @@ -17,7 +16,7 @@ public class CoverDetectorMaintenance extends CoverDetectorBase implements ITickable { - public CoverDetectorMaintenance(@NotNull CoverDefinition2 definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { + public CoverDetectorMaintenance(@NotNull CoverDefinition definition, @NotNull CoverableView coverableView, @NotNull EnumFacing attachedSide) { super(definition, coverableView, attachedSide); } diff --git a/src/main/java/gregtech/common/items/behaviors/CoverDigitalInterfaceWirelessPlaceBehaviour.java b/src/main/java/gregtech/common/items/behaviors/CoverDigitalInterfaceWirelessPlaceBehaviour.java index 143dce08fbf..b193001d753 100644 --- a/src/main/java/gregtech/common/items/behaviors/CoverDigitalInterfaceWirelessPlaceBehaviour.java +++ b/src/main/java/gregtech/common/items/behaviors/CoverDigitalInterfaceWirelessPlaceBehaviour.java @@ -1,7 +1,6 @@ package gregtech.common.items.behaviors; import gregtech.api.cover.CoverDefinition; -import gregtech.api.cover2.CoverDefinition2; import gregtech.api.items.behavior.CoverItemBehavior; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.client.renderer.handler.BlockPosHighlightRenderer; @@ -24,7 +23,7 @@ import java.util.List; public class CoverDigitalInterfaceWirelessPlaceBehaviour extends CoverItemBehavior { - public CoverDigitalInterfaceWirelessPlaceBehaviour(CoverDefinition2 coverDefinition) { + public CoverDigitalInterfaceWirelessPlaceBehaviour(CoverDefinition coverDefinition) { super(coverDefinition); } diff --git a/src/main/java/gregtech/common/metatileentities/multi/electric/centralmonitor/MetaTileEntityCentralMonitor.java b/src/main/java/gregtech/common/metatileentities/multi/electric/centralmonitor/MetaTileEntityCentralMonitor.java index 1e189bb283c..c6c5d8661fc 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/electric/centralmonitor/MetaTileEntityCentralMonitor.java +++ b/src/main/java/gregtech/common/metatileentities/multi/electric/centralmonitor/MetaTileEntityCentralMonitor.java @@ -7,7 +7,7 @@ import gregtech.api.capability.GregtechDataCodes; import gregtech.api.capability.IEnergyContainer; import gregtech.api.capability.impl.EnergyContainerList; -import gregtech.api.cover2.Cover; +import gregtech.api.cover.Cover; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.Widget; diff --git a/src/main/java/gregtech/common/metatileentities/multi/electric/centralmonitor/MetaTileEntityMonitorScreen.java b/src/main/java/gregtech/common/metatileentities/multi/electric/centralmonitor/MetaTileEntityMonitorScreen.java index 524c4e6d2f9..299ff7b0164 100644 --- a/src/main/java/gregtech/common/metatileentities/multi/electric/centralmonitor/MetaTileEntityMonitorScreen.java +++ b/src/main/java/gregtech/common/metatileentities/multi/electric/centralmonitor/MetaTileEntityMonitorScreen.java @@ -2,9 +2,8 @@ import codechicken.lib.raytracer.CuboidRayTraceResult; import gregtech.api.capability.GregtechDataCodes; -import gregtech.api.cover.CoverBehavior; -import gregtech.api.cover2.Cover; -import gregtech.api.cover2.CoverHolder; +import gregtech.api.cover.Cover; +import gregtech.api.cover.CoverHolder; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.*; diff --git a/src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumChest.java b/src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumChest.java index 309d596854d..02924a33929 100644 --- a/src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumChest.java +++ b/src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumChest.java @@ -9,7 +9,7 @@ import gregtech.api.capability.IActiveOutputSide; import gregtech.api.capability.impl.ItemHandlerList; import gregtech.api.capability.impl.ItemHandlerProxy; -import gregtech.api.cover.ICoverable; +import gregtech.api.cover.CoverRayTracer; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.ModularUI.Builder; @@ -446,7 +446,7 @@ public void clearMachineInventory(NonNullList itemBuffer) { @Override public boolean onScrewdriverClick(EntityPlayer playerIn, EnumHand hand, EnumFacing facing, CuboidRayTraceResult hitResult) { - EnumFacing hitFacing = ICoverable.determineGridSideHit(hitResult); + EnumFacing hitFacing = CoverRayTracer.determineGridSideHit(hitResult); if (facing == getOutputFacing() || (hitFacing == getOutputFacing() && playerIn.isSneaking())) { if (!getWorld().isRemote) { if (isAllowInputFromOutputSideItems()) { diff --git a/src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumTank.java b/src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumTank.java index a24aa592dcd..906152280a9 100644 --- a/src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumTank.java +++ b/src/main/java/gregtech/common/metatileentities/storage/MetaTileEntityQuantumTank.java @@ -13,7 +13,7 @@ import gregtech.api.capability.impl.FluidHandlerProxy; import gregtech.api.capability.impl.FluidTankList; import gregtech.api.capability.impl.GTFluidHandlerItemStack; -import gregtech.api.cover.ICoverable; +import gregtech.api.cover.CoverRayTracer; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.ModularUI; import gregtech.api.gui.widgets.*; @@ -531,7 +531,7 @@ public boolean onWrenchClick(EntityPlayer playerIn, EnumHand hand, EnumFacing fa @Override public boolean onScrewdriverClick(EntityPlayer playerIn, EnumHand hand, EnumFacing facing, CuboidRayTraceResult hitResult) { - EnumFacing hitFacing = ICoverable.determineGridSideHit(hitResult); + EnumFacing hitFacing = CoverRayTracer.determineGridSideHit(hitResult); if (facing == getOutputFacing() || (hitFacing == getOutputFacing() && playerIn.isSneaking())) { if (!getWorld().isRemote) { if (isAllowInputFromOutputSideFluids()) { diff --git a/src/main/java/gregtech/common/pipelike/fluidpipe/tile/TileEntityFluidPipeTickable.java b/src/main/java/gregtech/common/pipelike/fluidpipe/tile/TileEntityFluidPipeTickable.java index bd5d91298bf..770c84ffbc6 100644 --- a/src/main/java/gregtech/common/pipelike/fluidpipe/tile/TileEntityFluidPipeTickable.java +++ b/src/main/java/gregtech/common/pipelike/fluidpipe/tile/TileEntityFluidPipeTickable.java @@ -2,7 +2,7 @@ import gregtech.api.GTValues; import gregtech.api.capability.IPropertyFluidFilter; -import gregtech.api.cover2.Cover; +import gregtech.api.cover.Cover; import gregtech.api.fluids.MaterialFluid; import gregtech.api.fluids.fluidType.FluidTypes; import gregtech.api.metatileentity.IDataInfoProvider; diff --git a/src/main/java/gregtech/common/pipelike/itempipe/net/ItemNetHandler.java b/src/main/java/gregtech/common/pipelike/itempipe/net/ItemNetHandler.java index 62061b10c28..1195ed765d9 100644 --- a/src/main/java/gregtech/common/pipelike/itempipe/net/ItemNetHandler.java +++ b/src/main/java/gregtech/common/pipelike/itempipe/net/ItemNetHandler.java @@ -1,8 +1,8 @@ package gregtech.common.pipelike.itempipe.net; import gregtech.api.capability.GregtechTileCapabilities; -import gregtech.api.cover2.Cover; -import gregtech.api.cover2.CoverHolder; +import gregtech.api.cover.Cover; +import gregtech.api.cover.CoverHolder; import gregtech.api.util.FacingPos; import gregtech.api.util.GTTransferUtils; import gregtech.api.util.ItemStackHashStrategy; diff --git a/src/main/java/gregtech/common/pipelike/itempipe/net/ItemNetWalker.java b/src/main/java/gregtech/common/pipelike/itempipe/net/ItemNetWalker.java index f3efe8f47c7..f9f27217c18 100644 --- a/src/main/java/gregtech/common/pipelike/itempipe/net/ItemNetWalker.java +++ b/src/main/java/gregtech/common/pipelike/itempipe/net/ItemNetWalker.java @@ -1,6 +1,6 @@ package gregtech.common.pipelike.itempipe.net; -import gregtech.api.cover2.Cover; +import gregtech.api.cover.Cover; import gregtech.api.pipenet.PipeNetWalker; import gregtech.api.pipenet.tile.IPipeTile; import gregtech.api.unification.material.properties.ItemPipeProperties; diff --git a/src/main/java/gregtech/common/terminal/app/console/MachineConsoleWidget.java b/src/main/java/gregtech/common/terminal/app/console/MachineConsoleWidget.java index 43eef9dc5a5..0eb49bab023 100644 --- a/src/main/java/gregtech/common/terminal/app/console/MachineConsoleWidget.java +++ b/src/main/java/gregtech/common/terminal/app/console/MachineConsoleWidget.java @@ -4,8 +4,8 @@ import gregtech.api.capability.IControllable; import gregtech.api.capability.impl.AbstractRecipeLogic; import gregtech.api.capability.impl.RecipeLogicSteam; +import gregtech.api.cover.Cover; import gregtech.api.cover.CoverWithUI; -import gregtech.api.cover2.Cover; import gregtech.api.gui.GuiTextures; import gregtech.api.gui.IRenderContext; import gregtech.api.gui.ModularUI; diff --git a/src/main/java/gregtech/core/CoreModule.java b/src/main/java/gregtech/core/CoreModule.java index 58fcfb93a16..cbc1eb5b6c8 100644 --- a/src/main/java/gregtech/core/CoreModule.java +++ b/src/main/java/gregtech/core/CoreModule.java @@ -5,8 +5,8 @@ import gregtech.api.GregTechAPIInternal; import gregtech.api.block.IHeatingCoilBlockStats; import gregtech.api.capability.SimpleCapabilityManager; +import gregtech.api.cover.CoverDefinition; import gregtech.api.cover.CoverUIFactory; -import gregtech.api.cover2.CoverDefinition2; import gregtech.api.fluids.MetaFluids; import gregtech.api.gui.UIFactory; import gregtech.api.items.gui.PlayerInventoryUIFactory; @@ -223,10 +223,10 @@ public void init(FMLInitializationEvent event) { FilterTypeRegistry.init(); /* Start Cover Definition Registration */ - COVER_REGISTRY_2.unfreeze(); + COVER_REGISTRY.unfreeze(); CoverBehaviors.init(); - MinecraftForge.EVENT_BUS.post(new RegisterEvent<>(COVER_REGISTRY_2, CoverDefinition2.class)); - COVER_REGISTRY_2.freeze(); + MinecraftForge.EVENT_BUS.post(new RegisterEvent<>(COVER_REGISTRY, CoverDefinition.class)); + COVER_REGISTRY.freeze(); /* End Cover Definition Registration */ DungeonLootLoader.init(); diff --git a/src/main/java/gregtech/integration/opencomputers/OpenComputersModule.java b/src/main/java/gregtech/integration/opencomputers/OpenComputersModule.java index 47268be1d4f..b4c7eb63353 100644 --- a/src/main/java/gregtech/integration/opencomputers/OpenComputersModule.java +++ b/src/main/java/gregtech/integration/opencomputers/OpenComputersModule.java @@ -6,7 +6,10 @@ import gregtech.integration.IntegrationSubmodule; import gregtech.integration.IntegrationUtil; import gregtech.integration.opencomputers.drivers.*; -import gregtech.integration.opencomputers.drivers.specific.*; +import gregtech.integration.opencomputers.drivers.specific.DriverConverter; +import gregtech.integration.opencomputers.drivers.specific.DriverFusionReactor; +import gregtech.integration.opencomputers.drivers.specific.DriverPowerSubstation; +import gregtech.integration.opencomputers.drivers.specific.DriverWorldAccelerator; import gregtech.modules.GregTechModules; import li.cil.oc.api.Driver; import li.cil.oc.api.driver.DriverBlock; @@ -37,7 +40,7 @@ public void init(FMLInitializationEvent event) { registerDriver(new DriverWorkable()); registerDriver(new DriverAbstractRecipeLogic()); registerDriver(new DriverRecipeMapMultiblockController()); - registerDriver(new DriverICoverable()); + registerDriver(new DriverCoverHolder()); registerDriver(new DriverSimpleMachine()); registerDriver(new DriverFusionReactor()); registerDriver(new DriverWorldAccelerator()); diff --git a/src/main/java/gregtech/integration/opencomputers/drivers/DriverICoverable.java b/src/main/java/gregtech/integration/opencomputers/drivers/DriverCoverHolder.java similarity index 92% rename from src/main/java/gregtech/integration/opencomputers/drivers/DriverICoverable.java rename to src/main/java/gregtech/integration/opencomputers/drivers/DriverCoverHolder.java index 143ab450cfd..25ed615d1f4 100644 --- a/src/main/java/gregtech/integration/opencomputers/drivers/DriverICoverable.java +++ b/src/main/java/gregtech/integration/opencomputers/drivers/DriverCoverHolder.java @@ -1,10 +1,8 @@ package gregtech.integration.opencomputers.drivers; import gregtech.api.capability.GregtechTileCapabilities; -import gregtech.api.cover.CoverBehavior; -import gregtech.api.cover.ICoverable; -import gregtech.api.cover2.Cover; -import gregtech.api.cover2.CoverHolder; +import gregtech.api.cover.Cover; +import gregtech.api.cover.CoverHolder; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; import gregtech.common.covers.*; import gregtech.integration.opencomputers.InputValidator; @@ -19,7 +17,7 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -public class DriverICoverable extends DriverSidedTileEntity { +public class DriverCoverHolder extends DriverSidedTileEntity { @Override public Class getTileEntityClass() { @@ -30,7 +28,7 @@ public Class getTileEntityClass() { public boolean worksWith(World world, BlockPos pos, EnumFacing side) { TileEntity tileEntity = world.getTileEntity(pos); if (tileEntity instanceof IGregTechTileEntity) { - return tileEntity.hasCapability(GregtechTileCapabilities.CAPABILITY_COVERABLE, side); + return tileEntity.hasCapability(GregtechTileCapabilities.CAPABILITY_COVER_HOLDER, side); } return false; } diff --git a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverBehavior.java b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverBehavior.java index 6c33952a93d..6e23ef2b843 100644 --- a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverBehavior.java +++ b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverBehavior.java @@ -1,10 +1,9 @@ package gregtech.integration.opencomputers.values; import gregtech.api.capability.GregtechTileCapabilities; -import gregtech.api.cover2.Cover; -import gregtech.api.cover2.CoverableView; +import gregtech.api.cover.Cover; +import gregtech.api.cover.CoverableView; import gregtech.api.metatileentity.interfaces.IGregTechTileEntity; -import gregtech.integration.opencomputers.InputValidator; import li.cil.oc.api.machine.Arguments; import li.cil.oc.api.machine.Callback; import li.cil.oc.api.machine.Context; diff --git a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverConveyor.java b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverConveyor.java index 31615f6fffc..2a93f1ef8d9 100644 --- a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverConveyor.java +++ b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverConveyor.java @@ -1,6 +1,6 @@ package gregtech.integration.opencomputers.values; -import gregtech.api.cover2.Cover; +import gregtech.api.cover.Cover; import gregtech.common.covers.CoverConveyor; import gregtech.common.covers.CoverConveyor.ConveyorMode; import gregtech.integration.opencomputers.InputValidator; diff --git a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverEnderFluidLink.java b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverEnderFluidLink.java index 752a7756037..1a87f4d6ea4 100644 --- a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverEnderFluidLink.java +++ b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverEnderFluidLink.java @@ -1,7 +1,6 @@ package gregtech.integration.opencomputers.values; -import gregtech.api.cover.CoverBehavior; -import gregtech.api.cover2.Cover; +import gregtech.api.cover.Cover; import gregtech.common.covers.CoverEnderFluidLink; import gregtech.common.covers.CoverPump.PumpMode; import gregtech.integration.opencomputers.InputValidator; diff --git a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverFluidFilter.java b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverFluidFilter.java index 48eb6ee66ab..e5434f63ae3 100644 --- a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverFluidFilter.java +++ b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverFluidFilter.java @@ -1,7 +1,6 @@ package gregtech.integration.opencomputers.values; -import gregtech.api.cover.CoverBehavior; -import gregtech.api.cover2.Cover; +import gregtech.api.cover.Cover; import gregtech.common.covers.CoverFluidFilter; import gregtech.common.covers.FluidFilterMode; import gregtech.integration.opencomputers.InputValidator; diff --git a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverFluidRegulator.java b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverFluidRegulator.java index 33f0f87da75..dba40e29624 100644 --- a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverFluidRegulator.java +++ b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverFluidRegulator.java @@ -1,7 +1,6 @@ package gregtech.integration.opencomputers.values; -import gregtech.api.cover.CoverBehavior; -import gregtech.api.cover2.Cover; +import gregtech.api.cover.Cover; import gregtech.common.covers.CoverFluidRegulator; import gregtech.common.covers.TransferMode; import gregtech.integration.opencomputers.InputValidator; diff --git a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverItemFilter.java b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverItemFilter.java index c448e3cc077..6a3c316e6de 100644 --- a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverItemFilter.java +++ b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverItemFilter.java @@ -1,7 +1,6 @@ package gregtech.integration.opencomputers.values; -import gregtech.api.cover.CoverBehavior; -import gregtech.api.cover2.Cover; +import gregtech.api.cover.Cover; import gregtech.common.covers.CoverItemFilter; import gregtech.common.covers.ItemFilterMode; import gregtech.integration.opencomputers.InputValidator; diff --git a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverPump.java b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverPump.java index 00ee3fe8385..bb828702466 100644 --- a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverPump.java +++ b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverPump.java @@ -1,7 +1,6 @@ package gregtech.integration.opencomputers.values; -import gregtech.api.cover.CoverBehavior; -import gregtech.api.cover2.Cover; +import gregtech.api.cover.Cover; import gregtech.common.covers.CoverPump; import gregtech.common.covers.CoverPump.PumpMode; import gregtech.integration.opencomputers.InputValidator; diff --git a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverRoboticArm.java b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverRoboticArm.java index 2fb48854a55..9099f7535ca 100644 --- a/src/main/java/gregtech/integration/opencomputers/values/ValueCoverRoboticArm.java +++ b/src/main/java/gregtech/integration/opencomputers/values/ValueCoverRoboticArm.java @@ -1,6 +1,5 @@ package gregtech.integration.opencomputers.values; -import gregtech.api.cover.CoverBehavior; import gregtech.common.covers.CoverRoboticArm; import gregtech.common.covers.TransferMode; import gregtech.integration.opencomputers.InputValidator; diff --git a/src/main/java/gregtech/integration/theoneprobe/provider/CoverInfoProvider.java b/src/main/java/gregtech/integration/theoneprobe/provider/CoverInfoProvider.java index cf88ba296b4..72080f1e00d 100644 --- a/src/main/java/gregtech/integration/theoneprobe/provider/CoverInfoProvider.java +++ b/src/main/java/gregtech/integration/theoneprobe/provider/CoverInfoProvider.java @@ -2,8 +2,8 @@ import gregtech.api.GTValues; import gregtech.api.capability.GregtechTileCapabilities; -import gregtech.api.cover2.Cover; -import gregtech.api.cover2.CoverHolder; +import gregtech.api.cover.Cover; +import gregtech.api.cover.CoverHolder; import gregtech.api.util.TextFormattingUtil; import gregtech.common.covers.*; import gregtech.common.covers.filter.*;