1.15 port
This commit is contained in:
@@ -25,26 +25,26 @@ import java.util.List;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.block.BlockStateContainer;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.state.IProperty;
|
||||
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.RayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
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.util.IOrientable;
|
||||
import appeng.api.util.IOrientableBlock;
|
||||
@@ -101,20 +101,20 @@ public abstract class AEBaseBlock extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isNormalCube( IBlockState state )
|
||||
public final boolean isNormalCube( BlockState state )
|
||||
{
|
||||
return this.isFullSize() && this.isOpaque();
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox( IBlockState state, IBlockAccess source, BlockPos pos )
|
||||
public AxisAlignedBB getBoundingBox( BlockState state, IBlockReader source, BlockPos pos )
|
||||
{
|
||||
return this.boundingBox;
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public void addCollisionBoxToList( final IBlockState state, final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, @Nullable final Entity e, boolean p_185477_7_ )
|
||||
public void addCollisionBoxToList( final BlockState state, final World w, final BlockPos pos, final AxisAlignedBB bb, final List<AxisAlignedBB> out, @Nullable final Entity e, boolean p_185477_7_ )
|
||||
{
|
||||
final ICustomCollision collisionHandler = this.getCustomCollision( w, pos );
|
||||
|
||||
@@ -139,8 +139,8 @@ public abstract class AEBaseBlock extends Block
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
@SideOnly( Side.CLIENT )
|
||||
public AxisAlignedBB getSelectedBoundingBox( IBlockState state, final World w, final BlockPos pos )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
public AxisAlignedBB getSelectedBoundingBox( BlockState state, final World w, final BlockPos pos )
|
||||
{
|
||||
final ICustomCollision collisionHandler = this.getCustomCollision( w, pos );
|
||||
|
||||
@@ -148,10 +148,10 @@ public abstract class AEBaseBlock extends Block
|
||||
{
|
||||
if( Platform.isClient() )
|
||||
{
|
||||
final EntityPlayer player = Minecraft.getMinecraft().player;
|
||||
final PlayerEntity player = Minecraft.getInstance().player;
|
||||
final LookDirection ld = Platform.getPlayerRay( player, Platform.getEyeOffset( player ) );
|
||||
|
||||
final Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, pos, Minecraft.getMinecraft().player, true );
|
||||
final Iterable<AxisAlignedBB> bbs = collisionHandler.getSelectedBoundingBoxesFromPool( w, pos, Minecraft.getInstance().player, true );
|
||||
AxisAlignedBB br = null;
|
||||
|
||||
double lastDist = 0;
|
||||
@@ -225,14 +225,14 @@ public abstract class AEBaseBlock extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isOpaqueCube( IBlockState state )
|
||||
public final boolean isOpaqueCube( BlockState state )
|
||||
{
|
||||
return this.isOpaque();
|
||||
}
|
||||
|
||||
@SuppressWarnings( "deprecation" )
|
||||
@Override
|
||||
public RayTraceResult collisionRayTrace( final IBlockState state, final World w, final BlockPos pos, final Vec3d a, final Vec3d b )
|
||||
public RayTraceResult collisionRayTrace( final BlockState state, final World w, final BlockPos pos, final Vec3d a, final Vec3d b )
|
||||
{
|
||||
final ICustomCollision collisionHandler = this.getCustomCollision( w, pos );
|
||||
|
||||
@@ -279,25 +279,25 @@ public abstract class AEBaseBlock extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasComparatorInputOverride( IBlockState state )
|
||||
public boolean hasComparatorInputOverride( BlockState state )
|
||||
{
|
||||
return this.isInventory();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride( IBlockState state, final World worldIn, final BlockPos pos )
|
||||
public int getComparatorInputOverride( BlockState state, final World worldIn, final BlockPos pos )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean isNormalCube( IBlockState state, final IBlockAccess world, final BlockPos pos )
|
||||
public final boolean isNormalCube( BlockState state, final IBlockReader world, final BlockPos pos )
|
||||
{
|
||||
return this.isFullSize();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean rotateBlock( final World w, final BlockPos pos, final EnumFacing axis )
|
||||
public boolean rotateBlock( final World w, final BlockPos pos, final Direction axis )
|
||||
{
|
||||
final IOrientable rotatable = this.getOrientable( w, pos );
|
||||
|
||||
@@ -310,8 +310,8 @@ public abstract class AEBaseBlock extends Block
|
||||
}
|
||||
else
|
||||
{
|
||||
EnumFacing forward = rotatable.getForward();
|
||||
EnumFacing up = rotatable.getUp();
|
||||
Direction forward = rotatable.getForward();
|
||||
Direction up = rotatable.getUp();
|
||||
|
||||
for( int rs = 0; rs < 4; rs++ )
|
||||
{
|
||||
@@ -331,24 +331,24 @@ public abstract class AEBaseBlock extends Block
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumFacing[] getValidRotations( final World w, final BlockPos pos )
|
||||
public Direction[] getValidRotations( final World w, final BlockPos pos )
|
||||
{
|
||||
return new EnumFacing[0];
|
||||
return new Direction[0];
|
||||
}
|
||||
|
||||
@SideOnly( Side.CLIENT )
|
||||
@OnlyIn( Dist.CLIENT )
|
||||
@Override
|
||||
public void addInformation( final ItemStack is, final World world, final List<String> lines, final ITooltipFlag advancedItemTooltips )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public boolean onActivated( final World w, final BlockPos pos, final EntityPlayer player, final EnumHand hand, final @Nullable ItemStack heldItem, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
|
||||
public boolean onActivated( final World w, final BlockPos pos, final PlayerEntity player, final Hand hand, final @Nullable ItemStack heldItem, final Direction side, final float hitX, final float hitY, final float hitZ )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
public final EnumFacing mapRotation( final IOrientable ori, final EnumFacing dir )
|
||||
public final Direction mapRotation( final IOrientable ori, final Direction dir )
|
||||
{
|
||||
// case DOWN: return bottomIcon;
|
||||
// case UP: return blockIcon;
|
||||
@@ -357,8 +357,8 @@ public abstract class AEBaseBlock extends Block
|
||||
// case WEST: return sideIcon;
|
||||
// case EAST: return sideIcon;
|
||||
|
||||
final EnumFacing forward = ori.getForward();
|
||||
final EnumFacing up = ori.getUp();
|
||||
final Direction forward = ori.getForward();
|
||||
final Direction up = ori.getUp();
|
||||
|
||||
if( forward == null || up == null )
|
||||
{
|
||||
@@ -369,8 +369,8 @@ public abstract class AEBaseBlock extends Block
|
||||
final int west_y = forward.getFrontOffsetZ() * up.getFrontOffsetX() - forward.getFrontOffsetX() * up.getFrontOffsetZ();
|
||||
final int west_z = forward.getFrontOffsetX() * up.getFrontOffsetY() - forward.getFrontOffsetY() * up.getFrontOffsetX();
|
||||
|
||||
EnumFacing west = null;
|
||||
for( final EnumFacing dx : EnumFacing.VALUES )
|
||||
Direction west = null;
|
||||
for( final Direction dx : Direction.VALUES )
|
||||
{
|
||||
if( dx.getFrontOffsetX() == west_x && dx.getFrontOffsetY() == west_y && dx.getFrontOffsetZ() == west_z )
|
||||
{
|
||||
@@ -385,29 +385,29 @@ public abstract class AEBaseBlock extends Block
|
||||
|
||||
if( dir == forward )
|
||||
{
|
||||
return EnumFacing.SOUTH;
|
||||
return Direction.SOUTH;
|
||||
}
|
||||
if( dir == forward.getOpposite() )
|
||||
{
|
||||
return EnumFacing.NORTH;
|
||||
return Direction.NORTH;
|
||||
}
|
||||
|
||||
if( dir == up )
|
||||
{
|
||||
return EnumFacing.UP;
|
||||
return Direction.UP;
|
||||
}
|
||||
if( dir == up.getOpposite() )
|
||||
{
|
||||
return EnumFacing.DOWN;
|
||||
return Direction.DOWN;
|
||||
}
|
||||
|
||||
if( dir == west )
|
||||
{
|
||||
return EnumFacing.WEST;
|
||||
return Direction.WEST;
|
||||
}
|
||||
if( dir == west.getOpposite() )
|
||||
{
|
||||
return EnumFacing.EAST;
|
||||
return Direction.EAST;
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -420,9 +420,9 @@ public abstract class AEBaseBlock extends Block
|
||||
return this.getClass().getSimpleName() + "[" + regName + "]";
|
||||
}
|
||||
|
||||
protected String getUnlocalizedName( final ItemStack is )
|
||||
protected String getTranslationKey( final ItemStack is )
|
||||
{
|
||||
return this.getUnlocalizedName();
|
||||
return this.getTranslationKey();
|
||||
}
|
||||
|
||||
protected boolean hasCustomRotation()
|
||||
@@ -430,12 +430,12 @@ public abstract class AEBaseBlock extends Block
|
||||
return false;
|
||||
}
|
||||
|
||||
protected void customRotateBlock( final IOrientable rotatable, final EnumFacing axis )
|
||||
protected void customRotateBlock( final IOrientable rotatable, final Direction axis )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected IOrientable getOrientable( final IBlockAccess w, final BlockPos pos )
|
||||
protected IOrientable getOrientable( final IBlockReader w, final BlockPos pos )
|
||||
{
|
||||
if( this instanceof IOrientableBlock )
|
||||
{
|
||||
@@ -445,7 +445,7 @@ public abstract class AEBaseBlock extends Block
|
||||
return null;
|
||||
}
|
||||
|
||||
protected boolean isValidOrientation( final World w, final BlockPos pos, final EnumFacing forward, final EnumFacing up )
|
||||
protected boolean isValidOrientation( final World w, final BlockPos pos, final Direction forward, final Direction up )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user