mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2025-01-12 18:30:29 +00:00
Update to the latest mappings
This is a preliminary for updating to 1.13, as many of the name changes apply to both. This will make it harder to remain consistent with actual CC, though that will be less of a consideration when 1.13 hits.
This commit is contained in:
parent
3ac8dde779
commit
b8957cab5c
@ -37,7 +37,7 @@ minecraft {
|
|||||||
// stable_# stables are built at the discretion of the MCP team.
|
// stable_# stables are built at the discretion of the MCP team.
|
||||||
// Use non-default mappings at your own risk. they may not allways work.
|
// Use non-default mappings at your own risk. they may not allways work.
|
||||||
// simply re-run your setup task after changing the mappings to update your workspace.
|
// simply re-run your setup task after changing the mappings to update your workspace.
|
||||||
mappings = "snapshot_20180324"
|
mappings = "snapshot_20180724"
|
||||||
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
|
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ public class TileEntityCableRenderer extends TileEntitySpecialRenderer<TileCable
|
|||||||
buffer.setTranslation( x - pos.getX(), y - pos.getY(), z - pos.getZ() );
|
buffer.setTranslation( x - pos.getX(), y - pos.getY(), z - pos.getZ() );
|
||||||
buffer.noColor();
|
buffer.noColor();
|
||||||
|
|
||||||
ForgeHooksClient.setRenderLayer( block.getBlockLayer() );
|
ForgeHooksClient.setRenderLayer( block.getRenderLayer() );
|
||||||
|
|
||||||
// See BlockRendererDispatcher#renderBlockDamage
|
// See BlockRendererDispatcher#renderBlockDamage
|
||||||
TextureAtlasSprite breakingTexture = mc.getTextureMapBlocks().getAtlasSprite( "minecraft:blocks/destroy_stage_" + destroyStage );
|
TextureAtlasSprite breakingTexture = mc.getTextureMapBlocks().getAtlasSprite( "minecraft:blocks/destroy_stage_" + destroyStage );
|
||||||
|
@ -42,7 +42,7 @@ public class BlockCommandComputer extends BlockComputerBase
|
|||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
setBlockUnbreakable();
|
setBlockUnbreakable();
|
||||||
setResistance( 6000000.0F );
|
setResistance( 6000000.0F );
|
||||||
setUnlocalizedName( "computercraft:command_computer" );
|
setTranslationKey( "computercraft:command_computer" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
setDefaultState( this.blockState.getBaseState()
|
setDefaultState( this.blockState.getBaseState()
|
||||||
.withProperty( Properties.FACING, EnumFacing.NORTH )
|
.withProperty( Properties.FACING, EnumFacing.NORTH )
|
||||||
@ -62,7 +62,7 @@ public class BlockCommandComputer extends BlockComputerBase
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
public IBlockState getStateFromMeta( int meta )
|
public IBlockState getStateFromMeta( int meta )
|
||||||
{
|
{
|
||||||
EnumFacing dir = EnumFacing.getFront( meta & 0x7 );
|
EnumFacing dir = EnumFacing.byIndex( meta & 0x7 );
|
||||||
if( dir.getAxis() == EnumFacing.Axis.Y )
|
if( dir.getAxis() == EnumFacing.Axis.Y )
|
||||||
{
|
{
|
||||||
dir = EnumFacing.NORTH;
|
dir = EnumFacing.NORTH;
|
||||||
|
@ -44,7 +44,7 @@ public class BlockComputer extends BlockComputerBase
|
|||||||
{
|
{
|
||||||
super( Material.ROCK );
|
super( Material.ROCK );
|
||||||
setHardness( 2.0f );
|
setHardness( 2.0f );
|
||||||
setUnlocalizedName( "computercraft:computer" );
|
setTranslationKey( "computercraft:computer" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
setDefaultState( this.blockState.getBaseState()
|
setDefaultState( this.blockState.getBaseState()
|
||||||
.withProperty( Properties.FACING, EnumFacing.NORTH )
|
.withProperty( Properties.FACING, EnumFacing.NORTH )
|
||||||
@ -65,7 +65,7 @@ public class BlockComputer extends BlockComputerBase
|
|||||||
@Deprecated
|
@Deprecated
|
||||||
public IBlockState getStateFromMeta( int meta )
|
public IBlockState getStateFromMeta( int meta )
|
||||||
{
|
{
|
||||||
EnumFacing dir = EnumFacing.getFront( meta & 0x7 );
|
EnumFacing dir = EnumFacing.byIndex( meta & 0x7 );
|
||||||
if( dir.getAxis() == EnumFacing.Axis.Y )
|
if( dir.getAxis() == EnumFacing.Axis.Y )
|
||||||
{
|
{
|
||||||
dir = EnumFacing.NORTH;
|
dir = EnumFacing.NORTH;
|
||||||
|
@ -24,7 +24,7 @@ public class ItemCommandComputer extends ItemComputer
|
|||||||
super( block );
|
super( block );
|
||||||
setMaxStackSize( 64 );
|
setMaxStackSize( 64 );
|
||||||
setHasSubtypes( true );
|
setHasSubtypes( true );
|
||||||
setUnlocalizedName( "computercraft:command_computer" );
|
setTranslationKey( "computercraft:command_computer" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,7 +33,7 @@ public class ItemComputer extends ItemComputerBase
|
|||||||
super( block );
|
super( block );
|
||||||
setMaxStackSize( 64 );
|
setMaxStackSize( 64 );
|
||||||
setHasSubtypes( true );
|
setHasSubtypes( true );
|
||||||
setUnlocalizedName( "computercraft:computer" );
|
setTranslationKey( "computercraft:computer" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ public class ItemComputer extends ItemComputerBase
|
|||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName( @Nonnull ItemStack stack )
|
public String getTranslationKey( @Nonnull ItemStack stack )
|
||||||
{
|
{
|
||||||
switch( getFamily( stack ) )
|
switch( getFamily( stack ) )
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,7 @@ public class ItemDiskLegacy extends Item
|
|||||||
{
|
{
|
||||||
setMaxStackSize( 1 );
|
setMaxStackSize( 1 );
|
||||||
setHasSubtypes( true );
|
setHasSubtypes( true );
|
||||||
setUnlocalizedName( "computercraft:disk" );
|
setTranslationKey( "computercraft:disk" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ public class ItemPrintout extends Item
|
|||||||
{
|
{
|
||||||
setMaxStackSize( 1 );
|
setMaxStackSize( 1 );
|
||||||
setHasSubtypes( true );
|
setHasSubtypes( true );
|
||||||
setUnlocalizedName( "computercraft:page" );
|
setTranslationKey( "computercraft:page" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ public class ItemPrintout extends Item
|
|||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName( @Nonnull ItemStack stack )
|
public String getTranslationKey( @Nonnull ItemStack stack )
|
||||||
{
|
{
|
||||||
Type type = getType( stack );
|
Type type = getType( stack );
|
||||||
switch( type )
|
switch( type )
|
||||||
|
@ -34,7 +34,7 @@ public class ItemTreasureDisk extends Item
|
|||||||
{
|
{
|
||||||
setMaxStackSize( 1 );
|
setMaxStackSize( 1 );
|
||||||
setHasSubtypes( true );
|
setHasSubtypes( true );
|
||||||
setUnlocalizedName( "computercraft:treasure_disk" );
|
setTranslationKey( "computercraft:treasure_disk" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -55,7 +55,7 @@ public class BlockCable extends BlockPeripheralBase
|
|||||||
public BlockCable()
|
public BlockCable()
|
||||||
{
|
{
|
||||||
setHardness( 1.5f );
|
setHardness( 1.5f );
|
||||||
setUnlocalizedName( "computercraft:cable" );
|
setTranslationKey( "computercraft:cable" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
setDefaultState( this.blockState.getBaseState()
|
setDefaultState( this.blockState.getBaseState()
|
||||||
.withProperty( Properties.MODEM, BlockCableModemVariant.None )
|
.withProperty( Properties.MODEM, BlockCableModemVariant.None )
|
||||||
@ -94,12 +94,12 @@ public class BlockCable extends BlockPeripheralBase
|
|||||||
if( meta < 6 )
|
if( meta < 6 )
|
||||||
{
|
{
|
||||||
state = state.withProperty( Properties.CABLE, BlockCableCableVariant.NONE );
|
state = state.withProperty( Properties.CABLE, BlockCableCableVariant.NONE );
|
||||||
state = state.withProperty( Properties.MODEM, BlockCableModemVariant.fromFacing( EnumFacing.getFront( meta ) ) );
|
state = state.withProperty( Properties.MODEM, BlockCableModemVariant.fromFacing( EnumFacing.byIndex( meta ) ) );
|
||||||
}
|
}
|
||||||
else if( meta < 12 )
|
else if( meta < 12 )
|
||||||
{
|
{
|
||||||
state = state.withProperty( Properties.CABLE, BlockCableCableVariant.ANY );
|
state = state.withProperty( Properties.CABLE, BlockCableCableVariant.ANY );
|
||||||
state = state.withProperty( Properties.MODEM, BlockCableModemVariant.fromFacing( EnumFacing.getFront( meta - 6 ) ) );
|
state = state.withProperty( Properties.MODEM, BlockCableModemVariant.fromFacing( EnumFacing.byIndex( meta - 6 ) ) );
|
||||||
}
|
}
|
||||||
else if( meta == 13 )
|
else if( meta == 13 )
|
||||||
{
|
{
|
||||||
@ -296,7 +296,7 @@ public class BlockCable extends BlockPeripheralBase
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result == null ? null : new RayTraceResult( result.hitVec.addVector( pos.getX(), pos.getY(), pos.getZ() ), result.sideHit, pos );
|
return result == null ? null : new RayTraceResult( result.hitVec.add( pos.getX(), pos.getY(), pos.getZ() ), result.sideHit, pos );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -44,7 +44,7 @@ public class BlockPeripheral extends BlockPeripheralBase
|
|||||||
public BlockPeripheral()
|
public BlockPeripheral()
|
||||||
{
|
{
|
||||||
setHardness( 2.0f );
|
setHardness( 2.0f );
|
||||||
setUnlocalizedName( "computercraft:peripheral" );
|
setTranslationKey( "computercraft:peripheral" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
setDefaultState( this.blockState.getBaseState()
|
setDefaultState( this.blockState.getBaseState()
|
||||||
.withProperty( Properties.FACING, EnumFacing.NORTH )
|
.withProperty( Properties.FACING, EnumFacing.NORTH )
|
||||||
@ -55,7 +55,7 @@ public class BlockPeripheral extends BlockPeripheralBase
|
|||||||
@Override
|
@Override
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@SideOnly( Side.CLIENT)
|
@SideOnly( Side.CLIENT)
|
||||||
public BlockRenderLayer getBlockLayer()
|
public BlockRenderLayer getRenderLayer()
|
||||||
{
|
{
|
||||||
return BlockRenderLayer.CUTOUT;
|
return BlockRenderLayer.CUTOUT;
|
||||||
}
|
}
|
||||||
@ -76,7 +76,7 @@ public class BlockPeripheral extends BlockPeripheralBase
|
|||||||
if( meta >= 2 && meta <= 5 )
|
if( meta >= 2 && meta <= 5 )
|
||||||
{
|
{
|
||||||
state = state.withProperty( Properties.VARIANT, BlockPeripheralVariant.DiskDriveEmpty );
|
state = state.withProperty( Properties.VARIANT, BlockPeripheralVariant.DiskDriveEmpty );
|
||||||
state = state.withProperty( Properties.FACING, EnumFacing.getFront( meta ) );
|
state = state.withProperty( Properties.FACING, EnumFacing.byIndex( meta ) );
|
||||||
}
|
}
|
||||||
else if( meta <= 9 )
|
else if( meta <= 9 )
|
||||||
{
|
{
|
||||||
@ -93,7 +93,7 @@ public class BlockPeripheral extends BlockPeripheralBase
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
state = state.withProperty( Properties.VARIANT, BlockPeripheralVariant.WirelessModemOff );
|
state = state.withProperty( Properties.VARIANT, BlockPeripheralVariant.WirelessModemOff );
|
||||||
state = state.withProperty( Properties.FACING, EnumFacing.getFront( meta - 4 ) );
|
state = state.withProperty( Properties.FACING, EnumFacing.byIndex( meta - 4 ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if( meta == 10 )
|
else if( meta == 10 )
|
||||||
@ -651,7 +651,7 @@ public class BlockPeripheral extends BlockPeripheralBase
|
|||||||
public boolean causesSuffocation(IBlockState state)
|
public boolean causesSuffocation(IBlockState state)
|
||||||
{
|
{
|
||||||
// This normally uses the default state
|
// This normally uses the default state
|
||||||
return blockMaterial.blocksMovement() && state.isOpaqueCube();
|
return material.blocksMovement() && state.isOpaqueCube();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -34,7 +34,7 @@ public class BlockWiredModemFull extends BlockPeripheralBase
|
|||||||
public BlockWiredModemFull()
|
public BlockWiredModemFull()
|
||||||
{
|
{
|
||||||
setHardness( 1.5f );
|
setHardness( 1.5f );
|
||||||
setUnlocalizedName( "computercraft:wired_modem_full" );
|
setTranslationKey( "computercraft:wired_modem_full" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
setDefaultState( blockState.getBaseState()
|
setDefaultState( blockState.getBaseState()
|
||||||
.withProperty( Properties.MODEM_ON, false )
|
.withProperty( Properties.MODEM_ON, false )
|
||||||
|
@ -21,7 +21,7 @@ public class ItemAdvancedModem extends ItemPeripheralBase
|
|||||||
public ItemAdvancedModem( Block block )
|
public ItemAdvancedModem( Block block )
|
||||||
{
|
{
|
||||||
super( block );
|
super( block );
|
||||||
setUnlocalizedName( "computercraft:advanced_modem" );
|
setTranslationKey( "computercraft:advanced_modem" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ public class ItemCable extends ItemPeripheralBase
|
|||||||
public ItemCable( Block block )
|
public ItemCable( Block block )
|
||||||
{
|
{
|
||||||
super( block );
|
super( block );
|
||||||
setUnlocalizedName( "computercraft:cable" );
|
setTranslationKey( "computercraft:cable" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ public class ItemPeripheral extends ItemPeripheralBase
|
|||||||
public ItemPeripheral( Block block )
|
public ItemPeripheral( Block block )
|
||||||
{
|
{
|
||||||
super( block );
|
super( block );
|
||||||
setUnlocalizedName( "computercraft:peripheral" );
|
setTranslationKey( "computercraft:peripheral" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,7 +59,7 @@ public abstract class ItemPeripheralBase extends ItemBlock implements IPeriphera
|
|||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName( @Nonnull ItemStack stack )
|
public String getTranslationKey( @Nonnull ItemStack stack )
|
||||||
{
|
{
|
||||||
PeripheralType type = getPeripheralType( stack );
|
PeripheralType type = getPeripheralType( stack );
|
||||||
switch( type )
|
switch( type )
|
||||||
|
@ -143,7 +143,7 @@ public abstract class TilePeripheralBase extends TileGeneric
|
|||||||
super.readFromNBT(nbttagcompound);
|
super.readFromNBT(nbttagcompound);
|
||||||
if( nbttagcompound.hasKey( "dir" ) )
|
if( nbttagcompound.hasKey( "dir" ) )
|
||||||
{
|
{
|
||||||
m_dir = EnumFacing.getFront( nbttagcompound.getInteger( "dir" ) );
|
m_dir = EnumFacing.byIndex( nbttagcompound.getInteger( "dir" ) );
|
||||||
}
|
}
|
||||||
if( nbttagcompound.hasKey( "anim" ) )
|
if( nbttagcompound.hasKey( "anim" ) )
|
||||||
{
|
{
|
||||||
@ -174,7 +174,7 @@ public abstract class TilePeripheralBase extends TileGeneric
|
|||||||
public void readDescription( @Nonnull NBTTagCompound nbttagcompound )
|
public void readDescription( @Nonnull NBTTagCompound nbttagcompound )
|
||||||
{
|
{
|
||||||
super.readDescription( nbttagcompound );
|
super.readDescription( nbttagcompound );
|
||||||
m_dir = EnumFacing.getFront( nbttagcompound.getInteger( "dir" ) );
|
m_dir = EnumFacing.byIndex( nbttagcompound.getInteger( "dir" ) );
|
||||||
m_anim = nbttagcompound.getInteger( "anim" );
|
m_anim = nbttagcompound.getInteger( "anim" );
|
||||||
if( nbttagcompound.hasKey( "label" ) )
|
if( nbttagcompound.hasKey( "label" ) )
|
||||||
{
|
{
|
||||||
|
@ -605,8 +605,8 @@ public class TileDiskDrive extends TilePeripheralBase
|
|||||||
if( !destroyed )
|
if( !destroyed )
|
||||||
{
|
{
|
||||||
EnumFacing dir = getDirection();
|
EnumFacing dir = getDirection();
|
||||||
xOff = dir.getFrontOffsetX();
|
xOff = dir.getXOffset();
|
||||||
zOff = dir.getFrontOffsetZ();
|
zOff = dir.getZOffset();
|
||||||
}
|
}
|
||||||
|
|
||||||
BlockPos pos = getPos();
|
BlockPos pos = getPos();
|
||||||
|
@ -33,7 +33,7 @@ public class BlockAdvancedModem extends BlockPeripheralBase
|
|||||||
public BlockAdvancedModem()
|
public BlockAdvancedModem()
|
||||||
{
|
{
|
||||||
setHardness( 2.0f );
|
setHardness( 2.0f );
|
||||||
setUnlocalizedName( "computercraft:advanced_modem" );
|
setTranslationKey( "computercraft:advanced_modem" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
setDefaultState( this.blockState.getBaseState()
|
setDefaultState( this.blockState.getBaseState()
|
||||||
.withProperty( Properties.FACING, EnumFacing.NORTH )
|
.withProperty( Properties.FACING, EnumFacing.NORTH )
|
||||||
@ -54,7 +54,7 @@ public class BlockAdvancedModem extends BlockPeripheralBase
|
|||||||
public IBlockState getStateFromMeta( int meta )
|
public IBlockState getStateFromMeta( int meta )
|
||||||
{
|
{
|
||||||
IBlockState state = getDefaultState();
|
IBlockState state = getDefaultState();
|
||||||
state = state.withProperty( Properties.FACING, EnumFacing.getFront( meta ) );
|
state = state.withProperty( Properties.FACING, EnumFacing.byIndex( meta ) );
|
||||||
state = state.withProperty( Properties.ON, false );
|
state = state.withProperty( Properties.ON, false );
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
@ -344,7 +344,7 @@ public class TileMonitor extends TilePeripheralBase
|
|||||||
|
|
||||||
public EnumFacing getFront()
|
public EnumFacing getFront()
|
||||||
{
|
{
|
||||||
return m_dir <= 5 ? EnumFacing.getFront( m_dir ) : (m_dir <= 11 ? EnumFacing.DOWN : EnumFacing.UP);
|
return m_dir <= 5 ? EnumFacing.byIndex( m_dir ) : (m_dir <= 11 ? EnumFacing.DOWN : EnumFacing.UP);
|
||||||
}
|
}
|
||||||
|
|
||||||
public EnumFacing getRight()
|
public EnumFacing getRight()
|
||||||
|
@ -43,7 +43,7 @@ public class ItemPocketComputer extends Item implements IComputerItem, IMedia, I
|
|||||||
{
|
{
|
||||||
setMaxStackSize( 1 );
|
setMaxStackSize( 1 );
|
||||||
setHasSubtypes( true );
|
setHasSubtypes( true );
|
||||||
setUnlocalizedName( "computercraft:pocket_computer" );
|
setTranslationKey( "computercraft:pocket_computer" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,7 +189,7 @@ public class ItemPocketComputer extends Item implements IComputerItem, IMedia, I
|
|||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName( @Nonnull ItemStack stack )
|
public String getTranslationKey( @Nonnull ItemStack stack )
|
||||||
{
|
{
|
||||||
switch( getFamily( stack ) )
|
switch( getFamily( stack ) )
|
||||||
{
|
{
|
||||||
@ -209,7 +209,7 @@ public class ItemPocketComputer extends Item implements IComputerItem, IMedia, I
|
|||||||
@Override
|
@Override
|
||||||
public String getItemStackDisplayName( @Nonnull ItemStack stack )
|
public String getItemStackDisplayName( @Nonnull ItemStack stack )
|
||||||
{
|
{
|
||||||
String baseString = getUnlocalizedName( stack );
|
String baseString = getTranslationKey( stack );
|
||||||
IPocketUpgrade upgrade = getUpgrade( stack );
|
IPocketUpgrade upgrade = getUpgrade( stack );
|
||||||
if( upgrade != null )
|
if( upgrade != null )
|
||||||
{
|
{
|
||||||
|
@ -413,10 +413,10 @@ public abstract class CCTurtleProxyCommon implements ICCTurtleProxy
|
|||||||
// We have to use mappings.getAllMappings() as the mod ID is upper case but the domain lower.
|
// We have to use mappings.getAllMappings() as the mod ID is upper case but the domain lower.
|
||||||
for( RegistryEvent.MissingMappings.Mapping<Item> mapping : mappings.getAllMappings() )
|
for( RegistryEvent.MissingMappings.Mapping<Item> mapping : mappings.getAllMappings() )
|
||||||
{
|
{
|
||||||
String domain = mapping.key.getResourceDomain();
|
String domain = mapping.key.getNamespace();
|
||||||
if( !domain.equalsIgnoreCase( ComputerCraft.MOD_ID ) ) continue;
|
if( !domain.equalsIgnoreCase( ComputerCraft.MOD_ID ) ) continue;
|
||||||
|
|
||||||
String key = mapping.key.getResourcePath();
|
String key = mapping.key.getPath();
|
||||||
if( key.equalsIgnoreCase( "CC-Turtle" ) )
|
if( key.equalsIgnoreCase( "CC-Turtle" ) )
|
||||||
{
|
{
|
||||||
mapping.remap( Item.getItemFromBlock( ComputerCraft.Blocks.turtle ) );
|
mapping.remap( Item.getItemFromBlock( ComputerCraft.Blocks.turtle ) );
|
||||||
@ -438,10 +438,10 @@ public abstract class CCTurtleProxyCommon implements ICCTurtleProxy
|
|||||||
// We have to use mappings.getAllMappings() as the mod ID is upper case but the domain lower.
|
// We have to use mappings.getAllMappings() as the mod ID is upper case but the domain lower.
|
||||||
for( RegistryEvent.MissingMappings.Mapping<Block> mapping : mappings.getAllMappings() )
|
for( RegistryEvent.MissingMappings.Mapping<Block> mapping : mappings.getAllMappings() )
|
||||||
{
|
{
|
||||||
String domain = mapping.key.getResourceDomain();
|
String domain = mapping.key.getNamespace();
|
||||||
if( !domain.equalsIgnoreCase( ComputerCraft.MOD_ID ) ) continue;
|
if( !domain.equalsIgnoreCase( ComputerCraft.MOD_ID ) ) continue;
|
||||||
|
|
||||||
String key = mapping.key.getResourcePath();
|
String key = mapping.key.getPath();
|
||||||
if( key.equalsIgnoreCase( "CC-Turtle" ) )
|
if( key.equalsIgnoreCase( "CC-Turtle" ) )
|
||||||
{
|
{
|
||||||
mapping.remap( ComputerCraft.Blocks.turtle );
|
mapping.remap( ComputerCraft.Blocks.turtle );
|
||||||
|
@ -414,10 +414,10 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy
|
|||||||
// We have to use mappings.getAllMappings() as the mod ID is upper case but the domain lower.
|
// We have to use mappings.getAllMappings() as the mod ID is upper case but the domain lower.
|
||||||
for( RegistryEvent.MissingMappings.Mapping<Item> mapping : mappings.getAllMappings() )
|
for( RegistryEvent.MissingMappings.Mapping<Item> mapping : mappings.getAllMappings() )
|
||||||
{
|
{
|
||||||
String domain = mapping.key.getResourceDomain();
|
String domain = mapping.key.getNamespace();
|
||||||
if( !domain.equalsIgnoreCase( ComputerCraft.MOD_ID ) ) continue;
|
if( !domain.equalsIgnoreCase( ComputerCraft.MOD_ID ) ) continue;
|
||||||
|
|
||||||
String key = mapping.key.getResourcePath();
|
String key = mapping.key.getPath();
|
||||||
if( key.equalsIgnoreCase( "CC-Computer" ) )
|
if( key.equalsIgnoreCase( "CC-Computer" ) )
|
||||||
{
|
{
|
||||||
mapping.remap( Item.getItemFromBlock( ComputerCraft.Blocks.computer ) );
|
mapping.remap( Item.getItemFromBlock( ComputerCraft.Blocks.computer ) );
|
||||||
@ -451,10 +451,10 @@ public abstract class ComputerCraftProxyCommon implements IComputerCraftProxy
|
|||||||
// We have to use mappings.getAllMappings() as the mod ID is upper case but the domain lower.
|
// We have to use mappings.getAllMappings() as the mod ID is upper case but the domain lower.
|
||||||
for( RegistryEvent.MissingMappings.Mapping<Block> mapping : mappings.getAllMappings() )
|
for( RegistryEvent.MissingMappings.Mapping<Block> mapping : mappings.getAllMappings() )
|
||||||
{
|
{
|
||||||
String domain = mapping.key.getResourceDomain();
|
String domain = mapping.key.getNamespace();
|
||||||
if( !domain.equalsIgnoreCase( ComputerCraft.MOD_ID ) ) continue;
|
if( !domain.equalsIgnoreCase( ComputerCraft.MOD_ID ) ) continue;
|
||||||
|
|
||||||
String key = mapping.key.getResourcePath();
|
String key = mapping.key.getPath();
|
||||||
if( key.equalsIgnoreCase( "CC-Computer" ) )
|
if( key.equalsIgnoreCase( "CC-Computer" ) )
|
||||||
{
|
{
|
||||||
mapping.remap( ComputerCraft.Blocks.computer );
|
mapping.remap( ComputerCraft.Blocks.computer );
|
||||||
|
@ -48,7 +48,7 @@ public class BlockTurtle extends BlockComputerBase
|
|||||||
{
|
{
|
||||||
super( Material.IRON );
|
super( Material.IRON );
|
||||||
setHardness( 2.5f );
|
setHardness( 2.5f );
|
||||||
setUnlocalizedName( "computercraft:turtle" );
|
setTranslationKey( "computercraft:turtle" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
setDefaultState( this.blockState.getBaseState()
|
setDefaultState( this.blockState.getBaseState()
|
||||||
.withProperty( Properties.FACING, EnumFacing.NORTH )
|
.withProperty( Properties.FACING, EnumFacing.NORTH )
|
||||||
|
@ -226,7 +226,7 @@ public class TurtleBrain implements ITurtleAccess
|
|||||||
public void readFromNBT( NBTTagCompound nbttagcompound )
|
public void readFromNBT( NBTTagCompound nbttagcompound )
|
||||||
{
|
{
|
||||||
// Read state
|
// Read state
|
||||||
m_direction = EnumFacing.getFront( nbttagcompound.getInteger( "dir" ) );
|
m_direction = EnumFacing.byIndex( nbttagcompound.getInteger( "dir" ) );
|
||||||
m_selectedSlot = nbttagcompound.getInteger( "selectedSlot" );
|
m_selectedSlot = nbttagcompound.getInteger( "selectedSlot" );
|
||||||
if( nbttagcompound.hasKey( "fuelLevel" ) )
|
if( nbttagcompound.hasKey( "fuelLevel" ) )
|
||||||
{
|
{
|
||||||
@ -370,8 +370,8 @@ public class TurtleBrain implements ITurtleAccess
|
|||||||
// Write overlay
|
// Write overlay
|
||||||
if( m_overlay != null )
|
if( m_overlay != null )
|
||||||
{
|
{
|
||||||
nbttagcompound.setString( "overlay_mod", m_overlay.getResourceDomain() );
|
nbttagcompound.setString( "overlay_mod", m_overlay.getNamespace() );
|
||||||
nbttagcompound.setString( "overlay_path", m_overlay.getResourcePath() );
|
nbttagcompound.setString( "overlay_path", m_overlay.getPath() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write NBT
|
// Write NBT
|
||||||
@ -429,8 +429,8 @@ public class TurtleBrain implements ITurtleAccess
|
|||||||
// Overlay
|
// Overlay
|
||||||
if( m_overlay != null )
|
if( m_overlay != null )
|
||||||
{
|
{
|
||||||
nbttagcompound.setString( "overlay_mod", m_overlay.getResourceDomain() );
|
nbttagcompound.setString( "overlay_mod", m_overlay.getNamespace() );
|
||||||
nbttagcompound.setString( "overlay_path", m_overlay.getResourcePath() );
|
nbttagcompound.setString( "overlay_path", m_overlay.getPath() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Animation
|
// Animation
|
||||||
@ -505,7 +505,7 @@ public class TurtleBrain implements ITurtleAccess
|
|||||||
m_lastAnimationProgress = 0;
|
m_lastAnimationProgress = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_direction = EnumFacing.getFront( nbttagcompound.getInteger( "direction" ) );
|
m_direction = EnumFacing.byIndex( nbttagcompound.getInteger( "direction" ) );
|
||||||
m_fuelLevel = nbttagcompound.getInteger( "fuelLevel" );
|
m_fuelLevel = nbttagcompound.getInteger( "fuelLevel" );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -998,9 +998,9 @@ public class TurtleBrain implements ITurtleAccess
|
|||||||
|
|
||||||
double distance = -1.0 + getAnimationFraction( f );
|
double distance = -1.0 + getAnimationFraction( f );
|
||||||
return new Vec3d(
|
return new Vec3d(
|
||||||
distance * dir.getFrontOffsetX(),
|
distance * dir.getXOffset(),
|
||||||
distance * dir.getFrontOffsetY(),
|
distance * dir.getYOffset(),
|
||||||
distance * dir.getFrontOffsetZ()
|
distance * dir.getZOffset()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
@ -1184,31 +1184,31 @@ public class TurtleBrain implements ITurtleAccess
|
|||||||
|
|
||||||
float pushFrac = 1.0f - ((float)(m_animationProgress + 1) / (float)ANIM_DURATION);
|
float pushFrac = 1.0f - ((float)(m_animationProgress + 1) / (float)ANIM_DURATION);
|
||||||
float push = Math.max( pushFrac + 0.0125f, 0.0f );
|
float push = Math.max( pushFrac + 0.0125f, 0.0f );
|
||||||
if (moveDir.getFrontOffsetX() < 0)
|
if (moveDir.getXOffset() < 0)
|
||||||
{
|
{
|
||||||
minX += moveDir.getFrontOffsetX() * push;
|
minX += moveDir.getXOffset() * push;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
maxX -= moveDir.getFrontOffsetX() * push;
|
maxX -= moveDir.getXOffset() * push;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moveDir.getFrontOffsetY() < 0)
|
if (moveDir.getYOffset() < 0)
|
||||||
{
|
{
|
||||||
minY += moveDir.getFrontOffsetY() * push;
|
minY += moveDir.getYOffset() * push;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
maxY -= moveDir.getFrontOffsetY() * push;
|
maxY -= moveDir.getYOffset() * push;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moveDir.getFrontOffsetZ() < 0)
|
if (moveDir.getZOffset() < 0)
|
||||||
{
|
{
|
||||||
minZ += moveDir.getFrontOffsetZ() * push;
|
minZ += moveDir.getZOffset() * push;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
maxZ -= moveDir.getFrontOffsetZ() * push;
|
maxZ -= moveDir.getZOffset() * push;
|
||||||
}
|
}
|
||||||
|
|
||||||
AxisAlignedBB aabb = new AxisAlignedBB( minX, minY, minZ, maxX, maxY, maxZ );
|
AxisAlignedBB aabb = new AxisAlignedBB( minX, minY, minZ, maxX, maxY, maxZ );
|
||||||
@ -1216,9 +1216,9 @@ public class TurtleBrain implements ITurtleAccess
|
|||||||
if( !list.isEmpty() )
|
if( !list.isEmpty() )
|
||||||
{
|
{
|
||||||
double pushStep = 1.0f / ANIM_DURATION;
|
double pushStep = 1.0f / ANIM_DURATION;
|
||||||
double pushStepX = moveDir.getFrontOffsetX() * pushStep;
|
double pushStepX = moveDir.getXOffset() * pushStep;
|
||||||
double pushStepY = moveDir.getFrontOffsetY() * pushStep;
|
double pushStepY = moveDir.getYOffset() * pushStep;
|
||||||
double pushStepZ = moveDir.getFrontOffsetZ() * pushStep;
|
double pushStepZ = moveDir.getZOffset() * pushStep;
|
||||||
for (Entity entity : list)
|
for (Entity entity : list)
|
||||||
{
|
{
|
||||||
entity.move( MoverType.PISTON, pushStepX, pushStepY, pushStepZ );
|
entity.move( MoverType.PISTON, pushStepX, pushStepY, pushStepZ );
|
||||||
|
@ -126,7 +126,7 @@ public class TurtleCompareCommand implements ITurtleCommand
|
|||||||
{
|
{
|
||||||
return TurtleCommandResult.success();
|
return TurtleCommandResult.success();
|
||||||
}
|
}
|
||||||
else if( selectedStack.getUnlocalizedName().equals( lookAtStack.getUnlocalizedName() ) )
|
else if( selectedStack.getTranslationKey().equals( lookAtStack.getTranslationKey() ) )
|
||||||
{
|
{
|
||||||
return TurtleCommandResult.success();
|
return TurtleCommandResult.success();
|
||||||
}
|
}
|
||||||
|
@ -87,9 +87,9 @@ public class TurtleMoveCommand implements ITurtleCommand
|
|||||||
if( entityBB != null )
|
if( entityBB != null )
|
||||||
{
|
{
|
||||||
AxisAlignedBB pushedBB = entityBB.offset(
|
AxisAlignedBB pushedBB = entityBB.offset(
|
||||||
direction.getFrontOffsetX(),
|
direction.getXOffset(),
|
||||||
direction.getFrontOffsetY(),
|
direction.getYOffset(),
|
||||||
direction.getFrontOffsetZ()
|
direction.getZOffset()
|
||||||
);
|
);
|
||||||
if( !oldWorld.getCollisionBoxes( null, pushedBB ).isEmpty() )
|
if( !oldWorld.getCollisionBoxes( null, pushedBB ).isEmpty() )
|
||||||
{
|
{
|
||||||
|
@ -194,9 +194,9 @@ public class TurtlePlaceCommand implements ITurtleCommand
|
|||||||
// Stop intersection with the turtle itself
|
// Stop intersection with the turtle itself
|
||||||
if( turtle.getPosition().equals( position ) )
|
if( turtle.getPosition().equals( position ) )
|
||||||
{
|
{
|
||||||
turtlePlayer.posX += 0.48 * direction.getFrontOffsetX();
|
turtlePlayer.posX += 0.48 * direction.getXOffset();
|
||||||
turtlePlayer.posY += 0.48 * direction.getFrontOffsetY();
|
turtlePlayer.posY += 0.48 * direction.getYOffset();
|
||||||
turtlePlayer.posZ += 0.48 * direction.getFrontOffsetZ();
|
turtlePlayer.posZ += 0.48 * direction.getZOffset();
|
||||||
}
|
}
|
||||||
|
|
||||||
if( direction.getAxis() != EnumFacing.Axis.Y )
|
if( direction.getAxis() != EnumFacing.Axis.Y )
|
||||||
@ -367,9 +367,9 @@ public class TurtlePlaceCommand implements ITurtleCommand
|
|||||||
orientPlayer( turtle, turtlePlayer, playerPosition, playerDir );
|
orientPlayer( turtle, turtlePlayer, playerPosition, playerDir );
|
||||||
|
|
||||||
// Calculate where the turtle would hit the block
|
// Calculate where the turtle would hit the block
|
||||||
float hitX = 0.5f + side.getFrontOffsetX() * 0.5f;
|
float hitX = 0.5f + side.getXOffset() * 0.5f;
|
||||||
float hitY = 0.5f + side.getFrontOffsetY() * 0.5f;
|
float hitY = 0.5f + side.getYOffset() * 0.5f;
|
||||||
float hitZ = 0.5f + side.getFrontOffsetZ() * 0.5f;
|
float hitZ = 0.5f + side.getZOffset() * 0.5f;
|
||||||
if( Math.abs( hitY - 0.5f ) < 0.01f )
|
if( Math.abs( hitY - 0.5f ) < 0.01f )
|
||||||
{
|
{
|
||||||
hitY = 0.45f;
|
hitY = 0.45f;
|
||||||
|
@ -15,7 +15,7 @@ public class ItemTurtleAdvanced extends ItemTurtleNormal
|
|||||||
public ItemTurtleAdvanced( Block block )
|
public ItemTurtleAdvanced( Block block )
|
||||||
{
|
{
|
||||||
super( block );
|
super( block );
|
||||||
setUnlocalizedName( "computercraft:advanced_turtle" );
|
setTranslationKey( "computercraft:advanced_turtle" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ public abstract class ItemTurtleBase extends ItemComputerBase implements ITurtle
|
|||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public String getUnlocalizedName( @Nonnull ItemStack stack )
|
public String getTranslationKey( @Nonnull ItemStack stack )
|
||||||
{
|
{
|
||||||
ComputerFamily family = getFamily( stack );
|
ComputerFamily family = getFamily( stack );
|
||||||
switch( family )
|
switch( family )
|
||||||
@ -139,7 +139,7 @@ public abstract class ItemTurtleBase extends ItemComputerBase implements ITurtle
|
|||||||
@Override
|
@Override
|
||||||
public String getItemStackDisplayName( @Nonnull ItemStack stack )
|
public String getItemStackDisplayName( @Nonnull ItemStack stack )
|
||||||
{
|
{
|
||||||
String baseString = getUnlocalizedName( stack );
|
String baseString = getTranslationKey( stack );
|
||||||
ITurtleUpgrade left = getUpgrade( stack, TurtleSide.Left );
|
ITurtleUpgrade left = getUpgrade( stack, TurtleSide.Left );
|
||||||
ITurtleUpgrade right = getUpgrade( stack, TurtleSide.Right );
|
ITurtleUpgrade right = getUpgrade( stack, TurtleSide.Right );
|
||||||
if( left != null && right != null )
|
if( left != null && right != null )
|
||||||
|
@ -23,7 +23,7 @@ public class ItemTurtleLegacy extends ItemTurtleBase
|
|||||||
public ItemTurtleLegacy( Block block )
|
public ItemTurtleLegacy( Block block )
|
||||||
{
|
{
|
||||||
super( block );
|
super( block );
|
||||||
setUnlocalizedName( "computercraft:turtle" );
|
setTranslationKey( "computercraft:turtle" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ public class ItemTurtleNormal extends ItemTurtleBase
|
|||||||
public ItemTurtleNormal( Block block )
|
public ItemTurtleNormal( Block block )
|
||||||
{
|
{
|
||||||
super( block );
|
super( block );
|
||||||
setUnlocalizedName( "computercraft:turtle" );
|
setTranslationKey( "computercraft:turtle" );
|
||||||
setCreativeTab( ComputerCraft.mainCreativeTab );
|
setCreativeTab( ComputerCraft.mainCreativeTab );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,8 +72,8 @@ public class ItemTurtleNormal extends ItemTurtleBase
|
|||||||
}
|
}
|
||||||
if( overlay != null )
|
if( overlay != null )
|
||||||
{
|
{
|
||||||
nbt.setString( "overlay_mod", overlay.getResourceDomain() );
|
nbt.setString( "overlay_mod", overlay.getNamespace() );
|
||||||
nbt.setString( "overlay_path", overlay.getResourcePath() );
|
nbt.setString( "overlay_path", overlay.getPath() );
|
||||||
}
|
}
|
||||||
stack.setTagCompound( nbt );
|
stack.setTagCompound( nbt );
|
||||||
|
|
||||||
|
@ -103,7 +103,7 @@ public class TurtleTool implements ITurtleUpgrade
|
|||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly( Side.CLIENT )
|
||||||
public Pair<IBakedModel, Matrix4f> getModel( ITurtleAccess turtle, @Nonnull TurtleSide side )
|
public Pair<IBakedModel, Matrix4f> getModel( ITurtleAccess turtle, @Nonnull TurtleSide side )
|
||||||
{
|
{
|
||||||
float xOffset = (side == TurtleSide.Left) ? -0.40625f : 0.40625f;
|
float xOffset = (side == TurtleSide.Left) ? -0.40625f : 0.40625f;
|
||||||
@ -154,7 +154,7 @@ public class TurtleTool implements ITurtleUpgrade
|
|||||||
{
|
{
|
||||||
return 3.0f;
|
return 3.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
private TurtleCommandResult attack( final ITurtleAccess turtle, EnumFacing direction, TurtleSide side )
|
private TurtleCommandResult attack( final ITurtleAccess turtle, EnumFacing direction, TurtleSide side )
|
||||||
{
|
{
|
||||||
// Create a fake player, and orient it appropriately
|
// Create a fake player, and orient it appropriately
|
||||||
@ -185,9 +185,9 @@ public class TurtleTool implements ITurtleUpgrade
|
|||||||
{
|
{
|
||||||
return TurtleCommandResult.failure( attackEvent.getFailureMessage() );
|
return TurtleCommandResult.failure( attackEvent.getFailureMessage() );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start claiming entity drops
|
// Start claiming entity drops
|
||||||
List<ItemStack> extra = new ArrayList<>( );
|
List<ItemStack> extra = new ArrayList<>();
|
||||||
ComputerCraft.setDropConsumer( hitEntity, turtleDropConsumer( turtle, extra ) );
|
ComputerCraft.setDropConsumer( hitEntity, turtleDropConsumer( turtle, extra ) );
|
||||||
|
|
||||||
// Attack the entity
|
// Attack the entity
|
||||||
@ -232,7 +232,7 @@ public class TurtleTool implements ITurtleUpgrade
|
|||||||
|
|
||||||
return TurtleCommandResult.failure( "Nothing to attack here" );
|
return TurtleCommandResult.failure( "Nothing to attack here" );
|
||||||
}
|
}
|
||||||
|
|
||||||
private TurtleCommandResult dig( ITurtleAccess turtle, EnumFacing direction, TurtleSide side )
|
private TurtleCommandResult dig( ITurtleAccess turtle, EnumFacing direction, TurtleSide side )
|
||||||
{
|
{
|
||||||
// Get ready to dig
|
// Get ready to dig
|
||||||
@ -277,7 +277,7 @@ public class TurtleTool implements ITurtleUpgrade
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Consume the items the block drops
|
// Consume the items the block drops
|
||||||
List<ItemStack> extra = new ArrayList<>( );
|
List<ItemStack> extra = new ArrayList<>();
|
||||||
ComputerCraft.setDropConsumer( world, blockPosition, turtleDropConsumer( turtle, extra ) );
|
ComputerCraft.setDropConsumer( world, blockPosition, turtleDropConsumer( turtle, extra ) );
|
||||||
|
|
||||||
TileEntity tile = world.getTileEntity( blockPosition );
|
TileEntity tile = world.getTileEntity( blockPosition );
|
||||||
@ -291,7 +291,7 @@ public class TurtleTool implements ITurtleUpgrade
|
|||||||
// Destroy the block
|
// Destroy the block
|
||||||
boolean canHarvest = state.getBlock().canHarvestBlock( world, blockPosition, turtlePlayer );
|
boolean canHarvest = state.getBlock().canHarvestBlock( world, blockPosition, turtlePlayer );
|
||||||
boolean canBreak = state.getBlock().removedByPlayer( state, world, blockPosition, turtlePlayer, canHarvest );
|
boolean canBreak = state.getBlock().removedByPlayer( state, world, blockPosition, turtlePlayer, canHarvest );
|
||||||
if( canBreak ) state.getBlock().onBlockDestroyedByPlayer( world, blockPosition, state );
|
if( canBreak ) state.getBlock().onPlayerDestroy( world, blockPosition, state );
|
||||||
if( canHarvest )
|
if( canHarvest )
|
||||||
{
|
{
|
||||||
state.getBlock().harvestBlock( world, turtlePlayer, blockPosition, state, tile, turtlePlayer.getHeldItemMainhand() );
|
state.getBlock().harvestBlock( world, turtlePlayer, blockPosition, state, tile, turtlePlayer.getHeldItemMainhand() );
|
||||||
|
@ -24,7 +24,7 @@ public class CreativeTabMain extends CreativeTabs
|
|||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public ItemStack getTabIconItem()
|
public ItemStack createIcon()
|
||||||
{
|
{
|
||||||
return new ItemStack( ComputerCraft.Blocks.computer );
|
return new ItemStack( ComputerCraft.Blocks.computer );
|
||||||
}
|
}
|
||||||
@ -32,7 +32,7 @@ public class CreativeTabMain extends CreativeTabs
|
|||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public String getTranslatedTabLabel()
|
public String getTranslationKey()
|
||||||
{
|
{
|
||||||
return getTabLabel();
|
return getTabLabel();
|
||||||
}
|
}
|
||||||
|
@ -21,14 +21,14 @@ public class CreativeTabTreasure extends CreativeTabs
|
|||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getTabIconItem()
|
public ItemStack createIcon()
|
||||||
{
|
{
|
||||||
return new ItemStack( ComputerCraft.Items.treasureDisk );
|
return new ItemStack( ComputerCraft.Items.treasureDisk );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Nonnull
|
@Nonnull
|
||||||
@Override
|
@Override
|
||||||
public String getTranslatedTabLabel()
|
public String getTranslationKey()
|
||||||
{
|
{
|
||||||
return getTabLabel();
|
return getTabLabel();
|
||||||
}
|
}
|
||||||
|
@ -73,13 +73,13 @@ public class InventoryUtil
|
|||||||
|
|
||||||
// Look for entity with inventory
|
// Look for entity with inventory
|
||||||
Vec3d vecStart = new Vec3d(
|
Vec3d vecStart = new Vec3d(
|
||||||
pos.getX() + 0.5 + 0.6 * side.getFrontOffsetX(),
|
pos.getX() + 0.5 + 0.6 * side.getXOffset(),
|
||||||
pos.getY() + 0.5 + 0.6 * side.getFrontOffsetY(),
|
pos.getY() + 0.5 + 0.6 * side.getYOffset(),
|
||||||
pos.getZ() + 0.5 + 0.6 * side.getFrontOffsetZ()
|
pos.getZ() + 0.5 + 0.6 * side.getZOffset()
|
||||||
);
|
);
|
||||||
EnumFacing dir = side.getOpposite();
|
EnumFacing dir = side.getOpposite();
|
||||||
Vec3d vecDir = new Vec3d(
|
Vec3d vecDir = new Vec3d(
|
||||||
dir.getFrontOffsetX(), dir.getFrontOffsetY(), dir.getFrontOffsetZ()
|
dir.getXOffset(), dir.getYOffset(), dir.getZOffset()
|
||||||
);
|
);
|
||||||
Pair<Entity, Vec3d> hit = WorldUtil.rayTraceEntities( world, vecStart, vecDir, 1.1 );
|
Pair<Entity, Vec3d> hit = WorldUtil.rayTraceEntities( world, vecStart, vecDir, 1.1 );
|
||||||
if( hit != null )
|
if( hit != null )
|
||||||
|
@ -43,14 +43,14 @@ public class WorldUtil
|
|||||||
|
|
||||||
public static Pair<Entity, Vec3d> rayTraceEntities( World world, Vec3d vecStart, Vec3d vecDir, double distance )
|
public static Pair<Entity, Vec3d> rayTraceEntities( World world, Vec3d vecStart, Vec3d vecDir, double distance )
|
||||||
{
|
{
|
||||||
Vec3d vecEnd = vecStart.addVector( vecDir.x * distance, vecDir.y * distance, vecDir.z * distance );
|
Vec3d vecEnd = vecStart.add( vecDir.x * distance, vecDir.y * distance, vecDir.z * distance );
|
||||||
|
|
||||||
// Raycast for blocks
|
// Raycast for blocks
|
||||||
RayTraceResult result = world.rayTraceBlocks( vecStart.addVector(0.0,0.0,0.0), vecEnd.addVector(0.0,0.0,0.0) );
|
RayTraceResult result = world.rayTraceBlocks( vecStart, vecEnd );
|
||||||
if( result != null && result.typeOfHit == RayTraceResult.Type.BLOCK )
|
if( result != null && result.typeOfHit == RayTraceResult.Type.BLOCK )
|
||||||
{
|
{
|
||||||
distance = vecStart.distanceTo( result.hitVec );
|
distance = vecStart.distanceTo( result.hitVec );
|
||||||
vecEnd = vecStart.addVector( vecDir.x * distance, vecDir.y * distance, vecDir.z * distance );
|
vecEnd = vecStart.add( vecDir.x * distance, vecDir.y * distance, vecDir.z * distance );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for entities
|
// Check for entities
|
||||||
@ -114,7 +114,7 @@ public class WorldUtil
|
|||||||
}
|
}
|
||||||
if( closest != null && closestDist <= distance )
|
if( closest != null && closestDist <= distance )
|
||||||
{
|
{
|
||||||
Vec3d closestPos = vecStart.addVector( vecDir.x * closestDist, vecDir.y * closestDist, vecDir.z * closestDist );
|
Vec3d closestPos = vecStart.add( vecDir.x * closestDist, vecDir.y * closestDist, vecDir.z * closestDist );
|
||||||
return Pair.of( closest, closestPos );
|
return Pair.of( closest, closestPos );
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
@ -128,7 +128,7 @@ public class WorldUtil
|
|||||||
public static Vec3d getRayEnd( EntityPlayer player) {
|
public static Vec3d getRayEnd( EntityPlayer player) {
|
||||||
double reach = player.getEntityAttribute(EntityPlayer.REACH_DISTANCE).getAttributeValue();
|
double reach = player.getEntityAttribute(EntityPlayer.REACH_DISTANCE).getAttributeValue();
|
||||||
Vec3d look = player.getLookVec();
|
Vec3d look = player.getLookVec();
|
||||||
return getRayStart( player ).addVector( look.x * reach, look.y * reach, look.z * reach );
|
return getRayStart( player ).add( look.x * reach, look.y * reach, look.z * reach );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isVecInsideInclusive(AxisAlignedBB bb , Vec3d vec) {
|
public static boolean isVecInsideInclusive(AxisAlignedBB bb , Vec3d vec) {
|
||||||
@ -147,9 +147,9 @@ public class WorldUtil
|
|||||||
double zDir;
|
double zDir;
|
||||||
if( direction != null )
|
if( direction != null )
|
||||||
{
|
{
|
||||||
xDir = direction.getFrontOffsetX();
|
xDir = direction.getXOffset();
|
||||||
yDir = direction.getFrontOffsetY();
|
yDir = direction.getYOffset();
|
||||||
zDir = direction.getFrontOffsetZ();
|
zDir = direction.getZOffset();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user