Lots of compile fixes
This commit is contained in:
@@ -19,33 +19,31 @@
|
||||
package appeng.tile.networking;
|
||||
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.util.Direction;
|
||||
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.tile.AEBaseTile;
|
||||
|
||||
|
||||
public class CableBusTESR extends TileEntityRenderer<AEBaseTile>
|
||||
public class CableBusTESR extends TileEntityRenderer<TileCableBusTESR>
|
||||
{
|
||||
|
||||
public CableBusTESR(TileEntityRendererDispatcher rendererDispatcherIn) {
|
||||
super(rendererDispatcherIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render( AEBaseTile te, double x, double y, double z, float partialTicks, int destroyStage, float p_render_10_ )
|
||||
{
|
||||
|
||||
if( !( te instanceof TileCableBusTESR ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
TileCableBusTESR realTe = (TileCableBusTESR) te;
|
||||
|
||||
public void render(TileCableBusTESR te, float partialTicks, MatrixStack ms, IRenderTypeBuffer buffers, int combinedLightIn, int combinedOverlayIn) {
|
||||
for( Direction facing : Direction.values() )
|
||||
{
|
||||
IPart part = realTe.getPart( facing );
|
||||
IPart part = te.getPart( facing );
|
||||
if( part != null && part.requireDynamicRender() )
|
||||
{
|
||||
part.renderDynamic( x, y, z, partialTicks, destroyStage );
|
||||
part.renderDynamic(partialTicks, ms, buffers, combinedLightIn, combinedOverlayIn);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,25 +19,6 @@
|
||||
package appeng.tile.networking;
|
||||
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
|
||||
import appeng.api.networking.IGridNode;
|
||||
import appeng.api.parts.IFacadeContainer;
|
||||
import appeng.api.parts.IPart;
|
||||
@@ -49,31 +30,52 @@ import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.block.networking.BlockCableBus;
|
||||
import appeng.helpers.AEMultiTile;
|
||||
import appeng.helpers.ICustomCollision;
|
||||
import appeng.hooks.TickHandler;
|
||||
import appeng.parts.CableBusContainer;
|
||||
import appeng.tile.AEBaseTile;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomCollision
|
||||
public class TileCableBus extends AEBaseTile implements AEMultiTile
|
||||
{
|
||||
|
||||
private CableBusContainer cb = new CableBusContainer( this );
|
||||
|
||||
private int oldLV = -1; // on re-calculate light when it changes
|
||||
|
||||
public TileCableBus(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( final CompoundNBT data )
|
||||
public void read(final CompoundNBT data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
super.read( data );
|
||||
this.getCableBus().readFromNBT( data );
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT writeToNBT( final CompoundNBT data )
|
||||
public CompoundNBT write(final CompoundNBT data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
super.write( data );
|
||||
this.getCableBus().writeToNBT( data );
|
||||
return data;
|
||||
}
|
||||
@@ -88,7 +90,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
|
||||
if( newLV != this.oldLV )
|
||||
{
|
||||
this.oldLV = newLV;
|
||||
this.world.checkLight( this.pos );
|
||||
this.world.getLightManager().checkBlock( this.pos );
|
||||
ret = true;
|
||||
}
|
||||
|
||||
@@ -138,9 +140,9 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate()
|
||||
public void remove()
|
||||
{
|
||||
super.invalidate();
|
||||
super.remove();
|
||||
this.getCableBus().removeFromWorld();
|
||||
}
|
||||
|
||||
@@ -170,9 +172,9 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload()
|
||||
public void onChunkUnloaded()
|
||||
{
|
||||
super.onChunkUnload();
|
||||
super.onChunkUnloaded();
|
||||
this.getCableBus().removeFromWorld();
|
||||
}
|
||||
|
||||
@@ -188,7 +190,7 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
|
||||
if( newLV != this.oldLV )
|
||||
{
|
||||
this.oldLV = newLV;
|
||||
this.world.checkLight( this.pos );
|
||||
this.world.getLightManager().checkBlock( this.pos );
|
||||
}
|
||||
|
||||
super.markForUpdate();
|
||||
@@ -290,12 +292,6 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<AxisAlignedBB> getSelectedBoundingBoxesFromPool( final World w, final BlockPos pos, final Entity e, final boolean visual )
|
||||
{
|
||||
return this.getCableBus().getSelectedBoundingBoxesFromPool( false, true, e, visual );
|
||||
}
|
||||
|
||||
@Override
|
||||
public SelectedPart selectPart( final Vec3d pos )
|
||||
{
|
||||
@@ -338,15 +334,6 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
|
||||
this.getWorld().removeBlock(this.pos, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollidingBlockToList( final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, final Entity e )
|
||||
{
|
||||
for( final AxisAlignedBB bx : this.getSelectedBoundingBoxesFromPool( w, pos, e, false ) )
|
||||
{
|
||||
out.add( new AxisAlignedBB( bx.minX, bx.minY, bx.minZ, bx.maxX, bx.maxY, bx.maxZ ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyNeighbors()
|
||||
{
|
||||
@@ -379,25 +366,13 @@ public class TileCableBus extends AEBaseTile implements AEMultiTile, ICustomColl
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability( Capability<?> capabilityClass, @Nullable Direction fromSide )
|
||||
public <T> LazyOptional<T> getCapability(Capability<T> capabilityClass, @Nullable Direction fromSide )
|
||||
{
|
||||
// Note that null will be translated to INTERNAL here
|
||||
AEPartLocation partLocation = AEPartLocation.fromFacing( fromSide );
|
||||
|
||||
IPart part = this.getPart( partLocation );
|
||||
boolean result = part != null && part.hasCapability( capabilityClass );
|
||||
|
||||
return result || super.hasCapability( capabilityClass, fromSide );
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T getCapability( Capability<T> capabilityClass, @Nullable Direction fromSide )
|
||||
{
|
||||
// Note that null will be translated to INTERNAL here
|
||||
AEPartLocation partLocation = AEPartLocation.fromFacing( fromSide );
|
||||
|
||||
IPart part = this.getPart( partLocation );
|
||||
T result = part == null ? null : part.getCapability( capabilityClass );
|
||||
LazyOptional<T> result = part == null ? LazyOptional.empty() : part.getCapability(capabilityClass);
|
||||
|
||||
if( result != null )
|
||||
{
|
||||
|
||||
@@ -20,11 +20,16 @@ package appeng.tile.networking;
|
||||
|
||||
|
||||
import appeng.block.networking.BlockCableBus;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
|
||||
|
||||
public class TileCableBusTESR extends TileCableBus
|
||||
{
|
||||
|
||||
public TileCableBusTESR(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes this tile to the non-TESR version, if none of the parts require dynamic rendering.
|
||||
*/
|
||||
|
||||
@@ -22,8 +22,10 @@ package appeng.tile.networking;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.wrapper.EmptyHandler;
|
||||
|
||||
@@ -49,8 +51,8 @@ public class TileController extends AENetworkPowerTile
|
||||
{
|
||||
private boolean isValid = false;
|
||||
|
||||
public TileController()
|
||||
{
|
||||
public TileController(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
this.setInternalMaxPower( 8000 );
|
||||
this.setInternalPublicPowerStorage( true );
|
||||
this.getProxy().setIdlePowerUsage( 3 );
|
||||
@@ -126,7 +128,7 @@ public class TileController extends AENetworkPowerTile
|
||||
metaState = ControllerBlockState.offline;
|
||||
}
|
||||
|
||||
if( this.checkController( this.pos ) && this.world.getBlockState( this.pos ).getValue( BlockController.CONTROLLER_STATE ) != metaState )
|
||||
if( this.checkController( this.pos ) && this.world.getBlockState( this.pos ).get( BlockController.CONTROLLER_STATE ) != metaState )
|
||||
{
|
||||
this.world.setBlockState( this.pos, this.world.getBlockState( this.pos ).with( BlockController.CONTROLLER_STATE, metaState ) );
|
||||
}
|
||||
@@ -209,7 +211,7 @@ public class TileController extends AENetworkPowerTile
|
||||
*/
|
||||
private boolean checkController( final BlockPos pos )
|
||||
{
|
||||
if( this.world.getChunkProvider().getLoadedChunk( pos.getX() >> 4, pos.getZ() >> 4 ) != null )
|
||||
if( this.world.getChunkProvider().isChunkLoaded( new ChunkPos(pos.getX() >> 4, pos.getZ() >> 4)) )
|
||||
{
|
||||
return this.world.getTileEntity( pos ) instanceof TileController;
|
||||
}
|
||||
|
||||
@@ -26,13 +26,14 @@ import appeng.api.networking.energy.IAEPowerStorage;
|
||||
import appeng.api.util.AECableType;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.tile.grid.AENetworkTile;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
|
||||
|
||||
public class TileCreativeEnergyCell extends AENetworkTile implements IAEPowerStorage
|
||||
{
|
||||
|
||||
public TileCreativeEnergyCell()
|
||||
{
|
||||
public TileCreativeEnergyCell(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
this.getProxy().setIdlePowerUsage( 0 );
|
||||
}
|
||||
|
||||
|
||||
@@ -19,11 +19,14 @@
|
||||
package appeng.tile.networking;
|
||||
|
||||
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
|
||||
public class TileDenseEnergyCell extends TileEnergyCell
|
||||
{
|
||||
|
||||
public TileDenseEnergyCell()
|
||||
{
|
||||
public TileDenseEnergyCell(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
this.setInternalMaxPower( 200000 * 8 );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ package appeng.tile.networking;
|
||||
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.items.wrapper.EmptyHandler;
|
||||
|
||||
@@ -34,8 +35,9 @@ import appeng.util.inv.InvOperation;
|
||||
|
||||
public class TileEnergyAcceptor extends AENetworkPowerTile
|
||||
{
|
||||
public TileEnergyAcceptor()
|
||||
{
|
||||
|
||||
public TileEnergyAcceptor(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
this.getProxy().setIdlePowerUsage( 0.0 );
|
||||
this.setInternalMaxPower( 0 );
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import appeng.block.networking.BlockEnergyCell;
|
||||
import appeng.me.GridAccessException;
|
||||
import appeng.tile.grid.AENetworkTile;
|
||||
import appeng.util.SettingsFrom;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
|
||||
|
||||
public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
|
||||
@@ -43,8 +44,8 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
|
||||
|
||||
private byte currentMeta = -1;
|
||||
|
||||
public TileEnergyCell()
|
||||
{
|
||||
public TileEnergyCell(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
this.getProxy().setIdlePowerUsage( 0 );
|
||||
}
|
||||
|
||||
@@ -58,7 +59,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
|
||||
public void onReady()
|
||||
{
|
||||
super.onReady();
|
||||
final int value = this.world.getBlockState( this.pos ).getValue( BlockEnergyCell.ENERGY_STORAGE );
|
||||
final int value = this.world.getBlockState( this.pos ).get( BlockEnergyCell.ENERGY_STORAGE );
|
||||
this.currentMeta = (byte) value;
|
||||
this.changePowerLevel();
|
||||
}
|
||||
@@ -84,7 +85,7 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
|
||||
|
||||
private void changePowerLevel()
|
||||
{
|
||||
if( this.notLoaded() || this.isInvalid() )
|
||||
if( this.notLoaded() || this.isRemoved() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -99,17 +100,17 @@ public class TileEnergyCell extends AENetworkTile implements IAEPowerStorage
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT writeToNBT( final CompoundNBT data )
|
||||
public CompoundNBT write(final CompoundNBT data )
|
||||
{
|
||||
super.writeToNBT( data );
|
||||
super.write( data );
|
||||
data.putDouble("internalCurrentPower", this.internalCurrentPower);
|
||||
return data;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT( final CompoundNBT data )
|
||||
public void read(final CompoundNBT data )
|
||||
{
|
||||
super.readFromNBT( data );
|
||||
super.read( data );
|
||||
this.internalCurrentPower = data.getDouble( "internalCurrentPower" );
|
||||
}
|
||||
|
||||
|
||||
@@ -22,8 +22,10 @@ package appeng.tile.networking;
|
||||
import java.io.IOException;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import appeng.core.Api;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
@@ -56,8 +58,8 @@ public class TileWireless extends AENetworkInvTile implements IWirelessAccessPoi
|
||||
|
||||
private int clientFlags = 0;
|
||||
|
||||
public TileWireless()
|
||||
{
|
||||
public TileWireless(TileEntityType<?> tileEntityTypeIn) {
|
||||
super(tileEntityTypeIn);
|
||||
this.inv.setFilter( new AEItemDefinitionFilter( Api.INSTANCE.definitions().materials().wirelessBooster() ) );
|
||||
this.getProxy().setFlags( GridFlags.REQUIRE_CHANNEL );
|
||||
this.getProxy().setValidSides( EnumSet.noneOf( Direction.class ) );
|
||||
|
||||
Reference in New Issue
Block a user