API compiles

This commit is contained in:
Sebastian Hartte
2020-06-27 18:09:44 +02:00
parent ba71a82288
commit 80fbb58d4f
572 changed files with 2995 additions and 3037 deletions
@@ -20,12 +20,12 @@ package appeng.tile.misc;
import java.util.List;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import appeng.api.config.CopyMode;
import appeng.api.config.Settings;
@@ -49,17 +49,17 @@ public class CellWorkbenchTileEntity extends AEBaseTileEntity
private final AppEngInternalAEInventory config = new AppEngInternalAEInventory(this, 63);
private final ConfigManager manager = new ConfigManager(this);
private IItemHandler cacheUpgrades = null;
private IItemHandler cacheConfig = null;
private ItemTransferable cacheUpgrades = null;
private ItemTransferable cacheConfig = null;
private boolean locked = false;
public CellWorkbenchTileEntity(TileEntityType<?> tileEntityTypeIn) {
public CellWorkbenchTileEntity(BlockEntityType<?> tileEntityTypeIn) {
super(tileEntityTypeIn);
this.manager.registerSetting(Settings.COPY_MODE, CopyMode.CLEAR_ON_REMOVE);
this.cell.setEnableClientEvents(true);
}
public IItemHandler getCellUpgradeInventory() {
public ItemTransferable getCellUpgradeInventory() {
if (this.cacheUpgrades == null) {
final ICellWorkbenchItem cell = this.getCell();
if (cell == null) {
@@ -71,7 +71,7 @@ public class CellWorkbenchTileEntity extends AEBaseTileEntity
return null;
}
final IItemHandler inv = cell.getUpgradesInventory(is);
final ItemTransferable inv = cell.getUpgradesInventory(is);
if (inv == null) {
return null;
}
@@ -111,7 +111,7 @@ public class CellWorkbenchTileEntity extends AEBaseTileEntity
}
@Override
public IItemHandler getInventoryByName(final String name) {
public ItemTransferable getInventoryByName(final String name) {
if (name.equals("config")) {
return this.config;
}
@@ -129,15 +129,15 @@ public class CellWorkbenchTileEntity extends AEBaseTileEntity
}
@Override
public void onChangeInventory(final IItemHandler inv, final int slot, final InvOperation mc,
final ItemStack removedStack, final ItemStack newStack) {
public void onChangeInventory(final ItemTransferable inv, final int slot, final InvOperation mc,
final ItemStack removedStack, final ItemStack newStack) {
if (inv == this.cell && !this.locked) {
this.locked = true;
this.cacheUpgrades = null;
this.cacheConfig = null;
final IItemHandler configInventory = this.getCellConfigInventory();
final ItemTransferable configInventory = this.getCellConfigInventory();
if (configInventory != null) {
boolean cellHasConfig = false;
for (int x = 0; x < configInventory.getSlots(); x++) {
@@ -165,7 +165,7 @@ public class CellWorkbenchTileEntity extends AEBaseTileEntity
this.locked = false;
} else if (inv == this.config && !this.locked) {
this.locked = true;
final IItemHandler c = this.getCellConfigInventory();
final ItemTransferable c = this.getCellConfigInventory();
if (c != null) {
ItemHandlerUtil.copy(this.config, c, false);
// copy items back. The ConfigInventory may changed the items on insert
@@ -175,7 +175,7 @@ public class CellWorkbenchTileEntity extends AEBaseTileEntity
}
}
private IItemHandler getCellConfigInventory() {
private ItemTransferable getCellConfigInventory() {
if (this.cacheConfig == null) {
final ICellWorkbenchItem cell = this.getCell();
if (cell == null) {
@@ -187,7 +187,7 @@ public class CellWorkbenchTileEntity extends AEBaseTileEntity
return null;
}
final IItemHandler inv = cell.getConfigInventory(is);
final ItemTransferable inv = cell.getConfigInventory(is);
if (inv == null) {
return null;
}
@@ -23,12 +23,12 @@ import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.util.math.Direction;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
@@ -62,7 +62,7 @@ public class ChargerTileEntity extends AENetworkPowerTileEntity implements ICran
private final AppEngInternalInventory inv = new AppEngInternalInventory(this, 1, 1, new ChargerInvFilter());
public ChargerTileEntity(TileEntityType<?> tileEntityTypeIn) {
public ChargerTileEntity(BlockEntityType<?> tileEntityTypeIn) {
super(tileEntityTypeIn);
this.getProxy().setValidSides(EnumSet.noneOf(Direction.class));
this.getProxy().setFlags();
@@ -76,7 +76,7 @@ public class ChargerTileEntity extends AENetworkPowerTileEntity implements ICran
}
@Override
protected boolean readFromStream(final PacketBuffer data) throws IOException {
protected boolean readFromStream(final PacketByteBuf data) throws IOException {
final boolean c = super.readFromStream(data);
try {
final IAEItemStack item = AEItemStack.fromPacket(data);
@@ -89,7 +89,7 @@ public class ChargerTileEntity extends AENetworkPowerTileEntity implements ICran
}
@Override
protected void writeToStream(final PacketBuffer data) throws IOException {
protected void writeToStream(final PacketByteBuf data) throws IOException {
super.writeToStream(data);
final AEItemStack is = AEItemStack.fromItemStack(this.inv.getStackInSlot(0));
if (is != null) {
@@ -132,13 +132,13 @@ public class ChargerTileEntity extends AENetworkPowerTileEntity implements ICran
}
@Override
public IItemHandler getInternalInventory() {
public ItemTransferable getInternalInventory() {
return this.inv;
}
@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) {
try {
this.getProxy().getTick().wakeDevice(this.getProxy().getNode());
} catch (final GridAccessException e) {
@@ -253,14 +253,14 @@ public class ChargerTileEntity extends AENetworkPowerTileEntity implements ICran
private class ChargerInvFilter implements IAEItemFilter {
@Override
public boolean allowInsert(IItemHandler inv, final int i, final ItemStack itemstack) {
public boolean allowInsert(ItemTransferable inv, final int i, final ItemStack itemstack) {
final IItemDefinition cert = AEApi.instance().definitions().materials().certusQuartzCrystal();
return Platform.isChargeable(itemstack) || cert.isSameAs(itemstack);
}
@Override
public boolean allowExtract(IItemHandler inv, final int slotIndex, int amount) {
public boolean allowExtract(ItemTransferable inv, final int slotIndex, int amount) {
ItemStack extractedItem = inv.getStackInSlot(slotIndex);
if (Platform.isChargeable(extractedItem)) {
@@ -21,19 +21,19 @@ package appeng.tile.misc;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import alexiil.mc.lib.attributes.fluid.volume.FluidVolume;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.math.Direction;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.fluids.FluidAttributes;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fluids.IFluidTank;
import net.minecraftforge.fluids.capability.CapabilityFluidHandler;
import net.minecraftforge.fluids.capability.IFluidHandler;
import net.minecraftforge.items.CapabilityItemHandler;
import net.minecraftforge.items.IItemHandler;
import appeng.api.AEApi;
import appeng.api.config.CondenserOutput;
@@ -69,18 +69,18 @@ public class CondenserTileEntity extends AEBaseInvTileEntity implements IConfigM
private final AppEngInternalInventory outputSlot = new AppEngInternalInventory(this, 1);
private final AppEngInternalInventory storageSlot = new AppEngInternalInventory(this, 1);
private final IItemHandler inputSlot = new CondenseItemHandler();
private final ItemTransferable inputSlot = new CondenseItemHandler();
private final IFluidHandler fluidHandler = new FluidHandler();
private final MEHandler meHandler = new MEHandler();
private final IItemHandler externalInv = new WrapperChainedItemHandler(this.inputSlot,
private final ItemTransferable externalInv = new WrapperChainedItemHandler(this.inputSlot,
new WrapperFilteredItemHandler(this.outputSlot, AEItemFilters.EXTRACT_ONLY));
private final IItemHandler combinedInv = new WrapperChainedItemHandler(this.inputSlot, this.outputSlot,
private final ItemTransferable combinedInv = new WrapperChainedItemHandler(this.inputSlot, this.outputSlot,
this.storageSlot);
private double storedPower = 0;
public CondenserTileEntity(TileEntityType<?> tileEntityTypeIn) {
public CondenserTileEntity(BlockEntityType<?> tileEntityTypeIn) {
super(tileEntityTypeIn);
this.cm.registerSetting(Settings.CONDENSER_OUTPUT, CondenserOutput.TRASH);
}
@@ -142,7 +142,7 @@ public class CondenserTileEntity extends AEBaseInvTileEntity implements IConfigM
this.outputSlot.insertItem(0, output, false);
}
IItemHandler getOutputSlot() {
ItemTransferable getOutputSlot() {
return this.outputSlot;
}
@@ -167,13 +167,13 @@ public class CondenserTileEntity extends AEBaseInvTileEntity implements IConfigM
}
@Override
public IItemHandler getInternalInventory() {
public ItemTransferable getInternalInventory() {
return this.combinedInv;
}
@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 (inv == this.outputSlot) {
this.meHandler.outputChanged(added, removed);
}
@@ -210,7 +210,7 @@ public class CondenserTileEntity extends AEBaseInvTileEntity implements IConfigM
return super.getCapability(capability, facing);
}
private class CondenseItemHandler implements IItemHandler {
private class CondenseItemHandler implements ItemTransferable {
@Override
public int getSlots() {
@@ -259,8 +259,8 @@ public class CondenserTileEntity extends AEBaseInvTileEntity implements IConfigM
@Nonnull
@Override
public FluidStack getFluid() {
return FluidStack.EMPTY;
public FluidVolume getFluid() {
return FluidVolume.EMPTY;
}
@Override
@@ -274,12 +274,12 @@ public class CondenserTileEntity extends AEBaseInvTileEntity implements IConfigM
}
@Override
public boolean isFluidValid(FluidStack stack) {
public boolean isFluidValid(FluidVolume stack) {
return !stack.isEmpty();
}
@Override
public int fill(FluidStack resource, FluidAction action) {
public int fill(FluidVolume resource, FluidAction action) {
if (action == FluidAction.EXECUTE) {
final IStorageChannel<IAEFluidStack> chan = AEApi.instance().storage()
.getStorageChannel(IFluidStorageChannel.class);
@@ -292,14 +292,14 @@ public class CondenserTileEntity extends AEBaseInvTileEntity implements IConfigM
@Nonnull
@Override
public FluidStack drain(int maxDrain, FluidAction action) {
return FluidStack.EMPTY;
public FluidVolume drain(int maxDrain, FluidAction action) {
return FluidVolume.EMPTY;
}
@Nonnull
@Override
public FluidStack drain(FluidStack resource, FluidAction action) {
return FluidStack.EMPTY;
public FluidVolume drain(FluidVolume resource, FluidAction action) {
return FluidVolume.EMPTY;
}
@Override
@@ -309,8 +309,8 @@ public class CondenserTileEntity extends AEBaseInvTileEntity implements IConfigM
@Nonnull
@Override
public FluidStack getFluidInTank(int tank) {
return FluidStack.EMPTY;
public FluidVolume getFluidInTank(int tank) {
return FluidVolume.EMPTY;
}
@Override
@@ -319,7 +319,7 @@ public class CondenserTileEntity extends AEBaseInvTileEntity implements IConfigM
}
@Override
public boolean isFluidValid(int tank, @Nonnull FluidStack stack) {
public boolean isFluidValid(int tank, @Nonnull FluidVolume stack) {
return tank == 0 && isFluidValid(stack);
}
}
@@ -11,7 +11,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.item.crafting.Ingredient;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.Identifier;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.world.World;
@@ -29,7 +29,7 @@ import appeng.recipes.handlers.InscriberRecipe;
*/
public final class InscriberRecipes {
public static final ResourceLocation NAMEPLATE_RECIPE_ID = new ResourceLocation(AppEng.MOD_ID, "nameplate");
public static final Identifier NAMEPLATE_RECIPE_ID = new Identifier(AppEng.MOD_ID, "nameplate");
private InscriberRecipes() {
}
@@ -25,14 +25,14 @@ import java.util.List;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.items.IItemHandler;
import net.minecraftforge.items.IItemHandlerModifiable;
import appeng.api.AEApi;
@@ -89,16 +89,16 @@ public class InscriberTileEntity extends AENetworkPowerTileEntity
private final AppEngInternalInventory bottomItemHandler = new AppEngInternalInventory(this, 1, 1);
private final AppEngInternalInventory sideItemHandler = new AppEngInternalInventory(this, 2, 1);
private final IItemHandler topItemHandlerExtern;
private final IItemHandler bottomItemHandlerExtern;
private final IItemHandler sideItemHandlerExtern;
private final ItemTransferable topItemHandlerExtern;
private final ItemTransferable bottomItemHandlerExtern;
private final ItemTransferable sideItemHandlerExtern;
private InscriberRecipe cachedTask = null;
private final IItemHandlerModifiable inv = new WrapperChainedItemHandler(this.topItemHandler,
this.bottomItemHandler, this.sideItemHandler);
public InscriberTileEntity(TileEntityType<?> tileEntityTypeIn) {
public InscriberTileEntity(BlockEntityType<?> tileEntityTypeIn) {
super(tileEntityTypeIn);
this.getProxy().setValidSides(EnumSet.noneOf(Direction.class));
@@ -142,7 +142,7 @@ public class InscriberTileEntity extends AENetworkPowerTileEntity
}
@Override
protected boolean readFromStream(final PacketBuffer data) throws IOException {
protected boolean readFromStream(final PacketByteBuf data) throws IOException {
final boolean c = super.readFromStream(data);
final int slot = data.readByte();
@@ -167,7 +167,7 @@ public class InscriberTileEntity extends AENetworkPowerTileEntity
}
@Override
protected void writeToStream(final PacketBuffer data) throws IOException {
protected void writeToStream(final PacketByteBuf data) throws IOException {
super.writeToStream(data);
int slot = this.isSmash() ? 64 : 0;
@@ -206,13 +206,13 @@ public class InscriberTileEntity extends AENetworkPowerTileEntity
}
@Override
public IItemHandler getInternalInventory() {
public ItemTransferable getInternalInventory() {
return this.inv;
}
@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) {
try {
if (slot == 0) {
this.setProcessingTime(0);
@@ -341,7 +341,7 @@ public class InscriberTileEntity extends AENetworkPowerTileEntity
}
@Override
public IItemHandler getInventoryByName(final String name) {
public ItemTransferable getInventoryByName(final String name) {
if (name.equals("inv")) {
return this.getInternalInventory();
}
@@ -354,7 +354,7 @@ public class InscriberTileEntity extends AENetworkPowerTileEntity
}
@Override
protected IItemHandler getItemHandlerForSide(@Nonnull Direction facing) {
protected ItemTransferable getItemHandlerForSide(@Nonnull Direction facing) {
if (facing == this.getUp()) {
return this.topItemHandlerExtern;
} else if (facing == this.getUp().getOpposite()) {
@@ -410,7 +410,7 @@ public class InscriberTileEntity extends AENetworkPowerTileEntity
*/
private class ItemHandlerFilter implements IAEItemFilter {
@Override
public boolean allowExtract(IItemHandler inv, int slot, int amount) {
public boolean allowExtract(ItemTransferable inv, int slot, int amount) {
if (InscriberTileEntity.this.isSmash()) {
return false;
}
@@ -420,7 +420,7 @@ public class InscriberTileEntity extends AENetworkPowerTileEntity
}
@Override
public boolean allowInsert(IItemHandler inv, int slot, ItemStack stack) {
public boolean allowInsert(ItemTransferable inv, int slot, ItemStack stack) {
// output slot
if (slot == 1) {
return false;
@@ -30,15 +30,15 @@ import net.minecraft.inventory.CraftingInventory;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.items.IItemHandler;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import appeng.api.AEApi;
import appeng.api.config.Actionable;
@@ -75,7 +75,7 @@ public class InterfaceTileEntity extends AENetworkInvTileEntity
// Indicates that this interface has no specific direction set
private boolean omniDirectional = true;
public InterfaceTileEntity(TileEntityType<?> tileEntityTypeIn) {
public InterfaceTileEntity(BlockEntityType<?> tileEntityTypeIn) {
super(tileEntityTypeIn);
}
@@ -166,7 +166,7 @@ public class InterfaceTileEntity extends AENetworkInvTileEntity
}
@Override
protected boolean readFromStream(final PacketBuffer data) throws IOException {
protected boolean readFromStream(final PacketByteBuf data) throws IOException {
final boolean c = super.readFromStream(data);
boolean oldOmniDirectional = this.omniDirectional;
this.omniDirectional = data.readBoolean();
@@ -174,7 +174,7 @@ public class InterfaceTileEntity extends AENetworkInvTileEntity
}
@Override
protected void writeToStream(final PacketBuffer data) throws IOException {
protected void writeToStream(final PacketByteBuf data) throws IOException {
super.writeToStream(data);
data.writeBoolean(this.omniDirectional);
}
@@ -195,7 +195,7 @@ public class InterfaceTileEntity extends AENetworkInvTileEntity
}
@Override
public IItemHandler getInventoryByName(final String name) {
public ItemTransferable getInventoryByName(final String name) {
return this.duality.getInventoryByName(name);
}
@@ -210,13 +210,13 @@ public class InterfaceTileEntity extends AENetworkInvTileEntity
}
@Override
public IItemHandler getInternalInventory() {
public ItemTransferable getInternalInventory() {
return this.duality.getInternalInventory();
}
@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) {
this.duality.onChangeInventory(inv, slot, mc, removed, added);
}
@@ -234,7 +234,7 @@ public class InterfaceTileEntity extends AENetworkInvTileEntity
}
@Override
public TileEntity getTileEntity() {
public BlockEntity getTileEntity() {
return this;
}
@@ -19,7 +19,7 @@
package appeng.tile.misc;
import net.minecraft.tileentity.ITickableTileEntity;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.block.entity.BlockEntityType;
import appeng.tile.AEBaseTileEntity;
import appeng.util.Platform;
@@ -29,7 +29,7 @@ public class LightDetectorTileEntity extends AEBaseTileEntity implements ITickab
private int lastCheck = 30;
private int lastLight = 0;
public LightDetectorTileEntity(TileEntityType<?> tileEntityTypeIn) {
public LightDetectorTileEntity(BlockEntityType<?> tileEntityTypeIn) {
super(tileEntityTypeIn);
}
@@ -32,8 +32,8 @@ import io.netty.buffer.Unpooled;
import net.minecraft.block.BlockState;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
@@ -57,7 +57,7 @@ public class PaintSplotchesTileEntity extends AEBaseTileEntity {
private int isLit = 0;
private List<Splotch> dots = null;
public PaintSplotchesTileEntity(TileEntityType<?> tileEntityTypeIn) {
public PaintSplotchesTileEntity(BlockEntityType<?> tileEntityTypeIn) {
super(tileEntityTypeIn);
}
@@ -69,7 +69,7 @@ public class PaintSplotchesTileEntity extends AEBaseTileEntity {
@Override
public CompoundTag write(final CompoundTag data) {
super.write(data);
final PacketBuffer myDat = new PacketBuffer(Unpooled.buffer());
final PacketByteBuf myDat = new PacketByteBuf(Unpooled.buffer());
this.writeBuffer(myDat);
if (myDat.hasArray()) {
data.putByteArray("dots", myDat.array());
@@ -77,7 +77,7 @@ public class PaintSplotchesTileEntity extends AEBaseTileEntity {
return data;
}
private void writeBuffer(final PacketBuffer out) {
private void writeBuffer(final PacketByteBuf out) {
if (this.dots == null) {
out.writeByte(0);
return;
@@ -94,11 +94,11 @@ public class PaintSplotchesTileEntity extends AEBaseTileEntity {
public void read(final CompoundTag data) {
super.read(data);
if (data.contains("dots")) {
this.readBuffer(new PacketBuffer(Unpooled.copiedBuffer(data.getByteArray("dots"))));
this.readBuffer(new PacketByteBuf(Unpooled.copiedBuffer(data.getByteArray("dots"))));
}
}
private void readBuffer(final PacketBuffer in) {
private void readBuffer(final PacketByteBuf in) {
final byte howMany = in.readByte();
if (howMany == 0) {
@@ -133,13 +133,13 @@ public class PaintSplotchesTileEntity extends AEBaseTileEntity {
}
@Override
protected void writeToStream(final PacketBuffer data) throws IOException {
protected void writeToStream(final PacketByteBuf data) throws IOException {
super.writeToStream(data);
this.writeBuffer(data);
}
@Override
protected boolean readFromStream(final PacketBuffer data) throws IOException {
protected boolean readFromStream(final PacketByteBuf data) throws IOException {
super.readFromStream(data);
this.readBuffer(data);
return true;
@@ -21,8 +21,8 @@ package appeng.tile.misc;
import java.io.IOException;
import java.util.EnumSet;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.util.math.Direction;
import appeng.api.implementations.IPowerChannelState;
@@ -40,7 +40,7 @@ public class QuartzGrowthAcceleratorTileEntity extends AENetworkTileEntity
private boolean hasPower = false;
public QuartzGrowthAcceleratorTileEntity(TileEntityType<?> tileEntityTypeIn) {
public QuartzGrowthAcceleratorTileEntity(BlockEntityType<?> tileEntityTypeIn) {
super(tileEntityTypeIn);
this.getProxy().setValidSides(EnumSet.noneOf(Direction.class));
this.getProxy().setFlags();
@@ -58,7 +58,7 @@ public class QuartzGrowthAcceleratorTileEntity extends AENetworkTileEntity
}
@Override
public boolean readFromStream(final PacketBuffer data) throws IOException {
public boolean readFromStream(final PacketByteBuf data) throws IOException {
final boolean c = super.readFromStream(data);
final boolean hadPower = this.isPowered();
this.setPowered(data.readBoolean());
@@ -66,7 +66,7 @@ public class QuartzGrowthAcceleratorTileEntity extends AENetworkTileEntity
}
@Override
public void writeToStream(final PacketBuffer data) throws IOException {
public void writeToStream(final PacketByteBuf data) throws IOException {
super.writeToStream(data);
try {
data.writeBoolean(this.getProxy().getEnergy().isNetworkPowered());
@@ -23,18 +23,18 @@ import java.util.EnumSet;
import java.util.List;
import java.util.Map;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.INBT;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.items.IItemHandler;
import appeng.api.AEApi;
import appeng.api.config.SecurityPermissions;
@@ -92,7 +92,7 @@ public class SecurityStationTileEntity extends AENetworkTileEntity implements IT
private AEColor paintedColor = AEColor.TRANSPARENT;
private boolean isActive = false;
public SecurityStationTileEntity(TileEntityType<?> tileEntityTypeIn) {
public SecurityStationTileEntity(BlockEntityType<?> tileEntityTypeIn) {
super(tileEntityTypeIn);
this.getProxy().setFlags(GridFlags.REQUIRE_CHANNEL);
this.getProxy().setIdlePowerUsage(2.0);
@@ -109,8 +109,8 @@ public class SecurityStationTileEntity extends AENetworkTileEntity implements IT
}
@Override
public void onChangeInventory(final IItemHandler inv, final int slot, final InvOperation mc,
final ItemStack removedStack, final ItemStack newStack) {
public void onChangeInventory(final ItemTransferable inv, final int slot, final InvOperation mc,
final ItemStack removedStack, final ItemStack newStack) {
}
@@ -130,7 +130,7 @@ public class SecurityStationTileEntity extends AENetworkTileEntity implements IT
}
@Override
protected boolean readFromStream(final PacketBuffer data) throws IOException {
protected boolean readFromStream(final PacketByteBuf data) throws IOException {
final boolean c = super.readFromStream(data);
final boolean wasActive = this.isActive;
this.isActive = data.readBoolean();
@@ -142,7 +142,7 @@ public class SecurityStationTileEntity extends AENetworkTileEntity implements IT
}
@Override
protected void writeToStream(final PacketBuffer data) throws IOException {
protected void writeToStream(final PacketByteBuf data) throws IOException {
super.writeToStream(data);
data.writeBoolean(this.getProxy().isActive());
data.writeByte(this.paintedColor.ordinal());
@@ -18,13 +18,13 @@
package appeng.tile.misc;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.block.entity.BlockEntityType;
import appeng.tile.AEBaseTileEntity;
public class SkyCompassTileEntity extends AEBaseTileEntity {
public SkyCompassTileEntity(TileEntityType<?> tileEntityTypeIn) {
public SkyCompassTileEntity(BlockEntityType<?> tileEntityTypeIn) {
super(tileEntityTypeIn);
}
@@ -22,14 +22,14 @@ import java.io.IOException;
import javax.annotation.Nonnull;
import alexiil.mc.lib.attributes.item.ItemTransferable;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.network.PacketBuffer;
import net.minecraft.tileentity.TileEntityType;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.math.Direction;
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.items.IItemHandler;
import appeng.api.config.Actionable;
import appeng.api.networking.IGridNode;
@@ -55,7 +55,7 @@ public class VibrationChamberTileEntity extends AENetworkInvTileEntity implement
public static final int MAX_BURN_SPEED = 200;
public static final double DILATION_SCALING = 25.0; // x4 ~ 40 AE/t at max
private final AppEngInternalInventory inv = new AppEngInternalInventory(this, 1);
private final IItemHandler invExt = new WrapperFilteredItemHandler(this.inv, new FuelSlotFilter());
private final ItemTransferable invExt = new WrapperFilteredItemHandler(this.inv, new FuelSlotFilter());
private int burnSpeed = 100;
private double burnTime = 0;
@@ -64,7 +64,7 @@ public class VibrationChamberTileEntity extends AENetworkInvTileEntity implement
// client side..
public boolean isOn;
public VibrationChamberTileEntity(TileEntityType<?> tileEntityTypeIn) {
public VibrationChamberTileEntity(BlockEntityType<?> tileEntityTypeIn) {
super(tileEntityTypeIn);
this.getProxy().setIdlePowerUsage(0);
this.getProxy().setFlags();
@@ -76,7 +76,7 @@ public class VibrationChamberTileEntity extends AENetworkInvTileEntity implement
}
@Override
protected boolean readFromStream(final PacketBuffer data) throws IOException {
protected boolean readFromStream(final PacketByteBuf data) throws IOException {
final boolean c = super.readFromStream(data);
final boolean wasOn = this.isOn;
@@ -86,7 +86,7 @@ public class VibrationChamberTileEntity extends AENetworkInvTileEntity implement
}
@Override
protected void writeToStream(final PacketBuffer data) throws IOException {
protected void writeToStream(final PacketByteBuf data) throws IOException {
super.writeToStream(data);
data.writeBoolean(this.getBurnTime() > 0);
}
@@ -109,18 +109,18 @@ public class VibrationChamberTileEntity extends AENetworkInvTileEntity implement
}
@Override
protected IItemHandler getItemHandlerForSide(@Nonnull Direction facing) {
protected ItemTransferable getItemHandlerForSide(@Nonnull Direction facing) {
return this.invExt;
}
@Override
public IItemHandler getInternalInventory() {
public ItemTransferable getInternalInventory() {
return this.inv;
}
@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.getBurnTime() <= 0) {
if (this.canEatFuel()) {
try {
@@ -269,12 +269,12 @@ public class VibrationChamberTileEntity extends AENetworkInvTileEntity implement
private class FuelSlotFilter implements IAEItemFilter {
@Override
public boolean allowExtract(IItemHandler inv, int slot, int amount) {
public boolean allowExtract(ItemTransferable inv, int slot, int amount) {
return ForgeHooks.getBurnTime(inv.getStackInSlot(slot)) == 0;
}
@Override
public boolean allowInsert(IItemHandler inv, int slot, ItemStack stack) {
public boolean allowInsert(ItemTransferable inv, int slot, ItemStack stack) {
return ForgeHooks.getBurnTime(stack) != 0;
}
}