-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Holopad-focused code cleanup #623
Conversation
…aration for HolopadBlock.COLLISION_SHAPE
…ed rather than has an item
# Conflicts: # src/main/java/com/mraof/minestuck/block/machine/MachineBlock.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minestuck/src/main/java/com/mraof/minestuck/client/renderer/blockentity/HolopadRenderer.java
Line 29 in 731f9f0
poseStack.mulPose(Axis.YP.rotation((f / 20.0F * 57.295776F) / 75)); |
57.295776F
is representative of 180/pi, or Mth.RAD_TO_DEG
. Considering Axis.rotation
is handled in radians this value doesn't exactly make sense, perhaps we could optimize or make the code more legible by going with a different value?
https://github.com/lunar-sway/minestuck/blob/main/src/main/java/com/mraof/minestuck/block/CustomVoxelShape.java
CustomVoxelShape
is only used to create easily rotatable Collision and Interaction shapes, perhaps it could be refactored to RotatableVoxelShape
to better represent its purpose.
https://github.com/lunar-sway/minestuck/blob/main/src/main/resources/assets/minestuck/models/block/holopad_has_card.json
The Holopad's card-containing model currently has a Solid Render Type rather than Cutout, Making the Captchalogue card present in the model have a stray white pixel, we could either update its Render Type or change the model to separate the card's cubes into two.
protected static final AABB HOLOPAD_TOP_AABB = new AABB(3/16F, 6/16F, 2.6/16F, 13/16F, 7/16F, 12.6/16F); | ||
protected static final AABB HOLOPAD_CARDSLOT_AABB = new AABB(4/16F, 0F, 13.8/16F, 12/16F, 10.1/16F, 15.94/16F); | ||
public static final Map<Direction, VoxelShape> SHAPE = new CustomVoxelShape(new double[]{2, 0, 1, 14, 6, 13}).createRotatedShapes(); | ||
public static final Map<Direction, VoxelShape> COLLISION_SHAPE = new CustomVoxelShape(new double[]{4, 0, 14, 12, 10, 16}, new double[]{3, 6, 3, 13, 7, 13}).createRotatedShapes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Collision Shape doesn't include the main Interaction Shape cube, meaning that you can clip through the Holopad from below.
//todo these are unused? | ||
protected static final AABB HOLOPAD_TOP_AABB = new AABB(3/16F, 6/16F, 2.6/16F, 13/16F, 7/16F, 12.6/16F); | ||
protected static final AABB HOLOPAD_CARDSLOT_AABB = new AABB(4/16F, 0F, 13.8/16F, 12/16F, 10.1/16F, 15.94/16F); | ||
public static final Map<Direction, VoxelShape> SHAPE = new CustomVoxelShape(new double[]{2, 0, 1, 14, 6, 13}).createRotatedShapes(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the Holopad's Interaction Shape should match that of its Collision. Or at the very least add a box for the back part where the Captchalogue Card is supposed to be inserted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've combined the two, and also made small further adjustments.
# Conflicts: # src/main/java/com/mraof/minestuck/entity/MSEntityTypes.java
Messing around with |
Removes the unused hologram entity (the current version of the holopad functions through its block entity renderer) and some code associated with it, and performs some general code cleanup on both the block and block entity.
I also changed the holopad to display a generic object instead of the contained item when the card isn't punched, instead of just when the card is empty. This is to make the holopad behave as if it was specifically reading the item off of the punched holes of the card. Not sure whether to add this to the changelog or not.