Lots of compile fixes
This commit is contained in:
@@ -25,7 +25,7 @@ import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraftforge.common.ForgeChunkManager;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Ticket;
|
||||
import net.minecraftforge.common.ForgeChunkManager.Type;
|
||||
@@ -70,7 +70,7 @@ public class TileChunkLoader extends AEBaseTile implements ITickableTileEntity
|
||||
final List<ServerPlayerEntity> pl = server.getPlayerList().getPlayers();
|
||||
for( final ServerPlayerEntity p : pl )
|
||||
{
|
||||
p.sendMessage( new TextComponentString( "Can't chunk load.." ) );
|
||||
p.sendMessage( new StringTextComponent( "Can't chunk load.." ) );
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
@@ -29,6 +29,7 @@ import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.energy.CapabilityEnergy;
|
||||
import net.minecraftforge.energy.IEnergyStorage;
|
||||
|
||||
@@ -80,23 +81,14 @@ public class TileEnergyGenerator extends AEBaseTile implements ITickableTileEnti
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability( Capability<?> capability, @Nullable Direction facing )
|
||||
{
|
||||
if( capability == CapabilityEnergy.ENERGY )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return super.hasCapability( capability, facing );
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@Nullable
|
||||
public <T> T getCapability( Capability<T> capability, @Nullable Direction facing )
|
||||
public <T> LazyOptional<T> getCapability(Capability<T> capability, @Nullable Direction facing )
|
||||
{
|
||||
if( capability == CapabilityEnergy.ENERGY )
|
||||
{
|
||||
return (T) this;
|
||||
return (LazyOptional<T>) LazyOptional.of(() ->this);
|
||||
}
|
||||
return super.getCapability( capability, facing );
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
import net.minecraftforge.items.CapabilityItemHandler;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
@@ -71,23 +72,14 @@ public class TileItemGen extends AEBaseTile
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability( Capability<?> capability, @Nullable Direction facing )
|
||||
{
|
||||
if( CapabilityItemHandler.ITEM_HANDLER_CAPABILITY == capability )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return super.hasCapability( capability, facing );
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
@Nullable
|
||||
public <T> T getCapability( Capability<T> capability, @Nullable Direction facing )
|
||||
public <T> LazyOptional<T> getCapability(Capability<T> capability, @Nullable Direction facing )
|
||||
{
|
||||
if( CapabilityItemHandler.ITEM_HANDLER_CAPABILITY == capability )
|
||||
{
|
||||
return (T) this.handler;
|
||||
return (LazyOptional<T>) LazyOptional.of(() ->this.handler);
|
||||
}
|
||||
return super.getCapability( capability, facing );
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@ import java.util.Set;
|
||||
import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.networking.IGridConnection;
|
||||
@@ -56,11 +56,11 @@ import appeng.util.Platform;
|
||||
public class ToolDebugCard extends AEBaseItem
|
||||
{
|
||||
@Override
|
||||
public EnumActionResult onItemUseFirst( final PlayerEntity player, final World world, final BlockPos pos, final Direction side, final float hitX, final float hitY, final float hitZ, final Hand hand )
|
||||
public ActionResultType onItemUseFirst( final PlayerEntity player, final World world, final BlockPos pos, final Direction side, final float hitX, final float hitY, final float hitZ, final Hand hand )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return EnumActionResult.PASS;
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
if( player.isCrouching() )
|
||||
@@ -202,12 +202,12 @@ public class ToolDebugCard extends AEBaseItem
|
||||
}
|
||||
}
|
||||
}
|
||||
return EnumActionResult.SUCCESS;
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
private void outputMsg( final ICommandSender player, final String string )
|
||||
{
|
||||
player.sendMessage( new TextComponentString( string ) );
|
||||
player.sendMessage( new StringTextComponent( string ) );
|
||||
}
|
||||
|
||||
private String timeMeasurement( final long nanos )
|
||||
|
||||
@@ -24,7 +24,7 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -41,11 +41,11 @@ public class ToolEraser extends AEBaseItem
|
||||
private static final int BLOCK_ERASE_LIMIT = 90000;
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUseFirst( final PlayerEntity player, final World world, final BlockPos pos, final Direction side, final float hitX, final float hitY, final float hitZ, final Hand hand )
|
||||
public ActionResultType onItemUseFirst( final PlayerEntity player, final World world, final BlockPos pos, final Direction side, final float hitX, final float hitY, final float hitZ, final Hand hand )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return EnumActionResult.PASS;
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
final BlockState state = world.getBlockState( pos );
|
||||
@@ -80,6 +80,6 @@ public class ToolEraser extends AEBaseItem
|
||||
|
||||
AELog.info( "Delete " + blocks + " blocks" );
|
||||
|
||||
return EnumActionResult.SUCCESS;
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,11 +20,11 @@ package appeng.debug;
|
||||
|
||||
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.items.AEBaseItem;
|
||||
@@ -36,11 +36,11 @@ import appeng.worldgen.meteorite.StandardWorld;
|
||||
public class ToolMeteoritePlacer extends AEBaseItem
|
||||
{
|
||||
@Override
|
||||
public EnumActionResult onItemUseFirst( final PlayerEntity player, final World world, final BlockPos pos, final Direction side, final float hitX, final float hitY, final float hitZ, final Hand hand )
|
||||
public ActionResultType onItemUseFirst( final PlayerEntity player, final World world, final BlockPos pos, final Direction side, final float hitX, final float hitY, final float hitZ, final Hand hand )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return EnumActionResult.PASS;
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
final MeteoritePlacer mp = new MeteoritePlacer();
|
||||
@@ -48,9 +48,9 @@ public class ToolMeteoritePlacer extends AEBaseItem
|
||||
|
||||
if( !worked )
|
||||
{
|
||||
player.sendMessage( new TextComponentString( "Un-suitable Location." ) );
|
||||
player.sendMessage( new StringTextComponent( "Un-suitable Location." ) );
|
||||
}
|
||||
|
||||
return EnumActionResult.SUCCESS;
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@ import net.minecraft.command.ICommandSender;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.TextComponentString;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.DimensionManager;
|
||||
|
||||
@@ -46,11 +46,11 @@ import appeng.util.Platform;
|
||||
public class ToolReplicatorCard extends AEBaseItem
|
||||
{
|
||||
@Override
|
||||
public EnumActionResult onItemUseFirst( final PlayerEntity player, final World world, final BlockPos pos, final Direction side, final float hitX, final float hitY, final float hitZ, final Hand hand )
|
||||
public ActionResultType onItemUseFirst( final PlayerEntity player, final World world, final BlockPos pos, final Direction side, final float hitX, final float hitY, final float hitZ, final Hand hand )
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
return EnumActionResult.PASS;
|
||||
return ActionResultType.PASS;
|
||||
}
|
||||
|
||||
int x = pos.getX();
|
||||
@@ -62,11 +62,11 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
if( world.getTileEntity( pos ) instanceof IGridHost )
|
||||
{
|
||||
final CompoundNBT tag = new CompoundNBT();
|
||||
tag.setInteger( "x", x );
|
||||
tag.setInteger( "y", y );
|
||||
tag.setInteger( "z", z );
|
||||
tag.setInteger( "side", side.ordinal() );
|
||||
tag.setInteger( "dimid", world.provider.getDimension() );
|
||||
tag.putInt( "x", x );
|
||||
tag.putInt( "y", y );
|
||||
tag.putInt( "z", z );
|
||||
tag.putInt( "side", side.ordinal() );
|
||||
tag.putInt( "dimid", world.provider.getDimension() );
|
||||
player.getHeldItem( hand ).setTagCompound( tag );
|
||||
}
|
||||
else
|
||||
@@ -79,11 +79,11 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
final CompoundNBT ish = player.getHeldItem( hand ).getTag();
|
||||
if( ish != null )
|
||||
{
|
||||
final int src_x = ish.getInteger( "x" );
|
||||
final int src_y = ish.getInteger( "y" );
|
||||
final int src_z = ish.getInteger( "z" );
|
||||
final int src_side = ish.getInteger( "side" );
|
||||
final int dimid = ish.getInteger( "dimid" );
|
||||
final int src_x = ish.getInt( "x" );
|
||||
final int src_y = ish.getInt( "y" );
|
||||
final int src_z = ish.getInt( "z" );
|
||||
final int src_side = ish.getInt( "side" );
|
||||
final int dimid = ish.getInt( "dimid" );
|
||||
final World src_w = DimensionManager.getWorld( dimid );
|
||||
|
||||
final TileEntity te = src_w.getTileEntity( new BlockPos( src_x, src_y, src_z ) );
|
||||
@@ -172,11 +172,11 @@ public class ToolReplicatorCard extends AEBaseItem
|
||||
this.outputMsg( player, "No Source Defined" );
|
||||
}
|
||||
}
|
||||
return EnumActionResult.SUCCESS;
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
private void outputMsg( final ICommandSender player, final String string )
|
||||
{
|
||||
player.sendMessage( new TextComponentString( string ) );
|
||||
player.sendMessage( new StringTextComponent( string ) );
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user