1.15 port
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
package appeng.items.tools.powered;
|
||||
|
||||
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
@@ -41,7 +41,7 @@ public class ToolChargedStaff extends AEBasePoweredItem
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity( final ItemStack item, final EntityLivingBase target, final EntityLivingBase hitter )
|
||||
public boolean hitEntity( final ItemStack item, final LivingEntity target, final LivingEntity hitter )
|
||||
{
|
||||
if( this.getAECurrentPower( item ) > 300 )
|
||||
{
|
||||
|
||||
@@ -32,22 +32,22 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockColored;
|
||||
import net.minecraft.block.BlockStainedGlass;
|
||||
import net.minecraft.block.BlockStainedGlassPane;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.item.EnumDyeColor;
|
||||
import net.minecraft.item.ItemSnowball;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@@ -90,7 +90,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
{
|
||||
for( final AEColor color : AEColor.VALID_COLORS )
|
||||
{
|
||||
final String dyeName = color.dye.getUnlocalizedName();
|
||||
final String dyeName = color.dye.getTranslationKey();
|
||||
final String oreDictName = "dye" + WordUtils.capitalize( dyeName );
|
||||
final int oreDictId = OreDictionary.getOreID( oreDictName );
|
||||
|
||||
@@ -104,13 +104,13 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse( EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ )
|
||||
public EnumActionResult onItemUse( PlayerEntity p, World w, BlockPos pos, Hand hand, Direction side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
return this.onItemUse( p.getHeldItem( hand ), p, w, pos, hand, side, hitX, hitY, hitZ );
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse( ItemStack is, EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ )
|
||||
public EnumActionResult onItemUse( ItemStack is, PlayerEntity p, World w, BlockPos pos, Hand hand, Direction side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
final Block blk = w.getBlockState( pos ).getBlock();
|
||||
|
||||
@@ -185,7 +185,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
}
|
||||
|
||||
if( p.isSneaking() )
|
||||
if( p.isShiftKeyDown() )
|
||||
{
|
||||
this.cycleColors( is, paintBall, 1 );
|
||||
}
|
||||
@@ -248,10 +248,10 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
|
||||
public ItemStack getColor( final ItemStack is )
|
||||
{
|
||||
final NBTTagCompound c = is.getTagCompound();
|
||||
final CompoundNBT c = is.getTagCompound();
|
||||
if( c != null && c.hasKey( "color" ) )
|
||||
{
|
||||
final NBTTagCompound color = c.getCompoundTag( "color" );
|
||||
final CompoundNBT color = c.getCompoundTag( "color" );
|
||||
final ItemStack oldColor = new ItemStack( color );
|
||||
if( !oldColor.isEmpty() )
|
||||
{
|
||||
@@ -333,22 +333,22 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
|
||||
private void setColor( final ItemStack is, final ItemStack newColor )
|
||||
{
|
||||
final NBTTagCompound data = Platform.openNbtData( is );
|
||||
final CompoundNBT data = Platform.openNbtData( is );
|
||||
if( newColor.isEmpty() )
|
||||
{
|
||||
data.removeTag( "color" );
|
||||
}
|
||||
else
|
||||
{
|
||||
final NBTTagCompound color = new NBTTagCompound();
|
||||
final CompoundNBT color = new CompoundNBT();
|
||||
newColor.writeToNBT( color );
|
||||
data.setTag( "color", color );
|
||||
}
|
||||
}
|
||||
|
||||
private boolean recolourBlock( final Block blk, final EnumFacing side, final World w, final BlockPos pos, final EnumFacing orientation, final AEColor newColor, final EntityPlayer p )
|
||||
private boolean recolourBlock( final Block blk, final Direction side, final World w, final BlockPos pos, final Direction orientation, final AEColor newColor, final PlayerEntity p )
|
||||
{
|
||||
final IBlockState state = w.getBlockState( pos );
|
||||
final BlockState state = w.getBlockState( pos );
|
||||
|
||||
if( blk instanceof BlockColored )
|
||||
{
|
||||
@@ -422,7 +422,7 @@ public class ToolColorApplicator extends AEBasePoweredItem implements IStorageCe
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
super.addCheckedInformation( stack, world, lines, advancedTooltips );
|
||||
|
||||
@@ -5,8 +5,8 @@ package appeng.items.tools.powered;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.util.AEColor;
|
||||
import appeng.bootstrap.IItemRendering;
|
||||
@@ -22,7 +22,7 @@ public class ToolColorApplicatorRendering extends ItemRenderingCustomizer
|
||||
private static final ModelResourceLocation MODEL_UNCOLORED = new ModelResourceLocation( new ResourceLocation( AppEng.MOD_ID, "color_applicator_uncolored" ), "inventory" );
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public void customize( IItemRendering rendering )
|
||||
{
|
||||
rendering.builtInModel( "models/item/builtin/color_applicator_colored", new ColorApplicatorModel() );
|
||||
|
||||
@@ -25,22 +25,20 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.BlockTNT;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.BlockItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
@@ -90,10 +88,10 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
|
||||
private static class InWorldToolOperationIngredient
|
||||
{
|
||||
private final IBlockState state;
|
||||
private final BlockState state;
|
||||
private final boolean blockOnly;
|
||||
|
||||
public InWorldToolOperationIngredient( final IBlockState state )
|
||||
public InWorldToolOperationIngredient( final BlockState state )
|
||||
{
|
||||
this.state = state;
|
||||
this.blockOnly = false;
|
||||
@@ -127,7 +125,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
}
|
||||
|
||||
private void heat( final IBlockState state, final World w, final BlockPos pos )
|
||||
private void heat( final BlockState state, final World w, final BlockPos pos )
|
||||
{
|
||||
InWorldToolOperationResult r = this.heatUp.get( new InWorldToolOperationIngredient( state ) );
|
||||
|
||||
@@ -151,7 +149,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canHeat( final IBlockState state )
|
||||
private boolean canHeat( final BlockState state )
|
||||
{
|
||||
InWorldToolOperationResult r = this.heatUp.get( new InWorldToolOperationIngredient( state ) );
|
||||
|
||||
@@ -163,7 +161,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
return r != null;
|
||||
}
|
||||
|
||||
private void cool( final IBlockState state, final World w, final BlockPos pos )
|
||||
private void cool( final BlockState state, final World w, final BlockPos pos )
|
||||
{
|
||||
InWorldToolOperationResult r = this.coolDown.get( new InWorldToolOperationIngredient( state ) );
|
||||
|
||||
@@ -187,7 +185,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canCool( final IBlockState state )
|
||||
private boolean canCool( final BlockState state )
|
||||
{
|
||||
InWorldToolOperationResult r = this.coolDown.get( new InWorldToolOperationIngredient( state ) );
|
||||
|
||||
@@ -200,7 +198,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hitEntity( final ItemStack item, final EntityLivingBase target, final EntityLivingBase hitter )
|
||||
public boolean hitEntity( final ItemStack item, final LivingEntity target, final LivingEntity hitter )
|
||||
{
|
||||
if( this.getAECurrentPower( item ) > 1600 )
|
||||
{
|
||||
@@ -212,7 +210,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer p, final EnumHand hand )
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final PlayerEntity p, final Hand hand )
|
||||
{
|
||||
final RayTraceResult target = this.rayTrace( w, p, true );
|
||||
|
||||
@@ -224,12 +222,12 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
{
|
||||
if( target.typeOfHit == RayTraceResult.Type.BLOCK )
|
||||
{
|
||||
final IBlockState state = w.getBlockState( target.getBlockPos() );
|
||||
final BlockState state = w.getBlockState( target.getBlockPos() );
|
||||
if( state.getMaterial() == Material.LAVA || state.getMaterial() == Material.WATER )
|
||||
{
|
||||
if( Platform.hasPermissions( new DimensionalCoord( w, target.getBlockPos() ), p ) )
|
||||
{
|
||||
this.onItemUse( p, w, target.getBlockPos(), hand, EnumFacing.UP, 0.0F, 0.0F, 0.0F );
|
||||
this.onItemUse( p, w, target.getBlockPos(), hand, Direction.UP, 0.0F, 0.0F, 0.0F );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -239,13 +237,13 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse( EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ )
|
||||
public EnumActionResult onItemUse( PlayerEntity p, World w, BlockPos pos, Hand hand, Direction side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
return this.onItemUse( p.getHeldItem( hand ), p, w, pos, hand, side, hitX, hitY, hitZ );
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse( ItemStack item, EntityPlayer p, World w, BlockPos pos, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ )
|
||||
public ActionResult onItemUse( ItemStack item, PlayerEntity p, World w, BlockPos pos, Hand hand, Direction side, float hitX, float hitY, float hitZ )
|
||||
{
|
||||
if( this.getAECurrentPower( item ) > 1600 )
|
||||
{
|
||||
@@ -254,10 +252,10 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
return EnumActionResult.FAIL;
|
||||
}
|
||||
|
||||
final IBlockState state = w.getBlockState( pos );
|
||||
final BlockState state = w.getBlockState( pos );
|
||||
final Block blockID = state.getBlock();
|
||||
|
||||
if( p.isSneaking() )
|
||||
if( p.isShiftKeyDown() )
|
||||
{
|
||||
if( this.canCool( state ) )
|
||||
{
|
||||
@@ -300,7 +298,7 @@ public class ToolEntropyManipulator extends AEBasePoweredItem implements IBlockT
|
||||
|
||||
if( !result.isEmpty() )
|
||||
{
|
||||
if( result.getItem() instanceof ItemBlock )
|
||||
if( result.getItem() instanceof BlockItem )
|
||||
{
|
||||
if( Block.getBlockFromItem( result.getItem() ) == blockID && result.getItem().getDamage( result ) == blockID
|
||||
.getMetaFromState( state ) )
|
||||
|
||||
@@ -24,27 +24,27 @@ import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.entity.passive.EntitySheep;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -86,7 +86,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell<
|
||||
super( AEConfig.instance().getMatterCannonBattery() );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
@@ -102,7 +102,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell<
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer p, final @Nullable EnumHand hand )
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final PlayerEntity p, final @Nullable Hand hand )
|
||||
{
|
||||
if( this.getAECurrentPower( p.getHeldItem( hand ) ) > 1600 )
|
||||
{
|
||||
@@ -190,7 +190,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell<
|
||||
return new ActionResult<>( EnumActionResult.FAIL, p.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
private void shootPaintBalls( final ItemStack type, final World w, final EntityPlayer p, final Vec3d Vec3d, final Vec3d Vec3d1, final Vec3d direction, final double d0, final double d1, final double d2 )
|
||||
private void shootPaintBalls( final ItemStack type, final World w, final PlayerEntity p, final Vec3d Vec3d, final Vec3d Vec3d1, final Vec3d direction, final double d0, final double d1, final double d2 )
|
||||
{
|
||||
final AxisAlignedBB bb = new AxisAlignedBB( Math.min( Vec3d.x, Vec3d1.x ), Math.min( Vec3d.y, Vec3d1.y ), Math.min( Vec3d.z, Vec3d1.z ), Math
|
||||
.max( Vec3d.x, Vec3d1.x ), Math.max( Vec3d.y, Vec3d1.y ), Math.max( Vec3d.z, Vec3d1.z ) ).grow( 16, 16, 16 );
|
||||
@@ -203,9 +203,9 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell<
|
||||
{
|
||||
final Entity entity1 = (Entity) list.get( l );
|
||||
|
||||
if( !entity1.isDead && entity1 != p && !( entity1 instanceof EntityItem ) )
|
||||
if( !entity1.isAlive() && entity1 != p && !( entity1 instanceof ItemEntity ) )
|
||||
{
|
||||
if( entity1.isEntityAlive() )
|
||||
if( entity1.isAlive() )
|
||||
{
|
||||
// prevent killing / flying of mounts.
|
||||
if( entity1.isRidingOrBeingRiddenBy( p ) )
|
||||
@@ -279,7 +279,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell<
|
||||
}
|
||||
else if( pos.typeOfHit == RayTraceResult.Type.BLOCK )
|
||||
{
|
||||
final EnumFacing side = pos.sideHit;
|
||||
final Direction side = pos.sideHit;
|
||||
final BlockPos hitPos = pos.getBlockPos().offset( side );
|
||||
|
||||
if( !Platform.hasPermissions( new DimensionalCoord( w, hitPos ), p ) )
|
||||
@@ -306,7 +306,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell<
|
||||
}
|
||||
}
|
||||
|
||||
private void standardAmmo( float penetration, final World w, final EntityPlayer p, final Vec3d Vec3d, final Vec3d Vec3d1, final Vec3d direction, final double d0, final double d1, final double d2 )
|
||||
private void standardAmmo( float penetration, final World w, final PlayerEntity p, final Vec3d Vec3d, final Vec3d Vec3d1, final Vec3d direction, final double d0, final double d1, final double d2 )
|
||||
{
|
||||
boolean hasDestroyed = true;
|
||||
while( penetration > 0 && hasDestroyed )
|
||||
@@ -326,7 +326,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell<
|
||||
|
||||
if( !entity1.isDead && entity1 != p && !( entity1 instanceof EntityItem ) )
|
||||
{
|
||||
if( entity1.isEntityAlive() )
|
||||
if( entity1.isAlive() )
|
||||
{
|
||||
// prevent killing / flying of mounts.
|
||||
if( entity1.isRidingOrBeingRiddenBy( p ) )
|
||||
@@ -383,15 +383,15 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell<
|
||||
if( pos.typeOfHit == RayTraceResult.Type.ENTITY )
|
||||
{
|
||||
final int dmg = (int) Math.ceil( penetration / 20.0f );
|
||||
if( pos.entityHit instanceof EntityLivingBase )
|
||||
if( pos.entityHit instanceof LivingEntity )
|
||||
{
|
||||
final EntityLivingBase el = (EntityLivingBase) pos.entityHit;
|
||||
final LivingEntity el = (LivingEntity) pos.entityHit;
|
||||
penetration -= dmg;
|
||||
el.knockBack( p, 0, -direction.x, -direction.z );
|
||||
// el.knockBack( p, 0, Vec3d.x,
|
||||
// Vec3d.z );
|
||||
el.attackEntityFrom( dmgSrc, dmg );
|
||||
if( !el.isEntityAlive() )
|
||||
if( !el.isAlive() )
|
||||
{
|
||||
hasDestroyed = true;
|
||||
}
|
||||
@@ -414,7 +414,7 @@ public class ToolMatterCannon extends AEBasePoweredItem implements IStorageCell<
|
||||
}
|
||||
else
|
||||
{
|
||||
final IBlockState bs = w.getBlockState( pos.getBlockPos() );
|
||||
final BlockState bs = w.getBlockState( pos.getBlockPos() );
|
||||
// int meta = w.getBlockMetadata(
|
||||
// pos.blockX, pos.blockY, pos.blockZ );
|
||||
|
||||
|
||||
@@ -23,15 +23,15 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.items.IItemHandler;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
@@ -63,13 +63,13 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell<
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer player, final EnumHand hand )
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final PlayerEntity player, final Hand hand )
|
||||
{
|
||||
Platform.openGUI( player, null, AEPartLocation.INTERNAL, GuiBridge.GUI_PORTABLE_CELL );
|
||||
return new ActionResult<>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
@Override
|
||||
public boolean isFull3D()
|
||||
{
|
||||
@@ -77,7 +77,7 @@ public class ToolPortableCell extends AEBasePoweredItem implements IStorageCell<
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
super.addCheckedInformation( stack, world, lines, advancedTooltips );
|
||||
|
||||
@@ -22,16 +22,16 @@ package appeng.items.tools.powered;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.text.translation.I18n;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.config.Actionable;
|
||||
@@ -57,13 +57,13 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final EntityPlayer player, final EnumHand hand )
|
||||
public ActionResult<ItemStack> onItemRightClick( final World w, final PlayerEntity player, final Hand hand )
|
||||
{
|
||||
AEApi.instance().registries().wireless().openWirelessTerminalGui( player.getHeldItem( hand ), w, player );
|
||||
return new ActionResult<>( EnumActionResult.SUCCESS, player.getHeldItem( hand ) );
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
@Override
|
||||
public boolean isFull3D()
|
||||
{
|
||||
@@ -71,14 +71,14 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
super.addCheckedInformation( stack, world, lines, advancedTooltips );
|
||||
|
||||
if( stack.hasTagCompound() )
|
||||
{
|
||||
final NBTTagCompound tag = Platform.openNbtData( stack );
|
||||
final CompoundNBT tag = Platform.openNbtData( stack );
|
||||
if( tag != null )
|
||||
{
|
||||
final String encKey = tag.getString( "encryptionKey" );
|
||||
@@ -106,13 +106,13 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean usePower( final EntityPlayer player, final double amount, final ItemStack is )
|
||||
public boolean usePower( final PlayerEntity player, final double amount, final ItemStack is )
|
||||
{
|
||||
return this.extractAEPower( is, amount, Actionable.MODULATE ) >= amount - 0.5;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasPower( final EntityPlayer player, final double amt, final ItemStack is )
|
||||
public boolean hasPower( final PlayerEntity player, final double amt, final ItemStack is )
|
||||
{
|
||||
return this.getAECurrentPower( is ) >= amt;
|
||||
}
|
||||
@@ -122,7 +122,7 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
{
|
||||
final ConfigManager out = new ConfigManager( ( manager, settingName, newValue ) ->
|
||||
{
|
||||
final NBTTagCompound data = Platform.openNbtData( target );
|
||||
final CompoundNBT data = Platform.openNbtData( target );
|
||||
manager.writeToNBT( data );
|
||||
} );
|
||||
|
||||
@@ -137,14 +137,14 @@ public class ToolWirelessTerminal extends AEBasePoweredItem implements IWireless
|
||||
@Override
|
||||
public String getEncryptionKey( final ItemStack item )
|
||||
{
|
||||
final NBTTagCompound tag = Platform.openNbtData( item );
|
||||
final CompoundNBT tag = Platform.openNbtData( item );
|
||||
return tag.getString( "encryptionKey" );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEncryptionKey( final ItemStack item, final String encKey, final String name )
|
||||
{
|
||||
final NBTTagCompound tag = Platform.openNbtData( item );
|
||||
final CompoundNBT tag = Platform.openNbtData( item );
|
||||
tag.setString( "encryptionKey", encKey );
|
||||
tag.setString( "name", name );
|
||||
}
|
||||
|
||||
@@ -25,12 +25,12 @@ import java.util.List;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
import appeng.api.config.AccessRestriction;
|
||||
import appeng.api.config.Actionable;
|
||||
@@ -57,11 +57,11 @@ public abstract class AEBasePoweredItem extends AEBaseItem implements IAEItemPow
|
||||
this.powerCapacity = powerCapacity;
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
@Override
|
||||
public void addCheckedInformation( final ItemStack stack, final World world, final List<String> lines, final ITooltipFlag advancedTooltips )
|
||||
{
|
||||
final NBTTagCompound tag = stack.getTagCompound();
|
||||
final CompoundNBT tag = stack.getTagCompound();
|
||||
double internalCurrentPower = 0;
|
||||
final double internalMaxPower = this.getAEMaxPower( stack );
|
||||
|
||||
@@ -88,7 +88,7 @@ public abstract class AEBasePoweredItem extends AEBaseItem implements IAEItemPow
|
||||
super.getCheckedSubItems( creativeTab, itemStacks );
|
||||
|
||||
final ItemStack charged = new ItemStack( this, 1 );
|
||||
final NBTTagCompound tag = Platform.openNbtData( charged );
|
||||
final CompoundNBT tag = Platform.openNbtData( charged );
|
||||
tag.setDouble( CURRENT_POWER_NBT_KEY, this.getAEMaxPower( charged ) );
|
||||
tag.setDouble( MAX_POWER_NBT_KEY, this.getAEMaxPower( charged ) );
|
||||
|
||||
@@ -129,7 +129,7 @@ public abstract class AEBasePoweredItem extends AEBaseItem implements IAEItemPow
|
||||
|
||||
if( mode == Actionable.MODULATE )
|
||||
{
|
||||
final NBTTagCompound data = Platform.openNbtData( is );
|
||||
final CompoundNBT data = Platform.openNbtData( is );
|
||||
final double toAdd = Math.min( amount, required );
|
||||
|
||||
data.setDouble( CURRENT_POWER_NBT_KEY, currentStorage + toAdd );
|
||||
@@ -146,7 +146,7 @@ public abstract class AEBasePoweredItem extends AEBaseItem implements IAEItemPow
|
||||
|
||||
if( mode == Actionable.MODULATE )
|
||||
{
|
||||
final NBTTagCompound data = Platform.openNbtData( is );
|
||||
final CompoundNBT data = Platform.openNbtData( is );
|
||||
|
||||
data.setDouble( CURRENT_POWER_NBT_KEY, currentStorage - fulfillable );
|
||||
}
|
||||
@@ -163,7 +163,7 @@ public abstract class AEBasePoweredItem extends AEBaseItem implements IAEItemPow
|
||||
@Override
|
||||
public double getAECurrentPower( final ItemStack is )
|
||||
{
|
||||
final NBTTagCompound data = Platform.openNbtData( is );
|
||||
final CompoundNBT data = Platform.openNbtData( is );
|
||||
|
||||
return data.getDouble( CURRENT_POWER_NBT_KEY );
|
||||
}
|
||||
@@ -175,7 +175,7 @@ public abstract class AEBasePoweredItem extends AEBaseItem implements IAEItemPow
|
||||
}
|
||||
|
||||
@Override
|
||||
public ICapabilityProvider initCapabilities( ItemStack stack, NBTTagCompound nbt )
|
||||
public ICapabilityProvider initCapabilities( ItemStack stack, CompoundNBT nbt )
|
||||
{
|
||||
return new PoweredItemCapabilities( stack, this );
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import javax.annotation.Nullable;
|
||||
import net.darkhax.tesla.api.ITeslaConsumer;
|
||||
import net.darkhax.tesla.api.ITeslaHolder;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.energy.IEnergyStorage;
|
||||
@@ -62,14 +62,14 @@ class PoweredItemCapabilities implements ICapabilityProvider, IEnergyStorage
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCapability( Capability<?> capability, @Nullable EnumFacing facing )
|
||||
public boolean hasCapability( Capability<?> capability, @Nullable Direction facing )
|
||||
{
|
||||
return capability == Capabilities.FORGE_ENERGY || capability == Capabilities.TESLA_CONSUMER || capability == Capabilities.TESLA_HOLDER;
|
||||
}
|
||||
|
||||
@SuppressWarnings( "unchecked" )
|
||||
@Override
|
||||
public <T> T getCapability( Capability<T> capability, @Nullable EnumFacing facing )
|
||||
public <T> T getCapability( Capability<T> capability, @Nullable Direction facing )
|
||||
{
|
||||
if( capability == Capabilities.FORGE_ENERGY )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user