diff --git a/build.gradle b/build.gradle index 8867c9afc..43ca963f1 100755 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,7 @@ apply plugin: 'maven' apply plugin: 'maven-publish' apply plugin: 'net.minecraftforge.gradle.forge' -version = "1.5.35" +version = "1.6" group = "refinedstorage" archivesBaseName = "refinedstorage" @@ -24,25 +24,19 @@ sourceCompatibility = 1.8 targetCompatibility = 1.8 minecraft { - version = "1.12.2-14.23.1.2577" + version = "1.12.2-14.23.4.2703" runDir = "run" useDepAts = true - mappings = "snapshot_20171217" + mappings = "snapshot_20180526" } repositories { maven { url "http://dvs1.progwml6.com/files/maven" } - maven { - url "http://maven.amadornes.com" - } maven { url "http://maven.cil.li" } - maven { - url "https://dl.bintray.com/jaquadro/dev" - } maven { name = "CurseForge" url = "https://minecraft.curseforge.com/api/maven/" @@ -50,11 +44,9 @@ repositories { } dependencies { - deobfCompile "mezz.jei:jei_1.12.2:4.8.5.136:api" - runtime "mezz.jei:jei_1.12.2:4.8.5.136" - deobfCompile "MCMultiPart2:MCMultiPart:2.4.1" + deobfCompile "mezz.jei:jei_1.12.2:4.9.1.191:api" + runtime "mezz.jei:jei_1.12.2:4.9.1.191" deobfCompile "li.cil.oc:OpenComputers:MC1.12.1-1.7.1.43:api" - deobfCompile "com.jaquadro.minecraft.storagedrawers:StorageDrawers:1.12.1-5.3.3:api" compile "inventory-tweaks:InventoryTweaks:1.63:api" } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/RS.java b/src/main/java/com/raoulvdberge/refinedstorage/RS.java index b29be98a4..2c1df0517 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/RS.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/RS.java @@ -23,7 +23,7 @@ public final class RS { } public static final String ID = "refinedstorage"; - public static final String VERSION = "1.5.35"; + public static final String VERSION = "1.6"; public static final String DEPENDENCIES = "required-after:forge@[14.23.1.2555,);after:mcmultipart@[2.4.1,);after:storagedrawers@[1.12-5.2.2,);"; public static final String GUI_FACTORY = "com.raoulvdberge.refinedstorage.gui.config.ModGuiFactory"; public static final String UPDATE_JSON = "https://refinedstorage.raoulvdberge.com/update"; diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNode.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNode.java index 36161b739..0b294c5ae 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNode.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNode.java @@ -5,8 +5,6 @@ import com.raoulvdberge.refinedstorage.api.network.INetworkNodeVisitor; import com.raoulvdberge.refinedstorage.api.network.node.INetworkNode; import com.raoulvdberge.refinedstorage.api.util.IWrenchable; import com.raoulvdberge.refinedstorage.apiimpl.API; -import com.raoulvdberge.refinedstorage.integration.mcmp.IntegrationMCMP; -import com.raoulvdberge.refinedstorage.integration.mcmp.RSMCMPAddon; import com.raoulvdberge.refinedstorage.tile.TileBase; import com.raoulvdberge.refinedstorage.tile.config.RedstoneMode; import com.raoulvdberge.refinedstorage.util.WorldUtils; @@ -215,7 +213,7 @@ public abstract class NetworkNode implements INetworkNode, INetworkNodeVisitor, // @todo: Move this data to the network node. public void resetDirection() { - EnumFacing direction = ((TileBase) (IntegrationMCMP.isLoaded() ? RSMCMPAddon.unwrapTile(world, pos) : world.getTileEntity(pos))).getDirection(); + EnumFacing direction = ((TileBase) world.getTileEntity(pos)).getDirection(); if (!direction.equals(this.direction)) { this.direction = direction; onDirectionChanged(); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeCable.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeCable.java index c5a12eef4..88cf7b604 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeCable.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeCable.java @@ -1,16 +1,9 @@ package com.raoulvdberge.refinedstorage.apiimpl.network.node; import com.raoulvdberge.refinedstorage.RS; -import com.raoulvdberge.refinedstorage.RSBlocks; -import com.raoulvdberge.refinedstorage.block.BlockCable; -import com.raoulvdberge.refinedstorage.integration.mcmp.IntegrationMCMP; -import com.raoulvdberge.refinedstorage.integration.mcmp.RSMCMPAddon; -import net.minecraft.util.EnumFacing; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import javax.annotation.Nullable; - public class NetworkNodeCable extends NetworkNode { public static final String ID = "cable"; @@ -27,13 +20,4 @@ public class NetworkNodeCable extends NetworkNode { public String getId() { return ID; } - - @Override - public boolean canConduct(@Nullable EnumFacing direction) { - if (IntegrationMCMP.isLoaded() && direction != null) { - return BlockCable.hasConnectionWith(world, pos, RSBlocks.CABLE, IntegrationMCMP.isLoaded() ? RSMCMPAddon.unwrapTile(world, pos) : world.getTileEntity(pos), direction); - } - - return true; - } } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeConstructor.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeConstructor.java index 46d6f796f..c7f5f5dd6 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeConstructor.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeConstructor.java @@ -4,8 +4,6 @@ import com.mojang.authlib.GameProfile; import com.raoulvdberge.refinedstorage.RS; import com.raoulvdberge.refinedstorage.api.util.IComparer; import com.raoulvdberge.refinedstorage.container.slot.SlotFilter; -import com.raoulvdberge.refinedstorage.integration.mcmp.IntegrationMCMP; -import com.raoulvdberge.refinedstorage.integration.mcmp.RSMCMPAddon; import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBase; import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFluid; import com.raoulvdberge.refinedstorage.inventory.ItemHandlerListenerNetworkNode; @@ -134,18 +132,8 @@ public class NetworkNodeConstructor extends NetworkNode implements IComparable, } } - private WorldServer getWorldServer() { - World world = this.world; - - if (IntegrationMCMP.isLoaded()) { - world = RSMCMPAddon.unwrapWorld(world); - } - - return (WorldServer) world; - } - private boolean canPlace(BlockPos pos, IBlockState state) { - BlockEvent.PlaceEvent e = new BlockEvent.PlaceEvent(new BlockSnapshot(world, pos, state), world.getBlockState(pos), FakePlayerFactory.getMinecraft(getWorldServer()), EnumHand.MAIN_HAND); + BlockEvent.PlaceEvent e = new BlockEvent.PlaceEvent(new BlockSnapshot(world, pos, state), world.getBlockState(pos), FakePlayerFactory.getMinecraft((WorldServer) world), EnumHand.MAIN_HAND); return !MinecraftForge.EVENT_BUS.post(e); } @@ -161,7 +149,7 @@ public class NetworkNodeConstructor extends NetworkNode implements IComparable, IBlockState state = SlotFilter.getBlockState(world, front, took); if (state != null && world.isAirBlock(front) && state.getBlock().canPlaceBlockAt(world, front)) { - state = state.getBlock().getStateForPlacement(world, front, getDirection(), 0.5F, 0.5F, 0.5F, took.getMetadata(), FakePlayerFactory.getMinecraft(getWorldServer()), EnumHand.MAIN_HAND); + state = state.getBlock().getStateForPlacement(world, front, getDirection(), 0.5F, 0.5F, 0.5F, took.getMetadata(), FakePlayerFactory.getMinecraft((WorldServer) world), EnumHand.MAIN_HAND); if (!canPlace(front, state)) { return; @@ -173,7 +161,7 @@ public class NetworkNodeConstructor extends NetworkNode implements IComparable, if (item.getItem() instanceof ItemBlock) { ((ItemBlock) item.getItem()).placeBlockAt( took, - FakePlayerFactory.getMinecraft(getWorldServer()), + FakePlayerFactory.getMinecraft((WorldServer) world), world, front, getDirection(), @@ -185,7 +173,7 @@ public class NetworkNodeConstructor extends NetworkNode implements IComparable, } else { world.setBlockState(front, state, 1 | 2); - state.getBlock().onBlockPlacedBy(world, front, state, FakePlayerFactory.getMinecraft(getWorldServer()), took); + state.getBlock().onBlockPlacedBy(world, front, state, FakePlayerFactory.getMinecraft((WorldServer) world), took); } // From ItemBlock#onItemUse diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeDestructor.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeDestructor.java index a96f8aa29..4208614a8 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeDestructor.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/NetworkNodeDestructor.java @@ -2,8 +2,6 @@ package com.raoulvdberge.refinedstorage.apiimpl.network.node; import com.raoulvdberge.refinedstorage.RS; import com.raoulvdberge.refinedstorage.api.util.IComparer; -import com.raoulvdberge.refinedstorage.integration.mcmp.IntegrationMCMP; -import com.raoulvdberge.refinedstorage.integration.mcmp.RSMCMPAddon; import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBase; import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFluid; import com.raoulvdberge.refinedstorage.inventory.ItemHandlerListenerNetworkNode; @@ -74,16 +72,6 @@ public class NetworkNodeDestructor extends NetworkNode implements IComparable, I return RS.INSTANCE.config.destructorUsage + upgrades.getEnergyUsage(); } - private WorldServer getWorldServer() { - World world = this.world; - - if (IntegrationMCMP.isLoaded()) { - world = RSMCMPAddon.unwrapWorld(world); - } - - return (WorldServer) world; - } - @Override public void update() { super.update(); @@ -142,7 +130,7 @@ public class NetworkNodeDestructor extends NetworkNode implements IComparable, I } } - BlockEvent.BreakEvent e = new BlockEvent.BreakEvent(world, front, frontBlockState, FakePlayerFactory.getMinecraft(getWorldServer())); + BlockEvent.BreakEvent e = new BlockEvent.BreakEvent(world, front, frontBlockState, FakePlayerFactory.getMinecraft((WorldServer) world)); if (!MinecraftForge.EVENT_BUS.post(e)) { world.playEvent(null, 2001, front, Block.getStateId(frontBlockState)); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/externalstorage/NetworkNodeExternalStorage.java b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/externalstorage/NetworkNodeExternalStorage.java index 4489dd22a..c5a335d3b 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/externalstorage/NetworkNodeExternalStorage.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/apiimpl/network/node/externalstorage/NetworkNodeExternalStorage.java @@ -1,6 +1,5 @@ package com.raoulvdberge.refinedstorage.apiimpl.network.node.externalstorage; -import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawerGroup; import com.raoulvdberge.refinedstorage.RS; import com.raoulvdberge.refinedstorage.api.network.INetwork; import com.raoulvdberge.refinedstorage.api.storage.AccessType; @@ -12,9 +11,6 @@ import com.raoulvdberge.refinedstorage.apiimpl.network.node.NetworkNode; import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageCacheFluid; import com.raoulvdberge.refinedstorage.apiimpl.storage.StorageCacheItem; import com.raoulvdberge.refinedstorage.capability.CapabilityNetworkNodeProxy; -import com.raoulvdberge.refinedstorage.integration.projecte.IntegrationProjectE; -import com.raoulvdberge.refinedstorage.integration.projecte.StorageItemTransmutationTable; -import com.raoulvdberge.refinedstorage.integration.storagedrawers.StorageItemItemRepository; import com.raoulvdberge.refinedstorage.inventory.ItemHandlerBase; import com.raoulvdberge.refinedstorage.inventory.ItemHandlerFluid; import com.raoulvdberge.refinedstorage.inventory.ItemHandlerListenerNetworkNode; @@ -29,8 +25,6 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.CapabilityInject; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.capability.IFluidHandler; import net.minecraftforge.items.IItemHandler; @@ -39,9 +33,6 @@ import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; public class NetworkNodeExternalStorage extends NetworkNode implements IStorageProvider, IGuiStorage, IComparable, IFilterable, IPrioritizable, IType, IAccessType { - @CapabilityInject(IDrawerGroup.class) - private static final Capability DRAWER_GROUP_CAPABILITY = null; - public static final String ID = "external_storage"; private static final String NBT_PRIORITY = "Priority"; @@ -203,22 +194,12 @@ public class NetworkNodeExternalStorage extends NetworkNode implements IStorageP TileEntity facing = getFacingTile(); if (type == IType.ITEMS) { - if (facing != null) { - if (DRAWER_GROUP_CAPABILITY != null && facing.hasCapability(DRAWER_GROUP_CAPABILITY, getDirection().getOpposite())) { - itemStorages.add(new StorageItemItemRepository(this, () -> { - TileEntity f = getFacingTile(); + if (facing != null && !(facing.hasCapability(CapabilityNetworkNodeProxy.NETWORK_NODE_PROXY_CAPABILITY, getDirection().getOpposite()) && facing.getCapability(CapabilityNetworkNodeProxy.NETWORK_NODE_PROXY_CAPABILITY, getDirection().getOpposite()).getNode() instanceof IStorageProvider)) { + IItemHandler itemHandler = WorldUtils.getItemHandler(facing, getDirection().getOpposite()); - return (f != null && f.hasCapability(DRAWER_GROUP_CAPABILITY, getDirection().getOpposite())) ? f.getCapability(DRAWER_GROUP_CAPABILITY, getDirection().getOpposite()) : null; - })); - } else if (!(facing.hasCapability(CapabilityNetworkNodeProxy.NETWORK_NODE_PROXY_CAPABILITY, getDirection().getOpposite()) && facing.getCapability(CapabilityNetworkNodeProxy.NETWORK_NODE_PROXY_CAPABILITY, getDirection().getOpposite()).getNode() instanceof IStorageProvider)) { - IItemHandler itemHandler = WorldUtils.getItemHandler(facing, getDirection().getOpposite()); - - if (itemHandler != null) { - itemStorages.add(new StorageItemItemHandler(this, () -> WorldUtils.getItemHandler(getFacingTile(), getDirection().getOpposite()))); - } + if (itemHandler != null) { + itemStorages.add(new StorageItemItemHandler(this, () -> WorldUtils.getItemHandler(getFacingTile(), getDirection().getOpposite()))); } - } else if (IntegrationProjectE.isLoaded() && world.getBlockState(pos.offset(getDirection())).getBlock().getUnlocalizedName().equals("tile.pe_transmutation_stone")) { - itemStorages.add(new StorageItemTransmutationTable(this)); } } else if (type == IType.FLUIDS) { IFluidHandler fluidHandler = WorldUtils.getFluidHandler(facing, getDirection().getOpposite()); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockBase.java b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockBase.java index 1b0cd5695..4d6435383 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockBase.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockBase.java @@ -6,8 +6,6 @@ import com.raoulvdberge.refinedstorage.api.network.node.INetworkNodeProxy; import com.raoulvdberge.refinedstorage.api.network.security.Permission; import com.raoulvdberge.refinedstorage.capability.CapabilityNetworkNodeProxy; import com.raoulvdberge.refinedstorage.container.ContainerBase; -import com.raoulvdberge.refinedstorage.integration.mcmp.IntegrationMCMP; -import com.raoulvdberge.refinedstorage.integration.mcmp.RSMCMPAddon; import com.raoulvdberge.refinedstorage.item.ItemBlockBase; import com.raoulvdberge.refinedstorage.tile.TileBase; import com.raoulvdberge.refinedstorage.util.WorldUtils; @@ -89,7 +87,7 @@ public abstract class BlockBase extends Block { @SuppressWarnings("deprecation") public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { if (getDirection() != null) { - TileEntity tile = IntegrationMCMP.isLoaded() ? RSMCMPAddon.unwrapTile(world, pos) : world.getTileEntity(pos); + TileEntity tile = world.getTileEntity(pos); if (tile instanceof TileBase) { return state.withProperty(getDirection().getProperty(), ((TileBase) tile).getDirection()); @@ -138,7 +136,7 @@ public abstract class BlockBase extends Block { } protected void dropContents(World world, BlockPos pos) { - TileEntity tile = IntegrationMCMP.isLoaded() ? RSMCMPAddon.unwrapTile(world, pos) : world.getTileEntity(pos); + TileEntity tile = world.getTileEntity(pos); if (tile instanceof TileBase && ((TileBase) tile).getDrops() != null) { IItemHandler handler = ((TileBase) tile).getDrops(); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockCable.java b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockCable.java index d637a16b6..ecb27b694 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockCable.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockCable.java @@ -1,8 +1,6 @@ package com.raoulvdberge.refinedstorage.block; import com.raoulvdberge.refinedstorage.capability.CapabilityNetworkNodeProxy; -import com.raoulvdberge.refinedstorage.integration.mcmp.IntegrationMCMP; -import com.raoulvdberge.refinedstorage.integration.mcmp.RSMCMPAddon; import com.raoulvdberge.refinedstorage.tile.TileCable; import com.raoulvdberge.refinedstorage.tile.TileNode; import com.raoulvdberge.refinedstorage.util.RenderUtils; @@ -75,7 +73,7 @@ public class BlockCable extends BlockNode { @Override @SuppressWarnings("deprecation") public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { - TileEntity tile = IntegrationMCMP.isLoaded() ? RSMCMPAddon.unwrapTile(world, pos) : world.getTileEntity(pos); + TileEntity tile = world.getTileEntity(pos); state = super.getActualState(state, world, pos) .withProperty(NORTH, hasConnectionWith(world, pos, this, tile, EnumFacing.NORTH)) @@ -114,11 +112,6 @@ public class BlockCable extends BlockNode { return false; } - if (IntegrationMCMP.isLoaded()) { - return !RSMCMPAddon.hasObstructingMultipart(tile, Collections.singletonList(BlockCable.getCableExtensionAABB(direction))) - && !RSMCMPAddon.hasObstructingMultipart(otherTile, Collections.singletonList(BlockCable.getCableExtensionAABB(direction.getOpposite()))); - } - return true; } @@ -238,22 +231,4 @@ public class BlockCable extends BlockNode { public Direction getDirection() { return null; } - - public static AxisAlignedBB getCableExtensionAABB(EnumFacing facing) { - if (facing == EnumFacing.NORTH) { - return NORTH_AABB; - } else if (facing == EnumFacing.EAST) { - return EAST_AABB; - } else if (facing == EnumFacing.SOUTH) { - return SOUTH_AABB; - } else if (facing == EnumFacing.WEST) { - return WEST_AABB; - } else if (facing == EnumFacing.UP) { - return UP_AABB; - } else if (facing == EnumFacing.DOWN) { - return DOWN_AABB; - } - - return NORTH_AABB; - } } diff --git a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockNode.java b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockNode.java index ad21833cd..e25f5b760 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/block/BlockNode.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/block/BlockNode.java @@ -3,8 +3,6 @@ package com.raoulvdberge.refinedstorage.block; import com.raoulvdberge.refinedstorage.api.network.node.INetworkNode; import com.raoulvdberge.refinedstorage.api.network.node.INetworkNodeManager; import com.raoulvdberge.refinedstorage.apiimpl.API; -import com.raoulvdberge.refinedstorage.integration.mcmp.IntegrationMCMP; -import com.raoulvdberge.refinedstorage.integration.mcmp.RSMCMPAddon; import com.raoulvdberge.refinedstorage.tile.TileNode; import net.minecraft.block.properties.PropertyBool; import net.minecraft.block.state.BlockStateContainer; @@ -92,7 +90,7 @@ public abstract class BlockNode extends BlockBase { state = super.getActualState(state, world, pos); if (hasConnectivityState()) { - TileEntity tile = IntegrationMCMP.isLoaded() ? RSMCMPAddon.unwrapTile(world, pos) : world.getTileEntity(pos); + TileEntity tile = world.getTileEntity(pos); if (tile instanceof TileNode) { return state.withProperty(CONNECTED, ((TileNode) tile).getNode().isActive()); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiHandler.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiHandler.java index 1718cd820..eeeb924cb 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiHandler.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/gui/GuiHandler.java @@ -6,8 +6,6 @@ import com.raoulvdberge.refinedstorage.apiimpl.API; import com.raoulvdberge.refinedstorage.apiimpl.network.node.IGuiReaderWriter; import com.raoulvdberge.refinedstorage.container.*; import com.raoulvdberge.refinedstorage.gui.grid.GuiGrid; -import com.raoulvdberge.refinedstorage.integration.mcmp.IntegrationMCMP; -import com.raoulvdberge.refinedstorage.integration.mcmp.RSMCMPAddon; import com.raoulvdberge.refinedstorage.tile.*; import com.raoulvdberge.refinedstorage.tile.craftingmonitor.TileCraftingMonitor; import com.raoulvdberge.refinedstorage.tile.craftingmonitor.WirelessCraftingMonitor; @@ -89,12 +87,12 @@ public class GuiHandler implements IGuiHandler { return getCraftingMonitorContainer(player, x, y); } - return getContainer(ID, player, IntegrationMCMP.isLoaded() ? RSMCMPAddon.unwrapTile(world, new BlockPos(x, y, z)) : world.getTileEntity(new BlockPos(x, y, z))); + return getContainer(ID, player, world.getTileEntity(new BlockPos(x, y, z))); } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { - TileEntity tile = IntegrationMCMP.isLoaded() ? RSMCMPAddon.unwrapTile(world, new BlockPos(x, y, z)) : world.getTileEntity(new BlockPos(x, y, z)); + TileEntity tile = world.getTileEntity(new BlockPos(x, y, z)); switch (ID) { case RSGui.CONTROLLER: diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/control/SideButtonGridViewType.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/control/SideButtonGridViewType.java index 64ff6b752..58e54a458 100644 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/control/SideButtonGridViewType.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/gui/control/SideButtonGridViewType.java @@ -33,8 +33,6 @@ public class SideButtonGridViewType extends SideButton { type = IGrid.VIEW_TYPE_CRAFTABLES; } else if (type == IGrid.VIEW_TYPE_CRAFTABLES) { type = IGrid.VIEW_TYPE_NORMAL; - } else { - type = IGrid.VIEW_TYPE_NORMAL; // @todo: Remove in 1.13 (1.5.24 -> 1.5.26 conversion, removed detailed grid view type) } grid.onViewTypeChanged(type); diff --git a/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/stack/GridStackItem.java b/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/stack/GridStackItem.java index 3ce805f69..cdee2ae96 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/stack/GridStackItem.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/gui/grid/stack/GridStackItem.java @@ -9,7 +9,6 @@ import io.netty.buffer.ByteBuf; import net.minecraft.client.Minecraft; import net.minecraft.client.resources.I18n; import net.minecraft.client.util.ITooltipFlag; -import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.text.TextFormatting; import net.minecraftforge.oredict.OreDictionary; @@ -85,7 +84,7 @@ public class GridStackItem implements IGridStack { @Override public String getModId() { - return Item.REGISTRY.getNameForObject(stack.getItem()).getResourceDomain(); + return stack.getItem().getCreatorModId(stack); } @Override diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/mcmp/IntegrationMCMP.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/mcmp/IntegrationMCMP.java deleted file mode 100644 index 505813de1..000000000 --- a/src/main/java/com/raoulvdberge/refinedstorage/integration/mcmp/IntegrationMCMP.java +++ /dev/null @@ -1,9 +0,0 @@ -package com.raoulvdberge.refinedstorage.integration.mcmp; - -import net.minecraftforge.fml.common.Loader; - -public final class IntegrationMCMP { - public static boolean isLoaded() { - return Loader.isModLoaded("mcmultipart"); - } -} diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/mcmp/PartCable.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/mcmp/PartCable.java deleted file mode 100644 index aaffae8f1..000000000 --- a/src/main/java/com/raoulvdberge/refinedstorage/integration/mcmp/PartCable.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.raoulvdberge.refinedstorage.integration.mcmp; - -import com.raoulvdberge.refinedstorage.apiimpl.API; -import com.raoulvdberge.refinedstorage.block.BlockCable; -import mcmultipart.api.container.IPartInfo; -import mcmultipart.api.multipart.IMultipart; -import mcmultipart.api.slot.EnumCenterSlot; -import mcmultipart.api.slot.IPartSlot; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; - -import java.util.ArrayList; -import java.util.List; - -public class PartCable implements IMultipart { - private BlockCable block; - - public PartCable(BlockCable block) { - this.block = block; - } - - @Override - public IPartSlot getSlotForPlacement(World world, BlockPos pos, IBlockState state, EnumFacing facing, float hitX, float hitY, float hitZ, EntityLivingBase placer) { - return EnumCenterSlot.CENTER; - } - - @Override - public IPartSlot getSlotFromWorld(IBlockAccess world, BlockPos pos, IBlockState state) { - return EnumCenterSlot.CENTER; - } - - @Override - public Block getBlock() { - return block; - } - - @Override - public List getOcclusionBoxes(IPartInfo part) { - List boxes = new ArrayList<>(); - - boxes.add(BlockCable.CORE_AABB); - boxes.addAll(block.getNonUnionizedCollisionBoxes(part.getState())); - - return boxes; - } - - @Override - public void onPartChanged(IPartInfo part, IPartInfo otherPart) { - API.instance().discoverNode(part.getActualWorld(), part.getContainer().getPartPos()); - } -} diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/mcmp/PartCableTile.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/mcmp/PartCableTile.java deleted file mode 100644 index 601979f71..000000000 --- a/src/main/java/com/raoulvdberge/refinedstorage/integration/mcmp/PartCableTile.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.raoulvdberge.refinedstorage.integration.mcmp; - -import mcmultipart.api.container.IPartInfo; -import mcmultipart.api.multipart.IMultipartTile; -import net.minecraft.tileentity.TileEntity; - -public class PartCableTile implements IMultipartTile { - private TileEntity tile; - private IPartInfo info; - - public PartCableTile(TileEntity tile) { - this.tile = tile; - } - - @Override - public void setPartInfo(IPartInfo info) { - this.info = info; - } - - @Override - public TileEntity getTileEntity() { - return tile; - } - - public IPartInfo getInfo() { - return info; - } -} diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/mcmp/RSMCMPAddon.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/mcmp/RSMCMPAddon.java deleted file mode 100644 index 876f54d68..000000000 --- a/src/main/java/com/raoulvdberge/refinedstorage/integration/mcmp/RSMCMPAddon.java +++ /dev/null @@ -1,166 +0,0 @@ -package com.raoulvdberge.refinedstorage.integration.mcmp; - -import com.raoulvdberge.refinedstorage.RSBlocks; -import com.raoulvdberge.refinedstorage.block.BlockCable; -import com.raoulvdberge.refinedstorage.tile.*; -import mcmultipart.api.addon.IMCMPAddon; -import mcmultipart.api.addon.MCMPAddon; -import mcmultipart.api.container.IPartInfo; -import mcmultipart.api.multipart.IMultipart; -import mcmultipart.api.multipart.IMultipartRegistry; -import mcmultipart.api.multipart.IMultipartTile; -import mcmultipart.api.multipart.MultipartOcclusionHelper; -import mcmultipart.api.ref.MCMPCapabilities; -import mcmultipart.api.slot.EnumCenterSlot; -import mcmultipart.block.BlockMultipartContainer; -import mcmultipart.block.TileMultipartContainer; -import mcmultipart.util.MCMPWorldWrapper; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.item.Item; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.EnumFacing; -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.math.AxisAlignedBB; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.ICapabilityProvider; -import net.minecraftforge.event.AttachCapabilitiesEvent; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.List; -import java.util.Optional; - -@MCMPAddon -public class RSMCMPAddon implements IMCMPAddon { - @Override - public void registerParts(IMultipartRegistry registry) { - MinecraftForge.EVENT_BUS.register(this); - - register(registry, RSBlocks.CABLE); - register(registry, RSBlocks.CONSTRUCTOR); - register(registry, RSBlocks.DESTRUCTOR); - register(registry, RSBlocks.IMPORTER); - register(registry, RSBlocks.EXPORTER); - register(registry, RSBlocks.EXTERNAL_STORAGE); - register(registry, RSBlocks.READER); - register(registry, RSBlocks.WRITER); - } - - private void register(IMultipartRegistry registry, BlockCable block) { - registry.registerPartWrapper(block, new PartCable(block)); - registry.registerStackWrapper(Item.getItemFromBlock(block), s -> true, block); - } - - @SubscribeEvent - public void onAttachCapability(AttachCapabilitiesEvent e) { - TileEntity tile = e.getObject(); - - if (tile instanceof TileCable) { - register(e, "cable"); - } else if (tile instanceof TileConstructor) { - register(e, "constructor"); - } else if (tile instanceof TileDestructor) { - register(e, "destructor"); - } else if (tile instanceof TileImporter) { - register(e, "importer"); - } else if (tile instanceof TileExporter) { - register(e, "exporter"); - } else if (tile instanceof TileExternalStorage) { - register(e, "external_storage"); - } else if (tile instanceof TileReader) { - register(e, "reader"); - } else if (tile instanceof TileWriter) { - register(e, "writer"); - } - } - - private void register(AttachCapabilitiesEvent e, String id) { - e.addCapability(new ResourceLocation("refinedstorage:" + id), new ICapabilityProvider() { - private PartCableTile tile; - - @Override - public boolean hasCapability(@Nonnull Capability capability, @Nullable EnumFacing facing) { - return capability == MCMPCapabilities.MULTIPART_TILE; - } - - @Nullable - @Override - public T getCapability(@Nonnull Capability capability, @Nullable EnumFacing facing) { - if (capability == MCMPCapabilities.MULTIPART_TILE) { - if (tile == null) { - tile = new PartCableTile(e.getObject()); - } - - return MCMPCapabilities.MULTIPART_TILE.cast(tile); - } - - return null; - } - }); - } - - public static boolean hasObstructingMultipart(TileEntity tile, List testBoxes) { - if (tile != null && tile.hasCapability(MCMPCapabilities.MULTIPART_TILE, null)) { - IMultipartTile multipartTile = tile.getCapability(MCMPCapabilities.MULTIPART_TILE, null); - - if (multipartTile instanceof PartCableTile && ((PartCableTile) multipartTile).getInfo() != null) { - for (IPartInfo info : ((PartCableTile) multipartTile).getInfo().getContainer().getParts().values()) { - IMultipart multipart = info.getPart(); - - if (!(multipart instanceof PartCable) && MultipartOcclusionHelper.testBoxIntersection(testBoxes, multipart.getOcclusionBoxes(info))) { - return true; - } - } - } - } - - return false; - } - - @Nullable - public static TileEntity unwrapTile(IBlockAccess world, BlockPos pos) { - TileEntity tile = world.getTileEntity(pos); - - if (tile instanceof TileMultipartContainer) { - Optional multipartTile = ((TileMultipartContainer) tile).getPartTile(EnumCenterSlot.CENTER); - - if (multipartTile.isPresent()) { - return multipartTile.get().getTileEntity(); - } - } - - return tile; - } - - public static World unwrapWorld(World world) { - if (world instanceof MCMPWorldWrapper) { - return ((MCMPWorldWrapper) world).getActualWorld(); - } - - return world; - } - - public static Block unwrapBlock(IBlockAccess world, BlockPos pos) { - IBlockState state = world.getBlockState(pos); - - if (state.getBlock() instanceof BlockMultipartContainer) { - Optional multipartContainer = BlockMultipartContainer.getTile(world, pos); - - if (multipartContainer.isPresent()) { - Optional info = multipartContainer.get().get(EnumCenterSlot.CENTER); - - if (info.isPresent()) { - return info.get().getPart().getBlock(); - } - } - } - - return state.getBlock(); - } -} diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/projecte/IntegrationProjectE.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/projecte/IntegrationProjectE.java deleted file mode 100644 index 27e1673a9..000000000 --- a/src/main/java/com/raoulvdberge/refinedstorage/integration/projecte/IntegrationProjectE.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.raoulvdberge.refinedstorage.integration.projecte; - -import com.raoulvdberge.refinedstorage.api.solderer.ISoldererRecipe; -import com.raoulvdberge.refinedstorage.apiimpl.API; -import moze_intel.projecte.api.ProjectEAPI; -import net.minecraft.item.ItemStack; -import net.minecraft.util.NonNullList; -import net.minecraftforge.fml.common.Loader; - -import java.util.HashMap; -import java.util.Map; - -public final class IntegrationProjectE { - private static final String ID = "projecte"; - - public static boolean isLoaded() { - return Loader.isModLoaded(ID); - } - - public static void register() { - for (ISoldererRecipe recipe : API.instance().getSoldererRegistry().getRecipes()) { - if (!recipe.isProjectERecipe()) { - continue; - } - - Map ingredients = new HashMap<>(); - - for (int i = 0; i < 3; ++i) { - NonNullList items = recipe.getRow(i); - - if (!items.isEmpty()) { - ingredients.put(items.get(0), items.get(0).getCount()); - } - } - - ProjectEAPI.getConversionProxy().addConversion(recipe.getResult().getCount(), recipe.getResult(), ingredients); - } - } -} diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/projecte/StorageItemTransmutationTable.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/projecte/StorageItemTransmutationTable.java deleted file mode 100644 index 2d12e6fa4..000000000 --- a/src/main/java/com/raoulvdberge/refinedstorage/integration/projecte/StorageItemTransmutationTable.java +++ /dev/null @@ -1,162 +0,0 @@ -package com.raoulvdberge.refinedstorage.integration.projecte; - -import com.raoulvdberge.refinedstorage.api.storage.AccessType; -import com.raoulvdberge.refinedstorage.apiimpl.network.node.externalstorage.NetworkNodeExternalStorage; -import com.raoulvdberge.refinedstorage.apiimpl.network.node.externalstorage.StorageItemExternal; -import moze_intel.projecte.api.ProjectEAPI; -import moze_intel.projecte.api.capabilities.IKnowledgeProvider; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraftforge.items.ItemHandlerHelper; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; - -public class StorageItemTransmutationTable extends StorageItemExternal { - private NetworkNodeExternalStorage externalStorage; - - public StorageItemTransmutationTable(NetworkNodeExternalStorage externalStorage) { - this.externalStorage = externalStorage; - } - - @Override - public int getCapacity() { - return 0; - } - - @Override - public Collection getStacks() { - if (externalStorage.getOwner() != null) { - IKnowledgeProvider provider = ProjectEAPI.getTransmutationProxy().getKnowledgeProviderFor(externalStorage.getOwner()); - - // @todo: https://github.com/sinkillerj/ProjectE/issues/1591 - if (!provider.getClass().getName().equals("moze_intel.projecte.impl.TransmutationOffline$1")) { - List stored = new LinkedList<>(); - - for (ItemStack knowledge : provider.getKnowledge()) { - stored.add(ItemHandlerHelper.copyStackWithSize(knowledge, (int) Math.floor(provider.getEmc() / (double) ProjectEAPI.getEMCProxy().getValue(knowledge)))); - } - - return stored; - } - } - - return Collections.emptyList(); - } - - @Nullable - @Override - public ItemStack insert(@Nonnull ItemStack stack, int size, boolean simulate) { - ItemStack actualStack = ItemHandlerHelper.copyStackWithSize(stack, size); - - if (externalStorage.getOwner() != null) { - IKnowledgeProvider provider = ProjectEAPI.getTransmutationProxy().getKnowledgeProviderFor(externalStorage.getOwner()); - - // @todo: https://github.com/sinkillerj/ProjectE/issues/1591 - if (!provider.getClass().getName().equals("moze_intel.projecte.impl.TransmutationOffline$1")) { - int emc = ProjectEAPI.getEMCProxy().getValue(actualStack) * size; - - if (emc == 0) { - return actualStack; - } - - if (!simulate) { - provider.setEmc(provider.getEmc() + emc); - - handleKnowledge(provider, stack.copy()); - - EntityPlayer player = externalStorage.getWorld().getPlayerEntityByUUID(externalStorage.getOwner()); - - if (player != null) { - provider.sync((EntityPlayerMP) player); - } - } - - return null; - } - } - - return actualStack; - } - - // @todo: https://github.com/sinkillerj/ProjectE/issues/1592 - private void handleKnowledge(IKnowledgeProvider provider, ItemStack stack) { - if (stack.getCount() > 1) { - stack.setCount(1); - } - - if (!stack.getHasSubtypes() && stack.getMaxDamage() != 0) { - stack.setItemDamage(0); - } - - if (!provider.hasKnowledge(stack)) { - stack.setTagCompound(null); - - provider.addKnowledge(stack); - } - } - - @Nullable - @Override - public ItemStack extract(@Nonnull ItemStack stack, int size, int flags, boolean simulate) { - if (externalStorage.getOwner() != null) { - IKnowledgeProvider provider = ProjectEAPI.getTransmutationProxy().getKnowledgeProviderFor(externalStorage.getOwner()); - - // @todo: https://github.com/sinkillerj/ProjectE/issues/1591 - if (!provider.getClass().getName().equals("moze_intel.projecte.impl.TransmutationOffline$1") && provider.hasKnowledge(stack)) { - double singleEmc = ProjectEAPI.getEMCProxy().getValue(stack); - - // If we have the Tome of Knowledge, IKnowledgeProvider#hasKnowledge will always return true, even if the item has no EMC assigned - if (singleEmc == 0) { - return null; - } - - int maxExtract = (int) Math.floor(provider.getEmc() / singleEmc); - - if (size > maxExtract) { - size = maxExtract; - } - - if (size <= 0) { - return null; - } - - ItemStack result = ItemHandlerHelper.copyStackWithSize(stack, size); - - if (!simulate) { - provider.setEmc(provider.getEmc() - (singleEmc * size)); - - EntityPlayer player = externalStorage.getWorld().getPlayerEntityByUUID(externalStorage.getOwner()); - - if (player != null) { - provider.sync((EntityPlayerMP) player); - } - } - - return result; - } - } - - return null; - } - - @Override - public int getStored() { - return 0; - } - - @Override - public int getPriority() { - return externalStorage.getPriority(); - } - - @Override - public AccessType getAccessType() { - return externalStorage.getAccessType(); - } -} diff --git a/src/main/java/com/raoulvdberge/refinedstorage/integration/storagedrawers/StorageItemItemRepository.java b/src/main/java/com/raoulvdberge/refinedstorage/integration/storagedrawers/StorageItemItemRepository.java deleted file mode 100644 index f4a46de21..000000000 --- a/src/main/java/com/raoulvdberge/refinedstorage/integration/storagedrawers/StorageItemItemRepository.java +++ /dev/null @@ -1,125 +0,0 @@ -package com.raoulvdberge.refinedstorage.integration.storagedrawers; - -import com.jaquadro.minecraft.storagedrawers.api.capabilities.IItemRepository; -import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawer; -import com.jaquadro.minecraft.storagedrawers.api.storage.IDrawerGroup; -import com.raoulvdberge.refinedstorage.api.storage.AccessType; -import com.raoulvdberge.refinedstorage.apiimpl.API; -import com.raoulvdberge.refinedstorage.apiimpl.network.node.externalstorage.NetworkNodeExternalStorage; -import com.raoulvdberge.refinedstorage.apiimpl.network.node.externalstorage.StorageItemExternal; -import com.raoulvdberge.refinedstorage.util.StackUtils; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.CapabilityInject; -import net.minecraftforge.items.ItemHandlerHelper; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.Collection; -import java.util.Collections; -import java.util.function.Supplier; -import java.util.stream.Collectors; - -public class StorageItemItemRepository extends StorageItemExternal { - @CapabilityInject(IItemRepository.class) - private static final Capability ITEM_REPOSITORY_CAPABILITY = null; - - private NetworkNodeExternalStorage externalStorage; - private Supplier groupSupplier; - - public StorageItemItemRepository(NetworkNodeExternalStorage externalStorage, Supplier groupSupplier) { - this.externalStorage = externalStorage; - this.groupSupplier = groupSupplier; - } - - @Override - public Collection getStacks() { - IItemRepository repository = getRepositoryFromSupplier(); - - if (repository == null) { - return Collections.emptyList(); - } - - return repository.getAllItems().stream().map(r -> ItemHandlerHelper.copyStackWithSize(r.itemPrototype, r.count)).collect(Collectors.toList()); - } - - @Nullable - @Override - public ItemStack insert(@Nonnull ItemStack stack, int size, boolean simulate) { - IItemRepository repository = getRepositoryFromSupplier(); - - if (repository == null) { - return stack; - } - - return StackUtils.emptyToNull(repository.insertItem(ItemHandlerHelper.copyStackWithSize(stack, size), simulate)); - } - - @Nullable - @Override - public ItemStack extract(@Nonnull ItemStack stack, int size, int flags, boolean simulate) { - IItemRepository repository = getRepositoryFromSupplier(); - - if (repository == null) { - return null; - } - - return StackUtils.emptyToNull(repository.extractItem(stack, size, simulate, s -> API.instance().getComparer().isEqual(stack, s, flags))); - } - - @Override - public int getStored() { - IItemRepository repository = getRepositoryFromSupplier(); - - if (repository == null) { - return 0; - } - - return repository.getAllItems().stream().mapToInt(r -> r.count).sum(); - } - - @Override - public int getPriority() { - return externalStorage.getPriority(); - } - - @Override - public AccessType getAccessType() { - return externalStorage.getAccessType(); - } - - @Override - public int getCapacity() { - IDrawerGroup group = groupSupplier.get(); - - if (group == null) { - return 0; - } - - long capacity = 0; - - for (int slot : group.getAccessibleDrawerSlots()) { - IDrawer drawer = group.getDrawer(slot); - - if (drawer.isEnabled()) { - capacity += drawer.getMaxCapacity(); - } - } - - if (capacity >= Integer.MAX_VALUE) { - return Integer.MAX_VALUE; - } - - return (int) capacity; - } - - private IItemRepository getRepositoryFromSupplier() { - IDrawerGroup group = groupSupplier.get(); - - if (group == null) { - return null; - } - - return group.getCapability(ITEM_REPOSITORY_CAPABILITY, null); - } -} diff --git a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java index 13761c11e..ad8e43ff8 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyClient.java @@ -9,8 +9,6 @@ import com.raoulvdberge.refinedstorage.apiimpl.autocrafting.CraftingPattern; import com.raoulvdberge.refinedstorage.block.*; import com.raoulvdberge.refinedstorage.gui.GuiCraftingPreview; import com.raoulvdberge.refinedstorage.gui.grid.GuiCraftingStart; -import com.raoulvdberge.refinedstorage.integration.mcmp.IntegrationMCMP; -import com.raoulvdberge.refinedstorage.integration.mcmp.RSMCMPAddon; import com.raoulvdberge.refinedstorage.item.*; import com.raoulvdberge.refinedstorage.network.MessageGridCraftingPreviewResponse; import com.raoulvdberge.refinedstorage.render.*; @@ -331,7 +329,7 @@ public class ProxyClient extends ProxyCommon { BlockPos pos = e.getTarget().getBlockPos(); - Block block = IntegrationMCMP.isLoaded() ? RSMCMPAddon.unwrapBlock(player.getEntityWorld(), pos) : player.getEntityWorld().getBlockState(pos).getBlock(); + Block block = player.getEntityWorld().getBlockState(pos).getBlock(); if (!(block instanceof BlockCable)) { return; diff --git a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java index 01796bcac..97816fa3d 100755 --- a/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java +++ b/src/main/java/com/raoulvdberge/refinedstorage/proxy/ProxyCommon.java @@ -30,7 +30,6 @@ import com.raoulvdberge.refinedstorage.integration.funkylocomotion.MoveFactoryRe import com.raoulvdberge.refinedstorage.integration.inventorysorter.IntegrationInventorySorter; import com.raoulvdberge.refinedstorage.integration.oc.DriverNetwork; import com.raoulvdberge.refinedstorage.integration.oc.IntegrationOC; -import com.raoulvdberge.refinedstorage.integration.projecte.IntegrationProjectE; import com.raoulvdberge.refinedstorage.network.*; import com.raoulvdberge.refinedstorage.tile.*; import com.raoulvdberge.refinedstorage.tile.craftingmonitor.TileCraftingMonitor; @@ -263,10 +262,6 @@ public class ProxyCommon { if (IntegrationCraftingTweaks.isLoaded()) { IntegrationCraftingTweaks.register(); } - - if (IntegrationProjectE.isLoaded()) { - IntegrationProjectE.register(); - } } public void postInit(FMLPostInitializationEvent e) { @@ -327,7 +322,7 @@ public class ProxyCommon { } private void registerTile(Class tile, String id) { - GameRegistry.registerTileEntity(tile, RS.ID + ":" + id); + GameRegistry.registerTileEntity(tile, new ResourceLocation(RS.ID, id)); try { TileBase tileInstance = tile.newInstance(); diff --git a/src/main/java/moze_intel/projecte/api/PESounds.java b/src/main/java/moze_intel/projecte/api/PESounds.java deleted file mode 100644 index 24c44a4d8..000000000 --- a/src/main/java/moze_intel/projecte/api/PESounds.java +++ /dev/null @@ -1,21 +0,0 @@ -package moze_intel.projecte.api; - -import net.minecraft.util.ResourceLocation; -import net.minecraft.util.SoundEvent; -import net.minecraftforge.fml.common.registry.ForgeRegistries; - -public final class PESounds { - - public static final SoundEvent WIND = ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("projecte", "item.pewindmagic")); - public static final SoundEvent WATER = ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("projecte", "item.pewatermagic")); - public static final SoundEvent POWER = ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("projecte", "item.pepower")); - public static final SoundEvent HEAL = ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("projecte", "item.peheal")); - public static final SoundEvent DESTRUCT = ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("projecte", "item.pedestruct")); - public static final SoundEvent CHARGE = ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("projecte", "item.pecharge")); - public static final SoundEvent UNCHARGE = ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("projecte", "item.peuncharge")); - public static final SoundEvent TRANSMUTE = ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("projecte", "item.petransmute")); - - private PESounds() { - } - -} diff --git a/src/main/java/moze_intel/projecte/api/ProjectEAPI.java b/src/main/java/moze_intel/projecte/api/ProjectEAPI.java deleted file mode 100644 index 2e715d3ea..000000000 --- a/src/main/java/moze_intel/projecte/api/ProjectEAPI.java +++ /dev/null @@ -1,101 +0,0 @@ -package moze_intel.projecte.api; - -import moze_intel.projecte.api.capabilities.IAlchBagProvider; -import moze_intel.projecte.api.capabilities.IKnowledgeProvider; -import moze_intel.projecte.api.proxy.IBlacklistProxy; -import moze_intel.projecte.api.proxy.IConversionProxy; -import moze_intel.projecte.api.proxy.IEMCProxy; -import moze_intel.projecte.api.proxy.ITransmutationProxy; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.capabilities.CapabilityInject; -import net.minecraftforge.fml.common.FMLLog; - -public final class ProjectEAPI { - private static IEMCProxy emcProxy; - private static ITransmutationProxy transProxy; - private static IBlacklistProxy blacklistProxy; - private static IConversionProxy recipeProxy; - - private ProjectEAPI() { - } - - /** - * The capability object for IAlchBagProvider - */ - @CapabilityInject(IAlchBagProvider.class) - public static final Capability ALCH_BAG_CAPABILITY = null; - - /** - * The capability object for IKnowledgeProvider - */ - @CapabilityInject(IKnowledgeProvider.class) - public static final Capability KNOWLEDGE_CAPABILITY = null; - - /** - * Retrieves the proxy for EMC-based API queries. - * - * @return The proxy for EMC-based API queries - */ - public static IEMCProxy getEMCProxy() { - if (emcProxy == null) { - try { - Class clazz = Class.forName("moze_intel.projecte.impl.EMCProxyImpl"); - emcProxy = (IEMCProxy) clazz.getField("instance").get(null); - } catch (ReflectiveOperationException ex) { - FMLLog.warning("[ProjectEAPI] Error retrieving EMCProxyImpl, ProjectE may be absent, damaged, or outdated."); - } - } - return emcProxy; - } - - /** - * Retrieves the proxy for EMC-Recipe-Calculation-based API queries. - * - * @return The proxy for EMC-Recipe-Calculation-based API queries - */ - public static IConversionProxy getConversionProxy() { - if (recipeProxy == null) { - try { - Class clazz = Class.forName("moze_intel.projecte.impl.ConversionProxyImpl"); - recipeProxy = (IConversionProxy) clazz.getField("instance").get(null); - } catch (ReflectiveOperationException ex) { - FMLLog.warning("[ProjectEAPI] Error retrieving ConversionProxyImpl, ProjectE may be absent, damaged, or outdated."); - } - } - return recipeProxy; - } - - /** - * Retrieves the proxy for Transmutation-based API queries. - * - * @return The proxy for Transmutation-based API queries - */ - public static ITransmutationProxy getTransmutationProxy() { - if (transProxy == null) { - try { - Class clazz = Class.forName("moze_intel.projecte.impl.TransmutationProxyImpl"); - transProxy = (ITransmutationProxy) clazz.getField("instance").get(null); - } catch (ReflectiveOperationException ex) { - FMLLog.warning("[ProjectEAPI] Error retrieving TransmutationProxyImpl, ProjectE may be absent, damaged, or outdated."); - } - } - return transProxy; - } - - /** - * Retrieves the proxy for black/whitelist-based API queries. - * - * @return The proxy for black/whitelist-based API queries - */ - public static IBlacklistProxy getBlacklistProxy() { - if (blacklistProxy == null) { - try { - Class clazz = Class.forName("moze_intel.projecte.impl.BlacklistProxyImpl"); - blacklistProxy = (IBlacklistProxy) clazz.getField("instance").get(null); - } catch (ReflectiveOperationException ex) { - FMLLog.warning("[ProjectEAPI] Error retrieving BlacklistProxyImpl, ProjectE may be absent, damaged, or outdated."); - } - } - return blacklistProxy; - } -} \ No newline at end of file diff --git a/src/main/java/moze_intel/projecte/api/capabilities/IAlchBagProvider.java b/src/main/java/moze_intel/projecte/api/capabilities/IAlchBagProvider.java deleted file mode 100644 index b214e5435..000000000 --- a/src/main/java/moze_intel/projecte/api/capabilities/IAlchBagProvider.java +++ /dev/null @@ -1,38 +0,0 @@ -package moze_intel.projecte.api.capabilities; - -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.EnumDyeColor; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.items.IItemHandler; - -import javax.annotation.Nonnull; - -/** - * This interface defines the contract for some object that exposes sixteen colored inventories, - * for the purpose of usage as Alchemical Bags. - * This is exposed through the Capability system. - * Acquire an instance of this using {@link net.minecraft.entity.Entity#getCapability(Capability, EnumFacing)}. - */ -public interface IAlchBagProvider extends INBTSerializable { - - /** - * Note: modifying this clientside is not advised - * - * @param color The bag color to acquire - * @return The inventory representing this alchemical bag - */ - @Nonnull - IItemHandler getBag(@Nonnull EnumDyeColor color); - - /** - * Syncs the bag inventory associated with this color to the player provided (usually the owner of this capability instance) - * - * @param color The bag color to sync. If null, syncs every color. - * @param player The player to sync the bags to. - */ - void sync(@Nonnull EnumDyeColor color, @Nonnull EntityPlayerMP player); - -} diff --git a/src/main/java/moze_intel/projecte/api/capabilities/IKnowledgeProvider.java b/src/main/java/moze_intel/projecte/api/capabilities/IKnowledgeProvider.java deleted file mode 100644 index e8882935d..000000000 --- a/src/main/java/moze_intel/projecte/api/capabilities/IKnowledgeProvider.java +++ /dev/null @@ -1,81 +0,0 @@ -package moze_intel.projecte.api.capabilities; - -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumFacing; -import net.minecraftforge.common.capabilities.Capability; -import net.minecraftforge.common.util.INBTSerializable; -import net.minecraftforge.items.IItemHandler; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.List; - -/** - * This interface defines the contract for some object that exposes transmutation knowledge through the Capability system. - * Acquire an instance of this using {@link net.minecraft.entity.Entity#getCapability(Capability, EnumFacing)}. - */ -public interface IKnowledgeProvider extends INBTSerializable { - - /** - * @return Whether the player has the "tome" flag set, meaning all knowledge checks automatically return true - */ - boolean hasFullKnowledge(); - - /** - * @param fullKnowledge Whether the player has the "tome" flag set, meaning all knowledge checks automatically return true - */ - void setFullKnowledge(boolean fullKnowledge); - - /** - * Clears all knowledge. Additionally, clears the "tome" flag. - */ - void clearKnowledge(); - - /** - * @param stack The stack to query - * @return Whether the player has transmutation knowledge for this stack - */ - boolean hasKnowledge(@Nullable ItemStack stack); - - /** - * @param stack The stack to add to knowledge - * @return Whether the operation was successful - */ - boolean addKnowledge(@Nonnull ItemStack stack); - - /** - * @param stack The stack to remove from knowledge - * @return Whether the operation was successful - */ - boolean removeKnowledge(@Nonnull ItemStack stack); - - /** - * @return An unmodifiable but live view of the knowledge list. - */ - @Nonnull - List getKnowledge(); - - /** - * @return The player's input and lock slots - */ - @Nonnull - IItemHandler getInputAndLocks(); - - /** - * @return The emc in this player's transmutation tablet network - */ - double getEmc(); - - /** - * @param emc The emc to set in this player's transmutation tablet network - */ - void setEmc(double emc); - - /** - * @param player The player to sync to. - */ - void sync(@Nonnull EntityPlayerMP player); - -} diff --git a/src/main/java/moze_intel/projecte/api/event/EMCRemapEvent.java b/src/main/java/moze_intel/projecte/api/event/EMCRemapEvent.java deleted file mode 100644 index f6374d405..000000000 --- a/src/main/java/moze_intel/projecte/api/event/EMCRemapEvent.java +++ /dev/null @@ -1,11 +0,0 @@ -package moze_intel.projecte.api.event; - -import net.minecraftforge.fml.common.eventhandler.Event; - -/** - * This event is fired after all EMC values are recalculated - * This event is not cancelable, and has no result - * This event is fired on MinecraftForge#EVENT_BUS - */ -public class EMCRemapEvent extends Event { -} diff --git a/src/main/java/moze_intel/projecte/api/event/PlayerKnowledgeChangeEvent.java b/src/main/java/moze_intel/projecte/api/event/PlayerKnowledgeChangeEvent.java deleted file mode 100644 index db61ba58d..000000000 --- a/src/main/java/moze_intel/projecte/api/event/PlayerKnowledgeChangeEvent.java +++ /dev/null @@ -1,26 +0,0 @@ -package moze_intel.projecte.api.event; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.fml.common.eventhandler.Event; - -import javax.annotation.Nonnull; -import java.util.UUID; - -/** - * This event is fired after a players transmutation knowledge is changed - * This event is not cancelable, and has no result - * This event is fired on MinecraftForge#EVENT_BUS - */ -public class PlayerKnowledgeChangeEvent extends Event { - private final UUID playerUUID; - - public PlayerKnowledgeChangeEvent(@Nonnull EntityPlayer entityPlayer) { - playerUUID = entityPlayer.getUniqueID(); - } - - @Nonnull - public UUID getPlayerUUID() { - return playerUUID; - } - -} diff --git a/src/main/java/moze_intel/projecte/api/item/IAlchBagItem.java b/src/main/java/moze_intel/projecte/api/item/IAlchBagItem.java deleted file mode 100644 index b9261fc16..000000000 --- a/src/main/java/moze_intel/projecte/api/item/IAlchBagItem.java +++ /dev/null @@ -1,24 +0,0 @@ -package moze_intel.projecte.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.items.IItemHandler; - -import javax.annotation.Nonnull; - -/** - * This interfaces specifies items that perform a specific function every tick when inside an Alchemical Bag, on a player - * - * @author williewillus - */ -public interface IAlchBagItem { - /** - * Called on both client and server every time the alchemical bag ticks this item - * - * @param inv The inventory of the bag - * @param player The player whose bag is being ticked - * @param stack The ItemStack being ticked - * @return Whether the inventory was changed by this item ticking - */ - boolean updateInAlchBag(@Nonnull IItemHandler inv, @Nonnull EntityPlayer player, @Nonnull ItemStack stack); -} diff --git a/src/main/java/moze_intel/projecte/api/item/IAlchChestItem.java b/src/main/java/moze_intel/projecte/api/item/IAlchChestItem.java deleted file mode 100644 index 8c3c4a97a..000000000 --- a/src/main/java/moze_intel/projecte/api/item/IAlchChestItem.java +++ /dev/null @@ -1,24 +0,0 @@ -package moze_intel.projecte.api.item; - -import net.minecraft.item.ItemStack; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; - -import javax.annotation.Nonnull; - -/** - * This interface specifies items that perform a specific function every tick when inside an Alchemical Chest - * - * @author williewillus - */ -public interface IAlchChestItem { - /** - * Called on both client and server every time the alchemical chest ticks this item - * Implementers that modify the chest inventory (serverside) MUST call markDirty() on the tile entity. - * If you do not, your changes may not be saved when the world/chunk unloads! - * - * @param world The World - * @param stack The ItemStack being ticked - */ - void updateInAlchChest(@Nonnull World world, @Nonnull BlockPos pos, @Nonnull ItemStack stack); -} diff --git a/src/main/java/moze_intel/projecte/api/item/IExtraFunction.java b/src/main/java/moze_intel/projecte/api/item/IExtraFunction.java deleted file mode 100644 index dbf54783e..000000000 --- a/src/main/java/moze_intel/projecte/api/item/IExtraFunction.java +++ /dev/null @@ -1,23 +0,0 @@ -package moze_intel.projecte.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumHand; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * This interface specifies items that perform a specific function when the Extra Function key is activated (default C) - */ -public interface IExtraFunction { - /** - * Called serverside when the server receives a Extra Function key packet - * - * @param stack The ItemStack performing this function - * @param player The player performing this function - * @param hand The hand this stack was in, or null if the call was not from the player's hands - * @return Whether the operation succeeded - */ - boolean doExtraFunction(@Nonnull ItemStack stack, @Nonnull EntityPlayer player, @Nullable EnumHand hand); -} diff --git a/src/main/java/moze_intel/projecte/api/item/IItemCharge.java b/src/main/java/moze_intel/projecte/api/item/IItemCharge.java deleted file mode 100644 index 766dd125a..000000000 --- a/src/main/java/moze_intel/projecte/api/item/IItemCharge.java +++ /dev/null @@ -1,31 +0,0 @@ -package moze_intel.projecte.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumHand; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * This interface specifies items that have a charge that changes when the respective keybinding is activated (default V) - */ -public interface IItemCharge { - /** - * Returns the current charge on the given ItemStack - * - * @param stack Stack whose charge we want - * @return The charge on the stack - */ - byte getCharge(@Nonnull ItemStack stack); - - /** - * Called serverside when the player presses the charge keybinding; reading sneaking state is up to you - * - * @param player The player - * @param stack The item being charged - * @param hand The hand this stack was in, or null if the call was not from the player's hands - * @return Whether the operation succeeded - */ - boolean changeCharge(@Nonnull EntityPlayer player, @Nonnull ItemStack stack, @Nullable EnumHand hand); -} diff --git a/src/main/java/moze_intel/projecte/api/item/IItemEmc.java b/src/main/java/moze_intel/projecte/api/item/IItemEmc.java deleted file mode 100644 index 613996935..000000000 --- a/src/main/java/moze_intel/projecte/api/item/IItemEmc.java +++ /dev/null @@ -1,46 +0,0 @@ -package moze_intel.projecte.api.item; - -import net.minecraft.item.ItemStack; - -import javax.annotation.Nonnull; - -/** - * This interface defines the contract for items that wish to expose their internal EMC storage for external manipulation - * - * @author williewillus - */ -public interface IItemEmc { - /** - * Adds EMC to the itemstack - * - * @param stack The itemstack to add to - * @param toAdd The maximum amount to add - * @return The amount that was actually added - */ - double addEmc(@Nonnull ItemStack stack, double toAdd); - - /** - * Extracts EMC from the itemstack - * - * @param stack The itemstack to remove from - * @param toRemove The maximum amount to remove - * @return The amount that was actually extracted - */ - double extractEmc(@Nonnull ItemStack stack, double toRemove); - - /** - * Gets the current EMC this stack is showing to the public - * - * @param stack The stack to query - * @return The current publicly-accessible EMC stored in this stack - */ - double getStoredEmc(@Nonnull ItemStack stack); - - /** - * Gets the maximum EMC that is allowed to be stored in this stack - * - * @param stack The stack to query - * @return The maximum amount of publicly-accessible EMC that can be stored in this stack - */ - double getMaximumEmc(@Nonnull ItemStack stack); -} diff --git a/src/main/java/moze_intel/projecte/api/item/IModeChanger.java b/src/main/java/moze_intel/projecte/api/item/IModeChanger.java deleted file mode 100644 index e76d2d3bc..000000000 --- a/src/main/java/moze_intel/projecte/api/item/IModeChanger.java +++ /dev/null @@ -1,31 +0,0 @@ -package moze_intel.projecte.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumHand; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * This interface specifies items that switch between modes when the mode switch keybind is activated (default G) - */ -public interface IModeChanger { - /** - * Gets the mode from this ItemStack - * - * @param stack The stack we want the mode of - * @return The mode of this ItemStack - */ - byte getMode(@Nonnull ItemStack stack); - - /** - * Called serverside when the player presses change mode - * - * @param player The player pressing the change mode key - * @param stack The stack whose mode we are changing - * @param hand The hand this stack was in, or null if the call was not from the player's hands - * @return Whether the operation succeeded - */ - boolean changeMode(@Nonnull EntityPlayer player, @Nonnull ItemStack stack, @Nullable EnumHand hand); -} diff --git a/src/main/java/moze_intel/projecte/api/item/IPedestalItem.java b/src/main/java/moze_intel/projecte/api/item/IPedestalItem.java deleted file mode 100644 index 25d3b39fa..000000000 --- a/src/main/java/moze_intel/projecte/api/item/IPedestalItem.java +++ /dev/null @@ -1,35 +0,0 @@ -package moze_intel.projecte.api.item; - -import net.minecraft.client.resources.I18n; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.text.TextFormatting; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; - -import javax.annotation.Nonnull; -import java.util.List; - -/** - * This interface specifies items that perform a specific function every tick when inside an activated Dark Matter Pedestal - * - * @author williewillus - */ -public interface IPedestalItem { - - @SideOnly(Side.CLIENT) - String TOOLTIPDISABLED = TextFormatting.RED + I18n.format("pe.pedestal.item_disabled"); - - /*** - * Called on both client and server each time an active DMPedestalTile ticks with this item inside - */ - void updateInPedestal(@Nonnull World world, @Nonnull BlockPos pos); - - /*** - * Called clientside when inside the pedestal gui to add special function descriptions - * @return Brief strings describing the item's function in an activated pedestal - */ - @SideOnly(Side.CLIENT) - @Nonnull - List getPedestalDescription(); -} diff --git a/src/main/java/moze_intel/projecte/api/item/IProjectileShooter.java b/src/main/java/moze_intel/projecte/api/item/IProjectileShooter.java deleted file mode 100644 index b359d579f..000000000 --- a/src/main/java/moze_intel/projecte/api/item/IProjectileShooter.java +++ /dev/null @@ -1,23 +0,0 @@ -package moze_intel.projecte.api.item; - -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumHand; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; - -/** - * This interface specifies items that fire a projectile when the Shoot Projectile keybind is activated (default R) - */ -public interface IProjectileShooter { - /** - * Called serverside when the player presses the Fire Projectile Button - * - * @param player The player pressing the key - * @param stack The stack we are using to shoot - * @param hand The hand this stack was in, or null if the call was not from the player's hands - * @return If the projectile was actually fired - */ - boolean shootProjectile(@Nonnull EntityPlayer player, @Nonnull ItemStack stack, @Nullable EnumHand hand); -} diff --git a/src/main/java/moze_intel/projecte/api/package-info.java b/src/main/java/moze_intel/projecte/api/package-info.java deleted file mode 100644 index e050204df..000000000 --- a/src/main/java/moze_intel/projecte/api/package-info.java +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Increment apiVersion every time the API changes. - * (Adding methods, removing methods, changing method signatures, etc.) - */ -@API(owner = "ProjectE", apiVersion = "1.10.2-1.0.0", provides = "ProjectEAPI") -package moze_intel.projecte.api; - -import net.minecraftforge.fml.common.API; diff --git a/src/main/java/moze_intel/projecte/api/proxy/IBlacklistProxy.java b/src/main/java/moze_intel/projecte/api/proxy/IBlacklistProxy.java deleted file mode 100644 index c68fe20d5..000000000 --- a/src/main/java/moze_intel/projecte/api/proxy/IBlacklistProxy.java +++ /dev/null @@ -1,42 +0,0 @@ -package moze_intel.projecte.api.proxy; - -import net.minecraft.entity.Entity; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -import javax.annotation.Nonnull; - -public interface IBlacklistProxy { - /** - * Blacklist an Entity class from being repelled by the Interdiction Torch - * Call this during the postinit phase - * - * @param clazz The entity class to blacklist - */ - void blacklistInterdiction(@Nonnull Class clazz); - - /** - * Blacklist an Entity class from being repelled by the SWRG's repel mode - * Call this during the postinit phase - * - * @param clazz The entity class to blacklist - */ - void blacklistSwiftwolf(@Nonnull Class clazz); - - /** - * Prevent the Watch of Flowing Time from speeding up this TileEntity - * Modders: Use this only to prevent things from breaking badly - leave balance to the modpacker and player - * Call this during the postinit phase - * - * @param clazz The TileEntity to blacklist - */ - void blacklistTimeWatch(@Nonnull Class clazz); - - /** - * Whitelist an ItemStack, allowing stacks of its kind to dupe NBT during Transmutation and Condensation - * Call this during the postinit phase - * - * @param stack The stack to whitelist - */ - void whitelistNBT(@Nonnull ItemStack stack); -} diff --git a/src/main/java/moze_intel/projecte/api/proxy/IConversionProxy.java b/src/main/java/moze_intel/projecte/api/proxy/IConversionProxy.java deleted file mode 100644 index afcde1e26..000000000 --- a/src/main/java/moze_intel/projecte/api/proxy/IConversionProxy.java +++ /dev/null @@ -1,65 +0,0 @@ -package moze_intel.projecte.api.proxy; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; - -import javax.annotation.Nonnull; -import java.util.Map; - -public interface IConversionProxy { - /** - * Add a Conversion to the EMC Calculation. - *

- * Adding a Conversion allows ProjectE to calculate the EMC value for the output based on the specified ingredients. - * These do not need to be actually Conversions. You can use it to make the EMC value of an item relative to the EMC value of other items. - * ProjectE will automatically select the Conversion with the lowest EMC value. - *

- * Has to be called after {@code FMLInitializationEvent} and before {@code FMLServerStartingEvent}. - *

- * You can use the following things for the {@code output}-Parameter and the keys in the {@code ingredients} Map: - *

    - *
  • {@link ItemStack} - The ItemId and Metadata will be used to identify this ItemStack (May contain a {@code Block} or {@code Item}). You can use {@link net.minecraftforge.oredict.OreDictionary#WILDCARD_VALUE} as metadata.
  • - *
  • {@link Block} - Same as calling it with {@code new ItemStack(block)}. Uses the Id and metadata = 0
  • - *
  • {@link Item} - Same as calling it with {@code new ItemStack(item)}. Uses the Id and metadata = 0
  • - *
  • {@link FluidStack} - {@link FluidStack#getFluid()} and {@link Fluid#getName()} will be used to identify this Fluid.
  • - *
  • {@link String} - will be interpreted as an OreDictionary name.
  • - *
  • {@link Object} - (No subclasses of {@code Object} - only {@code Object}!) can be used as a intermediate fake object for complex conversion.
  • - *
- * All {@code Object}s will be assumed to be a single instance. No stacksize will be used. - *

- * Use the {@code amount} parameter to specify how many {@code output}s are created. - * Use the value in the {@code ingredients}-Map to specify how much of an ingredient is required. - * (Use Millibuckets for Fluids) - *

- * Examples: - *

- *

{@code
-     * //Furnace Crafting Recipe:
-     * addConversion(1, Blocks.FURNACE, ImmutableMap.of((Object)Blocks.COBBLESTONE, 8));
-     * //alternatively:
-     * addConversion(1, Blocks.FURNACE, ImmutableMap.of(Blocks.COBBLESTONE, 8));
-     *
-     * //Bed Crafting Recipe with OreDictionary Names:
-     * //3 "plankWood" and 3 "blockWool" turn into 1 Blocks.BED
-     * addConversion(1, Blocks.BED, ImmutableMap.of("plankWood", 3, "blockWool", 3));
-     *
-     * //For Recipes that have multiple possible Ingredients, that don't belong to a known OreDict entry you can use a fake-item Object:
-     * Object blackOrWhite = new Object();
-     * //1 White Wool can be turned into 1 'blackOrWhite'
-     * addConversion(1, blackOrWhite, ImmutableMap.of((Object)new ItemStack(Blocks.WOOL, 1, 0), 1));
-     * //1 Black Wool can be turned into 1 'blackOrWhite'
-     * addConversion(1, blackOrWhite, ImmutableMap.of((Object)new ItemStack(Blocks.WOOL, 1, 15), 1));
-     * //Bed created with black or white wool only
-     * addConversion(1, Blocks.BED, ImmutableMap.of(blackOrWhite, 3, "plankWood", 3));
-     * }
-     * 
- * - * @param amount - * @param output - * @param ingredients - */ - void addConversion(int amount, @Nonnull Object output, @Nonnull Map ingredients); -} \ No newline at end of file diff --git a/src/main/java/moze_intel/projecte/api/proxy/IEMCProxy.java b/src/main/java/moze_intel/projecte/api/proxy/IEMCProxy.java deleted file mode 100644 index e4e2013b8..000000000 --- a/src/main/java/moze_intel/projecte/api/proxy/IEMCProxy.java +++ /dev/null @@ -1,96 +0,0 @@ -package moze_intel.projecte.api.proxy; - -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -import javax.annotation.Nonnull; -import java.util.Map; - -public interface IEMCProxy { - /** - * Registers a custom EMC value for this ItemStack - * Call this during any of the main loading phases (Preinit, Init, Postinit) - * - * @param stack The stack we want to define EMC for - * @param value The value to define. Values below 0 are changed to 0 - */ - void registerCustomEMC(@Nonnull ItemStack stack, int value); - - /** - * Register a custom EMC value for emc calculation that is used in Recipes. - * You can use the following things for the {@code o}-Parameter: - *
    - *
  • {@link ItemStack} - The Modname:unlocalizedName and Metadata will be used to identify this ItemStack (May contain a {@code Block} or {@code Item})
  • - *
  • {@link String} - will be interpreted as an OreDictionary name.
  • - *
  • {@link Object} - (No subclasses of {@code Object} - only {@code Object}!) can be used as a intermediate fake object for complex recipes.
  • - *
- * - * @param o - * @param value - * @see IConversionProxy#addConversion(int, Object, Map) - */ - void registerCustomEMC(@Nonnull Object o, int value); - - /** - * Queries the EMC value registry if the given block has an EMC value - * Can be called at any time, but will only return valid results if a world is loaded - * Can be called on both sides - * - * @param block The block we want to query - * @return Whether the block has an emc value - */ - boolean hasValue(@Nonnull Block block); - - /** - * Queries the EMC value registry if the given item with a damage value of 0 has an EMC value - * Can be called at any time, but will only return valid results if a world is loaded - * Can be called on both sides - * - * @param item The item we want to query - * @return Whether the item has an emc value - */ - boolean hasValue(@Nonnull Item item); - - /** - * Queries the EMC value registry if the given ItemStack has an EMC value - * This will also use the damage value to check if the Item has an EMC value - * Can be called at any time, but will only return valid results if a world is loaded - * Can be called on both sides - * - * @param stack The stack we want to query - * @return Whether the ItemStack has an emc value - */ - boolean hasValue(@Nonnull ItemStack stack); - - /** - * Queries the EMC value for the provided block - * Can be called at any time, but will only return valid results if a world is loaded - * Can be called on both sides - * - * @param block The block we want to query - * @return The block's EMC value, or 0 if there is none - */ - int getValue(@Nonnull Block block); - - /** - * Queries the EMC value for the provided item - * Can be called at any time, but will only return valid results if a world is loaded - * Can be called on both sides - * - * @param item The item we want to query - * @return The item's EMC value, or 0 if there is none - */ - int getValue(@Nonnull Item item); - - /** - * Queries the EMC value for the provided stack - * Can be called at any time, but will only return valid results if a world is loaded - * Can be called on both sides - * This takes into account bonuses such as stored emc in power items and enchantments - * - * @param stack The stack we want to query - * @return The stack's EMC value, or 0 if there is none - */ - int getValue(@Nonnull ItemStack stack); -} diff --git a/src/main/java/moze_intel/projecte/api/proxy/ITransmutationProxy.java b/src/main/java/moze_intel/projecte/api/proxy/ITransmutationProxy.java deleted file mode 100644 index 52529c2ea..000000000 --- a/src/main/java/moze_intel/projecte/api/proxy/ITransmutationProxy.java +++ /dev/null @@ -1,37 +0,0 @@ -package moze_intel.projecte.api.proxy; - -import moze_intel.projecte.api.capabilities.IKnowledgeProvider; -import net.minecraft.block.state.IBlockState; - -import javax.annotation.Nonnull; -import javax.annotation.Nullable; -import java.util.UUID; - -public interface ITransmutationProxy { - /** - * Register a world transmutation with the Philosopher's Stone - * Calls this during the postinit phase - * - * @param origin Original blockstate when targeting world transmutation - * @param result1 First result blockstate - * @param result2 Alternate result blockstate (when sneaking). You may pass null, in which there will be no alternate transmutation - * @return Whether the registration succeeded. It may fail if transmutations already exist for block origin - */ - boolean registerWorldTransmutation(@Nonnull IBlockState origin, @Nonnull IBlockState result1, @Nullable IBlockState result2); - - /** - * Gets an {@link IKnowledgeProvider} representing the UUID provided. - *

- * If the provided UUID is offline, note that the returned {@link IKnowledgeProvider} is immutable! - * If called clientside, {@param playerUUID} is ignored and the client player is used instead. - * If called serverside, this must be called after the server has reached state SERVER_STARTED. - *

- * If the provided UUID could not be found both on or offline, an {@link IKnowledgeProvider} with no knowledge is returned. - * - * @param playerUUID The UUID to query - * @return an {@link IKnowledgeProvider} representing the UUID provided, or an {@link IKnowledgeProvider} representing no knowledge if - * the requested UUID could not be found - */ - @Nonnull - IKnowledgeProvider getKnowledgeProviderFor(@Nonnull UUID playerUUID); -} diff --git a/src/main/java/moze_intel/projecte/api/state/PEStateProps.java b/src/main/java/moze_intel/projecte/api/state/PEStateProps.java deleted file mode 100644 index 2d37e5f82..000000000 --- a/src/main/java/moze_intel/projecte/api/state/PEStateProps.java +++ /dev/null @@ -1,19 +0,0 @@ -package moze_intel.projecte.api.state; - -import moze_intel.projecte.api.state.enums.EnumFuelType; -import moze_intel.projecte.api.state.enums.EnumMatterType; -import net.minecraft.block.BlockHorizontal; -import net.minecraft.block.properties.IProperty; -import net.minecraft.block.properties.PropertyEnum; -import net.minecraft.util.EnumFacing; - -public final class PEStateProps { - - public static final IProperty FACING = BlockHorizontal.FACING; - public static final IProperty FUEL_PROP = PropertyEnum.create("fueltype", EnumFuelType.class); - public static final IProperty TIER_PROP = PropertyEnum.create("tier", EnumMatterType.class); - - private PEStateProps() { - } - -} diff --git a/src/main/java/moze_intel/projecte/api/state/enums/EnumFuelType.java b/src/main/java/moze_intel/projecte/api/state/enums/EnumFuelType.java deleted file mode 100644 index 702dabe00..000000000 --- a/src/main/java/moze_intel/projecte/api/state/enums/EnumFuelType.java +++ /dev/null @@ -1,28 +0,0 @@ -package moze_intel.projecte.api.state.enums; - -import net.minecraft.util.IStringSerializable; - -import javax.annotation.Nonnull; - -public enum EnumFuelType implements IStringSerializable { - ALCHEMICAL_COAL("alchemical_coal"), - MOBIUS_FUEL("mobius_fuel"), - AETERNALIS_FUEL("aeternalis_fuel"); - - private final String name; - - EnumFuelType(String name) { - this.name = name; - } - - @Nonnull - @Override - public String getName() { - return name; - } - - @Override - public String toString() { - return name; - } -} diff --git a/src/main/java/moze_intel/projecte/api/state/enums/EnumMatterType.java b/src/main/java/moze_intel/projecte/api/state/enums/EnumMatterType.java deleted file mode 100644 index cb958d945..000000000 --- a/src/main/java/moze_intel/projecte/api/state/enums/EnumMatterType.java +++ /dev/null @@ -1,27 +0,0 @@ -package moze_intel.projecte.api.state.enums; - -import net.minecraft.util.IStringSerializable; - -import javax.annotation.Nonnull; - -public enum EnumMatterType implements IStringSerializable { - DARK_MATTER("dark_matter"), - RED_MATTER("red_matter"); - - private final String name; - - EnumMatterType(String name) { - this.name = name; - } - - @Nonnull - @Override - public String getName() { - return name; - } - - @Override - public String toString() { - return name; - } -} diff --git a/src/main/java/moze_intel/projecte/api/tile/IEmcAcceptor.java b/src/main/java/moze_intel/projecte/api/tile/IEmcAcceptor.java deleted file mode 100644 index 80786a4f5..000000000 --- a/src/main/java/moze_intel/projecte/api/tile/IEmcAcceptor.java +++ /dev/null @@ -1,24 +0,0 @@ -package moze_intel.projecte.api.tile; - -import net.minecraft.util.EnumFacing; - -import javax.annotation.Nonnull; - -/** - * Implement this interface to specify that "EMC can be given to this Tile Entity from an external source" - * The contract of this interface is only the above statement - * However, ProjectE implements an "active-push" system, where providers automatically send EMC to acceptors. You are recommended to follow this convention - * Reference implementation provided in TileEmcHandler - * - * @author williewillus - */ -public interface IEmcAcceptor extends IEmcStorage { - /** - * Accept, at most, the given amount of EMC from the given side - * - * @param side The side to accept EMC from - * @param toAccept The maximum amount to accept - * @return The amount actually accepted - */ - double acceptEMC(@Nonnull EnumFacing side, double toAccept); -} diff --git a/src/main/java/moze_intel/projecte/api/tile/IEmcProvider.java b/src/main/java/moze_intel/projecte/api/tile/IEmcProvider.java deleted file mode 100644 index c483551d1..000000000 --- a/src/main/java/moze_intel/projecte/api/tile/IEmcProvider.java +++ /dev/null @@ -1,24 +0,0 @@ -package moze_intel.projecte.api.tile; - -import net.minecraft.util.EnumFacing; - -import javax.annotation.Nonnull; - -/** - * Implement this interface to specify that "EMC can be taken from this Tile Entity from an external source" - * The contract of this interface is limited to only the above statement - * However, ProjectE implements an "active-push" system, where providers automatically send EMC to acceptors. You are recommended to follow this convention - * Reference implementation provided in TileEmcHandler - * - * @author williewillus - */ -public interface IEmcProvider extends IEmcStorage { - /** - * Extract, at most, the given amount of EMC from the given side - * - * @param side The side to extract EMC from - * @param toExtract The maximum amount to extract - * @return The amount actually extracted - */ - double provideEMC(@Nonnull EnumFacing side, double toExtract); -} diff --git a/src/main/java/moze_intel/projecte/api/tile/IEmcStorage.java b/src/main/java/moze_intel/projecte/api/tile/IEmcStorage.java deleted file mode 100644 index 27434db64..000000000 --- a/src/main/java/moze_intel/projecte/api/tile/IEmcStorage.java +++ /dev/null @@ -1,24 +0,0 @@ -package moze_intel.projecte.api.tile; - -/** - * Defines the contract for arbitrary objects that can store EMC - * You usually do not want to use this directly - * Use extensions IEMCAcceptor and IEMCProvider, or the provided reference implementations instead - * - * @author williewillus - */ -public interface IEmcStorage { - /** - * Gets the current amount of EMC in this IEMCStorage - * - * @return The current EMC stored - */ - double getStoredEmc(); - - /** - * Gets the maximum amount of EMC this IEMCStorage is allowed to contain - * - * @return The maximum EMC allowed - */ - double getMaximumEmc(); -} diff --git a/src/main/java/moze_intel/projecte/api/tile/TileEmcAcceptor.java b/src/main/java/moze_intel/projecte/api/tile/TileEmcAcceptor.java deleted file mode 100644 index 03d924a15..000000000 --- a/src/main/java/moze_intel/projecte/api/tile/TileEmcAcceptor.java +++ /dev/null @@ -1,19 +0,0 @@ -package moze_intel.projecte.api.tile; - -import net.minecraft.util.EnumFacing; - -import javax.annotation.Nonnull; - -/** - * Reference implementation of IEMCAcceptor - * - * @author williewillus - */ -public class TileEmcAcceptor extends TileEmcBase implements IEmcAcceptor { - @Override - public double acceptEMC(@Nonnull EnumFacing side, double toAccept) { - double toAdd = Math.min(maximumEMC - currentEMC, toAccept); - addEMC(toAdd); - return toAdd; - } -} diff --git a/src/main/java/moze_intel/projecte/api/tile/TileEmcBase.java b/src/main/java/moze_intel/projecte/api/tile/TileEmcBase.java deleted file mode 100644 index 7507da94f..000000000 --- a/src/main/java/moze_intel/projecte/api/tile/TileEmcBase.java +++ /dev/null @@ -1,80 +0,0 @@ -package moze_intel.projecte.api.tile; - -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -import javax.annotation.Nonnull; - -/** - * Base class for the reference implementations TileEmcProvider, TileEmcAcceptor, and TileEmcHandler - * Usually you want to use one of three derived reference implementations - * Extend this if you want fine-grained control over all aspects of how your tile provides or accepts EMC - * - * @author williewillus - */ -public class TileEmcBase extends TileEntity implements IEmcStorage { - protected double maximumEMC; - protected double currentEMC = 0; - - protected TileEmcBase() { - setMaximumEMC(Double.MAX_VALUE); - } - - public final void setMaximumEMC(double max) { - maximumEMC = max; - if (currentEMC > maximumEMC) { - currentEMC = maximumEMC; - } - } - - @Override - public double getStoredEmc() { - return currentEMC; - } - - @Override - public double getMaximumEmc() { - return maximumEMC; - } - - /** - * Add EMC directly into the internal buffer. Use for internal implementation of your tile - */ - protected void addEMC(double toAdd) { - currentEMC += toAdd; - if (currentEMC > maximumEMC) { - currentEMC = maximumEMC; - } - } - - /** - * Removes EMC directly into the internal buffer. Use for internal implementation of your tile - */ - protected void removeEMC(double toRemove) { - currentEMC -= toRemove; - if (currentEMC < 0) { - currentEMC = 0; - } - } - - @Nonnull - @Override - public NBTTagCompound writeToNBT(NBTTagCompound tag) { - tag = super.writeToNBT(tag); - if (currentEMC > maximumEMC) { - currentEMC = maximumEMC; - } - tag.setDouble("EMC", currentEMC); - return tag; - } - - @Override - public void readFromNBT(NBTTagCompound tag) { - super.readFromNBT(tag); - double set = tag.getDouble("EMC"); - if (set > maximumEMC) { - set = maximumEMC; - } - currentEMC = set; - } -} diff --git a/src/main/java/moze_intel/projecte/api/tile/TileEmcHandler.java b/src/main/java/moze_intel/projecte/api/tile/TileEmcHandler.java deleted file mode 100644 index 62ee49279..000000000 --- a/src/main/java/moze_intel/projecte/api/tile/TileEmcHandler.java +++ /dev/null @@ -1,47 +0,0 @@ -package moze_intel.projecte.api.tile; - -import net.minecraft.util.EnumFacing; - -import javax.annotation.Nonnull; - -/** - * Reference implementation of both IEMCAcceptor and IEMCProvider - * - * @author williewillus - */ -public class TileEmcHandler extends TileEmcBase implements IEmcAcceptor, IEmcProvider { - public TileEmcHandler() { - this.maximumEMC = Double.MAX_VALUE; - } - - public TileEmcHandler(double max) { - this.maximumEMC = max; - } - - // -- IEMCAcceptor -- // - @Override - public double acceptEMC(@Nonnull EnumFacing side, double toAccept) { - double toAdd = Math.min(maximumEMC - currentEMC, toAccept); - currentEMC += toAdd; - return toAdd; - } - - // -- IEMCProvider -- // - @Override - public double provideEMC(@Nonnull EnumFacing side, double toExtract) { - double toRemove = Math.min(currentEMC, toExtract); - currentEMC -= toRemove; - return toRemove; - } - - // -- IEMCStorage --// - @Override - public double getStoredEmc() { - return currentEMC; - } - - @Override - public double getMaximumEmc() { - return maximumEMC; - } -} diff --git a/src/main/java/moze_intel/projecte/api/tile/TileEmcProvider.java b/src/main/java/moze_intel/projecte/api/tile/TileEmcProvider.java deleted file mode 100644 index 5e0cb3b4c..000000000 --- a/src/main/java/moze_intel/projecte/api/tile/TileEmcProvider.java +++ /dev/null @@ -1,19 +0,0 @@ -package moze_intel.projecte.api.tile; - -import net.minecraft.util.EnumFacing; - -import javax.annotation.Nonnull; - -/** - * Reference implementation for IEMCProvider - * - * @author williewillus - */ -public class TileEmcProvider extends TileEmcBase implements IEmcProvider { - @Override - public double provideEMC(@Nonnull EnumFacing side, double toExtract) { - double toRemove = Math.min(currentEMC, toExtract); - removeEMC(toRemove); - return toRemove; - } -} diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 05d2782be..89f06fa4b 100755 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -3,7 +3,7 @@ "modid": "refinedstorage", "name": "Refined Storage", "description": "An elegant solution to your hoarding problem", - "version": "1.5.35", + "version": "1.6", "mcversion": "1.12.2", "url": "https://refinedstorage.raoulvdberge.com", "updateUrl": "",