mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-19 17:37:42 +01:00
Upstream has released updates that appear to apply and compile correctly Paper Changes: 05af2837c [CI-SKIP] Improved the annotation test output 586966949 abstract custom set tags, add entity tags c7667378e Added PlayerLoomPatternSelectEvent 00972e80d Reimplement GS4QueryEvent 544c5c278 Re-add coral block tags (#4987) 7d56c8deb Added PlayerLecternPageChangeEvent c7cdf255b Add BlockFailedDispenseEvent c8a8d6fbe Added world settings for mobs picking up loot 91eda5bd3 Added ServerResourcesReloadedEvent be81b4f5c Add a Enchantable MaterialTag 975d18703 Add doors to material tags d075e748e colorful itemdump f3ba3dee0 Added WorldGameRuleChangeEvent 086d20118 Guardian beam workaround b63c890ec Support spawning item stacks d7d74c552 added height config for bamboo 7878e3bc2 Use setAmount for Recipe Amount 50e70697b Add EntityLoadCrossbowEvent f344e092c Add Anti-Xray bypass permission 9fd31e675 fix for nerfed slime mobs splitting 4a7962cd1 Zombie API - breaking doors 5650a41f5 Fix interact event not being called in adventure 2c9ed4335 Add PlayerFlowerPotManipulateEvent 1f32290b6 [Auto] Updated Upstream (CraftBukkit) d87694a20 Redact Velocity forwarding secret properly (#4980) 24a0b0206 [Auto] Updated Upstream (CraftBukkit) 7681042ef [Auto] Updated Upstream (Bukkit/CraftBukkit) 7dea3dba6 [Auto] Updated Upstream (CraftBukkit) 4b3792920 JavaDoc fixes f13b4727e Allow disabling mob spawner spawn egg transformation 525b50737 Cache burn durations 2c37d1077 Optimized tick ready check b4000b01a Add API to get the Material of Boats and Minecarts f1317386d Fix sign lazy initialisation 9f61759d9 Updated Upstream (CraftBukkit/Spigot) (#4972) aaff430b6 [CI-SKIP] Use GitHub Actions for build status 9f4055d99 Fix harming potion dupe 7bfb781ff Additional Block Material API's 0eaffd008 Micro Optimize DataBits Tuinity Changes: 9e5cabb6e Port starlight changes
91 lines
8.2 KiB
Diff
91 lines
8.2 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: William Blake Galbreath <Blake.Galbreath@GMail.com>
|
|
Date: Tue, 4 Aug 2020 17:11:58 -0500
|
|
Subject: [PATCH] Add option to disable mushroom block updates
|
|
|
|
|
|
diff --git a/src/main/java/net/minecraft/server/BlockHugeMushroom.java b/src/main/java/net/minecraft/server/BlockHugeMushroom.java
|
|
index e8f340b9f2a1e5de9cf7e8cf595de8a806cb528a..3490af6fe0cf2eccac9753778cf4085f95d5da93 100644
|
|
--- a/src/main/java/net/minecraft/server/BlockHugeMushroom.java
|
|
+++ b/src/main/java/net/minecraft/server/BlockHugeMushroom.java
|
|
@@ -14,30 +14,57 @@ public class BlockHugeMushroom extends Block {
|
|
|
|
public BlockHugeMushroom(BlockBase.Info blockbase_info) {
|
|
super(blockbase_info);
|
|
- this.j((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.blockStateList.getBlockData()).set(BlockHugeMushroom.a, true)).set(BlockHugeMushroom.b, true)).set(BlockHugeMushroom.c, true)).set(BlockHugeMushroom.d, true)).set(BlockHugeMushroom.e, true)).set(BlockHugeMushroom.f, true));
|
|
+ this.j(this.blockStateList.getBlockData()
|
|
+ .set(BlockHugeMushroom.a, true)
|
|
+ .set(BlockHugeMushroom.b, true)
|
|
+ .set(BlockHugeMushroom.c, true)
|
|
+ .set(BlockHugeMushroom.d, true)
|
|
+ .set(BlockHugeMushroom.e, true)
|
|
+ .set(BlockHugeMushroom.f, true));
|
|
}
|
|
|
|
@Override
|
|
public IBlockData getPlacedState(BlockActionContext blockactioncontext) {
|
|
World world = blockactioncontext.getWorld();
|
|
+ if (net.pl3x.purpur.PurpurConfig.disableMushroomBlockUpdates) return this.getBlockData();
|
|
BlockPosition blockposition = blockactioncontext.getClickPosition();
|
|
-
|
|
- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) this.getBlockData().set(BlockHugeMushroom.f, this != world.getType(blockposition.down()).getBlock())).set(BlockHugeMushroom.e, this != world.getType(blockposition.up()).getBlock())).set(BlockHugeMushroom.a, this != world.getType(blockposition.north()).getBlock())).set(BlockHugeMushroom.b, this != world.getType(blockposition.east()).getBlock())).set(BlockHugeMushroom.c, this != world.getType(blockposition.south()).getBlock())).set(BlockHugeMushroom.d, this != world.getType(blockposition.west()).getBlock());
|
|
+ return this.getBlockData()
|
|
+ .set(BlockHugeMushroom.f, this != world.getType(blockposition.down()).getBlock())
|
|
+ .set(BlockHugeMushroom.e, this != world.getType(blockposition.up()).getBlock())
|
|
+ .set(BlockHugeMushroom.a, this != world.getType(blockposition.north()).getBlock())
|
|
+ .set(BlockHugeMushroom.b, this != world.getType(blockposition.east()).getBlock())
|
|
+ .set(BlockHugeMushroom.c, this != world.getType(blockposition.south()).getBlock())
|
|
+ .set(BlockHugeMushroom.d, this != world.getType(blockposition.west()).getBlock());
|
|
}
|
|
|
|
@Override
|
|
public IBlockData updateState(IBlockData iblockdata, EnumDirection enumdirection, IBlockData iblockdata1, GeneratorAccess generatoraccess, BlockPosition blockposition, BlockPosition blockposition1) {
|
|
- return iblockdata1.a((Block) this) ? (IBlockData) iblockdata.set((IBlockState) BlockHugeMushroom.g.get(enumdirection), false) : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
|
+ if (net.pl3x.purpur.PurpurConfig.disableMushroomBlockUpdates) return iblockdata;
|
|
+ return iblockdata1.a(this) ? iblockdata.set(BlockHugeMushroom.g.get(enumdirection), false) : super.updateState(iblockdata, enumdirection, iblockdata1, generatoraccess, blockposition, blockposition1);
|
|
}
|
|
|
|
@Override
|
|
public IBlockData a(IBlockData iblockdata, EnumBlockRotation enumblockrotation) {
|
|
- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) iblockdata.set((IBlockState) BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.NORTH)), iblockdata.get(BlockHugeMushroom.a))).set((IBlockState) BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.SOUTH)), iblockdata.get(BlockHugeMushroom.c))).set((IBlockState) BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.EAST)), iblockdata.get(BlockHugeMushroom.b))).set((IBlockState) BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.WEST)), iblockdata.get(BlockHugeMushroom.d))).set((IBlockState) BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.UP)), iblockdata.get(BlockHugeMushroom.e))).set((IBlockState) BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.DOWN)), iblockdata.get(BlockHugeMushroom.f));
|
|
+ if (net.pl3x.purpur.PurpurConfig.disableMushroomBlockUpdates) return iblockdata;
|
|
+ return iblockdata
|
|
+ .set(BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.NORTH)), iblockdata.get(BlockHugeMushroom.a))
|
|
+ .set(BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.SOUTH)), iblockdata.get(BlockHugeMushroom.c))
|
|
+ .set(BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.EAST)), iblockdata.get(BlockHugeMushroom.b))
|
|
+ .set(BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.WEST)), iblockdata.get(BlockHugeMushroom.d))
|
|
+ .set(BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.UP)), iblockdata.get(BlockHugeMushroom.e))
|
|
+ .set(BlockHugeMushroom.g.get(enumblockrotation.a(EnumDirection.DOWN)), iblockdata.get(BlockHugeMushroom.f));
|
|
}
|
|
|
|
@Override
|
|
public IBlockData a(IBlockData iblockdata, EnumBlockMirror enumblockmirror) {
|
|
- return (IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) ((IBlockData) iblockdata.set((IBlockState) BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.NORTH)), iblockdata.get(BlockHugeMushroom.a))).set((IBlockState) BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.SOUTH)), iblockdata.get(BlockHugeMushroom.c))).set((IBlockState) BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.EAST)), iblockdata.get(BlockHugeMushroom.b))).set((IBlockState) BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.WEST)), iblockdata.get(BlockHugeMushroom.d))).set((IBlockState) BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.UP)), iblockdata.get(BlockHugeMushroom.e))).set((IBlockState) BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.DOWN)), iblockdata.get(BlockHugeMushroom.f));
|
|
+ if (net.pl3x.purpur.PurpurConfig.disableMushroomBlockUpdates) return iblockdata;
|
|
+ return iblockdata
|
|
+ .set(BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.NORTH)), iblockdata.get(BlockHugeMushroom.a))
|
|
+ .set(BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.SOUTH)), iblockdata.get(BlockHugeMushroom.c))
|
|
+ .set(BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.EAST)), iblockdata.get(BlockHugeMushroom.b))
|
|
+ .set(BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.WEST)), iblockdata.get(BlockHugeMushroom.d))
|
|
+ .set(BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.UP)), iblockdata.get(BlockHugeMushroom.e))
|
|
+ .set(BlockHugeMushroom.g.get(enumblockmirror.b(EnumDirection.DOWN)), iblockdata.get(BlockHugeMushroom.f));
|
|
}
|
|
|
|
@Override
|
|
diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
index 698a04682924a374af3ad9668feb4b0f324939e9..3f73dcc02d94d69f5deb6f734cf0a9ec6016bb4c 100644
|
|
--- a/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
+++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java
|
|
@@ -200,6 +200,11 @@ public class PurpurConfig {
|
|
allowWaterPlacementInTheEnd = getBoolean("settings.allow-water-placement-in-the-end", allowWaterPlacementInTheEnd);
|
|
}
|
|
|
|
+ public static boolean disableMushroomBlockUpdates = false;
|
|
+ private static void disableMushroomBlockUpdates() {
|
|
+ disableMushroomBlockUpdates= getBoolean("settings.blocks.disable-mushroom-updates", disableMushroomBlockUpdates);
|
|
+ }
|
|
+
|
|
public static boolean loggerSuppressInitLegacyMaterialError = false;
|
|
public static boolean loggerSuppressIgnoredAdvancementWarnings = false;
|
|
private static void loggerSettings() {
|