Skip to content
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

Merged
merged 12 commits into from
Sep 26, 2024
Merged

Holopad-focused code cleanup #623

merged 12 commits into from
Sep 26, 2024

Conversation

kirderf1
Copy link
Member

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.

@kirderf1 kirderf1 added the cleanup Patching up existing code label May 10, 2024
@kirderf1 kirderf1 requested a review from Dweblenod July 3, 2024 09:18
# Conflicts:
#	src/main/java/com/mraof/minestuck/block/machine/MachineBlock.java
Copy link
Contributor

@Cibernet83 Cibernet83 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();
Copy link
Contributor

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();
Copy link
Contributor

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.

Copy link
Member Author

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.

@kirderf1
Copy link
Member Author

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.

Messing around with CustomVoxelShape is a bit out of scope for this, and I would also rather not increase the scope of this PR at this time.

@kirderf1 kirderf1 merged commit 3ea2d2e into main Sep 26, 2024
3 checks passed
@kirderf1 kirderf1 deleted the holopad-cleanup branch September 26, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Patching up existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants