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 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; protected final ItemStack item;
public TurtleTool( ResourceLocation id, String adjective, Item item ) public TurtleTool( ResourceLocation id, String adjective, Item item )
@ -94,7 +91,7 @@ public class TurtleTool extends AbstractTurtleUpgrade
@OnlyIn( Dist.CLIENT ) @OnlyIn( Dist.CLIENT )
public TransformedModel getModel( ITurtleAccess turtle, @Nonnull TurtleSide side ) 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 @Nonnull
@ -290,13 +287,19 @@ public class TurtleTool extends AbstractTurtleUpgrade
DropConsumer.clearAndDrop( turtle.getWorld(), turtle.getPosition(), direction ); DropConsumer.clearAndDrop( turtle.getWorld(), turtle.getPosition(), direction );
} }
private static TransformationMatrix getMatrixFor( float offset ) private static class Transforms
{ {
return new TransformationMatrix( new Matrix4f( new float[] { static final TransformationMatrix leftTransform = getMatrixFor( -0.40625f );
0.0f, 0.0f, -1.0f, 1.0f + offset, static final TransformationMatrix rightTransform = getMatrixFor( 0.40625f );
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, -1.0f, 0.0f, 1.0f, private static TransformationMatrix getMatrixFor( float offset )
0.0f, 0.0f, 0.0f, 1.0f, {
} ) ); return new TransformationMatrix( new Matrix4f( new float[] {
0.0f, 0.0f, -1.0f, 1.0f + offset,
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, -1.0f, 0.0f, 1.0f,
0.0f, 0.0f, 0.0f, 1.0f,
} ) );
}
} }
} }