Fabric port in progress

This commit is contained in:
Sebastian Hartte
2020-06-28 00:45:33 +02:00
parent b79cd732b2
commit 37ce6b262e
102 changed files with 650 additions and 591 deletions
@@ -41,7 +41,7 @@ import appeng.parts.AEBasePart;
* can be one of three ways:
*
* <ul>
* <li>A tile entity at a given block position.</li>
* <li>A block entity at a given block position.</li>
* <li>A part (i.e. cable bus part) at the side of a given block position.</li>
* <li>An item held by the player.</li>
* </ul>
@@ -76,7 +76,7 @@ public final class ContainerLocator {
public static ContainerLocator forTileEntity(BlockEntity te) {
if (te.getWorld() == null) {
throw new IllegalArgumentException("Cannot open a tile entity that is not in a world");
throw new IllegalArgumentException("Cannot open a block entity that is not in a world");
}
int dimensionId = te.getWorld().getDimension().getType().getId();
return new ContainerLocator(Type.BLOCK, -1, dimensionId, te.getPos(), null);
@@ -84,7 +84,7 @@ public final class ContainerLocator {
public static ContainerLocator forTileEntitySide(BlockEntity te, Direction side) {
if (te.getWorld() == null) {
throw new IllegalArgumentException("Cannot open a tile entity that is not in a world");
throw new IllegalArgumentException("Cannot open a block entity that is not in a world");
}
int dimensionId = te.getWorld().getDimension().getType().getId();
return new ContainerLocator(Type.PART, -1, dimensionId, te.getPos(), AEPartLocation.fromFacing(side));
@@ -55,7 +55,7 @@ public final class ContainerHelper<C extends AEBaseContainer, I> {
}
/**
* Opens a container that is based around a single tile entity. The tile
* Opens a container that is based around a single block entity. The tile
* entity's position is encoded in the packet buffer.
*/
public C fromNetwork(int windowId, PlayerInventory inv, PacketByteBuf packetBuf) {
@@ -131,7 +131,7 @@ public final class ContainerHelper<C extends AEBaseContainer, I> {
BlockEntity tileEntity = player.world.getBlockEntity(locator.getBlockPos());
// The tile entity itself can host a terminal (i.e. Chest!)
// The block entity itself can host a terminal (i.e. Chest!)
if (interfaceClass.isInstance(tileEntity)) {
return interfaceClass.cast(tileEntity);
}
@@ -141,7 +141,7 @@ public final class ContainerHelper<C extends AEBaseContainer, I> {
}
if (tileEntity instanceof IPartHost) {
// But it could also be a part attached to the tile entity
// But it could also be a part attached to the block entity
IPartHost partHost = (IPartHost) tileEntity;
IPart part = partHost.getPart(locator.getSide());
if (part == null) {