fix: falling block entities calling can replace crashing logic side #15

Merged
Adrien1106 merged 1 commits from dev into master 2024-05-23 00:47:20 +02:00
7 changed files with 7 additions and 1 deletions
Showing only changes of commit 15a8f80210 - Show all commits

View File

@ -9,7 +9,7 @@ loader_version=0.15.11
# Mod Properties
modrinth_id = jCpoCBpn
mod_version = 1.5.9
mod_version = 1.5.10
maven_group = fr.adrien1106
archives_base_name = ReFramed
mod_id = reframed

View File

@ -43,6 +43,7 @@ public class ReFramedHalfStairBlock extends WaterloggableReFramedBlock {
@Override
public boolean canReplace(BlockState state, ItemPlacementContext context) {
if (context.getPlayer() == null) return false;
Direction dir = state.get(CORNER).getDirection(state.get(CORNER_FACE));
return !(
context.getPlayer().isSneaking()

View File

@ -39,6 +39,7 @@ public class ReFramedLayerBlock extends ReFramedSlabBlock {
@Override
public boolean canReplace(BlockState state, ItemPlacementContext context) {
if (context.getPlayer() == null) return false;
return !(
context.getPlayer().isSneaking()
|| !(context.getStack().getItem() instanceof BlockItem block_item)

View File

@ -42,6 +42,7 @@ public class ReFramedSlabBlock extends WaterloggableReFramedBlock {
@Override
public boolean canReplace(BlockState state, ItemPlacementContext context) {
if (context.getPlayer() == null) return false;
return !(
context.getPlayer().isSneaking()
|| !(context.getStack().getItem() instanceof BlockItem block_item)

View File

@ -43,6 +43,7 @@ public class ReFramedSmallCubeBlock extends WaterloggableReFramedBlock {
@Override
public boolean canReplace(BlockState state, ItemPlacementContext context) {
if (context.getPlayer() == null) return false;
Corner corner = state.get(CORNER);
return !(
context.getPlayer().isSneaking()

View File

@ -46,6 +46,7 @@ public class ReFramedStairBlock extends WaterloggableReFramedBlock {
@Override
public boolean canReplace(BlockState state, ItemPlacementContext context) {
if (context.getPlayer() == null) return false;
return !(
context.getPlayer().isSneaking()
|| !(context.getStack().getItem() instanceof BlockItem block_item)

View File

@ -43,6 +43,7 @@ public class ReFramedStepBlock extends WaterloggableReFramedBlock {
@Override
public boolean canReplace(BlockState state, ItemPlacementContext context) {
if (context.getPlayer() == null) return false;
Edge edge = state.get(EDGE);
return !(
context.getPlayer().isSneaking()