Skip to content

Commit

Permalink
Fix previous PR
Browse files Browse the repository at this point in the history
  • Loading branch information
jaquadro committed Jan 25, 2021
1 parent 655e795 commit 1294050
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ minecraft_version=1.16.3
forge_version=34.1.22
forge_mappings=20200916-1.16.2
loader_version=34
mod_version=8.2.0
mod_version=8.2.2

# Mod dependency versions
jei_version=7.3.2.36
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,11 @@ public void onBlockPlacedBy (World world, BlockPos pos, BlockState state, Living

@Override
public boolean isReplaceable (BlockState state, BlockItemUseContext useContext) {
if (useContext.getPlayer() && useContext.getPlayer().isCreative() && useContext.getHand() == Hand.OFF_HAND) {
PlayerEntity player = useContext.getPlayer();
if (player == null)
return super.isReplaceable(state, useContext);

if (useContext.getPlayer().isCreative() && useContext.getHand() == Hand.OFF_HAND) {
double blockReachDistance = useContext.getPlayer().getAttribute(net.minecraftforge.common.ForgeMod.REACH_DISTANCE.get()).getValue() + 1;
BlockRayTraceResult result = rayTraceEyes(useContext.getWorld(), useContext.getPlayer(), blockReachDistance);

Expand Down

0 comments on commit 1294050

Please sign in to comment.