mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 15:00:13 +01:00
960
This commit is contained in:
parent
a399f23903
commit
4140de28eb
2 changed files with 11 additions and 11 deletions
|
@ -5,10 +5,10 @@ Subject: [PATCH] Per world ticks per spawn settings
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
diff --git a/src/main/java/net/minecraft/world/level/Level.java b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
index 51c4877ffb77ece41e90d9c6ac06c04dc941e35c..975fcd4b8f93cb8c602ddeb165c485214eac10a4 100644
|
index 16478e2b2368636394cec8a9b30c6fb03e190851..4d6409875771413de7ae20def2aaad4049709c30 100644
|
||||||
--- a/src/main/java/net/minecraft/world/level/Level.java
|
--- a/src/main/java/net/minecraft/world/level/Level.java
|
||||||
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
+++ b/src/main/java/net/minecraft/world/level/Level.java
|
||||||
@@ -185,6 +185,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -186,6 +186,15 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
return this.getChunkIfLoaded(chunkX, chunkZ) != null;
|
return this.getChunkIfLoaded(chunkX, chunkZ) != null;
|
||||||
}
|
}
|
||||||
// Paper end - Use getChunkIfLoadedImmediately
|
// Paper end - Use getChunkIfLoadedImmediately
|
||||||
|
@ -24,7 +24,7 @@ index 51c4877ffb77ece41e90d9c6ac06c04dc941e35c..975fcd4b8f93cb8c602ddeb165c48521
|
||||||
|
|
||||||
public abstract ResourceKey<LevelStem> getTypeKey();
|
public abstract ResourceKey<LevelStem> getTypeKey();
|
||||||
|
|
||||||
@@ -197,7 +206,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
@@ -198,7 +207,7 @@ public abstract class Level implements LevelAccessor, AutoCloseable {
|
||||||
// CraftBukkit Ticks things
|
// CraftBukkit Ticks things
|
||||||
for (SpawnCategory spawnCategory : SpawnCategory.values()) {
|
for (SpawnCategory spawnCategory : SpawnCategory.values()) {
|
||||||
if (CraftSpawnCategory.isValidForLimits(spawnCategory)) {
|
if (CraftSpawnCategory.isValidForLimits(spawnCategory)) {
|
|
@ -5,10 +5,10 @@ Subject: [PATCH] Properly track the changed item from dispense events
|
||||||
|
|
||||||
|
|
||||||
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
diff --git a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||||
index 32084df594649d8da04052bbfa111896d8ea1f91..5dab1e10303177e5a4d97a91ee46ede66f30ae35 100644
|
index f96734580a29e0436ac808e41c6cbc3f35eff5f5..9d71388c6e8ff56228afbf8cb18c37f861d0b246 100644
|
||||||
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
--- a/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||||
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
+++ b/src/main/java/net/minecraft/core/dispenser/DispenseItemBehavior.java
|
||||||
@@ -133,10 +133,14 @@ public interface DispenseItemBehavior {
|
@@ -134,10 +134,14 @@ public interface DispenseItemBehavior {
|
||||||
idispensebehavior.dispense(pointer, eventStack);
|
idispensebehavior.dispense(pointer, eventStack);
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
@ -24,7 +24,7 @@ index 32084df594649d8da04052bbfa111896d8ea1f91..5dab1e10303177e5a4d97a91ee46ede6
|
||||||
} catch (Exception exception) {
|
} catch (Exception exception) {
|
||||||
DispenseItemBehavior.LOGGER.error("Error while dispensing spawn egg from dispenser at {}", pointer.pos(), exception); // CraftBukkit - decompile error
|
DispenseItemBehavior.LOGGER.error("Error while dispensing spawn egg from dispenser at {}", pointer.pos(), exception); // CraftBukkit - decompile error
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
@@ -191,9 +195,10 @@ public interface DispenseItemBehavior {
|
@@ -192,9 +196,10 @@ public interface DispenseItemBehavior {
|
||||||
}
|
}
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ index 32084df594649d8da04052bbfa111896d8ea1f91..5dab1e10303177e5a4d97a91ee46ede6
|
||||||
ArmorStand entityarmorstand = (ArmorStand) EntityType.ARMOR_STAND.spawn(worldserver, consumer, blockposition, MobSpawnType.DISPENSER, false, false);
|
ArmorStand entityarmorstand = (ArmorStand) EntityType.ARMOR_STAND.spawn(worldserver, consumer, blockposition, MobSpawnType.DISPENSER, false, false);
|
||||||
|
|
||||||
if (entityarmorstand != null) {
|
if (entityarmorstand != null) {
|
||||||
@@ -413,6 +418,7 @@ public interface DispenseItemBehavior {
|
@@ -414,6 +419,7 @@ public interface DispenseItemBehavior {
|
||||||
int y = blockposition.getY();
|
int y = blockposition.getY();
|
||||||
int z = blockposition.getZ();
|
int z = blockposition.getZ();
|
||||||
BlockState iblockdata = worldserver.getBlockState(blockposition);
|
BlockState iblockdata = worldserver.getBlockState(blockposition);
|
||||||
|
@ -44,7 +44,7 @@ index 32084df594649d8da04052bbfa111896d8ea1f91..5dab1e10303177e5a4d97a91ee46ede6
|
||||||
// Paper start - correctly check if the bucket place will succeed
|
// Paper start - correctly check if the bucket place will succeed
|
||||||
/* Taken from SolidBucketItem#emptyContents */
|
/* Taken from SolidBucketItem#emptyContents */
|
||||||
boolean willEmptyContentsSolidBucketItem = dispensiblecontaineritem instanceof net.minecraft.world.item.SolidBucketItem && worldserver.isInWorldBounds(blockposition) && iblockdata.isAir();
|
boolean willEmptyContentsSolidBucketItem = dispensiblecontaineritem instanceof net.minecraft.world.item.SolidBucketItem && worldserver.isInWorldBounds(blockposition) && iblockdata.isAir();
|
||||||
@@ -442,12 +448,15 @@ public interface DispenseItemBehavior {
|
@@ -443,12 +449,15 @@ public interface DispenseItemBehavior {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -59,9 +59,9 @@ index 32084df594649d8da04052bbfa111896d8ea1f91..5dab1e10303177e5a4d97a91ee46ede6
|
||||||
if (dispensiblecontaineritem.emptyContents((Player) null, worldserver, blockposition, (BlockHitResult) null)) {
|
if (dispensiblecontaineritem.emptyContents((Player) null, worldserver, blockposition, (BlockHitResult) null)) {
|
||||||
- dispensiblecontaineritem.checkExtraContent((Player) null, worldserver, stack, blockposition);
|
- dispensiblecontaineritem.checkExtraContent((Player) null, worldserver, stack, blockposition);
|
||||||
+ dispensiblecontaineritem.checkExtraContent((Player) null, worldserver, dispensedItem, blockposition); // Paper - track changed item from dispense event
|
+ dispensiblecontaineritem.checkExtraContent((Player) null, worldserver, dispensedItem, blockposition); // Paper - track changed item from dispense event
|
||||||
// CraftBukkit start - Handle stacked buckets
|
return this.consumeWithRemainder(pointer, stack, new ItemStack(Items.BUCKET));
|
||||||
Item item = Items.BUCKET;
|
} else {
|
||||||
stack.shrink(1);
|
return this.defaultDispenseItemBehavior.dispense(pointer, stack);
|
||||||
diff --git a/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java
|
diff --git a/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java b/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java
|
||||||
index 985954030654d521291cccbfc3ca49b67ee4357d..e37d2d29f3ba67cfe28abe4847a3dca07121f0be 100644
|
index 985954030654d521291cccbfc3ca49b67ee4357d..e37d2d29f3ba67cfe28abe4847a3dca07121f0be 100644
|
||||||
--- a/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java
|
--- a/src/main/java/net/minecraft/core/dispenser/ProjectileDispenseBehavior.java
|
Loading…
Reference in a new issue