mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-20 09:57:43 +01:00
fix repackage
This commit is contained in:
@@ -5,14 +5,14 @@ Subject: [PATCH] Add option to disable certain block updates
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/ChorusPlantBlock.java b/src/main/java/net/minecraft/world/level/block/ChorusPlantBlock.java
|
||||
index 2c29c125edac43cdf13da8eababe60fb7a87df15..8646d36b0a48b0d0cdfeab8e52a567b70aa0eff3 100644
|
||||
index 2c29c125edac43cdf13da8eababe60fb7a87df15..28c84432d0125dad414e623a317f665bdf7f438f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/ChorusPlantBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/ChorusPlantBlock.java
|
||||
@@ -21,6 +21,7 @@ public class ChorusPlantBlock extends PipeBlock {
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableChorusPlantUpdates) return this.defaultBlockState(); // Purpur
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.disableChorusPlantUpdates) return this.defaultBlockState(); // Purpur
|
||||
return this.getStateForPlacement(ctx.getLevel(), ctx.getClickedPos());
|
||||
}
|
||||
|
||||
@@ -20,12 +20,12 @@ index 2c29c125edac43cdf13da8eababe60fb7a87df15..8646d36b0a48b0d0cdfeab8e52a567b7
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableChorusPlantUpdates) return state; // Purpur
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.disableChorusPlantUpdates) return state; // Purpur
|
||||
if (!state.canSurvive(world, pos)) {
|
||||
world.scheduleTick(pos, this, 1);
|
||||
return super.updateShape(state, direction, neighborState, world, pos, neighborPos);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/HugeMushroomBlock.java b/src/main/java/net/minecraft/world/level/block/HugeMushroomBlock.java
|
||||
index 3c6d97b51c6fec130b80e5965afa2c49d48843c9..174d16ae5c45dd3a4c9b4cc58b36121bef38d9cc 100644
|
||||
index 3c6d97b51c6fec130b80e5965afa2c49d48843c9..f96fe5197d1af10fd98e6c8403e25da248e4ba1e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/HugeMushroomBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/HugeMushroomBlock.java
|
||||
@@ -22,29 +22,65 @@ public class HugeMushroomBlock extends Block {
|
||||
@@ -46,7 +46,7 @@ index 3c6d97b51c6fec130b80e5965afa2c49d48843c9..174d16ae5c45dd3a4c9b4cc58b36121b
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableMushroomBlockUpdates) return this.defaultBlockState(); // Purpur
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.disableMushroomBlockUpdates) return this.defaultBlockState(); // Purpur
|
||||
BlockGetter blockGetter = ctx.getLevel();
|
||||
BlockPos blockPos = ctx.getClickedPos();
|
||||
- return this.defaultBlockState().setValue(DOWN, Boolean.valueOf(!blockGetter.getBlockState(blockPos.below()).is(this))).setValue(UP, Boolean.valueOf(!blockGetter.getBlockState(blockPos.above()).is(this))).setValue(NORTH, Boolean.valueOf(!blockGetter.getBlockState(blockPos.north()).is(this))).setValue(EAST, Boolean.valueOf(!blockGetter.getBlockState(blockPos.east()).is(this))).setValue(SOUTH, Boolean.valueOf(!blockGetter.getBlockState(blockPos.south()).is(this))).setValue(WEST, Boolean.valueOf(!blockGetter.getBlockState(blockPos.west()).is(this)));
|
||||
@@ -63,7 +63,7 @@ index 3c6d97b51c6fec130b80e5965afa2c49d48843c9..174d16ae5c45dd3a4c9b4cc58b36121b
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableMushroomBlockUpdates) return state; // Purpur
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.disableMushroomBlockUpdates) return state; // Purpur
|
||||
return neighborState.is(this) ? state.setValue(PROPERTY_BY_DIRECTION.get(direction), Boolean.valueOf(false)) : super.updateShape(state, direction, neighborState, world, pos, neighborPos);
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ index 3c6d97b51c6fec130b80e5965afa2c49d48843c9..174d16ae5c45dd3a4c9b4cc58b36121b
|
||||
public BlockState rotate(BlockState state, Rotation rotation) {
|
||||
- return state.setValue(PROPERTY_BY_DIRECTION.get(rotation.rotate(Direction.NORTH)), state.getValue(NORTH)).setValue(PROPERTY_BY_DIRECTION.get(rotation.rotate(Direction.SOUTH)), state.getValue(SOUTH)).setValue(PROPERTY_BY_DIRECTION.get(rotation.rotate(Direction.EAST)), state.getValue(EAST)).setValue(PROPERTY_BY_DIRECTION.get(rotation.rotate(Direction.WEST)), state.getValue(WEST)).setValue(PROPERTY_BY_DIRECTION.get(rotation.rotate(Direction.UP)), state.getValue(UP)).setValue(PROPERTY_BY_DIRECTION.get(rotation.rotate(Direction.DOWN)), state.getValue(DOWN));
|
||||
+ // Purpur start
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableMushroomBlockUpdates) return state;
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.disableMushroomBlockUpdates) return state;
|
||||
+ return state
|
||||
+ .setValue(PROPERTY_BY_DIRECTION.get(rotation.rotate(Direction.NORTH)), state.getValue(NORTH))
|
||||
+ .setValue(PROPERTY_BY_DIRECTION.get(rotation.rotate(Direction.SOUTH)), state.getValue(SOUTH))
|
||||
@@ -86,7 +86,7 @@ index 3c6d97b51c6fec130b80e5965afa2c49d48843c9..174d16ae5c45dd3a4c9b4cc58b36121b
|
||||
public BlockState mirror(BlockState state, Mirror mirror) {
|
||||
- return state.setValue(PROPERTY_BY_DIRECTION.get(mirror.mirror(Direction.NORTH)), state.getValue(NORTH)).setValue(PROPERTY_BY_DIRECTION.get(mirror.mirror(Direction.SOUTH)), state.getValue(SOUTH)).setValue(PROPERTY_BY_DIRECTION.get(mirror.mirror(Direction.EAST)), state.getValue(EAST)).setValue(PROPERTY_BY_DIRECTION.get(mirror.mirror(Direction.WEST)), state.getValue(WEST)).setValue(PROPERTY_BY_DIRECTION.get(mirror.mirror(Direction.UP)), state.getValue(UP)).setValue(PROPERTY_BY_DIRECTION.get(mirror.mirror(Direction.DOWN)), state.getValue(DOWN));
|
||||
+ // Purpur start
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableMushroomBlockUpdates) return state;
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.disableMushroomBlockUpdates) return state;
|
||||
+ return state
|
||||
+ .setValue(PROPERTY_BY_DIRECTION.get(mirror.mirror(Direction.NORTH)), state.getValue(NORTH))
|
||||
+ .setValue(PROPERTY_BY_DIRECTION.get(mirror.mirror(Direction.SOUTH)), state.getValue(SOUTH))
|
||||
@@ -99,20 +99,20 @@ index 3c6d97b51c6fec130b80e5965afa2c49d48843c9..174d16ae5c45dd3a4c9b4cc58b36121b
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/NoteBlock.java b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
index 16e11e31077f160198e0b04abdfeabb97ed20c6f..0512b3701a3bf33891ab6281355c07af6be5b9c1 100644
|
||||
index 16e11e31077f160198e0b04abdfeabb97ed20c6f..7dd423f6b92b7f27dd43e5ef3f4029a100a8cfa6 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
@@ -34,11 +34,13 @@ public class NoteBlock extends Block {
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableNoteBlockUpdates) return this.defaultBlockState(); // Purpur
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.disableNoteBlockUpdates) return this.defaultBlockState(); // Purpur
|
||||
return (BlockState) this.defaultBlockState().setValue(NoteBlock.INSTRUMENT, NoteBlockInstrument.byState(ctx.getLevel().getBlockState(ctx.getClickedPos().below())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
+ if (net.pl3x.purpur.PurpurConfig.disableNoteBlockUpdates) return this.defaultBlockState(); // Purpur
|
||||
+ if (org.purpurmc.purpur.PurpurConfig.disableNoteBlockUpdates) return this.defaultBlockState(); // Purpur
|
||||
return direction == Direction.DOWN ? (BlockState) state.setValue(NoteBlock.INSTRUMENT, NoteBlockInstrument.byState(neighborState)) : super.updateShape(state, direction, neighborState, world, pos, neighborPos);
|
||||
}
|
||||
|
||||
@@ -120,12 +120,12 @@ index 16e11e31077f160198e0b04abdfeabb97ed20c6f..0512b3701a3bf33891ab6281355c07af
|
||||
state = world.getBlockState(pos); // CraftBukkit - SPIGOT-5617: update in case changed in event
|
||||
}
|
||||
|
||||
+ if (!net.pl3x.purpur.PurpurConfig.disableNoteBlockUpdates) // Purpur
|
||||
+ if (!org.purpurmc.purpur.PurpurConfig.disableNoteBlockUpdates) // Purpur
|
||||
world.setBlock(pos, (BlockState) state.setValue(NoteBlock.POWERED, flag1), 3);
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/purpurmc/purpur/PurpurConfig.java b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
index 5252ce6eb6bd9b7383bef17ec5a3087db43dbeef..01872f312cbbfc6ffd2fc2a8dff208bd026fe97f 100644
|
||||
index c2da5339ef01410d218bf48c919700939910d5d0..4f8a4b053a996589bf6c9f9107da3cabc8c791da 100644
|
||||
--- a/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
+++ b/src/main/java/org/purpurmc/purpur/PurpurConfig.java
|
||||
@@ -244,6 +244,15 @@ public class PurpurConfig {
|
||||
|
||||
Reference in New Issue
Block a user