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

accurate placement protocol V3 support (For Crafter Rotations) #323

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/main/java/carpetextra/CarpetExtraSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ public Integer validate(ServerCommandSource source, CarpetRule<Integer> currentR
)
public static boolean accurateBlockPlacement = false;

@Rule(
categories = {EXTRA, SURVIVAL}
)
public static boolean accurateBlockPlacementLegacy = false;

@Rule(
categories = {EXTRA, EXPERIMENTAL, FEATURE, DISPENSER}
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ public class BlockItemMixin_accurateBlockPlacement
))
private BlockState getAlternatePlacement(Block block, ItemPlacementContext context)
{
if (CarpetExtraSettings.accurateBlockPlacement)
if (CarpetExtraSettings.accurateBlockPlacement || CarpetExtraSettings.accurateBlockPlacementLegacy)
{
BlockState tryAlternative = BlockPlacer.alternativeBlockPlacement(block, context);
BlockState tryAlternative = BlockPlacer.applyAlternativeBlockPlacement(block.getPlacementState(context), BlockPlacer.UseContext.from(context, context.getHand()));
if (tryAlternative != null)
return tryAlternative;
}
return block.getPlacementState(context);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public abstract class ServerPlayNetworkHandlerMixin
require = 0)
private Vec3d carpetextra_removeHitPosCheck(Vec3d hitVec, Vec3d blockCenter)
{
if (CarpetExtraSettings.accurateBlockPlacement)
if (CarpetExtraSettings.accurateBlockPlacement || CarpetExtraSettings.accurateBlockPlacementLegacy)
{
return Vec3d.ZERO;
}
Expand Down
Loading
Loading