1.21.3
This commit is contained in:
@@ -5,7 +5,7 @@ Subject: [PATCH] Build changes
|
||||
|
||||
|
||||
diff --git a/build.gradle.kts b/build.gradle.kts
|
||||
index 421f6b3dc8890d63d2e7aa774d0bf8f7e15890ab..da5b65786a9fde73b5d4be5d89e4fbad3d3faa87 100644
|
||||
index faf3e3fd72e8c915e7a4803dacbe1bb576c6663e..256c09e98005cc64e2bc739ce6e880954664d693 100644
|
||||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -1,6 +1,8 @@
|
||||
@@ -17,8 +17,8 @@ index 421f6b3dc8890d63d2e7aa774d0bf8f7e15890ab..da5b65786a9fde73b5d4be5d89e4fbad
|
||||
plugins {
|
||||
java
|
||||
`maven-publish`
|
||||
@@ -13,7 +15,9 @@ configurations.named(log4jPlugins.compileClasspathConfigurationName) {
|
||||
val alsoShade: Configuration by configurations.creating
|
||||
@@ -25,7 +27,9 @@ abstract class MockitoAgentProvider : CommandLineArgumentProvider {
|
||||
// Paper end - configure mockito agent that is needed in newer java versions
|
||||
|
||||
dependencies {
|
||||
- implementation(project(":paper-api"))
|
||||
@@ -26,9 +26,9 @@ index 421f6b3dc8890d63d2e7aa774d0bf8f7e15890ab..da5b65786a9fde73b5d4be5d89e4fbad
|
||||
+ implementation(project(":parchment-api"))
|
||||
+ // Parchment end
|
||||
// Paper start
|
||||
implementation("org.jline:jline-terminal-jansi:3.21.0")
|
||||
implementation("net.minecrell:terminalconsoleappender:1.3.0")
|
||||
@@ -84,14 +88,14 @@ tasks.jar {
|
||||
implementation("org.jline:jline-terminal-ffm:3.27.1") // use ffm on java 22+
|
||||
implementation("org.jline:jline-terminal-jni:3.27.1") // fall back to jni on java 21
|
||||
@@ -99,14 +103,14 @@ tasks.jar {
|
||||
val gitBranch = git("rev-parse", "--abbrev-ref", "HEAD").getText().trim() // Paper
|
||||
attributes(
|
||||
"Main-Class" to "org.bukkit.craftbukkit.Main",
|
||||
@@ -48,7 +48,7 @@ index 421f6b3dc8890d63d2e7aa774d0bf8f7e15890ab..da5b65786a9fde73b5d4be5d89e4fbad
|
||||
"Build-Number" to (build ?: ""),
|
||||
"Build-Time" to Instant.now().toString(),
|
||||
"Git-Branch" to gitBranch, // Paper
|
||||
@@ -112,6 +116,27 @@ tasks.compileTestJava {
|
||||
@@ -127,6 +131,27 @@ tasks.compileTestJava {
|
||||
|
||||
publishing {
|
||||
publications.create<MavenPublication>("maven") {
|
||||
@@ -76,7 +76,7 @@ index 421f6b3dc8890d63d2e7aa774d0bf8f7e15890ab..da5b65786a9fde73b5d4be5d89e4fbad
|
||||
}
|
||||
}
|
||||
|
||||
@@ -148,7 +173,7 @@ fun TaskContainer.registerRunTask(
|
||||
@@ -172,7 +197,7 @@ fun TaskContainer.registerRunTask(
|
||||
name: String,
|
||||
block: JavaExec.() -> Unit
|
||||
): TaskProvider<JavaExec> = register<JavaExec>(name) {
|
||||
@@ -112,7 +112,7 @@ index 532306cacd52579cdf37e4aca25887b1ed3ba6a1..87db580c74d20714e2ebe01df23811c7
|
||||
final @Nullable Component history = this.getHistory();
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
index c1e88c31910e96ef07cece05046c0b55e708b52d..0937440b0e793e62f26ccfde9b4441513724ae27 100644
|
||||
index be0d38544395a9b3befb898bb961f34e32fe9509..693a7a0104e8da6c775a1fc718ac0b577a5ce89e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -267,7 +267,7 @@ public class Main {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Temporary Access Transformers
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/core/Holder.java b/src/main/java/net/minecraft/core/Holder.java
|
||||
index d7bbf60ba94ecd85f991a0c5c70c34fdb00ec9d5..724adc4c35aece988af815e7886fcbd727f0e27e 100644
|
||||
index e91c4e26c25980645941ca8fbdcc3a9d02e31063..a73a9d04dfff9d12d3e5425c867f32331a6b5996 100644
|
||||
--- a/src/main/java/net/minecraft/core/Holder.java
|
||||
+++ b/src/main/java/net/minecraft/core/Holder.java
|
||||
@@ -137,6 +137,12 @@ public interface Holder<T> {
|
||||
@@ -138,6 +138,12 @@ public interface Holder<T> {
|
||||
return new Holder.Reference<>(Holder.Reference.Type.INTRUSIVE, owner, null, value);
|
||||
}
|
||||
|
||||
@@ -22,10 +22,10 @@ index d7bbf60ba94ecd85f991a0c5c70c34fdb00ec9d5..724adc4c35aece988af815e7886fcbd7
|
||||
if (this.key == null) {
|
||||
throw new IllegalStateException("Trying to access unbound value '" + this.value + "' from registry " + this.owner);
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BlockItem.java b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
index 96fb69ec6db2e7c8c728435f0c537b076259b2fb..45a5f63268ebd67d6601e86e33f9fa5fd458ad0c 100644
|
||||
index c816c935ecc74a811ffdffbe6ded73c06e92324a..ac457cd1479c219e1975d475a3e6bce17ae6e567 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BlockItem.java
|
||||
@@ -183,7 +183,7 @@ public class BlockItem extends Item {
|
||||
@@ -177,7 +177,7 @@ public class BlockItem extends Item {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,10 +39,10 @@ index 0000000000000000000000000000000000000000..44245b61f64e4e2eb21ac4f5e540aa9a
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
index 22fe529890f34f66534c01248f654dc911b44c3b..dfa777529d3eb3cc0a6713c58b91b74cff25bc0e 100644
|
||||
index f466bfdf5557c94ebee3ad609d9b6f18f86aefef..687907f2ad51dceb523994adabcf8025960aa336 100644
|
||||
--- a/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
+++ b/src/main/java/io/papermc/paper/adventure/PaperAdventure.java
|
||||
@@ -364,6 +364,40 @@ public final class PaperAdventure {
|
||||
@@ -390,6 +390,36 @@ public final class PaperAdventure {
|
||||
return asVanilla(source);
|
||||
}
|
||||
|
||||
@@ -67,27 +67,23 @@ index 22fe529890f34f66534c01248f654dc911b44c3b..dfa777529d3eb3cc0a6713c58b91b74c
|
||||
+ }
|
||||
+
|
||||
+ public static Optional<Holder.Reference<SoundEvent>> asSoundHolder(final net.minecraft.resources.ResourceKey<SoundEvent> key) {
|
||||
+ return BuiltInRegistries.SOUND_EVENT.getHolder(key);
|
||||
+ return BuiltInRegistries.SOUND_EVENT.get(key);
|
||||
+ }
|
||||
+
|
||||
+ public static Optional<Holder.Reference<net.minecraft.sounds.SoundEvent>> asVanillaSoundHolder(final Key key) {
|
||||
+ return asSoundHolder(net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.SOUND_EVENT, asVanilla(key)));
|
||||
+ }
|
||||
+
|
||||
+ @SuppressWarnings("PatternValidation")
|
||||
+ public static Key asAdventure(final ResourceLocation key) {
|
||||
+ return Key.key(key.getNamespace(), key.getPath());
|
||||
+ }
|
||||
+ // Parchment end
|
||||
+
|
||||
public static Packet<?> asSoundPacket(final Sound sound, final double x, final double y, final double z, final long seed, @Nullable BiConsumer<Packet<?>, Float> packetConsumer) {
|
||||
final ResourceLocation name = asVanilla(sound.name());
|
||||
final Optional<SoundEvent> soundEvent = BuiltInRegistries.SOUND_EVENT.getOptional(name);
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 2fe9d9b38c01d04416843fdd48d3e33899b7de63..4d496c5fbf7f7431ac908f40b98578b6123e0d35 100644
|
||||
index 957cae6ddeba9efe3b55588567ae51e8b86b6a42..f6753ed14350b1c2dd7c69e2aed8657295863547 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1645,12 +1645,46 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1693,12 +1693,46 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
|
||||
@Override
|
||||
public void playSeededSound(@Nullable Player source, double x, double y, double z, Holder<SoundEvent> sound, SoundSource category, float volume, float pitch, long seed) {
|
||||
@@ -98,7 +94,7 @@ index 2fe9d9b38c01d04416843fdd48d3e33899b7de63..4d496c5fbf7f7431ac908f40b98578b6
|
||||
+ net.kyori.adventure.sound.Sound.sound()
|
||||
+ .type(sound.unwrap().<net.kyori.adventure.key.Key>map(
|
||||
+ key -> io.papermc.paper.adventure.PaperAdventure.asAdventure(key.location()),
|
||||
+ soundEvent -> io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEvent.getLocation())
|
||||
+ soundEvent -> io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEvent.location())
|
||||
+ ))
|
||||
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(category))
|
||||
+ .volume(volume)
|
||||
@@ -121,7 +117,7 @@ index 2fe9d9b38c01d04416843fdd48d3e33899b7de63..4d496c5fbf7f7431ac908f40b98578b6
|
||||
+ net.kyori.adventure.sound.Sound.sound()
|
||||
+ .type(sound.unwrap().<net.kyori.adventure.key.Key>map(
|
||||
+ key -> io.papermc.paper.adventure.PaperAdventure.asAdventure(key.location()),
|
||||
+ soundEvent -> io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEvent.getLocation())
|
||||
+ soundEvent -> io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEvent.location())
|
||||
+ ))
|
||||
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(category))
|
||||
+ .volume(volume)
|
||||
@@ -137,10 +133,10 @@ index 2fe9d9b38c01d04416843fdd48d3e33899b7de63..4d496c5fbf7f7431ac908f40b98578b6
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 763cffdc2e1e2e7cc9af88cc46bbaa240a20fd0d..73f788c8140fb2992beba1f825ac227c962abe64 100644
|
||||
index 2e8ecf3bbb9f9ceba6f896738fa1ab8e2bd0fed6..94de83a35998c82b807c6e5836d957f317dd2ceb 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -2560,7 +2560,20 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
@@ -2805,7 +2805,20 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
|
||||
@Override
|
||||
public void playNotifySound(SoundEvent sound, SoundSource category, float volume, float pitch) {
|
||||
@@ -149,7 +145,7 @@ index 763cffdc2e1e2e7cc9af88cc46bbaa240a20fd0d..73f788c8140fb2992beba1f825ac227c
|
||||
+ CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent(
|
||||
+ null,
|
||||
+ net.kyori.adventure.sound.Sound.sound()
|
||||
+ .type(io.papermc.paper.adventure.PaperAdventure.asAdventure(sound.getLocation()))
|
||||
+ .type(io.papermc.paper.adventure.PaperAdventure.asAdventure(sound.location()))
|
||||
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(category))
|
||||
+ .volume(volume)
|
||||
+ .pitch(pitch)
|
||||
@@ -163,10 +159,10 @@ index 763cffdc2e1e2e7cc9af88cc46bbaa240a20fd0d..73f788c8140fb2992beba1f825ac227c
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/net/minecraft/server/players/PlayerList.java b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
index 43eeb8ce4bc350c2b524ade11ca25d8d4d21bea5..e37555cf68b6c7108297d98cd84616bad9009bd7 100644
|
||||
index 30de3d1a7792c38ae946f19cb0e14637919b5001..ef10ed017ad5d06c3f34f1287a8721a33fc61ce1 100644
|
||||
--- a/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
+++ b/src/main/java/net/minecraft/server/players/PlayerList.java
|
||||
@@ -907,6 +907,9 @@ public abstract class PlayerList {
|
||||
@@ -876,6 +876,9 @@ public abstract class PlayerList {
|
||||
isBedSpawn = true;
|
||||
}
|
||||
// Paper end - Add PlayerPostRespawnEvent
|
||||
@@ -177,10 +173,10 @@ index 43eeb8ce4bc350c2b524ade11ca25d8d4d21bea5..e37555cf68b6c7108297d98cd84616ba
|
||||
// Added from changeDimension
|
||||
this.sendAllPlayerInfo(entityplayer); // Update health, etc...
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index 09bcbc0ae36e4e69fee87a7e0c49acf496117a39..a4b7229f0de89c315fcf0ecdeeb0ff743d1b05fa 100644
|
||||
index 61d412c4f1ebd55661cc3f0260468e3ac0efe0bb..6b73ca4ca59e3080926155613ce10af82cd43615 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1894,9 +1894,23 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1840,9 +1840,23 @@ public abstract class Player extends LivingEntity {
|
||||
}
|
||||
// Paper start - send while respecting visibility
|
||||
private static void sendSoundEffect(Player fromEntity, double x, double y, double z, SoundEvent soundEffect, SoundSource soundCategory, float volume, float pitch) {
|
||||
@@ -193,7 +189,7 @@ index 09bcbc0ae36e4e69fee87a7e0c49acf496117a39..a4b7229f0de89c315fcf0ecdeeb0ff74
|
||||
+ CraftEventFactory.playSoundEvent(new gg.projecteden.parchment.event.sound.SoundEvent(
|
||||
+ null,
|
||||
+ net.kyori.adventure.sound.Sound.sound()
|
||||
+ .type(io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEffect.getLocation()))
|
||||
+ .type(io.papermc.paper.adventure.PaperAdventure.asAdventure(soundEffect.location()))
|
||||
+ .source(io.papermc.paper.adventure.PaperAdventure.asAdventure(soundCategory))
|
||||
+ .volume(volume)
|
||||
+ .pitch(pitch)
|
||||
@@ -208,10 +204,10 @@ index 09bcbc0ae36e4e69fee87a7e0c49acf496117a39..a4b7229f0de89c315fcf0ecdeeb0ff74
|
||||
}
|
||||
// Paper end - send while respecting visibility
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/raid/Raid.java b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
index dcbef04bbaab988096bf416163264833e84d1967..4117f12172d1d67283fab21851bf2d1c167da1cb 100644
|
||||
index 11cf2d9def087b0898c828eaa21eb5f7b8811d5f..7c1332f6c2fbe615e2831911b6548310532b022e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/raid/Raid.java
|
||||
@@ -561,7 +561,7 @@ public class Raid {
|
||||
@@ -552,7 +552,7 @@ public class Raid {
|
||||
double d2 = vec3d.z + 13.0D / d0 * (vec3d1.z - vec3d.z);
|
||||
|
||||
if (d0 <= 64.0D || collection.contains(entityplayer)) {
|
||||
@@ -221,10 +217,10 @@ index dcbef04bbaab988096bf416163264833e84d1967..4117f12172d1d67283fab21851bf2d1c
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 8dd85b9ca3b3e3429de4d0ec0654982589c6e93e..33daeb74cdf11c5b920e02b191eb62d5d0937f8e 100644
|
||||
index e37aaf77f94b97b736cc20ef070cefdff0400188..c01ea04bc72ea7342722a463a384b1cc664c7afb 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -2251,4 +2251,42 @@ public class CraftEventFactory {
|
||||
@@ -2271,4 +2271,42 @@ public class CraftEventFactory {
|
||||
return event;
|
||||
}
|
||||
// Paper end - add EntityFertilizeEggEvent
|
||||
@@ -240,7 +236,7 @@ index 8dd85b9ca3b3e3429de4d0ec0654982589c6e93e..33daeb74cdf11c5b920e02b191eb62d5
|
||||
+ long seed = sound.seed().orElse(0L); // TODO: random source?
|
||||
+ net.minecraft.resources.ResourceKey<net.minecraft.sounds.SoundEvent> soundKey = net.minecraft.resources.ResourceKey.create(net.minecraft.core.registries.Registries.SOUND_EVENT, name);
|
||||
+ net.minecraft.core.Holder.Reference<net.minecraft.sounds.SoundEvent> soundEvent = io.papermc.paper.adventure.PaperAdventure.asVanillaSoundHolder(sound.name()) // TODO: calculate event distance?
|
||||
+ .orElseGet(() -> net.minecraft.core.Holder.Reference.create(net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT.holderOwner(), soundKey, net.minecraft.sounds.SoundEvent.createFixedRangeEvent(name, (float) event.calculateDistance())));
|
||||
+ .orElseGet(() -> net.minecraft.core.Holder.Reference.create(net.minecraft.core.registries.BuiltInRegistries.SOUND_EVENT, soundKey, net.minecraft.sounds.SoundEvent.createFixedRangeEvent(name, (float) event.calculateDistance())));
|
||||
+ if (emitter instanceof gg.projecteden.parchment.event.sound.SoundEvent.EntityEmitter entityEmitter)
|
||||
+ return new net.minecraft.network.protocol.game.ClientboundSoundEntityPacket(soundEvent, source, ((CraftEntity) entityEmitter.entity()).getHandle(), volume, pitch, seed);
|
||||
+ else if (emitter instanceof gg.projecteden.parchment.event.sound.SoundEvent.LocationEmitter locationEmitter) {
|
||||
|
||||
@@ -5,13 +5,13 @@ Subject: [PATCH] Add PlayerUseRespawnAnchorEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
index 94d067e9eeee73183de25165d8c97043fe256103..3d6e33abbebe526796359fab76768601c227fbe8 100644
|
||||
index 9117c035d5a6ff114b028fad3380ceb1fc2b9691..c490b30531bf722b31db88aa4937d3fd777c2844 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/RespawnAnchorBlock.java
|
||||
@@ -65,7 +65,33 @@ public class RespawnAnchorBlock extends Block {
|
||||
@@ -64,7 +64,33 @@ public class RespawnAnchorBlock extends Block {
|
||||
|
||||
@Override
|
||||
protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||
protected InteractionResult useItemOn(ItemStack stack, BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||
+ // Parchment start -- PlayerUseRespawnAnchorEvent
|
||||
+ org.bukkit.entity.Player bukkitPlayer = player.getBukkitEntity() instanceof org.bukkit.entity.Player ? (org.bukkit.entity.Player) player.getBukkitEntity() : null;
|
||||
+ org.bukkit.block.Block block = org.bukkit.craftbukkit.block.CraftBlock.at(world, pos);
|
||||
@@ -28,7 +28,7 @@ index 94d067e9eeee73183de25165d8c97043fe256103..3d6e33abbebe526796359fab76768601
|
||||
+ } else if (!world.isClientSide) {
|
||||
+ result = gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.SET_SPAWN;
|
||||
+ } else {
|
||||
+ return ItemInteractionResult.SUCCESS;
|
||||
+ return InteractionResult.SUCCESS;
|
||||
+ }
|
||||
+ if (bukkitPlayer != null) {
|
||||
+ gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent event = new gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent(bukkitPlayer, block, result);
|
||||
@@ -36,9 +36,9 @@ index 94d067e9eeee73183de25165d8c97043fe256103..3d6e33abbebe526796359fab76768601
|
||||
+ result = event.getResult();
|
||||
+ }
|
||||
+ if (result == gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.NOTHING) {
|
||||
+ return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
|
||||
+ return InteractionResult.PASS;
|
||||
+ } else if (result == gg.projecteden.parchment.event.player.PlayerUseRespawnAnchorEvent.RespawnAnchorResult.CHARGE) {
|
||||
+ // Parchment end
|
||||
RespawnAnchorBlock.charge(player, world, pos, state);
|
||||
stack.consume(1, player);
|
||||
return ItemInteractionResult.sidedSuccess(world.isClientSide);
|
||||
return InteractionResult.SUCCESS;
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add UnsafeValues#canPlaceItemOn
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
index 41c34ffdf9d95a04ed55a1e09ebc78e8cf946777..b43be3c60dc46cd11b652f315d641f16b44b13f2 100644
|
||||
index 507f908916cbeb592496f963b46e4c2121a7b5e3..356999f8359838f248ad0e673fef23a82a0560c8 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java
|
||||
@@ -690,6 +690,55 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
@@ -702,6 +702,55 @@ public final class CraftMagicNumbers implements UnsafeValues {
|
||||
}
|
||||
// Paper end - proxy ItemStack
|
||||
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Player#setGameProfile
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index a4b7229f0de89c315fcf0ecdeeb0ff743d1b05fa..0acb4ef6d4ea60d7e4bc17534e84a7a9b477f04e 100644
|
||||
index 6b73ca4ca59e3080926155613ce10af82cd43615..09ed0bd5f012ae2e34d5ed58828475577b6ab6f8 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -1566,6 +1566,12 @@ public abstract class Player extends LivingEntity {
|
||||
@@ -1523,6 +1523,12 @@ public abstract class Player extends LivingEntity {
|
||||
return this.gameProfile;
|
||||
}
|
||||
|
||||
|
||||
@@ -5,13 +5,14 @@ Subject: [PATCH] Expose MCUtil Executors
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
index c8b82bc41f2042bb4b067f06265a3a22e51f7629..6ee706a17443cd53d6f3d768df07e6e5b51db670 100644
|
||||
index cac8592e3a2f438fe9ca167a4fdcd65152bbb2de..b85d19598c09a14e68fced841de2148bf6f469e0 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
|
||||
@@ -3218,4 +3218,16 @@ public final class CraftServer implements Server {
|
||||
return this.potionBrewer;
|
||||
@@ -3258,4 +3258,18 @@ public final class CraftServer implements Server {
|
||||
this.console.addPluginAllowingSleep(plugin.getName(), value);
|
||||
}
|
||||
// Paper end
|
||||
// Paper end - API to check if the server is sleeping
|
||||
+
|
||||
+
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
@@ -24,4 +25,5 @@ index c8b82bc41f2042bb4b067f06265a3a22e51f7629..6ee706a17443cd53d6f3d768df07e6e5
|
||||
+ return io.papermc.paper.util.MCUtil.MAIN_EXECUTOR;
|
||||
+ }
|
||||
+ // Parchment end
|
||||
+
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ to easily get the items being dropped by any
|
||||
block instead of only blocks broken by players.
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index a7108b2be0746aa1f0e574d8c6f5ffad6d369835..d9aff85fce2a65794dd57cf790f878b4fc4ec54e 100644
|
||||
index b6d6c2cb9b227a17fb4ce42bc75f92206fbea043..43c288a4e226060a5e0cecddd941846d29ae8025 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -301,7 +301,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -292,7 +292,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
|
||||
public static void dropResources(BlockState state, Level world, BlockPos pos) {
|
||||
if (world instanceof ServerLevel) {
|
||||
@@ -20,7 +20,7 @@ index a7108b2be0746aa1f0e574d8c6f5ffad6d369835..d9aff85fce2a65794dd57cf790f878b4
|
||||
Block.popResource(world, pos, itemstack);
|
||||
});
|
||||
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
|
||||
@@ -311,7 +311,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -302,7 +302,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
|
||||
public static void dropResources(BlockState state, LevelAccessor world, BlockPos pos, @Nullable BlockEntity blockEntity) {
|
||||
if (world instanceof ServerLevel) {
|
||||
@@ -29,7 +29,7 @@ index a7108b2be0746aa1f0e574d8c6f5ffad6d369835..d9aff85fce2a65794dd57cf790f878b4
|
||||
Block.popResource((ServerLevel) world, pos, itemstack);
|
||||
});
|
||||
state.spawnAfterBreak((ServerLevel) world, pos, ItemStack.EMPTY, true);
|
||||
@@ -347,7 +347,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -338,7 +338,7 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
public static void dropResources(BlockState state, Level world, BlockPos pos, @Nullable BlockEntity blockEntity, @Nullable Entity entity, ItemStack tool, boolean dropExperience) {
|
||||
// Paper end - Properly handle xp dropping
|
||||
if (world instanceof ServerLevel) {
|
||||
@@ -39,10 +39,10 @@ index a7108b2be0746aa1f0e574d8c6f5ffad6d369835..d9aff85fce2a65794dd57cf790f878b4
|
||||
});
|
||||
state.spawnAfterBreak((ServerLevel) world, pos, tool, dropExperience); // Paper - Properly handle xp dropping
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
index 8f438df5d9112460e5b1664a56688bb1c6ddc6fa..d19b9c7773d7d416085dc5a4dbe8113ad5fe9c41 100644
|
||||
index 0af82fae494762fec22afbb2363d24370dbdb71b..f29ddf243147a866b2b17f41556ff3d817aedf2e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java
|
||||
@@ -2288,5 +2288,19 @@ public class CraftEventFactory {
|
||||
@@ -2308,5 +2308,19 @@ public class CraftEventFactory {
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -215,10 +215,10 @@ index 0000000000000000000000000000000000000000..e7114e456f818d7bdd4081620f4b9b93
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 8045d6c9398d1c88595da6e41aa1ed27fb6fbad0..a5a98d23f1b339b320761446a3c4f1f6a3ec3b1f 100644
|
||||
index 8f234b46c24a0ae08aa5f8190c5b27e1f62dfbab..77c914fb58403f4b6c2d145664740d1fb59bb261 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
@@ -2475,4 +2475,11 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
@@ -2510,4 +2510,15 @@ public class CraftWorld extends CraftRegionAccessor implements World {
|
||||
return this.adventure$pointers;
|
||||
}
|
||||
// Paper end
|
||||
@@ -226,7 +226,11 @@ index 8045d6c9398d1c88595da6e41aa1ed27fb6fbad0..a5a98d23f1b339b320761446a3c4f1f6
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
+ public ItemStack smeltItem(ItemStack toSmelt, gg.projecteden.parchment.inventory.RecipeType recipeType) {
|
||||
+ return world.getRecipeManager().getRecipeFor(gg.projecteden.parchment.inventory.CraftRecipeType.asCookingRecipe(recipeType), new net.minecraft.world.item.crafting.SingleRecipeInput(CraftItemStack.asNMSCopy(toSmelt)), world).map(recipe -> recipe.value().getResultItem(world.registryAccess()).getBukkitStack()).orElse(null);
|
||||
+ var optional = world.recipeAccess().getRecipeFor(gg.projecteden.parchment.inventory.CraftRecipeType.asCookingRecipe(recipeType), new net.minecraft.world.item.crafting.SingleRecipeInput(CraftItemStack.asNMSCopy(toSmelt)), world).map(recipe -> recipe.value()).orElse(null);
|
||||
+ if (optional == null) {
|
||||
+ return null;
|
||||
+ }
|
||||
+ return optional.assemble(new net.minecraft.world.item.crafting.SingleRecipeInput(CraftItemStack.asNMSCopy(toSmelt)), world.registryAccess()).asBukkitCopy();
|
||||
+ }
|
||||
+ // Parchment end
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Disable sleep status announcements
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerLevel.java b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
index 4d496c5fbf7f7431ac908f40b98578b6123e0d35..5619beb2cf3b5c31e392a2c4a1b7fc01330c7587 100644
|
||||
index f6753ed14350b1c2dd7c69e2aed8657295863547..1d614e2e4274ac24abd74dfb10c52d6624e0a9de 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerLevel.java
|
||||
@@ -1003,7 +1003,7 @@ public class ServerLevel extends Level implements WorldGenLevel, ca.spottedleaf.
|
||||
@@ -1068,7 +1068,7 @@ public class ServerLevel extends Level implements ServerEntityGetter, WorldGenLe
|
||||
}
|
||||
|
||||
private void announceSleepStatus() {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add config for ticking TIME_SINCE_REST
|
||||
|
||||
|
||||
diff --git a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
index 4bcf27f98765abf693e535cfc1756c27a10cb316..6a698656c90c368d5c64f4a0b2a16500c7dadc02 100644
|
||||
index b1c917d65076a3805e5b78cb946753f0c101e214..7034391701ce34119c6cfc22a8dd2dec6293f63d 100644
|
||||
--- a/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
+++ b/src/main/java/io/papermc/paper/configuration/WorldConfiguration.java
|
||||
@@ -290,6 +290,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
@@ -317,6 +317,7 @@ public class WorldConfiguration extends ConfigurationPart {
|
||||
}
|
||||
|
||||
public boolean disablePlayerCrits = false;
|
||||
@@ -17,7 +17,7 @@ index 4bcf27f98765abf693e535cfc1756c27a10cb316..6a698656c90c368d5c64f4a0b2a16500
|
||||
@Comment("Prevents merging items that are not on the same y level, preventing potential visual artifacts.")
|
||||
public boolean onlyMergeItemsHorizontally = false;
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/player/Player.java b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
index 0acb4ef6d4ea60d7e4bc17534e84a7a9b477f04e..dae72e66a976701c0cb1fc26e6c37657b79da423 100644
|
||||
index 09ed0bd5f012ae2e34d5ed58828475577b6ab6f8..e280cd56a4dc446edab97e6c48397e03edb2ca1e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/player/Player.java
|
||||
@@ -304,7 +304,7 @@ public abstract class Player extends LivingEntity {
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add HangingFrame Tick API
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
index 25f5c7346f06bcb58cdaaee2a61b0154761925df..dfc29d0f7a5c7f10588438f4b1d3b00b003a7974 100644
|
||||
index 799b1fc67bd16029ea26c480e21f5f51877343ab..da1ec6e15fe9525e50f2389eeea6719eb8d8882f 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/decoration/HangingEntity.java
|
||||
@@ -20,7 +20,11 @@ import org.apache.commons.lang3.Validate;
|
||||
@@ -21,7 +21,11 @@ import org.apache.commons.lang3.Validate;
|
||||
|
||||
public abstract class HangingEntity extends BlockAttachedEntity {
|
||||
protected static final Predicate<Entity> HANGING_ENTITY = entity -> entity instanceof HangingEntity;
|
||||
@@ -20,7 +20,7 @@ index 25f5c7346f06bcb58cdaaee2a61b0154761925df..dfc29d0f7a5c7f10588438f4b1d3b00b
|
||||
|
||||
protected HangingEntity(EntityType<? extends HangingEntity> type, Level world) {
|
||||
super(type, world);
|
||||
@@ -53,6 +57,38 @@ public abstract class HangingEntity extends BlockAttachedEntity {
|
||||
@@ -54,6 +58,38 @@ public abstract class HangingEntity extends BlockAttachedEntity {
|
||||
protected abstract AABB calculateBoundingBox(BlockPos pos, Direction side);
|
||||
|
||||
@Override
|
||||
@@ -49,7 +49,7 @@ index 25f5c7346f06bcb58cdaaee2a61b0154761925df..dfc29d0f7a5c7f10588438f4b1d3b00b
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+ this.discard(org.bukkit.event.entity.EntityRemoveEvent.Cause.DROP); // CraftBukkit - add Bukkit remove cause
|
||||
+ this.dropItem((Entity) null);
|
||||
+ this.dropItem((ServerLevel) this.level(), (Entity) null);
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Player#getHiddenEntities API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 992437a6e838f653f32d33b5b3f702c484640a97..49d5cdd931de7c28faadd211a52109f28a9df6e5 100644
|
||||
index d0010dfd22463986bf3be9b3ee015ce92735753e..17b353b44fb15726203ecf643961a8242f2a9372 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -2165,6 +2165,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -2179,6 +2179,17 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.server.getPluginManager().callEvent(new PlayerShowEntityEvent(this, entity));
|
||||
}
|
||||
// Paper start
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Blast-MC <cjblanton2@gmail.com>
|
||||
Date: Wed, 20 Jul 2022 05:26:25 -0400
|
||||
Subject: [PATCH] Add Timings Events
|
||||
|
||||
|
||||
diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
index 7620c72a4c243cbeea245203ce03a97cbfa7d922..37da50840a55e9df555aaf3aceb21661e472bcff 100644
|
||||
--- a/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
+++ b/src/main/java/co/aikar/timings/TimingsExport.java
|
||||
@@ -348,6 +348,8 @@ public class TimingsExport extends Thread {
|
||||
timingsURL = con.getHeaderField("Location");
|
||||
listeners.sendMessage(text("View Timings Report: ", NamedTextColor.GREEN).append(text(timingsURL).clickEvent(ClickEvent.clickEvent(ClickEvent.Action.OPEN_URL, timingsURL))));
|
||||
|
||||
+ new co.aikar.timings.event.TimingsGenerateReportEvent(this.listeners, timingsURL).callEvent();
|
||||
+
|
||||
if (response != null && !response.isEmpty()) {
|
||||
Bukkit.getLogger().log(Level.INFO, "Timing Response: " + response);
|
||||
}
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Expanded Insomnia API
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
index 49d5cdd931de7c28faadd211a52109f28a9df6e5..1dc933a1b8a5d731de0d1a1e9754eafb8460224d 100644
|
||||
index 17b353b44fb15726203ecf643961a8242f2a9372..b137889665a2e678951c631053d0f8cecd2adc95 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java
|
||||
@@ -213,6 +213,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@@ -218,6 +218,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
private static final boolean DISABLE_CHANNEL_LIMIT = System.getProperty("paper.disableChannelLimit") != null; // Paper - add a flag to disable the channel limit
|
||||
private long lastSaveTime; // Paper - getLastPlayed replacement API
|
||||
|
||||
@@ -17,10 +17,10 @@ index 49d5cdd931de7c28faadd211a52109f28a9df6e5..1dc933a1b8a5d731de0d1a1e9754eafb
|
||||
public CraftPlayer(CraftServer server, ServerPlayer entity) {
|
||||
super(server, entity);
|
||||
|
||||
@@ -3565,4 +3567,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
((ca.spottedleaf.moonrise.patches.chunk_system.player.ChunkSystemServerPlayer)this.getHandle())
|
||||
.moonrise$getViewDistanceHolder().setSendViewDistance(viewDistance);
|
||||
@@ -3589,4 +3591,31 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
this.getHandle().connection.send(new net.minecraft.network.protocol.game.ClientboundEntityEventPacket(((CraftEntity) target).getHandle(), effect.getData()));
|
||||
}
|
||||
// Paper end - entity effect API
|
||||
+
|
||||
+ // Parchment start
|
||||
+ @Override
|
||||
48
patches/server/0017-Add-spam-bypass-permission.patch
Normal file
48
patches/server/0017-Add-spam-bypass-permission.patch
Normal file
@@ -0,0 +1,48 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Blast-MC <cjblanton2@gmail.com>
|
||||
Date: Mon, 25 Jul 2022 09:11:13 -0400
|
||||
Subject: [PATCH] Add spam bypass permission
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index b5d5dbc50a7b8c40739a15f164ffd08fdc534f9c..ef65deee8c878a3a6b7349b2421473ac550e4e1c 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -802,9 +802,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
|
||||
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - AsyncTabCompleteEvent; run this async
|
||||
// CraftBukkit start
|
||||
- if (!this.tabSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) { // Paper - configurable tab spam limits
|
||||
- this.disconnectAsync(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - Kick event cause // Paper - add proper async disconnect
|
||||
- return;
|
||||
+ if (!this.getCraftPlayer().hasPermission("spam.bypass")) { // Parchment - spam bypass
|
||||
+ if (!this.tabSpamThrottler.isIncrementAndUnderThreshold() && !this.server.getPlayerList().isOp(this.player.getGameProfile()) && !this.server.isSingleplayerOwner(this.player.getGameProfile())) { // Paper - configurable tab spam limits
|
||||
+ this.disconnectAsync(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - Kick event cause // Paper - add proper async disconnect
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
// CraftBukkit end
|
||||
// Paper start - Don't suggest if tab-complete is disabled
|
||||
@@ -2559,6 +2561,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
// Spigot start - spam exclusions
|
||||
private void detectRateSpam(String s) {
|
||||
+ if (this.getCraftPlayer().hasPermission("spam.bypass")) return; // Parchment - spam bypass
|
||||
// CraftBukkit start - replaced with thread safe throttle
|
||||
for ( String exclude : org.spigotmc.SpigotConfig.spamExclusions )
|
||||
{
|
||||
@@ -3339,9 +3342,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {
|
||||
// Paper start - auto recipe limit
|
||||
if (!org.bukkit.Bukkit.isPrimaryThread()) {
|
||||
- if (!this.recipeSpamPackets.isIncrementAndUnderThreshold()) {
|
||||
- this.disconnectAsync(net.minecraft.network.chat.Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause // Paper - add proper async disconnect
|
||||
- return;
|
||||
+ if (!this.getCraftPlayer().hasPermission("spam.bypass")) { // Parchment - spam bypass
|
||||
+ if (!this.recipeSpamPackets.isIncrementAndUnderThreshold()) {
|
||||
+ this.disconnectAsync(net.minecraft.network.chat.Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause // Paper - add proper async disconnect
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
}
|
||||
// Paper end - auto recipe limit
|
||||
@@ -1,50 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Blast-MC <cjblanton2@gmail.com>
|
||||
Date: Mon, 25 Jul 2022 09:11:13 -0400
|
||||
Subject: [PATCH] Add spam bypass permission
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
index 60ff21c8df4168f14da04a12073bde47cd4693c4..51c9f6239d0bbf2090b29cc3052a0925b1763649 100644
|
||||
--- a/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
+++ b/src/main/java/net/minecraft/server/network/ServerGamePacketListenerImpl.java
|
||||
@@ -756,9 +756,11 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
public void handleCustomCommandSuggestions(ServerboundCommandSuggestionPacket packet) {
|
||||
// PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel()); // Paper - AsyncTabCompleteEvent; run this async
|
||||
// CraftBukkit start
|
||||
- if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper - configurable tab spam limits
|
||||
- this.disconnect(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - Kick event cause
|
||||
- return;
|
||||
+ if (!this.getCraftPlayer().hasPermission("spam.bypass")) { // Parchment - spam bypass
|
||||
+ if (this.chatSpamTickCount.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.tabSpamLimit && !this.server.getPlayerList().isOp(this.player.getGameProfile())) { // Paper - configurable tab spam limits
|
||||
+ server.scheduleOnMain(() -> this.disconnect(Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - AsyncTabCompleteEvent & kick event cause
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
// CraftBukkit end
|
||||
// Paper start - Don't suggest if tab-complete is disabled
|
||||
@@ -2452,6 +2454,7 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
|
||||
// Spigot start - spam exclusions
|
||||
private void detectRateSpam(String s) {
|
||||
+ if (this.getCraftPlayer().hasPermission("spam.bypass")) return; // Parchment - spam bypass
|
||||
// CraftBukkit start - replaced with thread safe throttle
|
||||
boolean counted = true;
|
||||
for ( String exclude : org.spigotmc.SpigotConfig.spamExclusions )
|
||||
@@ -3206,10 +3209,12 @@ public class ServerGamePacketListenerImpl extends ServerCommonPacketListenerImpl
|
||||
public void handlePlaceRecipe(ServerboundPlaceRecipePacket packet) {
|
||||
// Paper start - auto recipe limit
|
||||
if (!org.bukkit.Bukkit.isPrimaryThread()) {
|
||||
- if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
|
||||
- this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM); // Paper - kick event cause
|
||||
- return;
|
||||
- }
|
||||
+ if (!this.getCraftPlayer().hasPermission("spam.bypass")) { // Parchment - spam bypass
|
||||
+ if (this.recipeSpamPackets.addAndGet(io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamIncrement) > io.papermc.paper.configuration.GlobalConfiguration.get().spamLimiter.recipeSpamLimit) {
|
||||
+ this.server.scheduleOnMain(() -> this.disconnect(net.minecraft.network.chat.Component.translatable("disconnect.spam"), org.bukkit.event.player.PlayerKickEvent.Cause.SPAM)); // Paper - kick event cause
|
||||
+ return;
|
||||
+ }
|
||||
+ } // Parchment - spam bypass
|
||||
}
|
||||
// Paper end - auto recipe limit
|
||||
PacketUtils.ensureRunningOnSameThread(packet, this, this.player.serverLevel());
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Disable set respawn message
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/server/level/ServerPlayer.java b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
index 5174b23c6e04da7a3d833ea3fd191b5956a49809..323330172fde196c6e992484d22479d9f8b041db 100644
|
||||
index 94de83a35998c82b807c6e5836d957f317dd2ceb..64752d1c129b85f7a700c91e43741ac4d9bedd22 100644
|
||||
--- a/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
+++ b/src/main/java/net/minecraft/server/level/ServerPlayer.java
|
||||
@@ -2524,9 +2524,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
@@ -2769,9 +2769,10 @@ public class ServerPlayer extends net.minecraft.world.entity.player.Player imple
|
||||
forced = event.isForced();
|
||||
// Paper end - Add PlayerSetSpawnEvent
|
||||
|
||||
@@ -5,14 +5,10 @@ Subject: [PATCH] Add PreEntityShootBowEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
index 3b5cf6ffb74d11bea5eb21bd66d679734ff5000c..321499a52848101b6c36bef18a35f5367c62913c 100644
|
||||
index 32670a3cb4b54b66d655197e3fde834d2b2b6d34..ec0f692bfc19669797b9b355fe4028578be7a133 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/AbstractSkeleton.java
|
||||
@@ -201,15 +201,21 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
|
||||
@Override
|
||||
public void performRangedAttack(LivingEntity target, float pullProgress) {
|
||||
+
|
||||
@@ -206,6 +206,11 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
ItemStack itemstack = this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, Items.BOW));
|
||||
ItemStack itemstack1 = this.getProjectile(itemstack);
|
||||
AbstractArrow entityarrow = this.getArrow(itemstack1, pullProgress, itemstack);
|
||||
@@ -24,18 +20,20 @@ index 3b5cf6ffb74d11bea5eb21bd66d679734ff5000c..321499a52848101b6c36bef18a35f536
|
||||
double d0 = target.getX() - this.getX();
|
||||
double d1 = target.getY(0.3333333333333333D) - entityarrow.getY();
|
||||
double d2 = target.getZ() - this.getZ();
|
||||
double d3 = Math.sqrt(d0 * d0 + d2 * d2);
|
||||
@@ -221,7 +226,7 @@ public abstract class AbstractSkeleton extends Monster implements RangedAttackMo
|
||||
}
|
||||
|
||||
- entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4));
|
||||
+ entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4), preEvent.isRelative()); // Parchment
|
||||
// CraftBukkit start
|
||||
org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getMainHandItem(), entityarrow.getPickupItem(), entityarrow, net.minecraft.world.InteractionHand.MAIN_HAND, 0.8F, true); // Paper
|
||||
if (event.isCancelled()) {
|
||||
if (event.getProjectile() == entityarrow.getBukkitEntity()) {
|
||||
- Projectile.spawnProjectileUsingShoot(entityarrow, worldserver, itemstack1, d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - worldserver.getDifficulty().getId() * 4));
|
||||
+ Projectile.spawnProjectileUsingShoot(entityarrow, worldserver, itemstack1, d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - worldserver.getDifficulty().getId() * 4), preEvent.isRelative());
|
||||
}
|
||||
// CraftBukkit end
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
|
||||
index c858556ea457931aa14e338e20672cb50cb19f0e..b93db38d69ea6f12f4c1d2f73800753a04309772 100644
|
||||
index db3aac9ba711dcd18ffc35c4a745ecaec89d0166..052125cdb7ae6aef5b247ca5509e61dd21b567a2 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Illusioner.java
|
||||
@@ -179,12 +179,16 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob {
|
||||
@@ -177,6 +177,10 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob {
|
||||
ItemStack itemstack = this.getItemInHand(ProjectileUtil.getWeaponHoldingHand(this, Items.BOW));
|
||||
ItemStack itemstack1 = this.getProjectile(itemstack);
|
||||
AbstractArrow entityarrow = ProjectileUtil.getMobArrow(this, itemstack1, pullProgress, itemstack);
|
||||
@@ -46,18 +44,20 @@ index c858556ea457931aa14e338e20672cb50cb19f0e..b93db38d69ea6f12f4c1d2f73800753a
|
||||
double d0 = target.getX() - this.getX();
|
||||
double d1 = target.getY(0.3333333333333333D) - entityarrow.getY();
|
||||
double d2 = target.getZ() - this.getZ();
|
||||
double d3 = Math.sqrt(d0 * d0 + d2 * d2);
|
||||
@@ -192,7 +196,7 @@ public class Illusioner extends SpellcasterIllager implements RangedAttackMob {
|
||||
}
|
||||
|
||||
- entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4));
|
||||
+ entityarrow.shoot(d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - this.level().getDifficulty().getId() * 4), preEvent.isRelative()); // Parchment
|
||||
// Paper start - EntityShootBowEvent
|
||||
org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(this, this.getMainHandItem(), entityarrow.getPickupItem(), entityarrow, target.getUsedItemHand(), 0.8F, true);
|
||||
if (event.isCancelled()) {
|
||||
if (event.getProjectile() == entityarrow.getBukkitEntity()) {
|
||||
- Projectile.spawnProjectileUsingShoot(entityarrow, worldserver, itemstack1, d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - worldserver.getDifficulty().getId() * 4));
|
||||
+ Projectile.spawnProjectileUsingShoot(entityarrow, worldserver, itemstack1, d0, d1 + d3 * 0.20000000298023224D, d2, 1.6F, (float) (14 - worldserver.getDifficulty().getId() * 4), preEvent.isRelative());
|
||||
}
|
||||
// Paper end - EntityShootBowEvent
|
||||
}
|
||||
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 9ca29b3d4bf8bca5f51f3644e12fcbec2cb5d35e..3c314a9db7467c1066f9e5c8857438bb01317274 100644
|
||||
index 571f0699772eecbe02d71845da82a142321f2142..937da68b6d9aac6ad0c37de7f9db888eb29e017b 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/AbstractArrow.java
|
||||
@@ -167,8 +167,10 @@ public abstract class AbstractArrow extends Projectile {
|
||||
@@ -164,8 +164,10 @@ public abstract class AbstractArrow extends Projectile {
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -71,10 +71,10 @@ index 9ca29b3d4bf8bca5f51f3644e12fcbec2cb5d35e..3c314a9db7467c1066f9e5c8857438bb
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
index de64de5d1328d3e0826c9990eb7c7eca5088cb9c..1a4678def2e1f0a48a94c73b2ea5ab3215e6ba3b 100644
|
||||
index 6c2d4d6f3a36ab452dfd3c33f66e54f152906639..ed9ca8381bd23336bd1859f4bdc1f18d4867ee1e 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/projectile/Projectile.java
|
||||
@@ -181,9 +181,17 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
@@ -192,9 +192,17 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
}
|
||||
|
||||
public void shoot(double x, double y, double z, float power, float uncertainty) {
|
||||
@@ -94,7 +94,7 @@ index de64de5d1328d3e0826c9990eb7c7eca5088cb9c..1a4678def2e1f0a48a94c73b2ea5ab32
|
||||
this.hasImpulse = true;
|
||||
double d3 = vec3d.horizontalDistance();
|
||||
|
||||
@@ -194,6 +202,12 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
@@ -205,6 +213,12 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
}
|
||||
|
||||
public void shootFromRotation(Entity shooter, float pitch, float yaw, float roll, float speed, float divergence) {
|
||||
@@ -107,22 +107,59 @@ index de64de5d1328d3e0826c9990eb7c7eca5088cb9c..1a4678def2e1f0a48a94c73b2ea5ab32
|
||||
float f5 = -Mth.sin(yaw * 0.017453292F) * Mth.cos(pitch * 0.017453292F);
|
||||
float f6 = -Mth.sin((pitch + roll) * 0.017453292F);
|
||||
float f7 = Mth.cos(yaw * 0.017453292F) * Mth.cos(pitch * 0.017453292F);
|
||||
@@ -204,7 +218,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
if (vec3d.lengthSqr() > 4D * 4D) {
|
||||
vec3d = vec3d.normalize().scale(2D);
|
||||
}
|
||||
@@ -212,7 +226,7 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
this.shoot((double) f5, (double) f6, (double) f7, speed, divergence);
|
||||
Vec3 vec3d = shooter.getKnownMovement();
|
||||
// Paper start - allow disabling relative velocity
|
||||
- if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity) {
|
||||
+ if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity && relative) { // Parchment
|
||||
+ if (!shooter.level().paperConfig().misc.disableRelativeProjectileVelocity && relative) {
|
||||
this.setDeltaMovement(this.getDeltaMovement().add(vec3d.x, shooter.onGround() ? 0.0D : vec3d.y, vec3d.z));
|
||||
}
|
||||
// Paper end - allow disabling relative velocity
|
||||
@@ -230,8 +244,12 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
}
|
||||
|
||||
public static <T extends Projectile> T spawnProjectileUsingShoot(Projectile.ProjectileFactory<T> creator, ServerLevel world, ItemStack projectileStack, LivingEntity shooter, double velocityX, double velocityY, double velocityZ, float power, float divergence) {
|
||||
+ return Projectile.spawnProjectileUsingShoot(creator, world, projectileStack, shooter, velocityX, velocityY, velocityZ, power, divergence, true);
|
||||
+ }
|
||||
+
|
||||
+ public static <T extends Projectile> T spawnProjectileUsingShoot(Projectile.ProjectileFactory<T> creator, ServerLevel world, ItemStack projectileStack, LivingEntity shooter, double velocityX, double velocityY, double velocityZ, float power, float divergence, boolean relative) {
|
||||
return Projectile.spawnProjectile(creator.create(world, shooter, projectileStack), world, projectileStack, (iprojectile) -> {
|
||||
- iprojectile.shoot(velocityX, velocityY, velocityZ, power, divergence);
|
||||
+ iprojectile.shoot(velocityX, velocityY, velocityZ, power, divergence, relative);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -239,12 +257,22 @@ public abstract class Projectile extends Entity implements TraceableEntity {
|
||||
// Paper start - fixes and addition to spawn reason API
|
||||
return spawnProjectileUsingShootDelayed(projectile, world, projectileStack, velocityX, velocityY, velocityZ, power, divergence).spawn();
|
||||
}
|
||||
+ public static <T extends Projectile> T spawnProjectileUsingShoot(T projectile, ServerLevel world, ItemStack projectileStack, double velocityX, double velocityY, double velocityZ, float power, float divergence, boolean relative) {
|
||||
+ // Paper start - fixes and addition to spawn reason API
|
||||
+ return spawnProjectileUsingShootDelayed(projectile, world, projectileStack, velocityX, velocityY, velocityZ, power, divergence, relative).spawn();
|
||||
+ }
|
||||
public static <T extends Projectile> Delayed<T> spawnProjectileUsingShootDelayed(T projectile, ServerLevel world, ItemStack projectileStack, double velocityX, double velocityY, double velocityZ, float power, float divergence) {
|
||||
return Projectile.spawnProjectileDelayed(projectile, world, projectileStack, (iprojectile) -> {
|
||||
// Paper end - fixes and addition to spawn reason API
|
||||
projectile.shoot(velocityX, velocityY, velocityZ, power, divergence);
|
||||
});
|
||||
}
|
||||
+ public static <T extends Projectile> Delayed<T> spawnProjectileUsingShootDelayed(T projectile, ServerLevel world, ItemStack projectileStack, double velocityX, double velocityY, double velocityZ, float power, float divergence, boolean relative) {
|
||||
+ return Projectile.spawnProjectileDelayed(projectile, world, projectileStack, (iprojectile) -> {
|
||||
+ // Paper end - fixes and addition to spawn reason API
|
||||
+ projectile.shoot(velocityX, velocityY, velocityZ, power, divergence, relative);
|
||||
+ });
|
||||
+ }
|
||||
|
||||
public static <T extends Projectile> T spawnProjectile(T projectile, ServerLevel world, ItemStack projectileStack) {
|
||||
return Projectile.spawnProjectile(projectile, world, projectileStack, (iprojectile) -> {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BowItem.java b/src/main/java/net/minecraft/world/item/BowItem.java
|
||||
index 6eb5c0f23d9dc61e69ad5ad493c89602a9dcd4b5..63ba7c2ecdd80e10d611aeb08fa786a478107cb9 100644
|
||||
index bb593209c95c9cf1f9c5d52d52fab4a33ddbabcf..768964dbc785cb78d5ef517cf88f9f8b1f6af629 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BowItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BowItem.java
|
||||
@@ -31,8 +31,13 @@ public class BowItem extends ProjectileWeaponItem {
|
||||
float f = getPowerForTime(i);
|
||||
if (!((double)f < 0.1)) {
|
||||
@@ -37,8 +37,13 @@ public class BowItem extends ProjectileWeaponItem {
|
||||
return false;
|
||||
} else {
|
||||
List<ItemStack> list = draw(stack, itemStack, player);
|
||||
- if (world instanceof ServerLevel serverLevel && !list.isEmpty()) {
|
||||
- this.shoot(serverLevel, player, player.getUsedItemHand(), stack, list, f * 3.0F, 1.0F, f == 1.0F, null);
|
||||
@@ -130,13 +167,13 @@ index 6eb5c0f23d9dc61e69ad5ad493c89602a9dcd4b5..63ba7c2ecdd80e10d611aeb08fa786a4
|
||||
+ if (!world.isClientSide() && !list.isEmpty()) {
|
||||
+ // Parchment start
|
||||
+ gg.projecteden.parchment.event.entity.PreEntityShootBowEvent preEvent = new gg.projecteden.parchment.event.entity.PreEntityShootBowEvent(user.getBukkitEntity(), stack.asBukkitCopy(), itemStack.asBukkitCopy());
|
||||
+ if (!preEvent.callEvent()) return;
|
||||
+ if (!preEvent.callEvent()) return false;
|
||||
+ // Parchment end
|
||||
+ this.shoot((ServerLevel) world, player, player.getUsedItemHand(), stack, list, f * 3.0F, 1.0F, f == 1.0F, null, preEvent.isRelative());
|
||||
}
|
||||
|
||||
world.playSound(
|
||||
@@ -53,9 +58,9 @@ public class BowItem extends ProjectileWeaponItem {
|
||||
@@ -60,9 +65,9 @@ public class BowItem extends ProjectileWeaponItem {
|
||||
|
||||
@Override
|
||||
protected void shootProjectile(
|
||||
@@ -149,10 +186,10 @@ index 6eb5c0f23d9dc61e69ad5ad493c89602a9dcd4b5..63ba7c2ecdd80e10d611aeb08fa786a4
|
||||
|
||||
public static float getPowerForTime(int useTicks) {
|
||||
diff --git a/src/main/java/net/minecraft/world/item/CrossbowItem.java b/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||
index c39fa953accd6cf35672f452052cca42fe6f29d0..9bbdf240f7ee520e5d13155ca34f26235f4e5f5b 100644
|
||||
index 52c40eafc77e50a6fd21b9a7a250cea501f11690..2eca32e58e41f15cd9453e936d19c26a1a4b588c 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/CrossbowItem.java
|
||||
@@ -137,7 +137,7 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||
@@ -140,7 +140,7 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||
|
||||
@Override
|
||||
protected void shootProjectile(
|
||||
@@ -161,7 +198,7 @@ index c39fa953accd6cf35672f452052cca42fe6f29d0..9bbdf240f7ee520e5d13155ca34f2623
|
||||
) {
|
||||
Vector3f vector3f;
|
||||
if (target != null) {
|
||||
@@ -198,8 +198,14 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||
@@ -201,8 +201,14 @@ public class CrossbowItem extends ProjectileWeaponItem {
|
||||
) {
|
||||
if (world instanceof ServerLevel serverLevel) {
|
||||
ChargedProjectiles chargedProjectiles = stack.set(DataComponents.CHARGED_PROJECTILES, ChargedProjectiles.EMPTY);
|
||||
@@ -178,32 +215,30 @@ index c39fa953accd6cf35672f452052cca42fe6f29d0..9bbdf240f7ee520e5d13155ca34f2623
|
||||
CriteriaTriggers.SHOT_CROSSBOW.trigger(serverPlayer, stack);
|
||||
serverPlayer.awardStat(Stats.ITEM_USED.get(stack.getItem()));
|
||||
diff --git a/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java b/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java
|
||||
index 32dd0b13a0819f597d8a93c6bc3a155781067544..a74540e3a0aa61534fd84868bf8a29d97ccb6e6b 100644
|
||||
index 78ba170a83f8c026bd110eae494c52577182ed61..5ece12e41233727fbd1106d067e607810341acab 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/ProjectileWeaponItem.java
|
||||
@@ -46,9 +46,10 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
@@ -41,7 +41,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
|
||||
public abstract int getDefaultProjectileRange();
|
||||
|
||||
- protected void shoot(ServerLevel world, LivingEntity shooter, InteractionHand hand, ItemStack stack, List<ItemStack> projectiles, float speed, float divergence, boolean critical, @Nullable LivingEntity target) {
|
||||
+
|
||||
+ protected void shoot(ServerLevel world, LivingEntity shooter, InteractionHand hand, ItemStack stack, List<ItemStack> projectiles, float speed, float divergence, boolean critical, @Nullable LivingEntity target, boolean relative) {
|
||||
float f2 = EnchantmentHelper.processProjectileSpread(world, stack, shooter, 0.0F);
|
||||
- float f3 = projectiles.size() == 1 ? 0.0F : 2.0F * f2 / (float) (projectiles.size() - 1);
|
||||
+ float f3 = projectiles.size() == 1 ? 0.0F : 20.0F / (float) (projectiles.size() - 1);
|
||||
float f3 = projectiles.size() == 1 ? 0.0F : 2.0F * f2 / (float) (projectiles.size() - 1);
|
||||
float f4 = (float) ((projectiles.size() - 1) % 2) * f3 / 2.0F;
|
||||
float f5 = 1.0F;
|
||||
|
||||
@@ -61,7 +62,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
@@ -56,8 +56,9 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
f5 = -f5;
|
||||
Projectile iprojectile = this.createProjectile(world, shooter, stack, itemstack1, critical);
|
||||
|
||||
- this.shootProjectile(shooter, iprojectile, i, speed, divergence, f6, target);
|
||||
+ this.shootProjectile(shooter, iprojectile, i, speed, divergence, f6, target, relative);
|
||||
// CraftBukkit start
|
||||
Projectile iprojectile = this.createProjectile(world, shooter, stack, itemstack1, critical);
|
||||
- this.shootProjectile(shooter, iprojectile, i, speed, divergence, f6, target);
|
||||
|
||||
+ this.shootProjectile(shooter, iprojectile, i, speed, divergence, f6, target, relative);
|
||||
+ // CraftBukkit start
|
||||
org.bukkit.event.entity.EntityShootBowEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityShootBowEvent(shooter, stack, itemstack1, iprojectile, hand, speed, true);
|
||||
if (event.isCancelled()) {
|
||||
@@ -91,7 +92,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
event.getProjectile().remove();
|
||||
@@ -86,7 +87,7 @@ public abstract class ProjectileWeaponItem extends Item {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Return Displays in getTargetEntity
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/LivingEntity.java b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
index fe435d4a387bb28be6831cec0c8bb0a7c8b603a4..b5c5294a59aad34e21da88bb9d7a6fc70d1a959b 100644
|
||||
index f36a075dbee2b96d01899e02460b1d8443e91749..6782f6184dedd38dfefefd48a6399cd141b00711 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/LivingEntity.java
|
||||
@@ -4183,7 +4183,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
@@ -4340,7 +4340,7 @@ public abstract class LivingEntity extends Entity implements Attackable {
|
||||
Vec3 direction = this.getLookAngle();
|
||||
Vec3 end = start.add(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance);
|
||||
|
||||
@@ -16,4 +16,4 @@ index fe435d4a387bb28be6831cec0c8bb0a7c8b603a4..b5c5294a59aad34e21da88bb9d7a6fc7
|
||||
+ List<Entity> entityList = this.level().getEntities(this, getBoundingBox().expandTowards(direction.x * maxDistance, direction.y * maxDistance, direction.z * maxDistance).inflate(1.0D, 1.0D, 1.0D), EntitySelector.NO_SPECTATORS.and(entity -> entity.isPickable() || entity instanceof Display)); // Parchment - add displays
|
||||
|
||||
double distance = 0.0D;
|
||||
EntityHitResult result = null;
|
||||
net.minecraft.world.phys.EntityHitResult result = null;
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add CustomBlockUpdateEvent
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/NoteBlock.java b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
index 1d82cfe7af0dc42f88901fb0c44896771fdf8a93..60bb2fe8bb5773d7d0d4279af2216f4c175eca74 100644
|
||||
index 6582db84c5307257f16c321453491cf24e40c9c7..eb54895ed35eb623bf93d375ff2d01a49fc2824c 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/NoteBlock.java
|
||||
@@ -66,12 +66,14 @@ public class NoteBlock extends Block {
|
||||
@@ -68,12 +68,14 @@ public class NoteBlock extends Block {
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||
@@ -18,23 +18,23 @@ index 1d82cfe7af0dc42f88901fb0c44896771fdf8a93..60bb2fe8bb5773d7d0d4279af2216f4c
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.INSTRUMENT, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, world.getMinecraftWorld())).callEvent()) return state;
|
||||
protected BlockState updateShape(BlockState state, LevelReader world, ScheduledTickAccess tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, RandomSource random) {
|
||||
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.INSTRUMENT, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, (Level) world)).callEvent()) return state;
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) return state; // Paper - prevent noteblock instrument from updating
|
||||
boolean flag = direction.getAxis() == Direction.Axis.Y;
|
||||
|
||||
@@ -80,6 +82,7 @@ public class NoteBlock extends Block {
|
||||
@@ -82,6 +84,7 @@ public class NoteBlock extends Block {
|
||||
|
||||
@Override
|
||||
protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, BlockPos sourcePos, boolean notify) {
|
||||
protected void neighborChanged(BlockState state, Level world, BlockPos pos, Block sourceBlock, @Nullable Orientation wireOrientation, boolean notify) {
|
||||
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(this.defaultBlockState()), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.POWERED, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, world)).callEvent()) return;
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) return; // Paper - prevent noteblock powered-state from updating
|
||||
boolean flag1 = world.hasNeighborSignal(pos);
|
||||
|
||||
@@ -119,7 +122,8 @@ public class NoteBlock extends Block {
|
||||
if (world.isClientSide) {
|
||||
return InteractionResult.SUCCESS;
|
||||
} else {
|
||||
@Override
|
||||
protected InteractionResult useWithoutItem(BlockState state, Level world, BlockPos pos, Player player, BlockHitResult hit) {
|
||||
if (!world.isClientSide) {
|
||||
- if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates) state = (BlockState) state.cycle(NoteBlock.NOTE); // Paper - prevent noteblock note from updating
|
||||
+ if (!io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableNoteblockUpdates ||
|
||||
+ !new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(this.defaultBlockState()), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.PITCH, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, world)).callEvent()) state = (BlockState) state.cycle(NoteBlock.NOTE); // Paper - prevent noteblock note from updating
|
||||
@@ -42,10 +42,10 @@ index 1d82cfe7af0dc42f88901fb0c44896771fdf8a93..60bb2fe8bb5773d7d0d4279af2216f4c
|
||||
this.playNote(player, state, world, pos);
|
||||
player.awardStat(Stats.TUNE_NOTEBLOCK);
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||
index 6fe5be785423a35b6ff4e6206ca281b66845b979..227c969c0c52709ccc85663d3b7dce282bba75b0 100644
|
||||
index 74cce7874809dcbce2718ec3840bb6bb3127e871..d46503c9d31877412ba4ae5a3bb22c0a444662cf 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/TripWireBlock.java
|
||||
@@ -67,21 +67,25 @@ public class TripWireBlock extends Block {
|
||||
@@ -68,21 +68,25 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
public BlockState getStateForPlacement(BlockPlaceContext ctx) {
|
||||
@@ -60,10 +60,10 @@ index 6fe5be785423a35b6ff4e6206ca281b66845b979..227c969c0c52709ccc85663d3b7dce28
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockState updateShape(BlockState state, Direction direction, BlockState neighborState, LevelAccessor world, BlockPos pos, BlockPos neighborPos) {
|
||||
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.SHAPE, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, world.getMinecraftWorld())).callEvent()) return state;
|
||||
protected BlockState updateShape(BlockState state, LevelReader world, ScheduledTickAccess tickView, BlockPos pos, Direction direction, BlockPos neighborPos, BlockState neighborState, RandomSource random) {
|
||||
+ if (!new gg.projecteden.parchment.event.block.CustomBlockUpdateEvent(org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(state), gg.projecteden.parchment.event.block.CustomBlockUpdateEvent.UpdateType.SHAPE, org.bukkit.craftbukkit.util.CraftLocation.toBukkit(pos, (Level) world)).callEvent()) return state;
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return state; // Paper - prevent tripwire from updating
|
||||
return direction.getAxis().isHorizontal() ? (BlockState) state.setValue((Property) TripWireBlock.PROPERTY_BY_DIRECTION.get(direction), this.shouldConnectTo(neighborState, direction)) : super.updateShape(state, direction, neighborState, world, pos, neighborPos);
|
||||
return direction.getAxis().isHorizontal() ? (BlockState) state.setValue((Property) TripWireBlock.PROPERTY_BY_DIRECTION.get(direction), this.shouldConnectTo(neighborState, direction)) : super.updateShape(state, world, tickView, pos, direction, neighborPos, neighborState, random);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,7 +72,7 @@ index 6fe5be785423a35b6ff4e6206ca281b66845b979..227c969c0c52709ccc85663d3b7dce28
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent adjacent tripwires from updating
|
||||
if (!oldState.is(state.getBlock())) {
|
||||
this.updateSource(world, pos, state);
|
||||
@@ -90,6 +94,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -91,6 +95,7 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
protected void onRemove(BlockState state, Level world, BlockPos pos, BlockState newState, boolean moved) {
|
||||
@@ -80,7 +80,7 @@ index 6fe5be785423a35b6ff4e6206ca281b66845b979..227c969c0c52709ccc85663d3b7dce28
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent adjacent tripwires from updating
|
||||
if (!moved && !state.is(newState.getBlock())) {
|
||||
this.updateSource(world, pos, (BlockState) state.setValue(TripWireBlock.POWERED, true));
|
||||
@@ -98,6 +103,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -99,6 +104,7 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
public BlockState playerWillDestroy(Level world, BlockPos pos, BlockState state, Player player) {
|
||||
@@ -88,7 +88,7 @@ index 6fe5be785423a35b6ff4e6206ca281b66845b979..227c969c0c52709ccc85663d3b7dce28
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return state; // Paper - prevent disarming tripwires
|
||||
if (!world.isClientSide && !player.getMainHandItem().isEmpty() && player.getMainHandItem().is(Items.SHEARS)) {
|
||||
world.setBlock(pos, (BlockState) state.setValue(TripWireBlock.DISARMED, true), 4);
|
||||
@@ -108,6 +114,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -109,6 +115,7 @@ public class TripWireBlock extends Block {
|
||||
}
|
||||
|
||||
private void updateSource(Level world, BlockPos pos, BlockState state) {
|
||||
@@ -96,7 +96,7 @@ index 6fe5be785423a35b6ff4e6206ca281b66845b979..227c969c0c52709ccc85663d3b7dce28
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent adjacent tripwires from updating
|
||||
Direction[] aenumdirection = new Direction[]{Direction.SOUTH, Direction.WEST};
|
||||
int i = aenumdirection.length;
|
||||
@@ -141,6 +148,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -147,6 +154,7 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
protected void entityInside(BlockState state, Level world, BlockPos pos, Entity entity) {
|
||||
@@ -104,7 +104,7 @@ index 6fe5be785423a35b6ff4e6206ca281b66845b979..227c969c0c52709ccc85663d3b7dce28
|
||||
if (io.papermc.paper.configuration.GlobalConfiguration.get().blockUpdates.disableTripwireUpdates) return; // Paper - prevent tripwires from detecting collision
|
||||
if (!new io.papermc.paper.event.entity.EntityInsideBlockEvent(entity.getBukkitEntity(), org.bukkit.craftbukkit.block.CraftBlock.at(world, pos)).callEvent()) { return; } // Paper - Add EntityInsideBlockEvent
|
||||
if (!world.isClientSide) {
|
||||
@@ -152,6 +160,7 @@ public class TripWireBlock extends Block {
|
||||
@@ -158,6 +166,7 @@ public class TripWireBlock extends Block {
|
||||
|
||||
@Override
|
||||
protected void tick(BlockState state, ServerLevel world, BlockPos pos, RandomSource random) {
|
||||
@@ -27,10 +27,10 @@ index 0000000000000000000000000000000000000000..30f8fd154136d05267e8737ff04a0be4
|
||||
+
|
||||
+}
|
||||
diff --git a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
index dd56c8e041116ef3602a9f89c998c8208ab89b51..9197be4019ddbe16e09c781a74809d15f569e0f3 100644
|
||||
index 17a158ff6ce6520b69a5a0032ba4c05449dd0cf8..9309598317d361ecef658fe4de57c64ba73f36c1 100644
|
||||
--- a/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
+++ b/src/main/java/net/minecraft/server/dedicated/DedicatedServer.java
|
||||
@@ -287,6 +287,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
@@ -284,6 +284,8 @@ public class DedicatedServer extends MinecraftServer implements ServerInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -40,12 +40,12 @@ index dd56c8e041116ef3602a9f89c998c8208ab89b51..9197be4019ddbe16e09c781a74809d15
|
||||
// this.setPlayerList(new DedicatedPlayerList(this, this.registries(), this.playerDataStorage)); // Spigot - moved up
|
||||
this.server.loadPlugins();
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/Entity.java b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
index 1f7594e22f0f08ae110ef9b42f15119358aa5723..577a6cc50cf41dc3e590edb955a372c4c2a83fe2 100644
|
||||
index ed5b00620527c1776722d25b1b45f1544802a341..544882862b2248d426185dd67bd217f593caef2a 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/Entity.java
|
||||
@@ -169,6 +169,31 @@ import org.bukkit.plugin.PluginManager;
|
||||
@@ -178,6 +178,31 @@ import org.bukkit.plugin.PluginManager;
|
||||
|
||||
public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess, CommandSource, ScoreHolder, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker
|
||||
public abstract class Entity implements SyncedDataHolder, Nameable, EntityAccess, ScoreHolder, ca.spottedleaf.moonrise.patches.chunk_system.entity.ChunkSystemEntity, ca.spottedleaf.moonrise.patches.entity_tracker.EntityTrackerEntity { // Paper - rewrite chunk system // Paper - optimise entity tracker
|
||||
|
||||
+ @javax.annotation.Nullable
|
||||
+ private gg.projecteden.parchment.entity.EntityData storedEntityData;
|
||||
@@ -76,17 +76,16 @@ index 1f7594e22f0f08ae110ef9b42f15119358aa5723..577a6cc50cf41dc3e590edb955a372c4
|
||||
private static final int CURRENT_LEVEL = 2;
|
||||
public boolean preserveMotion = true; // Paper - Fix Entity Teleportation and cancel velocity if teleported; keep initial motion on first setPositionRotation
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 2cde808bfa797256409879505ba205a71f381981..1bde22a5ec330980ee697830cb2c6a7441394722 100644
|
||||
index ddabaed899c755925ad8618b78c33dacaf2126ac..134dba0bf6340772c7b3fa233dfabffd859422b2 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -80,6 +80,10 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
};
|
||||
// Paper end - Folia schedulers
|
||||
|
||||
@@ -1306,4 +1306,9 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
}
|
||||
}
|
||||
// Paper end - broadcast hurt animation
|
||||
+
|
||||
+ public gg.projecteden.parchment.entity.EntityData getStoredEntityData() {
|
||||
+ return this.entity.getStoredEntityData();
|
||||
+ }
|
||||
+
|
||||
public CraftEntity(final CraftServer server, final Entity entity) {
|
||||
this.server = server;
|
||||
this.entity = entity;
|
||||
}
|
||||
@@ -5,10 +5,10 @@ Subject: [PATCH] Add Block BreakNaturally Overload
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/Block.java b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
index d9aff85fce2a65794dd57cf790f878b4fc4ec54e..4ed92f149be39929a874678bdfa049694270d3b5 100644
|
||||
index 43c288a4e226060a5e0cecddd941846d29ae8025..78726d52117105ffebd9d15b407f5e529a217900 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/Block.java
|
||||
@@ -299,24 +299,28 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -290,24 +290,28 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
return state.getDrops(lootparams_a);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ index d9aff85fce2a65794dd57cf790f878b4fc4ec54e..4ed92f149be39929a874678bdfa04969
|
||||
}
|
||||
|
||||
// Paper start - Add BlockBreakBlockEvent
|
||||
@@ -344,15 +348,17 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -335,15 +339,17 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
// Paper start - Properly handle xp dropping
|
||||
dropResources(state, world, pos, blockEntity, entity, tool, true);
|
||||
}
|
||||
@@ -64,7 +64,7 @@ index d9aff85fce2a65794dd57cf790f878b4fc4ec54e..4ed92f149be39929a874678bdfa04969
|
||||
}
|
||||
|
||||
public static void popResource(Level world, BlockPos pos, ItemStack stack) {
|
||||
@@ -366,6 +372,17 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
@@ -357,6 +363,17 @@ public class Block extends BlockBehaviour implements ItemLike {
|
||||
}, stack);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ index d9aff85fce2a65794dd57cf790f878b4fc4ec54e..4ed92f149be39929a874678bdfa04969
|
||||
int i = direction.getStepX();
|
||||
int j = direction.getStepY();
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
index ac11f18690434922179b61ffcc3036dea025b0cb..f9aae49eed516bce00cb968de36ca8b3de038311 100644
|
||||
index 5cb69d0b822e11a99a96aef4f59986d083b079f4..f151b805763ce5fa4b9bfacb74b0152ab3a6ae5e 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
||||
@@ -500,6 +500,11 @@ public class CraftBlock implements Block {
|
||||
Reference in New Issue
Block a user