mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 15:30:19 +01:00
Properly identify golem spawn reason (#8635)
This commit is contained in:
parent
f4a28408d4
commit
ad6b5121b7
1 changed files with 23 additions and 0 deletions
|
@ -33,6 +33,29 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
} else areaEffectCloud.discard(); // Paper
|
||||
this.discard();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java b/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/CarvedPumpkinBlock.java
|
||||
@@ -0,0 +0,0 @@ public class CarvedPumpkinBlock extends HorizontalDirectionalBlock implements We
|
||||
// clearPatternBlocks(world, shapedetector_shapedetectorcollection); // CraftBukkit - moved down
|
||||
entity.moveTo((double) pos.getX() + 0.5D, (double) pos.getY() + 0.05D, (double) pos.getZ() + 0.5D, 0.0F, 0.0F);
|
||||
// CraftBukkit start
|
||||
- if (!world.addFreshEntity(entity, SpawnReason.BUILD_IRONGOLEM)) {
|
||||
+ // Paper start - correct spawn reason
|
||||
+ final SpawnReason spawnReason;
|
||||
+ if (entity.getType() == EntityType.SNOW_GOLEM) {
|
||||
+ spawnReason = SpawnReason.BUILD_SNOWMAN;
|
||||
+ } else if (entity.getType() == EntityType.IRON_GOLEM) {
|
||||
+ spawnReason = SpawnReason.BUILD_IRONGOLEM;
|
||||
+ } else {
|
||||
+ spawnReason = SpawnReason.DEFAULT;
|
||||
+ }
|
||||
+ if (!world.addFreshEntity(entity, spawnReason)) {
|
||||
+ // Paper end
|
||||
return;
|
||||
}
|
||||
CarvedPumpkinBlock.clearPatternBlocks(world, patternResult); // CraftBukkit - from above
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java b/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/FrogspawnBlock.java
|
||||
|
|
Loading…
Reference in a new issue