Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 04:20:04 +01:00
more work (721)
Dieser Commit ist enthalten in:
Ursprung
90095cd7c4
Commit
71ae391eb3
@ -32,22 +32,22 @@ index 0000000000000000000000000000000000000000..7ea357ac2f3a93db4ebdf24b5072be7d
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
index 041ba5fd85748b3183e12e7a8e10fca77eb35bf5..88821acddee03c30c2630d3d6c39cc93702ed35b 100644
|
||||
index ea442883eda28e5673cef9470145d5c40ac66159..79f7e0fb2f1aa6af441c6e09d2c443d7d4bb47ef 100644
|
||||
--- a/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/MinecraftServer.java
|
||||
@@ -2081,6 +2081,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
@@ -2141,6 +2141,7 @@ public abstract class MinecraftServer extends ReentrantBlockableEventLoop<TickTa
|
||||
|
||||
this.worldData.setDataConfiguration(worlddataconfiguration);
|
||||
this.resources.managers.updateRegistryTags(this.registryAccess());
|
||||
+ net.minecraft.world.item.alchemy.PotionBrewing.reload(); // Paper - Custom Potion Mixes
|
||||
this.resources.managers.updateRegistryTags();
|
||||
+ this.potionBrewing.reload(this.worldData.enabledFeatures()); // Paper - Custom Potion Mixes
|
||||
this.getPlayerList().saveAll();
|
||||
this.getPlayerList().reloadResources();
|
||||
this.functionManager.replaceLibrary(this.resources.managers.getFunctionLibrary());
|
||||
diff --git a/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java b/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
|
||||
index ad012400d76c263bf26cfa07e2e24f26dc32276b..054555c6b9c61243b1f14139b5c0eb2579403707 100644
|
||||
index 8be4e04df480faaa3aac516012709e9ff852f8a5..5dceffcb6883db128ea41561ed8a8ba41eb275ef 100644
|
||||
--- a/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
|
||||
+++ b/src/main/java/net/minecraft/world/inventory/BrewingStandMenu.java
|
||||
@@ -169,7 +169,7 @@ public class BrewingStandMenu extends AbstractContainerMenu {
|
||||
@@ -173,7 +173,7 @@ public class BrewingStandMenu extends AbstractContainerMenu {
|
||||
}
|
||||
|
||||
public static boolean mayPlaceItem(ItemStack stack) {
|
||||
@ -57,54 +57,54 @@ index ad012400d76c263bf26cfa07e2e24f26dc32276b..054555c6b9c61243b1f14139b5c0eb25
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java b/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java
|
||||
index a37573d06aeaa4ae05d26fa26c888524dd834421..96197185d1cba4a77bd6afd0e57615b45d4dfc85 100644
|
||||
index 50e81e3babd331077eda8daa769eb2b3f99e8ca2..45b1a0346c7b0a541b336e2a89f825bf58d993f8 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/alchemy/PotionBrewing.java
|
||||
@@ -14,6 +14,7 @@ public class PotionBrewing {
|
||||
public static final int BREWING_TIME_SECONDS = 20;
|
||||
private static final List<PotionBrewing.Mix<Potion>> POTION_MIXES = Lists.newArrayList();
|
||||
private static final List<PotionBrewing.Mix<Item>> CONTAINER_MIXES = Lists.newArrayList();
|
||||
@@ -19,6 +19,7 @@ public class PotionBrewing {
|
||||
private final List<Ingredient> containers;
|
||||
private final List<PotionBrewing.Mix<Potion>> potionMixes;
|
||||
private final List<PotionBrewing.Mix<Item>> containerMixes;
|
||||
+ private static final it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap<org.bukkit.NamespacedKey, io.papermc.paper.potion.PaperPotionMix> CUSTOM_MIXES = new it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap<>(); // Paper - Custom Potion Mixes
|
||||
private static final List<Ingredient> ALLOWED_CONTAINERS = Lists.newArrayList();
|
||||
private static final Predicate<ItemStack> ALLOWED_CONTAINER = stack -> {
|
||||
for (Ingredient ingredient : ALLOWED_CONTAINERS) {
|
||||
@@ -26,7 +27,7 @@ public class PotionBrewing {
|
||||
};
|
||||
|
||||
public static boolean isIngredient(ItemStack stack) {
|
||||
- return isContainerIngredient(stack) || isPotionIngredient(stack);
|
||||
+ return isContainerIngredient(stack) || isPotionIngredient(stack) || isCustomIngredient(stack); // Paper - Custom Potion Mixes
|
||||
PotionBrewing(List<Ingredient> potionTypes, List<PotionBrewing.Mix<Potion>> potionRecipes, List<PotionBrewing.Mix<Item>> itemRecipes) {
|
||||
this.containers = potionTypes;
|
||||
@@ -27,7 +28,7 @@ public class PotionBrewing {
|
||||
}
|
||||
|
||||
protected static boolean isContainerIngredient(ItemStack stack) {
|
||||
@@ -60,6 +61,11 @@ public class PotionBrewing {
|
||||
public boolean isIngredient(ItemStack stack) {
|
||||
- return this.isContainerIngredient(stack) || this.isPotionIngredient(stack);
|
||||
+ return this.isContainerIngredient(stack) || this.isPotionIngredient(stack) || isCustomIngredient(stack); // Paper - Custom Potion Mixes
|
||||
}
|
||||
|
||||
public static boolean hasMix(ItemStack input, ItemStack ingredient) {
|
||||
private boolean isContainer(ItemStack stack) {
|
||||
@@ -71,6 +72,11 @@ public class PotionBrewing {
|
||||
}
|
||||
|
||||
public boolean hasMix(ItemStack input, ItemStack ingredient) {
|
||||
+ // Paper start - Custom Potion Mixes
|
||||
+ if (hasCustomMix(input, ingredient)) {
|
||||
+ return true;
|
||||
+ }
|
||||
+ // Paper end - Custom Potion Mixes
|
||||
return ALLOWED_CONTAINER.test(input) && (hasContainerMix(input, ingredient) || hasPotionMix(input, ingredient));
|
||||
return this.isContainer(input) && (this.hasContainerMix(input, ingredient) || this.hasPotionMix(input, ingredient));
|
||||
}
|
||||
|
||||
@@ -89,6 +95,13 @@ public class PotionBrewing {
|
||||
|
||||
public static ItemStack mix(ItemStack ingredient, ItemStack input) {
|
||||
if (!input.isEmpty()) {
|
||||
+ // Paper start - Custom Potion Mixes
|
||||
+ for (var mix : CUSTOM_MIXES.values()) {
|
||||
+ if (mix.input().test(input) && mix.ingredient().test(ingredient)) {
|
||||
+ return mix.result().copy();
|
||||
@@ -107,6 +113,13 @@ public class PotionBrewing {
|
||||
if (optional.isEmpty()) {
|
||||
return input;
|
||||
} else {
|
||||
+ // Paper start - Custom Potion Mixes
|
||||
+ for (var mix : CUSTOM_MIXES.values()) {
|
||||
+ if (mix.input().test(input) && mix.ingredient().test(ingredient)) {
|
||||
+ return mix.result().copy();
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - Custom Potion Mixes
|
||||
Potion potion = PotionUtils.getPotion(input);
|
||||
Item item = input.getItem();
|
||||
|
||||
@@ -108,6 +121,54 @@ public class PotionBrewing {
|
||||
return input;
|
||||
+ // Paper end - Custom Potion Mixes
|
||||
for (PotionBrewing.Mix<Item> mix : this.containerMixes) {
|
||||
if (input.is(mix.from) && mix.ingredient.test(ingredient)) {
|
||||
return PotionContents.createItemStack(mix.to.value(), optional.get());
|
||||
@@ -190,6 +203,54 @@ public class PotionBrewing {
|
||||
builder.addMix(Potions.SLOW_FALLING, Items.REDSTONE, Potions.LONG_SLOW_FALLING);
|
||||
}
|
||||
|
||||
+ // Paper start - Custom Potion Mixes
|
||||
@ -146,36 +146,36 @@ index a37573d06aeaa4ae05d26fa26c888524dd834421..96197185d1cba4a77bd6afd0e57615b4
|
||||
+ return CUSTOM_MIXES.remove(key) != null;
|
||||
+ }
|
||||
+
|
||||
+ public static void reload() {
|
||||
+ POTION_MIXES.clear();
|
||||
+ CONTAINER_MIXES.clear();
|
||||
+ ALLOWED_CONTAINERS.clear();
|
||||
+ public void reload(FeatureFlagSet flags) {
|
||||
+ potionMixes.clear();
|
||||
+ containerMixes.clear();
|
||||
+ containers.clear();
|
||||
+ CUSTOM_MIXES.clear();
|
||||
+ bootStrap();
|
||||
+ bootstrap(flags);
|
||||
+ }
|
||||
+ // Paper end - Custom Potion Mixes
|
||||
+
|
||||
public static void bootStrap() {
|
||||
addContainer(Items.POTION);
|
||||
addContainer(Items.SPLASH_POTION);
|
||||
public static class Builder {
|
||||
private final List<Ingredient> containers = new ArrayList<>();
|
||||
private final List<PotionBrewing.Mix<Potion>> potionMixes = new ArrayList<>();
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||
index b31d7053abf1d2432b4887dab2bd8f8cc5308554..9bb542ce3a8c52e1688bb1f66fc916dd23a5fd10 100644
|
||||
index 3ebfd564d4bbf00da5919e966f3d047285845640..c1254088fc65fe46101c82cf2629cf0269711d39 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/BrewingStandBlockEntity.java
|
||||
@@ -341,7 +341,7 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
|
||||
@@ -316,7 +316,7 @@ public class BrewingStandBlockEntity extends BaseContainerBlockEntity implements
|
||||
|
||||
@Override
|
||||
public boolean canPlaceItem(int slot, ItemStack stack) {
|
||||
- return slot == 3 ? PotionBrewing.isIngredient(stack) : (slot == 4 ? stack.is(Items.BLAZE_POWDER) : (stack.is(Items.POTION) || stack.is(Items.SPLASH_POTION) || stack.is(Items.LINGERING_POTION) || stack.is(Items.GLASS_BOTTLE)) && this.getItem(slot).isEmpty());
|
||||
+ return slot == 3 ? PotionBrewing.isIngredient(stack) : (slot == 4 ? stack.is(Items.BLAZE_POWDER) : (stack.is(Items.POTION) || stack.is(Items.SPLASH_POTION) || stack.is(Items.LINGERING_POTION) || stack.is(Items.GLASS_BOTTLE) || PotionBrewing.isCustomInput(stack)) && this.getItem(slot).isEmpty()); // Paper - Custom Potion Mixes
|
||||
return potionbrewer.isIngredient(stack);
|
||||
} else {
|
||||
- return slot == 4 ? stack.is(Items.BLAZE_POWDER) : (stack.is(Items.POTION) || stack.is(Items.SPLASH_POTION) || stack.is(Items.LINGERING_POTION) || stack.is(Items.GLASS_BOTTLE)) && this.getItem(slot).isEmpty();
|
||||
+ return slot == 4 ? stack.is(Items.BLAZE_POWDER) : (stack.is(Items.POTION) || stack.is(Items.SPLASH_POTION) || stack.is(Items.LINGERING_POTION) || stack.is(Items.GLASS_BOTTLE) || PotionBrewing.isCustomInput(stack)) && this.getItem(slot).isEmpty(); // Paper - Custom Potion Mixes
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index f629991fa998d4dab89ed5c3d26b1b7a4f85b5cb..d8bec75e7f5c034051839818f51cdae71863608c 100644
|
||||
index 489fe1078a954ae7dd7133938bfd338d5fdeea5b..a7545b824dcf38a7e5e743e639f54d0e4d9b78aa 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -306,6 +306,7 @@ public final class CraftServer implements Server {
|
||||
@@ -308,6 +308,7 @@ public final class CraftServer implements Server {
|
||||
private final io.papermc.paper.datapack.PaperDatapackManager datapackManager; // Paper
|
||||
public static Exception excessiveVelEx; // Paper - Velocity warnings
|
||||
private final io.papermc.paper.logging.SysoutCatcher sysoutCatcher = new io.papermc.paper.logging.SysoutCatcher(); // Paper
|
||||
@ -183,16 +183,7 @@ index f629991fa998d4dab89ed5c3d26b1b7a4f85b5cb..d8bec75e7f5c034051839818f51cdae7
|
||||
|
||||
static {
|
||||
ConfigurationSerialization.registerClass(CraftOfflinePlayer.class);
|
||||
@@ -332,7 +333,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
CraftRegistry.setMinecraftRegistry(console.registryAccess());
|
||||
|
||||
- Potion.setPotionBrewer(new CraftPotionBrewer());
|
||||
+ Potion.setPotionBrewer(potionBrewer); // Paper - Custom Potion Mixes
|
||||
// Ugly hack :(
|
||||
|
||||
if (!Main.useConsole) {
|
||||
@@ -3079,5 +3080,10 @@ public final class CraftServer implements Server {
|
||||
@@ -3098,5 +3099,10 @@ public final class CraftServer implements Server {
|
||||
return datapackManager;
|
||||
}
|
||||
|
||||
@ -220,13 +211,41 @@ index 139dff90561ac6c51954c6289918a07aeea13a1b..6ba29875d78ede4aa7978ff689e588f7
|
||||
|
||||
if (bukkit == null) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java
|
||||
index 09ac71b6b41c757832792d9ea8ac9288f8a7404f..2909a2736a0c9d863c7ab01e0ec259f7952080cc 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..2909a2736a0c9d863c7ab01e0ec259f7952080cc
|
||||
--- /dev/null
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/potion/CraftPotionBrewer.java
|
||||
@@ -28,4 +28,21 @@ public class CraftPotionBrewer implements PotionBrewer {
|
||||
public PotionEffect createEffect(PotionEffectType potion, int duration, int amplifier) {
|
||||
return new PotionEffect(potion, potion.isInstant() ? 1 : (int) (duration * potion.getDurationModifier()), amplifier);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
+package org.bukkit.craftbukkit.potion;
|
||||
+
|
||||
+import com.google.common.base.Preconditions;
|
||||
+import java.util.ArrayList;
|
||||
+import java.util.Collection;
|
||||
+import org.bukkit.potion.PotionBrewer;
|
||||
+import org.bukkit.potion.PotionData;
|
||||
+import org.bukkit.potion.PotionEffect;
|
||||
+import org.bukkit.potion.PotionEffectType;
|
||||
+import org.bukkit.potion.PotionType;
|
||||
+
|
||||
+public class CraftPotionBrewer implements PotionBrewer {
|
||||
+
|
||||
+ @Override
|
||||
+ public Collection<PotionEffect> getEffects(PotionType type, boolean upgraded, boolean extended) {
|
||||
+ Preconditions.checkArgument(!type.getKey().getKey().startsWith("strong_"), "Strong potion type cannot be used directly, got %s", type.getKey());
|
||||
+ Preconditions.checkArgument(!type.getKey().getKey().startsWith("long_"), "Extended potion type cannot be used directly, got %s", type.getKey());
|
||||
+
|
||||
+ return CraftPotionUtil.fromBukkit(new PotionData(type, upgraded, extended)).getPotionEffects();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public Collection<PotionEffect> getEffectsFromDamage(int damage) {
|
||||
+ return new ArrayList<PotionEffect>();
|
||||
+ }
|
||||
+
|
||||
+ @Override
|
||||
+ public PotionEffect createEffect(PotionEffectType potion, int duration, int amplifier) {
|
||||
+ return new PotionEffect(potion, potion.isInstant() ? 1 : (int) (duration * potion.getDurationModifier()), amplifier);
|
||||
+ }
|
||||
+
|
||||
+ // Paper start
|
||||
+ @Override
|
||||
@ -244,4 +263,4 @@ index 09ac71b6b41c757832792d9ea8ac9288f8a7404f..2909a2736a0c9d863c7ab01e0ec259f7
|
||||
+ net.minecraft.world.item.alchemy.PotionBrewing.reload();
|
||||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
+}
|
@ -10,13 +10,13 @@ so we do not need that. The client only needs the chunk it is currently in to
|
||||
be loaded to close the loading screen, so we just send an empty one.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 95ba9b3bf957e5f744e85b3834a50ee2eb925a70..8ba90d47d7015c0081d341915035ce65baa6b9a4 100644
|
||||
index 825a63a23adceaea0de996f6c6122c44f5e700c0..4338015bbe0a0c33146190c81191fa62b6991499 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -399,6 +399,16 @@ public abstract class PlayerList {
|
||||
|
||||
@@ -400,6 +400,16 @@ public abstract class PlayerList {
|
||||
}
|
||||
// Paper start - Fire PlayerJoinEvent when Player is actually ready; move vehicle into method so it can be called above - short circuit around that code
|
||||
onPlayerJoinFinish(player, worldserver1, s1);
|
||||
this.onPlayerJoinFinish(player, worldserver1, s1);
|
||||
+ // Paper start - Send empty chunk, so players aren't stuck in the world loading screen with our chunk system not sending chunks when dead
|
||||
+ if (player.isDeadOrDying()) {
|
||||
+ net.minecraft.core.Holder<net.minecraft.world.level.biome.Biome> plains = worldserver1.registryAccess().registryOrThrow(net.minecraft.core.registries.Registries.BIOME)
|
||||
@ -28,5 +28,5 @@ index 95ba9b3bf957e5f744e85b3834a50ee2eb925a70..8ba90d47d7015c0081d341915035ce65
|
||||
+ }
|
||||
+ // Paper end - Send empty chunk
|
||||
}
|
||||
private void mountSavedVehicle(ServerPlayer player, ServerLevel worldserver1, CompoundTag nbttagcompound) {
|
||||
private void mountSavedVehicle(ServerPlayer player, ServerLevel worldserver1, Optional<CompoundTag> optional) {
|
||||
// Paper end - Fire PlayerJoinEvent when Player is actually ready
|
@ -11,10 +11,10 @@ Restores the API behavior from previous versions of the server
|
||||
public net.minecraft.world.entity.item.FallingBlockEntity <init>(Lnet/minecraft/world/level/Level;DDDLnet/minecraft/world/level/block/state/BlockState;)V
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 558d95381bca2f950824748b05e59e4ced7347c3..f2e4494a31dd7ca7e099c6960a9e6378ecac8727 100644
|
||||
index 2c7b94719fb815025f73e8cf98cb0323b9375923..4efbda6521f36ceae3b5b32ad0c79fa53b48b5bd 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -1414,7 +1414,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1423,7 +1423,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
Preconditions.checkArgument(material != null, "Material cannot be null");
|
||||
Preconditions.checkArgument(material.isBlock(), "Material.%s must be a block", material);
|
||||
|
||||
@ -28,7 +28,7 @@ index 558d95381bca2f950824748b05e59e4ced7347c3..f2e4494a31dd7ca7e099c6960a9e6378
|
||||
return (FallingBlock) entity.getBukkitEntity();
|
||||
}
|
||||
|
||||
@@ -1423,7 +1428,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -1432,7 +1437,12 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
Preconditions.checkArgument(location != null, "Location cannot be null");
|
||||
Preconditions.checkArgument(data != null, "BlockData cannot be null");
|
||||
|
||||
@ -43,15 +43,15 @@ index 558d95381bca2f950824748b05e59e4ced7347c3..f2e4494a31dd7ca7e099c6960a9e6378
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
index 0aa6cd6da72c4a48d8bb48adeccc2bb49939fabd..08316493785e0cf1f93f07dda8016ca5956216f8 100644
|
||||
index abcfb3accb715a5a041de4b798cf3582d1fde325..7ba6302ecb72fa6e523054e7e3223d79eedf6589 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
@@ -378,7 +378,7 @@ public final class CraftEntityTypes {
|
||||
register(new EntityTypeData<>(EntityType.PRIMED_TNT, TNTPrimed.class, CraftTNTPrimed::new, spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null)));
|
||||
@@ -386,7 +386,7 @@ public final class CraftEntityTypes {
|
||||
register(new EntityTypeData<>(EntityType.TNT, TNTPrimed.class, CraftTNTPrimed::new, spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null)));
|
||||
register(new EntityTypeData<>(EntityType.FALLING_BLOCK, FallingBlock.class, CraftFallingBlock::new, spawnData -> {
|
||||
BlockPos pos = BlockPos.containing(spawnData.x(), spawnData.y(), spawnData.z());
|
||||
- return FallingBlockEntity.fall(spawnData.minecraftWorld(), pos, spawnData.world().getBlockState(pos));
|
||||
+ return new FallingBlockEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), spawnData.world().getBlockState(pos)); // Paper - create falling block entities correctly
|
||||
}));
|
||||
register(new EntityTypeData<>(EntityType.FIREWORK, Firework.class, CraftFirework::new, spawnData -> new FireworkRocketEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), net.minecraft.world.item.ItemStack.EMPTY)));
|
||||
register(new EntityTypeData<>(EntityType.FIREWORK_ROCKET, Firework.class, CraftFirework::new, spawnData -> new FireworkRocketEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), net.minecraft.world.item.ItemStack.EMPTY)));
|
||||
register(new EntityTypeData<>(EntityType.EVOKER_FANGS, EvokerFangs.class, CraftEvokerFangs::new, spawnData -> new net.minecraft.world.entity.projectile.EvokerFangs(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), (float) Math.toRadians(spawnData.yaw()), 0, null)));
|
@ -15,26 +15,27 @@ piercing arrows to avoid duplicate damage being applied.
|
||||
protected net.minecraft.world.entity.projectile.Projectile hitCancelled
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
index b3972c0aececb1d7170a47bbe8f1d6ce02d11331..c30f19162e33dbe8f018b7dc66210681b6027389 100644
|
||||
index 8e8258333e181491b2d5b61ebdb80de36e8179a9..2df84bc367f650c3d468e0f09ed565e68de43a82 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
@@ -298,6 +298,19 @@ public abstract class AbstractArrow extends Projectile {
|
||||
@@ -305,10 +305,18 @@ public abstract class AbstractArrow extends Projectile {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Paper start - Fix cancelling ProjectileHitEvent for piercing arrows
|
||||
+ @Override
|
||||
+ public void preOnHit(HitResult hitResult) {
|
||||
+ super.preOnHit(hitResult);
|
||||
@Override
|
||||
- protected double getDefaultGravity() {
|
||||
- return 0.05D;
|
||||
+ public ProjectileDeflection preHitTargetOrDeflectSelf(HitResult hitResult) {
|
||||
+ if (hitResult instanceof EntityHitResult entityHitResult && this.hitCancelled && this.getPierceLevel() > 0) {
|
||||
+ if (this.piercingIgnoreEntityIds == null) {
|
||||
+ this.piercingIgnoreEntityIds = new IntOpenHashSet(5);
|
||||
+ }
|
||||
+ this.piercingIgnoreEntityIds.add(entityHitResult.getEntity().getId());
|
||||
+ }
|
||||
+ }
|
||||
+ super.preHitTargetOrDeflectSelf(hitResult);
|
||||
}
|
||||
+ // Paper end - Fix cancelling ProjectileHitEvent for piercing arrows
|
||||
+
|
||||
|
||||
private boolean shouldFall() {
|
||||
return this.inGround && this.level().noCollision((new AABB(this.position(), this.position())).inflate(0.06D));
|
||||
}
|
@ -20,10 +20,10 @@ public net.minecraft.world.entity.projectile.Projectile canHitEntity(Lnet/minecr
|
||||
Co-authored-by: Nassim Jahnke <nassim@njahnke.dev>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
|
||||
index 0204257ca0245830534592922e400a362c347715..252355d19e4f07406f78616e2366182758e0947b 100644
|
||||
index 14444325c0ed62c5f0ec230a7e191b0904e7b1ae..125941177bc7c74ee743449c5ea498781ee34975 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
|
||||
@@ -101,6 +101,11 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
||||
@@ -100,6 +100,11 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
||||
@Override
|
||||
protected void onHit(HitResult hitResult) {
|
||||
super.onHit(hitResult);
|
||||
@ -34,31 +34,31 @@ index 0204257ca0245830534592922e400a362c347715..252355d19e4f07406f78616e23661827
|
||||
+ // Paper end - More projectile API
|
||||
if (!this.level().isClientSide) {
|
||||
ItemStack itemstack = this.getItem();
|
||||
Potion potionregistry = PotionUtils.getPotion(itemstack);
|
||||
@@ -114,7 +119,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
||||
PotionContents potioncontents = (PotionContents) itemstack.getOrDefault(DataComponents.POTION_CONTENTS, PotionContents.EMPTY);
|
||||
@@ -111,7 +116,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
||||
if (this.isLingering()) {
|
||||
showParticles = this.makeAreaOfEffectCloud(itemstack, potionregistry, hitResult); // CraftBukkit - Pass MovingObjectPosition // Paper
|
||||
showParticles = this.makeAreaOfEffectCloud(itemstack, hitResult); // CraftBukkit - Pass MovingObjectPosition // Paper
|
||||
} else {
|
||||
- showParticles = this.applySplash(list, hitResult.getType() == HitResult.Type.ENTITY ? ((EntityHitResult) hitResult).getEntity() : null, hitResult); // CraftBukkit - Pass MovingObjectPosition // Paper
|
||||
+ showParticles = this.applySplash(list, hitResult != null && hitResult.getType() == HitResult.Type.ENTITY ? ((EntityHitResult) hitResult).getEntity() : null, hitResult); // CraftBukkit - Pass MovingObjectPosition // Paper - More projectile API
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +181,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
||||
@@ -173,7 +178,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
||||
|
||||
}
|
||||
|
||||
- private boolean applySplash(List<MobEffectInstance> list, @Nullable Entity entity, HitResult position) { // CraftBukkit - Pass MovingObjectPosition // Paper - Fix potions splash events
|
||||
+ private boolean applySplash(List<MobEffectInstance> list, @Nullable Entity entity, @Nullable HitResult position) { // CraftBukkit - Pass MovingObjectPosition // Paper - Fix potions splash events & More projectile API
|
||||
- private boolean applySplash(Iterable<MobEffectInstance> iterable, @Nullable Entity entity, HitResult position) { // CraftBukkit - Pass MovingObjectPosition // Paper - Fix potions splash events
|
||||
+ private boolean applySplash(Iterable<MobEffectInstance> iterable, @Nullable Entity entity, @Nullable HitResult position) { // CraftBukkit - Pass MovingObjectPosition // Paper - Fix potions splash events & More projectile API
|
||||
AABB axisalignedbb = this.getBoundingBox().inflate(4.0D, 2.0D, 4.0D);
|
||||
List<net.minecraft.world.entity.LivingEntity> list1 = this.level().getEntitiesOfClass(net.minecraft.world.entity.LivingEntity.class, axisalignedbb);
|
||||
List<net.minecraft.world.entity.LivingEntity> list = this.level().getEntitiesOfClass(net.minecraft.world.entity.LivingEntity.class, axisalignedbb);
|
||||
Map<LivingEntity, Double> affected = new HashMap<LivingEntity, Double>(); // CraftBukkit
|
||||
@@ -253,7 +258,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
||||
@@ -251,7 +256,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
||||
|
||||
}
|
||||
|
||||
- private boolean makeAreaOfEffectCloud(ItemStack itemstack, Potion potionregistry, HitResult position) { // CraftBukkit - Pass MovingObjectPosition // Paper - return boolean
|
||||
+ private boolean makeAreaOfEffectCloud(ItemStack itemstack, Potion potionregistry, @Nullable HitResult position) { // CraftBukkit - Pass MovingObjectPosition // Paper - return boolean & More projectile API
|
||||
- private boolean makeAreaOfEffectCloud(PotionContents potioncontents, HitResult position) { // CraftBukkit - Pass MovingObjectPosition
|
||||
+ private boolean makeAreaOfEffectCloud(PotionContents potioncontents, @Nullable HitResult position) { // CraftBukkit - Pass MovingObjectPosition // Paper - More projectile API
|
||||
AreaEffectCloud entityareaeffectcloud = new AreaEffectCloud(this.level(), this.getX(), this.getY(), this.getZ());
|
||||
Entity entity = this.getOwner();
|
||||
|
||||
@ -133,33 +133,11 @@ index 91c2d0b40d3fca86938cd454e1415a4eea3df7c7..c1c52f4fc5f900fac4098e5e37c52dfc
|
||||
+ // Paper end - More projectile API
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
|
||||
index a24a6fe5bf634bb02654b0ec4f771aa07458ce84..0fd2677181d741e553b9825c8c319a209194ec46 100644
|
||||
index 62fe1ae5cfdcba84d8d1456a9939e4649aea8794..291e97eedda1c6d77d53631253be8c3333b88ff2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftArrow.java
|
||||
@@ -60,20 +60,7 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow {
|
||||
this.getHandle().setCritArrow(critical);
|
||||
}
|
||||
|
||||
- @Override
|
||||
- public ProjectileSource getShooter() {
|
||||
- return this.getHandle().projectileSource;
|
||||
- }
|
||||
-
|
||||
- @Override
|
||||
- public void setShooter(ProjectileSource shooter) {
|
||||
- if (shooter instanceof Entity) {
|
||||
- this.getHandle().setOwner(((CraftEntity) shooter).getHandle());
|
||||
- } else {
|
||||
- this.getHandle().setOwner(null);
|
||||
- }
|
||||
- this.getHandle().projectileSource = shooter;
|
||||
- }
|
||||
+ // Paper - moved to AbstractProjectile
|
||||
|
||||
@Override
|
||||
public boolean isInBlock() {
|
||||
@@ -101,6 +88,35 @@ public class CraftArrow extends AbstractProjectile implements AbstractArrow {
|
||||
this.getHandle().pickup = net.minecraft.world.entity.projectile.AbstractArrow.Pickup.byOrdinal(status.ordinal());
|
||||
@@ -72,6 +72,35 @@ public class CraftArrow extends CraftAbstractArrow implements Arrow {
|
||||
return false;
|
||||
}
|
||||
|
||||
+ // Paper start
|
||||
@ -192,10 +170,10 @@ index a24a6fe5bf634bb02654b0ec4f771aa07458ce84..0fd2677181d741e553b9825c8c319a20
|
||||
+ // Paper end
|
||||
+
|
||||
@Override
|
||||
public void setTicksLived(int value) {
|
||||
super.setTicksLived(value);
|
||||
public boolean hasCustomEffects() {
|
||||
return !this.getHandle().getPotionContents().customEffects().isEmpty();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
|
||||
index e1a2f0924da6ebcdf332040f922226af5d8a2d45..a8699b274b51c5f6691557c3c3db88436f05e304 100644
|
||||
index 3815b68e139702f3f97c4fa2a77a0314d83fa758..939a0713c74dd92273190017d3976d894f002d95 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftFireball.java
|
||||
@@ -32,20 +32,7 @@ public class CraftFireball extends AbstractProjectile implements Fireball {
|
||||
@ -460,10 +438,10 @@ index d685d09cae5f862c0004f148298c800736d2139e..636c4481e3afdf20197e502cf221f5d3
|
||||
public String toString() {
|
||||
return "CraftShulkerBullet";
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java
|
||||
index 269af20a6d0d100909a0aea0bdba307ea0658f3e..d5f1681a476c8fe2ae128a84910f4bf04063b75a 100644
|
||||
index a7443a61e796e8b8f4b480085a77e098d1b134e5..a5edfd484737b5f6af8aa1d9a1d31d7d2710f7da 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftThrownPotion.java
|
||||
@@ -35,11 +35,31 @@ public class CraftThrownPotion extends CraftThrowableProjectile implements Throw
|
||||
@@ -36,11 +36,31 @@ public class CraftThrownPotion extends CraftThrowableProjectile implements Throw
|
||||
@Override
|
||||
public void setItem(ItemStack item) {
|
||||
Preconditions.checkArgument(item != null, "ItemStack cannot be null");
|
||||
@ -497,10 +475,10 @@ index 269af20a6d0d100909a0aea0bdba307ea0658f3e..d5f1681a476c8fe2ae128a84910f4bf0
|
||||
public net.minecraft.world.entity.projectile.ThrownPotion getHandle() {
|
||||
return (net.minecraft.world.entity.projectile.ThrownPotion) this.entity;
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java
|
||||
index 20f9735c7cb76024e15dbdca7684f5c560876175..8a6af0db8e0aa0cffbf19584be747076c2c8ee44 100644
|
||||
index e374b9f40eddca13b30855d25a2030f8df98138f..4fc893378fb0568ddcffc7593d66df6bfe23f659 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTrident.java
|
||||
@@ -53,5 +53,15 @@ public class CraftTrident extends CraftArrow implements Trident {
|
||||
@@ -53,5 +53,15 @@ public class CraftTrident extends CraftAbstractArrow implements Trident {
|
||||
com.google.common.base.Preconditions.checkArgument(loyaltyLevel >= 0 && loyaltyLevel <= 127, "The loyalty level has to be between 0 and 127");
|
||||
this.getHandle().setLoyalty((byte) loyaltyLevel);
|
||||
}
|
||||
@ -517,10 +495,10 @@ index 20f9735c7cb76024e15dbdca7684f5c560876175..8a6af0db8e0aa0cffbf19584be747076
|
||||
// Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 7d72ccdd82daa6afe85859f5bc6ec7b187622384..fb0426a1d864f3c60637e394e5bedb3963677df1 100644
|
||||
index 28d371e59d8780bf6e154bac56ee189b3b43b201..dd092e44a18e238e4a8b4d8a791ef4267af01c04 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -833,19 +833,19 @@ public class CraftEventFactory {
|
||||
@@ -832,19 +832,19 @@ public class CraftEventFactory {
|
||||
/**
|
||||
* PotionSplashEvent
|
||||
*/
|
||||
@ -543,7 +521,7 @@ index 7d72ccdd82daa6afe85859f5bc6ec7b187622384..fb0426a1d864f3c60637e394e5bedb39
|
||||
hitEntity = ((EntityHitResult) position).getEntity().getBukkitEntity();
|
||||
}
|
||||
|
||||
@@ -854,20 +854,20 @@ public class CraftEventFactory {
|
||||
@@ -853,20 +853,20 @@ public class CraftEventFactory {
|
||||
return event;
|
||||
}
|
||||
|
||||
@ -568,10 +546,10 @@ index 7d72ccdd82daa6afe85859f5bc6ec7b187622384..fb0426a1d864f3c60637e394e5bedb39
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
index f3195b37c314a1327752ece7ec33dfdae16f0bec..6b75314023adf313937990e31323dff9bacc564b 100644
|
||||
index 13e6fc9f42d63fdbd659462070dc7f0767fbb1d9..79529a5208810d25aeab537eac70ed9c6583ef18 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemStack.java
|
||||
@@ -298,12 +298,20 @@ public final class CraftItemStack extends ItemStack {
|
||||
@@ -293,12 +293,20 @@ public final class CraftItemStack extends ItemStack {
|
||||
public ItemMeta getItemMeta() {
|
||||
return CraftItemStack.getItemMeta(this.handle);
|
||||
}
|
||||
@ -592,5 +570,5 @@ index f3195b37c314a1327752ece7ec33dfdae16f0bec..6b75314023adf313937990e31323dff9
|
||||
- switch (CraftItemStack.getType(item)) {
|
||||
+ switch (material) { // Paper
|
||||
case WRITTEN_BOOK:
|
||||
return new CraftMetaBookSigned(item.getTag());
|
||||
return new CraftMetaBookSigned(item.getComponentsPatch());
|
||||
case WRITABLE_BOOK:
|
@ -10,23 +10,23 @@ indefinitely. Instead of using the world state, we use the already
|
||||
supplied ServerLevelAccessor which will always have the chunk available.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
||||
index 534630b0161c8d869e49e7a59572193550be0671..7dfd2b17e82a80683af28779d0bd8f64a909c3b6 100644
|
||||
index f3b0e5a97ad5d344741dfa3b7c864712c7ba8802..d2e273f58b4c9b65642980d3f47e01ae92166e46 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
||||
@@ -364,7 +364,7 @@ public class Cat extends TamableAnimal implements VariantHolder<CatVariant> {
|
||||
});
|
||||
@@ -367,7 +367,7 @@ public class Cat extends TamableAnimal implements VariantHolder<Holder<CatVarian
|
||||
BuiltInRegistries.CAT_VARIANT.getRandomElementOf(tagkey, world.getRandom()).ifPresent(this::setVariant);
|
||||
ServerLevel worldserver = world.getLevel();
|
||||
|
||||
- if (worldserver.structureManager().getStructureWithPieceAt(this.blockPosition(), StructureTags.CATS_SPAWN_AS_BLACK).isValid()) {
|
||||
+ if (worldserver.structureManager().getStructureWithPieceAt(this.blockPosition(), StructureTags.CATS_SPAWN_AS_BLACK, world).isValid()) { // Paper - Fix swamp hut cat generation deadlock
|
||||
this.setVariant((CatVariant) BuiltInRegistries.CAT_VARIANT.getOrThrow(CatVariant.ALL_BLACK));
|
||||
this.setVariant((Holder) BuiltInRegistries.CAT_VARIANT.getHolderOrThrow(CatVariant.ALL_BLACK));
|
||||
this.setPersistenceRequired();
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/StructureManager.java b/src/main/java/net/minecraft/world/level/StructureManager.java
|
||||
index 09e0c6b6bddcba2f4a59838ac63cda3188f71e41..07eb481380e8fd4e492f36342ba633579c1b624e 100644
|
||||
index ceec33ced3d0b65a3e800378e250d0166d0c195f..54972cce2314eff774250101df43a9b7074e9604 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/StructureManager.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/StructureManager.java
|
||||
@@ -46,7 +46,12 @@ public class StructureManager {
|
||||
@@ -48,7 +48,12 @@ public class StructureManager {
|
||||
}
|
||||
|
||||
public List<StructureStart> startsForStructure(ChunkPos pos, Predicate<Structure> predicate) {
|
||||
@ -40,20 +40,25 @@ index 09e0c6b6bddcba2f4a59838ac63cda3188f71e41..07eb481380e8fd4e492f36342ba63357
|
||||
Builder<StructureStart> builder = ImmutableList.builder();
|
||||
|
||||
for (Entry<Structure, LongSet> entry : map.entrySet()) {
|
||||
@@ -111,10 +116,15 @@ public class StructureManager {
|
||||
@@ -116,10 +121,20 @@ public class StructureManager {
|
||||
}
|
||||
|
||||
public StructureStart getStructureWithPieceAt(BlockPos pos, TagKey<Structure> structureTag) {
|
||||
public StructureStart getStructureWithPieceAt(BlockPos pos, Predicate<Holder<Structure>> predicate) {
|
||||
+ // Paper start - Fix swamp hut cat generation deadlock
|
||||
+ return this.getStructureWithPieceAt(pos, structureTag, null);
|
||||
+ return this.getStructureWithPieceAt(pos, predicate, null);
|
||||
+ }
|
||||
+ public StructureStart getStructureWithPieceAt(BlockPos pos, TagKey<Structure> structureTag, @Nullable ServerLevelAccessor levelAccessor) {
|
||||
+
|
||||
+ public StructureStart getStructureWithPieceAt(BlockPos pos, TagKey<Structure> tag, @Nullable ServerLevelAccessor levelAccessor) {
|
||||
+ return this.getStructureWithPieceAt(pos, structure -> structure.is(tag), levelAccessor);
|
||||
+ }
|
||||
+
|
||||
+ public StructureStart getStructureWithPieceAt(BlockPos pos, Predicate<Holder<Structure>> predicate, @Nullable ServerLevelAccessor levelAccessor) {
|
||||
+ // Paper end - Fix swamp hut cat generation deadlock
|
||||
Registry<Structure> registry = this.registryAccess().registryOrThrow(Registries.STRUCTURE);
|
||||
|
||||
for (StructureStart structureStart : this.startsForStructure(
|
||||
- new ChunkPos(pos), structure -> registry.getHolder(registry.getId(structure)).map(reference -> reference.is(structureTag)).orElse(false)
|
||||
+ new ChunkPos(pos), structure -> registry.getHolder(registry.getId(structure)).map(reference -> reference.is(structureTag)).orElse(false), levelAccessor // Paper - Fix swamp hut cat generation deadlock
|
||||
- new ChunkPos(pos), structure -> registry.getHolder(registry.getId(structure)).map(predicate::test).orElse(false)
|
||||
+ new ChunkPos(pos), structure -> registry.getHolder(registry.getId(structure)).map(predicate::test).orElse(false), levelAccessor // Paper - Fix swamp hut cat generation deadlock
|
||||
)) {
|
||||
if (this.structureHasPieceAt(pos, structureStart)) {
|
||||
return structureStart;
|
@ -7,10 +7,10 @@ Bring the vehicle move packet behavior in line with the
|
||||
regular player move packet.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 7127c6f163cc00eb439eb37665df3e1a4bf27cc2..47d47d1979ca543679884e256dc805d2362d619d 100644
|
||||
index 39ba1860b6c0384f04fa9219c976c144cc4027fe..21922416b68d6097c44749fc18fcf1f5634323f4 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -464,6 +464,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
@@ -490,6 +490,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
this.disconnect(Component.translatable("multiplayer.disconnect.invalid_vehicle_movement"), org.bukkit.event.player.PlayerKickEvent.Cause.INVALID_VEHICLE_MOVEMENT); // Paper - kick event cause
|
||||
} else {
|
||||
Entity entity = this.player.getRootVehicle();
|
@ -5,7 +5,7 @@ Subject: [PATCH] Implement getComputedBiome API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
index af14244caba22e750ee7baba03bb7ce267795b21..fbcf1320ef9c1817b24aa8724cd6cf07319c20b9 100644
|
||||
index 4932ba59a6b70b405f7dd05358f6bb00b629d34c..d1c265733941874002f6dfc7543917af88600659 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
@@ -76,6 +76,13 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
@ -41,7 +41,7 @@ index 068b3735b6c50a7a2053c7dc39856f728fb7218a..6d10396347b69d9243ab902ecc68ede9
|
||||
public void setBiome(Biome bio) {
|
||||
this.getWorld().setBiome(this.getX(), this.getY(), this.getZ(), bio);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java
|
||||
index 423a853192c87eb81b79cb6f17866c4665cc1655..ca9bb98ccfc3863c2ba538953470ab9e2b8a2f29 100644
|
||||
index 09c282b3fbbdec82f21ab97fe0a486eacc2c2e8b..06ab1ac654e0c6f0ab7208783d186ed306ce204f 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/generator/CraftLimitedRegion.java
|
||||
@@ -165,6 +165,14 @@ public class CraftLimitedRegion extends CraftRegionAccessor implements LimitedRe
|
@ -5,10 +5,10 @@ Subject: [PATCH] Implement enchantWithLevels API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
index ef0c6e04a89704688f7b5461b27c0036abbf647d..c421649a0c88ee9c773bb6985f7114e58f08a7a1 100644
|
||||
index acf57732dd902bd23166e60788477b69e023cb35..071f4fe53fbea333b5db52ac719c5e6b833ffe19 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftItemFactory.java
|
||||
@@ -579,4 +579,20 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
@@ -589,4 +589,20 @@ public final class CraftItemFactory implements ItemFactory {
|
||||
return eggItem == null ? null : new net.minecraft.world.item.ItemStack(eggItem).asBukkitMirror();
|
||||
}
|
||||
// Paper end - old getSpawnEgg API
|
@ -6,10 +6,10 @@ Subject: [PATCH] Fix saving in unloadWorld
|
||||
Change savingDisabled to false to ensure ServerLevel's saving logic gets called when unloadWorld is called with save = true
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index d8bec75e7f5c034051839818f51cdae71863608c..713d36b8bcb3f39f7f0cff61532199416970bcf4 100644
|
||||
index a7545b824dcf38a7e5e743e639f54d0e4d9b78aa..27072040887df4ff117179cfa5e7a39ef27c7501 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1343,7 +1343,7 @@ public final class CraftServer implements Server {
|
||||
@@ -1349,7 +1349,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
try {
|
||||
if (save) {
|
@ -13,10 +13,10 @@ we'll also only gen a trace for the first one, I see no real pressing need
|
||||
to generate more, given that that would *massively* negate this patch otherwise
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/WorldGenRegion.java b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
||||
index d11741d2618976bdb51f75d823f260f32d5bafc9..ff94af5be8de374f5cde2607eebbb23e65705581 100644
|
||||
index 744efc6cdc99f653a1eb9d4f26af8a7c34627f5e..a343bb1b1ee2cd2ecd75be00aa91d5418dcdec76 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/WorldGenRegion.java
|
||||
@@ -275,6 +275,7 @@ public class WorldGenRegion implements WorldGenLevel {
|
||||
@@ -283,6 +283,7 @@ public class WorldGenRegion implements WorldGenLevel {
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,17 +24,18 @@ index d11741d2618976bdb51f75d823f260f32d5bafc9..ff94af5be8de374f5cde2607eebbb23e
|
||||
@Override
|
||||
public boolean ensureCanWrite(BlockPos pos) {
|
||||
int i = SectionPos.blockToSectionCoord(pos.getX());
|
||||
@@ -294,7 +295,15 @@ public class WorldGenRegion implements WorldGenLevel {
|
||||
@@ -302,7 +303,15 @@ public class WorldGenRegion implements WorldGenLevel {
|
||||
|
||||
return true;
|
||||
} else {
|
||||
- Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + String.valueOf(pos) + ", status: " + String.valueOf(this.generatingStatus) + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
|
||||
+ // Paper start - Buffer OOB setBlock calls
|
||||
+ if (!hasSetFarWarned) {
|
||||
Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + pos + ", status: " + this.generatingStatus + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
|
||||
+ hasSetFarWarned = true;
|
||||
+ if (this.getServer() != null && this.getServer().isDebugging()) {
|
||||
+ io.papermc.paper.util.TraceUtil.dumpTraceForThread("far setBlock call");
|
||||
+ }
|
||||
+ Util.logAndPauseIfInIde("Detected setBlock in a far chunk [" + i + ", " + j + "], pos: " + String.valueOf(pos) + ", status: " + String.valueOf(this.generatingStatus) + (this.currentlyGenerating == null ? "" : ", currently generating: " + (String) this.currentlyGenerating.get()));
|
||||
+ hasSetFarWarned = true;
|
||||
+ if (this.getServer() != null && this.getServer().isDebugging()) {
|
||||
+ io.papermc.paper.util.TraceUtil.dumpTraceForThread("far setBlock call");
|
||||
+ }
|
||||
+ }
|
||||
+ // Paper end - Buffer OOB setBlock calls
|
||||
return false;
|
@ -5,10 +5,10 @@ Subject: [PATCH] Add TameableDeathMessageEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/TamableAnimal.java b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
|
||||
index ae474216d54317a9d102cb6832225074c94c8e4b..01b91388577b6013d7bd5c9112a03f818fee1f9c 100644
|
||||
index 8c387df4d1e0b714edb07f177e85fe2ec4706b2a..ed2514de46d0939259ca4e45a6dc96d7c1dac20d 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/TamableAnimal.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/TamableAnimal.java
|
||||
@@ -195,7 +195,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
|
||||
@@ -196,7 +196,12 @@ public abstract class TamableAnimal extends Animal implements OwnableEntity {
|
||||
@Override
|
||||
public void die(DamageSource damageSource) {
|
||||
if (!this.level().isClientSide && this.level().getGameRules().getBoolean(GameRules.RULE_SHOWDEATHMESSAGES) && this.getOwner() instanceof ServerPlayer) {
|
@ -14,10 +14,10 @@ Co-authored-by: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com>
|
||||
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java b/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java
|
||||
index b7abd8309a7d9744d3b3df9be8cad54f8909cc15..d3a2a6dee2d83b3df0ddc521c080f7d72b709461 100644
|
||||
index 6a7052cd6ec88ed4aaea2fef0ebc750060d1dec0..2ade08d1466660ee1787fa97908002ef56389712 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/ai/behavior/HarvestFarmland.java
|
||||
@@ -107,7 +107,7 @@ public class HarvestFarmland extends Behavior<Villager> {
|
||||
@@ -108,7 +108,7 @@ public class HarvestFarmland extends Behavior<Villager> {
|
||||
Block block1 = world.getBlockState(this.aboveFarmlandPos.below()).getBlock();
|
||||
|
||||
if (block instanceof CropBlock && ((CropBlock) block).isMaxAge(iblockdata)) {
|
||||
@ -65,10 +65,10 @@ index f4bc556e245179d0a4710e5255dd289aaafdceb7..d802985f1431be4332c07f0dab88feeb
|
||||
this.level.setBlock(blockposition1, Blocks.DIRT.defaultBlockState(), 2);
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
||||
index 6e1c67ad757e466d122badd547ee3f8421eba9ba..cf4859814a60468f683e3afe285b4934d35e9704 100644
|
||||
index 8feb886acf3b60356f1cba9e09a0cdea9ea8266a..b58300e114e2e27ac68d7a9489bc52b127c9bc17 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Rabbit.java
|
||||
@@ -580,7 +580,7 @@ public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
|
||||
@@ -577,7 +577,7 @@ public class Rabbit extends Animal implements VariantHolder<Rabbit.Variant> {
|
||||
|
||||
if (i == 0) {
|
||||
// CraftBukkit start
|
||||
@ -78,36 +78,36 @@ index 6e1c67ad757e466d122badd547ee3f8421eba9ba..cf4859814a60468f683e3afe285b4934
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
index 25f611b35a5710c595574d2d6ed50c442ca55721..6c215470ad05d59f903cbeff15088a03b42c3f66 100644
|
||||
index b5cb4e4682f66ac9423af8d1547d0f1a4f9e6c5d..aa22829c3d41118664a872540fdc8f716120c407 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/wither/WitherBoss.java
|
||||
@@ -375,7 +375,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
@@ -377,7 +377,7 @@ public class WitherBoss extends Monster implements PowerableMob, RangedAttackMob
|
||||
|
||||
if (WitherBoss.canDestroy(iblockdata)) {
|
||||
// CraftBukkit start
|
||||
- if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.defaultBlockState())) {
|
||||
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, iblockdata.getFluidState().createLegacyBlock())) { // Paper - fix wrong block state
|
||||
continue;
|
||||
}
|
||||
// CraftBukkit end
|
||||
if (WitherBoss.canDestroy(iblockdata)) {
|
||||
// CraftBukkit start
|
||||
- if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, Blocks.AIR.defaultBlockState())) {
|
||||
+ if (!CraftEventFactory.callEntityChangeBlockEvent(this, blockposition, iblockdata.getFluidState().createLegacyBlock())) { // Paper - fix wrong block state
|
||||
continue;
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
index c360135b923aa8d1ed2c7caf97ede981cb605cf2..f33c03e81b7ff643741f56eea055e6af260de618 100644
|
||||
index 57f84a0eccbdb051adddc25a1a7126f60c7c274b..260202fab3ac300552c557b44dcf251f083c6a78 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/EnderMan.java
|
||||
@@ -580,7 +580,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
@@ -563,7 +563,7 @@ public class EnderMan extends Monster implements NeutralMob {
|
||||
boolean flag = movingobjectpositionblock.getBlockPos().equals(blockposition);
|
||||
|
||||
if (iblockdata.is(BlockTags.ENDERMAN_HOLDABLE) && flag) {
|
||||
- if (CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, Blocks.AIR.defaultBlockState())) { // CraftBukkit - Place event
|
||||
+ if (CraftEventFactory.callEntityChangeBlockEvent(this.enderman, blockposition, iblockdata.getFluidState().createLegacyBlock())) { // CraftBukkit - Place event // Paper - fix wrong block state
|
||||
world.removeBlock(blockposition, false);
|
||||
world.gameEvent(GameEvent.BLOCK_DESTROY, blockposition, GameEvent.Context.of(this.enderman, iblockdata));
|
||||
world.gameEvent((Holder) GameEvent.BLOCK_DESTROY, blockposition, GameEvent.Context.of(this.enderman, iblockdata));
|
||||
this.enderman.setCarriedBlock(iblockdata.getBlock().defaultBlockState());
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Ravager.java b/src/main/java/net/minecraft/world/entity/monster/Ravager.java
|
||||
index aac60e85cd6dba7d87f4a1663c2c62952521d112..151acc43c96b4545ce92d3d559d8e1591874b4b5 100644
|
||||
index cec801ba14bed8b043b2375f1bf9e7811a63e995..2d7b7c949faaaaae94c0043132a4a822f55df104 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Ravager.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Ravager.java
|
||||
@@ -158,7 +158,7 @@ public class Ravager extends Raider {
|
||||
@@ -150,7 +150,7 @@ public class Ravager extends Raider {
|
||||
|
||||
if (block instanceof LeavesBlock) {
|
||||
// CraftBukkit start
|
||||
@ -117,10 +117,10 @@ index aac60e85cd6dba7d87f4a1663c2c62952521d112..151acc43c96b4545ce92d3d559d8e159
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
|
||||
index 0e2725d92002c181f542e2335cdd6e6de69155e1..fcd5cc3ff8d4b38f4dea08f78723db3dac53ffde 100644
|
||||
index 9ff42b0ae2b82dc3092e38e1439d89b4ab554b17..860e385fc83f9787dca92efe35d21fd69c4dd635 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Silverfish.java
|
||||
@@ -182,7 +182,8 @@ public class Silverfish extends Monster {
|
||||
@@ -162,7 +162,8 @@ public class Silverfish extends Monster {
|
||||
|
||||
if (block instanceof InfestedBlock) {
|
||||
// CraftBukkit start
|
||||
@ -131,10 +131,10 @@ index 0e2725d92002c181f542e2335cdd6e6de69155e1..fcd5cc3ff8d4b38f4dea08f78723db3d
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
|
||||
index 252355d19e4f07406f78616e2366182758e0947b..2b05824f5826a2da2539f8a6d373a16c185aa80a 100644
|
||||
index 125941177bc7c74ee743449c5ea498781ee34975..d5e9f2bb692a162c3a2ed93498aa9649d6554cd9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/ThrownPotion.java
|
||||
@@ -307,7 +307,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
||||
@@ -290,7 +290,7 @@ public class ThrownPotion extends ThrowableItemProjectile implements ItemSupplie
|
||||
|
||||
if (iblockdata.is(BlockTags.FIRE)) {
|
||||
// CraftBukkit start
|
||||
@ -144,7 +144,7 @@ index 252355d19e4f07406f78616e2366182758e0947b..2b05824f5826a2da2539f8a6d373a16c
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/ChorusFlowerBlock.java b/src/main/java/net/minecraft/world/level/block/ChorusFlowerBlock.java
|
||||
index 87c66bf8fee56e77b25498d9b2524fe2b6fd6549..0ab1bbd7c8dc8e45f754434357898d8fc990a021 100644
|
||||
index bb1487dd2c8e4374f75a102ab5e17ce9b2d31114..6709cb6b657a8612781c2fe4dd76ee38f329c5ba 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/ChorusFlowerBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/ChorusFlowerBlock.java
|
||||
@@ -284,7 +284,7 @@ public class ChorusFlowerBlock extends Block {
|
||||
@ -157,10 +157,10 @@ index 87c66bf8fee56e77b25498d9b2524fe2b6fd6549..0ab1bbd7c8dc8e45f754434357898d8f
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java
|
||||
index 998e43e8dc6bd6b741bdcb77d2b75df8ab2feefc..d0e679745a794228bf62a9aa59422776760f3867 100644
|
||||
index ec9190abe3edf7c3845156bb967dddf6ae7c30ff..95cb7492ac691a8e8aa9894f701b802a7eda5446 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/PointedDripstoneBlock.java
|
||||
@@ -133,7 +133,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate
|
||||
@@ -134,7 +134,7 @@ public class PointedDripstoneBlock extends Block implements Fallable, SimpleWate
|
||||
|
||||
if (projectile.mayInteract(world, blockposition) && projectile.mayBreak(world) && projectile instanceof ThrownTrident && projectile.getDeltaMovement().length() > 0.6D) {
|
||||
// CraftBukkit start
|
||||
@ -170,10 +170,10 @@ index 998e43e8dc6bd6b741bdcb77d2b75df8ab2feefc..d0e679745a794228bf62a9aa59422776
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/TntBlock.java b/src/main/java/net/minecraft/world/level/block/TntBlock.java
|
||||
index 4edd2e7bb62df65d6da8c8a623cf03e7e947bf75..5fa5e8c838720eb1491aea73d462f4bc7d779956 100644
|
||||
index 58b8c3cc579a1d34af26c44d6a7413bd5cc9e4e7..aef1638fe0b41eb04a55671ac1163753e9a8e70f 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/TntBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/TntBlock.java
|
||||
@@ -163,7 +163,7 @@ public class TntBlock extends Block {
|
||||
@@ -160,7 +160,7 @@ public class TntBlock extends Block {
|
||||
|
||||
if (projectile.isOnFire() && projectile.mayInteract(world, blockposition)) {
|
||||
// CraftBukkit start
|
||||
@ -183,7 +183,7 @@ index 4edd2e7bb62df65d6da8c8a623cf03e7e947bf75..5fa5e8c838720eb1491aea73d462f4bc
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java b/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java
|
||||
index 61abbcfe97e3d3e3da5ee658672549d14594ad17..05e14322e519d1399e87beb532e1cc4a95f689aa 100644
|
||||
index edc20745649b0837f1371c8d29e71fc0c8e5528f..932831bb5632ead5850842fc77192c841571162e 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/WaterlilyBlock.java
|
||||
@@ -37,7 +37,7 @@ public class WaterlilyBlock extends BushBlock {
|
||||
@ -196,10 +196,10 @@ index 61abbcfe97e3d3e3da5ee658672549d14594ad17..05e14322e519d1399e87beb532e1cc4a
|
||||
}
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index fb0426a1d864f3c60637e394e5bedb3963677df1..13366b67b20b812a037a199b8a1e6609a4a54444 100644
|
||||
index dd092e44a18e238e4a8b4d8a791ef4267af01c04..70489085763475d29ddddc0bd3279974d0eb73cf 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -1361,11 +1361,11 @@ public class CraftEventFactory {
|
||||
@@ -1356,11 +1356,11 @@ public class CraftEventFactory {
|
||||
return event;
|
||||
}
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] fix player loottables running when mob loot gamerule is false
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index b5a3587a9074a1a2fcc2252d2db8b184b6ab6793..3f8f0e88339d847c44120b7657161bf43402db74 100644
|
||||
index 3db8f376f3a73256d13fd778bb1c80606e6712d9..c9c5e667c2aa26db1fb0038e40598d04a7c80889 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -875,12 +875,14 @@ public class ServerPlayer extends Player {
|
||||
@@ -942,12 +942,14 @@ public class ServerPlayer extends Player {
|
||||
}
|
||||
}
|
||||
}
|
@ -6,10 +6,10 @@ Subject: [PATCH] Ensure entity passenger world matches ridden entity
|
||||
Bad plugins doing this would cause some obvious problems...
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index d391114787e4f7491241b6abc45dcf3f2a7f9fb5..f08908238cc9680310a2b37089b051bf6fdf5ee3 100644
|
||||
index 8e09bfb7c1b4fb34e6615b0cf774bc8e6cae29fa..3bd13975934e8f61b41c4c08b73ead6e0f45ffac 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -2580,7 +2580,7 @@ public abstract class Entity implements Nameable, EntityAccess, CommandSource, S
|
||||
@@ -2611,7 +2611,7 @@ public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess
|
||||
}
|
||||
|
||||
public boolean startRiding(Entity entity, boolean force) {
|
@ -5,10 +5,10 @@ Subject: [PATCH] Allow changing the EnderDragon podium
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
index 6d01175ea2092bc5f5ebb7aa066450bfec2443a1..61e4f8be9f5927b65ae03da98250d3cd4c1e8c13 100644
|
||||
index 789823dbaaf2e23942749145dbb64071539624aa..e8be7ddbef12b27ed5c5fcfa8b726d5a85058aa9 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/boss/enderdragon/EnderDragon.java
|
||||
@@ -104,6 +104,10 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
@@ -102,6 +102,10 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
private final int[] nodeAdjacency;
|
||||
private final BinaryHeap openSet;
|
||||
private final Explosion explosionSource; // CraftBukkit - reusable source for CraftTNTPrimed.getSource()
|
||||
@ -19,7 +19,7 @@ index 6d01175ea2092bc5f5ebb7aa066450bfec2443a1..61e4f8be9f5927b65ae03da98250d3cd
|
||||
|
||||
public EnderDragon(EntityType<? extends EnderDragon> entitytypes, Level world) {
|
||||
super(EntityType.ENDER_DRAGON, world);
|
||||
@@ -144,6 +148,19 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
@@ -142,6 +146,19 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
return Mob.createMobAttributes().add(Attributes.MAX_HEALTH, 200.0D);
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ index 6d01175ea2092bc5f5ebb7aa066450bfec2443a1..61e4f8be9f5927b65ae03da98250d3cd
|
||||
@Override
|
||||
public boolean isFlapping() {
|
||||
float f = Mth.cos(this.flapTime * 6.2831855F);
|
||||
@@ -995,7 +1012,7 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
@@ -993,7 +1010,7 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
d0 = segment2[1] - segment1[1];
|
||||
}
|
||||
} else {
|
||||
@ -48,7 +48,7 @@ index 6d01175ea2092bc5f5ebb7aa066450bfec2443a1..61e4f8be9f5927b65ae03da98250d3cd
|
||||
double d1 = Math.max(Math.sqrt(blockposition.distToCenterSqr(this.position())) / 4.0D, 1.0D);
|
||||
|
||||
d0 = (double) segmentOffset / d1;
|
||||
@@ -1022,7 +1039,7 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
@@ -1020,7 +1037,7 @@ public class EnderDragon extends Mob implements Enemy {
|
||||
vec3d = this.getViewVector(tickDelta);
|
||||
}
|
||||
} else {
|
@ -9,7 +9,7 @@ is not a WorldGenRegion, we can bypass the deadlock entirely.
|
||||
See https://bugs.mojang.com/browse/MC-246262
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
|
||||
index be8aab51a1b92a3a0cc94976975fc3aabc46f0b4..ae8a42261337bf736d0cc1bbe18da2b773417ca4 100644
|
||||
index bd401b38239fb7e510f82f458f9336b7da372da0..b5365dce7882c98b5be4f5df877165eee80933dd 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplate.java
|
||||
@@ -279,7 +279,11 @@ public class StructureTemplate {
|
@ -5,11 +5,11 @@ Subject: [PATCH] Prevent tile entity copies loading chunks
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 47d47d1979ca543679884e256dc805d2362d619d..19bc63da6bca5b3ff62bb2a148b35e0d3f93bb1d 100644
|
||||
index 21922416b68d6097c44749fc18fcf1f5634323f4..ae440c8b7597d08ae62dfe301b20886f82c720ca 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -3111,7 +3111,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
BlockPos blockposition = BlockEntity.getPosFromTag(nbttagcompound);
|
||||
@@ -3195,7 +3195,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
BlockPos blockposition = BlockEntity.getPosFromTag(customdata.getUnsafe());
|
||||
|
||||
if (this.player.level().isLoaded(blockposition)) {
|
||||
- BlockEntity tileentity = this.player.level().getBlockEntity(blockposition);
|
||||
@ -21,4 +21,4 @@ index 47d47d1979ca543679884e256dc805d2362d619d..19bc63da6bca5b3ff62bb2a148b35e0d
|
||||
+ // Paper end - Prevent tile entity copies loading chunks
|
||||
|
||||
if (tileentity != null) {
|
||||
tileentity.saveToItem(itemstack);
|
||||
tileentity.saveToItem(itemstack, this.player.level().registryAccess());
|
@ -6,10 +6,10 @@ Subject: [PATCH] Use username instead of display name in
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 8ba90d47d7015c0081d341915035ce65baa6b9a4..6fbcea8fd32a425cab936330d5d9545782e03346 100644
|
||||
index 4338015bbe0a0c33146190c81191fa62b6991499..42d609cc3bd13e957b6f2194552da34393849790 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -1435,7 +1435,7 @@ public abstract class PlayerList {
|
||||
@@ -1434,7 +1434,7 @@ public abstract class PlayerList {
|
||||
// CraftBukkit start
|
||||
public ServerStatsCounter getPlayerStats(ServerPlayer entityhuman) {
|
||||
ServerStatsCounter serverstatisticmanager = entityhuman.getStats();
|
@ -5,10 +5,10 @@ Subject: [PATCH] Expand PlayerItemDamageEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ItemStack.java b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
index a8f1953da3a5684079fb0cdb88cb3caf72d43646..59c4550b4cb8b0317f5256efc9376265f4583b60 100644
|
||||
index 2616a8fedcf67b395f1a7c9ef26ab7a34e38bb41..a80d225a7a4206acc4b93e328c96adf4411dad1d 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ItemStack.java
|
||||
@@ -640,10 +640,11 @@ public final class ItemStack {
|
||||
@@ -653,10 +653,11 @@ public final class ItemStack implements DataComponentHolder {
|
||||
}
|
||||
}
|
||||
|
25
patches/server/0718-WorldCreator-keepSpawnLoaded.patch
Normale Datei
25
patches/server/0718-WorldCreator-keepSpawnLoaded.patch
Normale Datei
@ -0,0 +1,25 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Sat, 3 Jul 2021 21:18:28 +0100
|
||||
Subject: [PATCH] WorldCreator#keepSpawnLoaded
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 27072040887df4ff117179cfa5e7a39ef27c7501..70de655fd319863260bbfb0316fad892ba2f4af0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1308,6 +1308,14 @@ public final class CraftServer implements Server {
|
||||
internal.setSpawnSettings(true, true);
|
||||
// Paper - Put world into worldlist before initing the world; move up
|
||||
|
||||
+ // Paper start
|
||||
+ if (creator.keepSpawnLoaded().toBooleanOrElse(internal.getWorld().getKeepSpawnInMemory())) {
|
||||
+ GameRules.IntegerValue rule = internal.getGameRules().getRule(GameRules.RULE_SPAWN_CHUNK_RADIUS);
|
||||
+ rule.deserialize("0");
|
||||
+ rule.onChanged(internal);
|
||||
+ }
|
||||
+ // Paper end
|
||||
+
|
||||
this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal);
|
||||
internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API
|
||||
|
@ -5,10 +5,10 @@ Subject: [PATCH] Trigger bee_nest_destroyed trigger in the correct place
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
index 4fe571915b247ec612b2376dce57991e441f63c2..8f4c9b99b638cfce8cc7c55f6369f62e757f4e48 100644
|
||||
index f080322bc766361b9d2d8b1214c3dff1c3df9ae8..d8c5f8e584976a97bd909bfa20023993ab776952 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayerGameMode.java
|
||||
@@ -421,12 +421,16 @@ public class ServerPlayerGameMode {
|
||||
@@ -424,12 +424,16 @@ public class ServerPlayerGameMode {
|
||||
block.destroy(this.level, pos, iblockdata1);
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ index 4fe571915b247ec612b2376dce57991e441f63c2..8f4c9b99b638cfce8cc7c55f6369f62e
|
||||
|
||||
itemstack.mineBlock(this.level, iblockdata1, pos, this.player);
|
||||
if (flag && flag1 && event.isDropItems()) { // CraftBukkit - Check if block should drop items
|
||||
@@ -447,6 +451,13 @@ public class ServerPlayerGameMode {
|
||||
@@ -450,6 +454,13 @@ public class ServerPlayerGameMode {
|
||||
if (flag && event != null) {
|
||||
iblockdata.getBlock().popExperience(this.level, pos, event.getExpToDrop(), this.player); // Paper
|
||||
}
|
||||
@ -40,7 +40,7 @@ index 4fe571915b247ec612b2376dce57991e441f63c2..8f4c9b99b638cfce8cc7c55f6369f62e
|
||||
return true;
|
||||
// CraftBukkit end
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
|
||||
index 27f1c1ac12251f1438ee8bf14f4afb5fe601138f..799e44ae5a7c3d6994653d43d455c39f3e30b012 100644
|
||||
index 7b311f60ceae9942eeee0d2c7a170278e5983f2d..4e8bafa97127632799a1f0260c1ef3367cb8a54c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/BeehiveBlock.java
|
||||
@@ -95,7 +95,7 @@ public class BeehiveBlock extends BaseEntityBlock {
|
@ -5,11 +5,11 @@ Subject: [PATCH] Add EntityDyeEvent and CollarColorable interface
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Cat.java b/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
||||
index 7dfd2b17e82a80683af28779d0bd8f64a909c3b6..1d0c424be2b67cad0f8bca85070a9c46a6b283da 100644
|
||||
index d2e273f58b4c9b65642980d3f47e01ae92166e46..57c22ca91e9f3a161f5277914e379ea9dc8eeeef 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Cat.java
|
||||
@@ -402,6 +402,13 @@ public class Cat extends TamableAnimal implements VariantHolder<CatVariant> {
|
||||
DyeColor enumcolor = ((DyeItem) item).getDyeColor();
|
||||
@@ -388,6 +388,13 @@ public class Cat extends TamableAnimal implements VariantHolder<Holder<CatVarian
|
||||
DyeColor enumcolor = itemdye.getDyeColor();
|
||||
|
||||
if (enumcolor != this.getCollarColor()) {
|
||||
+ // Paper start - Add EntityDyeEvent and CollarColorable interface
|
||||
@ -19,14 +19,14 @@ index 7dfd2b17e82a80683af28779d0bd8f64a909c3b6..1d0c424be2b67cad0f8bca85070a9c46
|
||||
+ }
|
||||
+ enumcolor = DyeColor.byId(event.getColor().getWoolData());
|
||||
+ // Paper end - Add EntityDyeEvent and CollarColorable interface
|
||||
this.setCollarColor(enumcolor);
|
||||
if (!player.getAbilities().instabuild) {
|
||||
itemstack.shrink(1);
|
||||
if (!this.level().isClientSide()) {
|
||||
this.setCollarColor(enumcolor);
|
||||
itemstack.consume(1, player);
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
||||
index 9ebb994b62b58352525da21385f02803e8414687..2d20b2c1f58beb1ad8c9012d8124e476899e6be6 100644
|
||||
index 11f4a2e15d42a029406fe8399b8d93ae136f0295..b5ee82e5abfecc59e2362628f288b76881855f36 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
|
||||
@@ -369,6 +369,14 @@ public class Wolf extends TamableAnimal implements NeutralMob {
|
||||
@@ -447,6 +447,14 @@ public class Wolf extends TamableAnimal implements NeutralMob, VariantHolder<Hol
|
||||
DyeColor enumcolor = itemdye.getDyeColor();
|
||||
|
||||
if (enumcolor != this.getCollarColor()) {
|
||||
@ -39,5 +39,5 @@ index 9ebb994b62b58352525da21385f02803e8414687..2d20b2c1f58beb1ad8c9012d8124e476
|
||||
+ // Paper end - Add EntityDyeEvent and CollarColorable interface
|
||||
+
|
||||
this.setCollarColor(enumcolor);
|
||||
if (!player.getAbilities().instabuild) {
|
||||
itemstack.shrink(1);
|
||||
itemstack.consume(1, player);
|
||||
return InteractionResult.SUCCESS;
|
@ -1,27 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Sat, 3 Jul 2021 21:18:28 +0100
|
||||
Subject: [PATCH] WorldCreator#keepSpawnLoaded
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index 713d36b8bcb3f39f7f0cff61532199416970bcf4..f3b461baac5a5de61f6b1c00251961bd25eb4773 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -1290,7 +1290,7 @@ public final class CraftServer implements Server {
|
||||
|
||||
ServerLevel internal = (ServerLevel) new ServerLevel(this.console, this.console.executor, worldSession, worlddata, worldKey, worlddimension, this.getServer().progressListenerFactory.create(11),
|
||||
worlddata.isDebugWorld(), j, creator.environment() == Environment.NORMAL ? list : ImmutableList.of(), true, this.console.overworld().getRandomSequences(), creator.environment(), generator, biomeProvider);
|
||||
- internal.keepSpawnInMemory = creator.keepSpawnInMemory();
|
||||
+ // internal.keepSpawnInMemory = creator.keepSpawnInMemory(); // Paper - replace
|
||||
|
||||
if (!(this.worlds.containsKey(name.toLowerCase(java.util.Locale.ENGLISH)))) {
|
||||
return null;
|
||||
@@ -1302,6 +1302,7 @@ public final class CraftServer implements Server {
|
||||
internal.setSpawnSettings(true, true);
|
||||
// Paper - Put world into worldlist before initing the world; move up
|
||||
|
||||
+ internal.keepSpawnInMemory = creator.keepSpawnLoaded().toBooleanOrElse(internal.getWorld().getKeepSpawnInMemory()); // Paper
|
||||
this.getServer().prepareLevels(internal.getChunkSource().chunkMap.progressListener, internal);
|
||||
internal.entityManager.tick(); // SPIGOT-6526: Load pending entities so they are available to the API
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren