-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve placement behaviour of custom blocks
- Loading branch information
Showing
3 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
...ecraft-patches/sources/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
--- a/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java | ||
+++ b/net/minecraft/world/level/block/BaseCoralPlantTypeBlock.java | ||
@@ -33,12 +_,14 @@ | ||
protected abstract MapCodec<? extends BaseCoralPlantTypeBlock> codec(); | ||
|
||
protected void tryScheduleDieTick(BlockState state, BlockGetter level, ScheduledTickAccess scheduledTickAccess, RandomSource random, BlockPos pos) { | ||
+ if (true) return; // Papyrus - Disable coral plant death | ||
if (!scanForWater(state, level, pos)) { | ||
scheduledTickAccess.scheduleTick(pos, this, 60 + random.nextInt(40)); | ||
} | ||
} | ||
|
||
protected static boolean scanForWater(BlockState state, BlockGetter level, BlockPos pos) { | ||
+ if (true) return true; // Papyrus - Disable coral plant death | ||
if (state.getValue(WATERLOGGED)) { | ||
return true; | ||
} else { | ||
@@ -75,6 +_,7 @@ | ||
BlockState neighborState, | ||
RandomSource random | ||
) { | ||
+ if (true) return state; // Papyrus - Disable coral plant death | ||
if (state.getValue(WATERLOGGED)) { | ||
scheduledTickAccess.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level)); | ||
} | ||
@@ -86,6 +_,7 @@ | ||
|
||
@Override | ||
protected boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) { | ||
+ if (true) return true; // Papyrus - Disable state change | ||
BlockPos blockPos = pos.below(); | ||
return level.getBlockState(blockPos).isFaceSturdy(level, blockPos, Direction.UP); | ||
} |
18 changes: 18 additions & 0 deletions
18
...inecraft-patches/sources/net/minecraft/world/level/block/BaseCoralWallFanBlock.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- a/net/minecraft/world/level/block/BaseCoralWallFanBlock.java | ||
+++ b/net/minecraft/world/level/block/BaseCoralWallFanBlock.java | ||
@@ -77,6 +_,7 @@ | ||
BlockState neighborState, | ||
RandomSource random | ||
) { | ||
+ if (true) return state; // Papyrus - Disable state change | ||
if (state.getValue(WATERLOGGED)) { | ||
scheduledTickAccess.scheduleTick(pos, Fluids.WATER, Fluids.WATER.getTickDelay(level)); | ||
} | ||
@@ -86,6 +_,7 @@ | ||
|
||
@Override | ||
protected boolean canSurvive(BlockState state, LevelReader level, BlockPos pos) { | ||
+ if (true) return true; // Papyrus - Disable state change | ||
Direction direction = state.getValue(FACING); | ||
BlockPos blockPos = pos.relative(direction.getOpposite()); | ||
BlockState blockState = level.getBlockState(blockPos); |
41 changes: 41 additions & 0 deletions
41
...ver/minecraft-patches/sources/net/minecraft/world/level/block/ChorusPlantBlock.java.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters