1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-11-17 05:37:12 +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:
SquidDev
2018-07-24 09:27:05 +01:00
parent 3ac8dde779
commit b8957cab5c
37 changed files with 107 additions and 107 deletions

View File

@@ -48,7 +48,7 @@ public class BlockTurtle extends BlockComputerBase
{
super( Material.IRON );
setHardness( 2.5f );
setUnlocalizedName( "computercraft:turtle" );
setTranslationKey( "computercraft:turtle" );
setCreativeTab( ComputerCraft.mainCreativeTab );
setDefaultState( this.blockState.getBaseState()
.withProperty( Properties.FACING, EnumFacing.NORTH )

View File

@@ -226,7 +226,7 @@ public class TurtleBrain implements ITurtleAccess
public void readFromNBT( NBTTagCompound nbttagcompound )
{
// Read state
m_direction = EnumFacing.getFront( nbttagcompound.getInteger( "dir" ) );
m_direction = EnumFacing.byIndex( nbttagcompound.getInteger( "dir" ) );
m_selectedSlot = nbttagcompound.getInteger( "selectedSlot" );
if( nbttagcompound.hasKey( "fuelLevel" ) )
{
@@ -370,8 +370,8 @@ public class TurtleBrain implements ITurtleAccess
// Write overlay
if( m_overlay != null )
{
nbttagcompound.setString( "overlay_mod", m_overlay.getResourceDomain() );
nbttagcompound.setString( "overlay_path", m_overlay.getResourcePath() );
nbttagcompound.setString( "overlay_mod", m_overlay.getNamespace() );
nbttagcompound.setString( "overlay_path", m_overlay.getPath() );
}
// Write NBT
@@ -429,8 +429,8 @@ public class TurtleBrain implements ITurtleAccess
// Overlay
if( m_overlay != null )
{
nbttagcompound.setString( "overlay_mod", m_overlay.getResourceDomain() );
nbttagcompound.setString( "overlay_path", m_overlay.getResourcePath() );
nbttagcompound.setString( "overlay_mod", m_overlay.getNamespace() );
nbttagcompound.setString( "overlay_path", m_overlay.getPath() );
}
// Animation
@@ -505,7 +505,7 @@ public class TurtleBrain implements ITurtleAccess
m_lastAnimationProgress = 0;
}
m_direction = EnumFacing.getFront( nbttagcompound.getInteger( "direction" ) );
m_direction = EnumFacing.byIndex( nbttagcompound.getInteger( "direction" ) );
m_fuelLevel = nbttagcompound.getInteger( "fuelLevel" );
}
@@ -998,9 +998,9 @@ public class TurtleBrain implements ITurtleAccess
double distance = -1.0 + getAnimationFraction( f );
return new Vec3d(
distance * dir.getFrontOffsetX(),
distance * dir.getFrontOffsetY(),
distance * dir.getFrontOffsetZ()
distance * dir.getXOffset(),
distance * dir.getYOffset(),
distance * dir.getZOffset()
);
}
default:
@@ -1184,31 +1184,31 @@ public class TurtleBrain implements ITurtleAccess
float pushFrac = 1.0f - ((float)(m_animationProgress + 1) / (float)ANIM_DURATION);
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
{
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
{
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
{
maxZ -= moveDir.getFrontOffsetZ() * push;
maxZ -= moveDir.getZOffset() * push;
}
AxisAlignedBB aabb = new AxisAlignedBB( minX, minY, minZ, maxX, maxY, maxZ );
@@ -1216,9 +1216,9 @@ public class TurtleBrain implements ITurtleAccess
if( !list.isEmpty() )
{
double pushStep = 1.0f / ANIM_DURATION;
double pushStepX = moveDir.getFrontOffsetX() * pushStep;
double pushStepY = moveDir.getFrontOffsetY() * pushStep;
double pushStepZ = moveDir.getFrontOffsetZ() * pushStep;
double pushStepX = moveDir.getXOffset() * pushStep;
double pushStepY = moveDir.getYOffset() * pushStep;
double pushStepZ = moveDir.getZOffset() * pushStep;
for (Entity entity : list)
{
entity.move( MoverType.PISTON, pushStepX, pushStepY, pushStepZ );

View File

@@ -126,7 +126,7 @@ public class TurtleCompareCommand implements ITurtleCommand
{
return TurtleCommandResult.success();
}
else if( selectedStack.getUnlocalizedName().equals( lookAtStack.getUnlocalizedName() ) )
else if( selectedStack.getTranslationKey().equals( lookAtStack.getTranslationKey() ) )
{
return TurtleCommandResult.success();
}

View File

@@ -87,9 +87,9 @@ public class TurtleMoveCommand implements ITurtleCommand
if( entityBB != null )
{
AxisAlignedBB pushedBB = entityBB.offset(
direction.getFrontOffsetX(),
direction.getFrontOffsetY(),
direction.getFrontOffsetZ()
direction.getXOffset(),
direction.getYOffset(),
direction.getZOffset()
);
if( !oldWorld.getCollisionBoxes( null, pushedBB ).isEmpty() )
{

View File

@@ -194,9 +194,9 @@ public class TurtlePlaceCommand implements ITurtleCommand
// Stop intersection with the turtle itself
if( turtle.getPosition().equals( position ) )
{
turtlePlayer.posX += 0.48 * direction.getFrontOffsetX();
turtlePlayer.posY += 0.48 * direction.getFrontOffsetY();
turtlePlayer.posZ += 0.48 * direction.getFrontOffsetZ();
turtlePlayer.posX += 0.48 * direction.getXOffset();
turtlePlayer.posY += 0.48 * direction.getYOffset();
turtlePlayer.posZ += 0.48 * direction.getZOffset();
}
if( direction.getAxis() != EnumFacing.Axis.Y )
@@ -367,9 +367,9 @@ public class TurtlePlaceCommand implements ITurtleCommand
orientPlayer( turtle, turtlePlayer, playerPosition, playerDir );
// Calculate where the turtle would hit the block
float hitX = 0.5f + side.getFrontOffsetX() * 0.5f;
float hitY = 0.5f + side.getFrontOffsetY() * 0.5f;
float hitZ = 0.5f + side.getFrontOffsetZ() * 0.5f;
float hitX = 0.5f + side.getXOffset() * 0.5f;
float hitY = 0.5f + side.getYOffset() * 0.5f;
float hitZ = 0.5f + side.getZOffset() * 0.5f;
if( Math.abs( hitY - 0.5f ) < 0.01f )
{
hitY = 0.45f;

View File

@@ -15,7 +15,7 @@ public class ItemTurtleAdvanced extends ItemTurtleNormal
public ItemTurtleAdvanced( Block block )
{
super( block );
setUnlocalizedName( "computercraft:advanced_turtle" );
setTranslationKey( "computercraft:advanced_turtle" );
setCreativeTab( ComputerCraft.mainCreativeTab );
}

View File

@@ -114,7 +114,7 @@ public abstract class ItemTurtleBase extends ItemComputerBase implements ITurtle
@Nonnull
@Override
public String getUnlocalizedName( @Nonnull ItemStack stack )
public String getTranslationKey( @Nonnull ItemStack stack )
{
ComputerFamily family = getFamily( stack );
switch( family )
@@ -139,7 +139,7 @@ public abstract class ItemTurtleBase extends ItemComputerBase implements ITurtle
@Override
public String getItemStackDisplayName( @Nonnull ItemStack stack )
{
String baseString = getUnlocalizedName( stack );
String baseString = getTranslationKey( stack );
ITurtleUpgrade left = getUpgrade( stack, TurtleSide.Left );
ITurtleUpgrade right = getUpgrade( stack, TurtleSide.Right );
if( left != null && right != null )

View File

@@ -23,7 +23,7 @@ public class ItemTurtleLegacy extends ItemTurtleBase
public ItemTurtleLegacy( Block block )
{
super( block );
setUnlocalizedName( "computercraft:turtle" );
setTranslationKey( "computercraft:turtle" );
setCreativeTab( ComputerCraft.mainCreativeTab );
}

View File

@@ -24,7 +24,7 @@ public class ItemTurtleNormal extends ItemTurtleBase
public ItemTurtleNormal( Block block )
{
super( block );
setUnlocalizedName( "computercraft:turtle" );
setTranslationKey( "computercraft:turtle" );
setCreativeTab( ComputerCraft.mainCreativeTab );
}
@@ -72,8 +72,8 @@ public class ItemTurtleNormal extends ItemTurtleBase
}
if( overlay != null )
{
nbt.setString( "overlay_mod", overlay.getResourceDomain() );
nbt.setString( "overlay_path", overlay.getResourcePath() );
nbt.setString( "overlay_mod", overlay.getNamespace() );
nbt.setString( "overlay_path", overlay.getPath() );
}
stack.setTagCompound( nbt );

View File

@@ -103,7 +103,7 @@ public class TurtleTool implements ITurtleUpgrade
@Nonnull
@Override
@SideOnly(Side.CLIENT)
@SideOnly( Side.CLIENT )
public Pair<IBakedModel, Matrix4f> getModel( ITurtleAccess turtle, @Nonnull TurtleSide side )
{
float xOffset = (side == TurtleSide.Left) ? -0.40625f : 0.40625f;
@@ -154,7 +154,7 @@ public class TurtleTool implements ITurtleUpgrade
{
return 3.0f;
}
private TurtleCommandResult attack( final ITurtleAccess turtle, EnumFacing direction, TurtleSide side )
{
// Create a fake player, and orient it appropriately
@@ -185,9 +185,9 @@ public class TurtleTool implements ITurtleUpgrade
{
return TurtleCommandResult.failure( attackEvent.getFailureMessage() );
}
// Start claiming entity drops
List<ItemStack> extra = new ArrayList<>( );
List<ItemStack> extra = new ArrayList<>();
ComputerCraft.setDropConsumer( hitEntity, turtleDropConsumer( turtle, extra ) );
// Attack the entity
@@ -232,7 +232,7 @@ public class TurtleTool implements ITurtleUpgrade
return TurtleCommandResult.failure( "Nothing to attack here" );
}
private TurtleCommandResult dig( ITurtleAccess turtle, EnumFacing direction, TurtleSide side )
{
// Get ready to dig
@@ -277,7 +277,7 @@ public class TurtleTool implements ITurtleUpgrade
}
// Consume the items the block drops
List<ItemStack> extra = new ArrayList<>( );
List<ItemStack> extra = new ArrayList<>();
ComputerCraft.setDropConsumer( world, blockPosition, turtleDropConsumer( turtle, extra ) );
TileEntity tile = world.getTileEntity( blockPosition );
@@ -291,7 +291,7 @@ public class TurtleTool implements ITurtleUpgrade
// Destroy the block
boolean canHarvest = state.getBlock().canHarvestBlock( world, blockPosition, turtlePlayer );
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 )
{
state.getBlock().harvestBlock( world, turtlePlayer, blockPosition, state, tile, turtlePlayer.getHeldItemMainhand() );