API compiles
This commit is contained in:
@@ -28,29 +28,29 @@ import java.util.Optional;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.ItemTransferable;
|
||||
import com.google.common.collect.ImmutableSet;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.inventory.CraftingInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.text.TranslatableText;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.wrapper.RangedWrapper;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -169,8 +169,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChangeInventory(final IItemHandler inv, final int slot, final InvOperation mc,
|
||||
final ItemStack removed, final ItemStack added) {
|
||||
public void onChangeInventory(final ItemTransferable inv, final int slot, final InvOperation mc,
|
||||
final ItemStack removed, final ItemStack added) {
|
||||
if (this.isWorking == slot) {
|
||||
return;
|
||||
}
|
||||
@@ -401,7 +401,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
}
|
||||
}
|
||||
|
||||
final TileEntity te = this.iHost.getTileEntity();
|
||||
final BlockEntity te = this.iHost.getTileEntity();
|
||||
if (te != null && te.getWorld() != null) {
|
||||
Platform.notifyBlocksOfNeighbors(te.getWorld(), te.getPos());
|
||||
}
|
||||
@@ -445,11 +445,11 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
// return after.stackSize != stack.stackSize;
|
||||
}
|
||||
|
||||
public IItemHandler getConfig() {
|
||||
public ItemTransferable getConfig() {
|
||||
return this.config;
|
||||
}
|
||||
|
||||
public IItemHandler getPatterns() {
|
||||
public ItemTransferable getPatterns() {
|
||||
return this.patterns;
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
return new DimensionalCoord(this.iHost.getTileEntity());
|
||||
}
|
||||
|
||||
public IItemHandler getInternalInventory() {
|
||||
public ItemTransferable getInternalInventory() {
|
||||
return this.storage;
|
||||
}
|
||||
|
||||
@@ -505,7 +505,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
return;
|
||||
}
|
||||
|
||||
final TileEntity tile = this.iHost.getTileEntity();
|
||||
final BlockEntity tile = this.iHost.getTileEntity();
|
||||
final World w = tile.getWorld();
|
||||
|
||||
final Iterator<ItemStack> i = this.waitingToSend.iterator();
|
||||
@@ -513,7 +513,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
ItemStack whatToSend = i.next();
|
||||
|
||||
for (final Direction s : possibleDirections) {
|
||||
final TileEntity te = w.getTileEntity(tile.getPos().offset(s));
|
||||
final BlockEntity te = w.getTileEntity(tile.getPos().offset(s));
|
||||
if (te == null) {
|
||||
continue;
|
||||
}
|
||||
@@ -657,8 +657,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity getTile() {
|
||||
return (TileEntity) (this.iHost instanceof TileEntity ? this.iHost : null);
|
||||
public BlockEntity getTile() {
|
||||
return (BlockEntity) (this.iHost instanceof BlockEntity ? this.iHost : null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -685,7 +685,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemHandler getInventoryByName(final String name) {
|
||||
public ItemTransferable getInventoryByName(final String name) {
|
||||
if (name.equals("storage")) {
|
||||
return this.storage;
|
||||
}
|
||||
@@ -705,7 +705,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
return null;
|
||||
}
|
||||
|
||||
public IItemHandler getStorage() {
|
||||
public ItemTransferable getStorage() {
|
||||
return this.storage;
|
||||
}
|
||||
|
||||
@@ -751,12 +751,12 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
return false;
|
||||
}
|
||||
|
||||
final TileEntity tile = this.iHost.getTileEntity();
|
||||
final BlockEntity tile = this.iHost.getTileEntity();
|
||||
final World w = tile.getWorld();
|
||||
|
||||
final EnumSet<Direction> possibleDirections = this.iHost.getTargets();
|
||||
for (final Direction s : possibleDirections) {
|
||||
final TileEntity te = w.getTileEntity(tile.getPos().offset(s));
|
||||
final BlockEntity te = w.getTileEntity(tile.getPos().offset(s));
|
||||
if (te instanceof IInterfaceHost) {
|
||||
try {
|
||||
if (((IInterfaceHost) te).getInterfaceDuality().sameGrid(this.gridProxy.getGrid())) {
|
||||
@@ -812,13 +812,13 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
|
||||
if (this.isBlocking()) {
|
||||
final EnumSet<Direction> possibleDirections = this.iHost.getTargets();
|
||||
final TileEntity tile = this.iHost.getTileEntity();
|
||||
final BlockEntity tile = this.iHost.getTileEntity();
|
||||
final World w = tile.getWorld();
|
||||
|
||||
boolean allAreBusy = true;
|
||||
|
||||
for (final Direction s : possibleDirections) {
|
||||
final TileEntity te = w.getTileEntity(tile.getPos().offset(s));
|
||||
final BlockEntity te = w.getTileEntity(tile.getPos().offset(s));
|
||||
|
||||
final InventoryAdaptor ad = InventoryAdaptor.getAdaptor(te, s.getOpposite());
|
||||
if (ad != null) {
|
||||
@@ -937,8 +937,8 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
this.craftingTracker.jobStateChange(link);
|
||||
}
|
||||
|
||||
public ITextComponent getTermName() {
|
||||
final TileEntity hostTile = this.iHost.getTileEntity();
|
||||
public Text getTermName() {
|
||||
final BlockEntity hostTile = this.iHost.getTileEntity();
|
||||
final World hostWorld = hostTile.getWorld();
|
||||
|
||||
if (((ICustomNameObject) this.iHost).hasCustomInventoryName()) {
|
||||
@@ -948,7 +948,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
final EnumSet<Direction> possibleDirections = this.iHost.getTargets();
|
||||
for (final Direction direction : possibleDirections) {
|
||||
final BlockPos targ = hostTile.getPos().offset(direction);
|
||||
final TileEntity directedTile = hostWorld.getTileEntity(targ);
|
||||
final BlockEntity directedTile = hostWorld.getTileEntity(targ);
|
||||
|
||||
if (directedTile == null) {
|
||||
continue;
|
||||
@@ -995,12 +995,12 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
}
|
||||
|
||||
if (what.getItem() != Items.AIR) {
|
||||
return new TranslationTextComponent(what.getTranslationKey());
|
||||
return new TranslatableText(what.getTranslationKey());
|
||||
}
|
||||
|
||||
final Item item = Item.getItemFromBlock(directedBlock);
|
||||
if (item == Items.AIR) {
|
||||
return new TranslationTextComponent(directedBlock.getTranslationKey());
|
||||
return new TranslatableText(directedBlock.getTranslationKey());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1009,7 +1009,7 @@ public class DualityInterface implements IGridTickable, IStorageMonitorable, IIn
|
||||
}
|
||||
|
||||
public long getSortValue() {
|
||||
final TileEntity te = this.iHost.getTileEntity();
|
||||
final BlockEntity te = this.iHost.getTileEntity();
|
||||
return (te.getPos().getZ() << 24) ^ (te.getPos().getX() << 8) ^ te.getPos().getY();
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
package appeng.helpers;
|
||||
|
||||
import alexiil.mc.lib.attributes.item.ItemTransferable;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.networking.security.IActionSource;
|
||||
@@ -36,7 +36,7 @@ public interface IContainerCraftingPacket {
|
||||
*
|
||||
* @return the inventory of the part/tile by name.
|
||||
*/
|
||||
IItemHandler getInventoryByName(String string);
|
||||
ItemTransferable getInventoryByName(String string);
|
||||
|
||||
/**
|
||||
* @return who are we?
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
|
||||
package appeng.helpers;
|
||||
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
public interface ICustomNameObject {
|
||||
|
||||
ITextComponent getCustomInventoryName();
|
||||
Text getCustomInventoryName();
|
||||
|
||||
boolean hasCustomInventoryName();
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ package appeng.helpers;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.block.entity.BlockEntity;
|
||||
import net.minecraft.util.math.Direction;
|
||||
|
||||
import appeng.api.implementations.IUpgradeableHost;
|
||||
@@ -33,7 +33,7 @@ public interface IInterfaceHost extends ICraftingProvider, IUpgradeableHost, ICr
|
||||
|
||||
EnumSet<Direction> getTargets();
|
||||
|
||||
TileEntity getTileEntity();
|
||||
BlockEntity getTileEntity();
|
||||
|
||||
void saveChanges();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.List;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
@@ -103,7 +103,7 @@ public class InvalidPatternHelper {
|
||||
return !this.stack.isEmpty();
|
||||
}
|
||||
|
||||
public ITextComponent getName() {
|
||||
public Text getName() {
|
||||
return this.isValid() ? Platform.getItemDisplayName(this.stack)
|
||||
: new StringTextComponent(this.id + '@' + this.getDamage());
|
||||
}
|
||||
@@ -124,8 +124,8 @@ public class InvalidPatternHelper {
|
||||
return this.stack;
|
||||
}
|
||||
|
||||
public ITextComponent getFormattedToolTip() {
|
||||
ITextComponent result = new StringTextComponent(this.getCount() + " ").appendSibling(this.getName());
|
||||
public Text getFormattedToolTip() {
|
||||
Text result = new StringTextComponent(this.getCount() + " ").appendSibling(this.getName());
|
||||
|
||||
if (!this.isValid()) {
|
||||
result.applyTextStyle(TextFormatting.RED);
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
package appeng.helpers;
|
||||
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.network.PacketByteBuf;
|
||||
import net.minecraft.util.math.Direction;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
||||
@@ -60,7 +60,7 @@ public class Splotch {
|
||||
this.side = side;
|
||||
}
|
||||
|
||||
public Splotch(final PacketBuffer data) {
|
||||
public Splotch(final PacketByteBuf data) {
|
||||
|
||||
this.pos = data.readByte();
|
||||
final int val = data.readByte();
|
||||
@@ -70,7 +70,7 @@ public class Splotch {
|
||||
this.lumen = ((val >> 7) & 0x01) > 0;
|
||||
}
|
||||
|
||||
public void writeToStream(final PacketBuffer stream) {
|
||||
public void writeToStream(final PacketByteBuf stream) {
|
||||
stream.writeByte(this.pos);
|
||||
final int val = this.getSide().ordinal() | (this.getColor().ordinal() << 3) | (this.isLumen() ? 0x80 : 0x00);
|
||||
stream.writeByte(val);
|
||||
|
||||
Reference in New Issue
Block a user