1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-11-17 15:24:52 +00:00

Fix depending on a client-only class

I checked matrix but not transformationmatrix >_>.
This commit is contained in:
Jonathan Coates 2021-08-08 12:38:06 +01:00
parent 39f3cf8cbe
commit 62172c6049
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06

View File

@ -48,9 +48,6 @@ import java.util.function.Function;
public class TurtleTool extends AbstractTurtleUpgrade
{
private static final TransformationMatrix leftTransform = getMatrixFor( -0.40625f );
private static final TransformationMatrix rightTransform = getMatrixFor( 0.40625f );
protected final ItemStack item;
public TurtleTool( ResourceLocation id, String adjective, Item item )
@ -94,7 +91,7 @@ public class TurtleTool extends AbstractTurtleUpgrade
@OnlyIn( Dist.CLIENT )
public TransformedModel getModel( ITurtleAccess turtle, @Nonnull TurtleSide side )
{
return TransformedModel.of( getCraftingItem(), side == TurtleSide.LEFT ? leftTransform : rightTransform );
return TransformedModel.of( getCraftingItem(), side == TurtleSide.LEFT ? Transforms.leftTransform : Transforms.rightTransform );
}
@Nonnull
@ -290,6 +287,11 @@ public class TurtleTool extends AbstractTurtleUpgrade
DropConsumer.clearAndDrop( turtle.getWorld(), turtle.getPosition(), direction );
}
private static class Transforms
{
static final TransformationMatrix leftTransform = getMatrixFor( -0.40625f );
static final TransformationMatrix rightTransform = getMatrixFor( 0.40625f );
private static TransformationMatrix getMatrixFor( float offset )
{
return new TransformationMatrix( new Matrix4f( new float[] {
@ -300,3 +302,4 @@ public class TurtleTool extends AbstractTurtleUpgrade
} ) );
}
}
}