mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-12 18:01:07 +01:00
77a5779e24
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: 2ec53f49 PR-1050: Fix empty result check for Complex Recipes 10671012 PR-1044: Add CrafterCraftEvent 4d87ffe0 Use correct method in JavaDoc ae5e5817 SPIGOT-7850: Add API for Bogged shear state 46b6d445 SPIGOT-7837: Support data pack banner patterns d5d0cefc Fix JavaDoc error b3c2b83d PR-1036: Add API for InventoryView derivatives 1fe2c75a SPIGOT-7809: Add ShieldMeta CraftBukkit Changes: 8ee6fd1b8 SPIGOT-7857: Improve ItemMeta block data deserialization 8f26c30c6 SPIGOT-7857: Fix spurious internal NBT tag when deserializing BlockStateMeta 759061b93 SPIGOT-7855: Fire does not spread or burn blocks 00fc9fb64 SPIGOT-7853: AnvilInventory#getRepairCost() always returns 0 7501e2e04 PR-1450: Add CrafterCraftEvent 8c51673e7 SPIGOT-5731: PortalCreateEvent#getEntity returns null for nether portals ignited by flint and steel d53d0d0b1 PR-1456: Fix inverted logic in CraftCrafterView#setSlotDisabled 682a678c8 SPIGOT-7850: Add API for Bogged shear state fccf5243a SPIGOT-7837: Support data pack banner patterns 9c3bd4390 PR-1431: Add API for InventoryView derivatives 0cc6acbc4 SPIGOT-7849: Fix FoodComponent serialize with "using-converts-to" using null 2c5474952 Don't rely on tags for CraftItemMetas 20d107e46 SPIGOT-7846: Fix ItemMeta for hanging signs 76f59e315 Remove redundant clone in Dropper InventoryMoveItemEvent e61a53d25 SPIGOT-7817: Call InventoryMoveItemEvent for Crafters 894682e2d SPIGOT-7839: Remove redundant Java version checks 2c12b2187 SPIGOT-7809: Add ShieldMeta and fix setting shield base colours Spigot Changes: fb8fb722 Rebuild patches 34bd42b7 SPIGOT-7835: Fix issue with custom hopper settings
65 lines
3.8 KiB
Diff
65 lines
3.8 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Max Lee <max@themoep.de>
|
|
Date: Thu, 27 May 2021 14:52:30 -0700
|
|
Subject: [PATCH] Fix invulnerable end crystals
|
|
|
|
MC-108513
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
|
index 6f8d4584aae56fc7fbcbc38b1291ea415208fd5e..a33d89fe9ca9e343edab8bb1cc88c54130ddb4a7 100644
|
|
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
|
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EndCrystal.java
|
|
@@ -30,6 +30,7 @@ public class EndCrystal extends Entity {
|
|
private static final EntityDataAccessor<Optional<BlockPos>> DATA_BEAM_TARGET = SynchedEntityData.defineId(EndCrystal.class, EntityDataSerializers.OPTIONAL_BLOCK_POS);
|
|
private static final EntityDataAccessor<Boolean> DATA_SHOW_BOTTOM = SynchedEntityData.defineId(EndCrystal.class, EntityDataSerializers.BOOLEAN);
|
|
public int time;
|
|
+ public boolean generatedByDragonFight = false; // Paper - Fix invulnerable end crystals
|
|
|
|
public EndCrystal(EntityType<? extends EndCrystal> type, Level world) {
|
|
super(type, world);
|
|
@@ -68,6 +69,17 @@ public class EndCrystal extends Entity {
|
|
}
|
|
// CraftBukkit end
|
|
}
|
|
+ // Paper start - Fix invulnerable end crystals
|
|
+ if (this.level().paperConfig().unsupportedSettings.fixInvulnerableEndCrystalExploit && this.generatedByDragonFight && this.isInvulnerable()) {
|
|
+ if (!java.util.Objects.equals(((ServerLevel) this.level()).uuid, this.getOriginWorld())
|
|
+ || ((ServerLevel) this.level()).getDragonFight() == null
|
|
+ || ((ServerLevel) this.level()).getDragonFight().respawnStage == null
|
|
+ || ((ServerLevel) this.level()).getDragonFight().respawnStage.ordinal() > net.minecraft.world.level.dimension.end.DragonRespawnAnimation.SUMMONING_DRAGON.ordinal()) {
|
|
+ this.setInvulnerable(false);
|
|
+ this.setBeamTarget(null);
|
|
+ }
|
|
+ }
|
|
+ // Paper end - Fix invulnerable end crystals
|
|
}
|
|
|
|
}
|
|
@@ -79,6 +91,7 @@ public class EndCrystal extends Entity {
|
|
}
|
|
|
|
nbt.putBoolean("ShowBottom", this.showsBottom());
|
|
+ if (this.generatedByDragonFight) nbt.putBoolean("Paper.GeneratedByDragonFight", this.generatedByDragonFight); // Paper - Fix invulnerable end crystals
|
|
}
|
|
|
|
@Override
|
|
@@ -87,6 +100,7 @@ public class EndCrystal extends Entity {
|
|
if (nbt.contains("ShowBottom", 1)) {
|
|
this.setShowBottom(nbt.getBoolean("ShowBottom"));
|
|
}
|
|
+ if (nbt.contains("Paper.GeneratedByDragonFight", 1)) this.generatedByDragonFight = nbt.getBoolean("Paper.GeneratedByDragonFight"); // Paper - Fix invulnerable end crystals
|
|
|
|
}
|
|
|
|
diff --git a/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java b/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java
|
|
index c3bf90178abe89ccc987718237d472ed10c70d69..260c3a7dc592fba220ad4a7febb43ee2c9279115 100644
|
|
--- a/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java
|
|
+++ b/src/main/java/net/minecraft/world/level/levelgen/feature/SpikeFeature.java
|
|
@@ -114,6 +114,7 @@ public class SpikeFeature extends Feature<SpikeConfiguration> {
|
|
endCrystal.moveTo(
|
|
(double)spike.getCenterX() + 0.5, (double)(spike.getHeight() + 1), (double)spike.getCenterZ() + 0.5, random.nextFloat() * 360.0F, 0.0F
|
|
);
|
|
+ endCrystal.generatedByDragonFight = true; // Paper - Fix invulnerable end crystals
|
|
world.addFreshEntity(endCrystal);
|
|
BlockPos blockPos2 = endCrystal.blockPosition();
|
|
this.setBlock(world, blockPos2.below(), Blocks.BEDROCK.defaultBlockState());
|