mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-27 06:50:12 +01:00
Updated Upstream (Bukkit/CraftBukkit) (#10034)
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: f29cb801 Separate checkstyle-suppressions file is not required 86f99bbe SPIGOT-7540, PR-946: Add ServerTickManager API d4119585 SPIGOT-6903, PR-945: Add BlockData#getMapColor b7a2ed41 SPIGOT-7530, PR-947: Add Player#removeResourcePack 9dd56255 SPIGOT-7527, PR-944: Add WindCharge#explode() 994a6163 Attempt upgrade of resolver libraries CraftBukkit Changes: b3b43a6ad Add Checkstyle check for unused imports 13fb3358e SPIGOT-7544: Scoreboard#getEntries() doesn't get entries but class names 3dda99c06 SPIGOT-7540, PR-1312: Add ServerTickManager API 2ab4508c0 SPIGOT-6903, PR-1311: Add BlockData#getMapColor 1dbdbbed4 PR-1238: Remove unnecessary sign ticking 659728d2a MC-264285, SPIGOT-7439, PR-1237: Fix unbreakable flint and steel is completely consumed while igniting creeper e37e29ce0 Increase outdated build delay c00438b39 SPIGOT-7530, PR-1313: Add Player#removeResourcePack 492dd80ce SPIGOT-7527, PR-1310: Add WindCharge#explode() e11fbb9d7 Upgrade MySQL driver 9f3a0bd2a Attempt upgrade of resolver libraries 60d16d7ca PR-1306: Centralize Bukkit and Minecraft entity conversion Spigot Changes: 06d602e7 Rebuild patches
This commit is contained in:
parent
d597c4927a
commit
6f7ee18a4c
43 changed files with 210 additions and 414 deletions
|
@ -27,5 +27,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Gets the material that a player would use to place this block.
|
||||
* <p>
|
||||
* Gets the color this block should appear as when rendered on a map.
|
||||
*
|
||||
|
|
|
@ -16,4 +16,4 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ api("it.unimi.dsi:fastutil:8.5.6")
|
||||
// Paper end
|
||||
|
||||
compileOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
compileOnly("org.apache.maven:maven-resolver-provider:3.9.6")
|
||||
|
|
|
@ -53,7 +53,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ apiAndDocs("net.kyori:adventure-text-logger-slf4j")
|
||||
// Paper end
|
||||
|
||||
compileOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
compileOnly("org.apache.maven:maven-resolver-provider:3.9.6")
|
||||
@@ -0,0 +0,0 @@ tasks.withType<Javadoc> {
|
||||
"https://guava.dev/releases/32.1.2-jre/api/docs/",
|
||||
"https://javadoc.io/doc/org.yaml/snakeyaml/2.2/",
|
||||
|
@ -2681,8 +2681,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Paper end
|
||||
+
|
||||
/**
|
||||
* Gets the Scoreboard displayed to this player
|
||||
*
|
||||
* Request that the player's client remove a resource pack sent by the
|
||||
* server.
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
*
|
||||
* @param title Title text
|
||||
|
|
|
@ -18,9 +18,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ // Paper end
|
||||
|
||||
compileOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
||||
compileOnly("org.apache.maven:maven-resolver-provider:3.9.6")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
|
||||
|
||||
- val annotations = "org.jetbrains:annotations-java5:$annotationsVersion"
|
||||
+ val annotations = "org.jetbrains:annotations:$annotationsVersion" // Paper - we don't want Java 5 annotations...
|
||||
|
|
|
@ -182,8 +182,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Paper end - more resource pack API
|
||||
+
|
||||
/**
|
||||
* Gets the Scoreboard displayed to this player
|
||||
*
|
||||
* Request that the player's client remove a resource pack sent by the
|
||||
* server.
|
||||
diff --git a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java b/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/event/player/PlayerResourcePackStatusEvent.java
|
||||
|
|
|
@ -52,9 +52,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ api("org.yaml:snakeyaml:2.2")
|
||||
+ api("org.joml:joml:1.10.5")
|
||||
+
|
||||
+ compileOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
+ compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||
+ compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
||||
+ compileOnly("org.apache.maven:maven-resolver-provider:3.9.6")
|
||||
+ compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
||||
+ compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
|
||||
+
|
||||
+ val annotations = "org.jetbrains:annotations-java5:$annotationsVersion"
|
||||
+ compileOnly(annotations)
|
||||
|
@ -199,19 +199,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- <dependency>
|
||||
- <groupId>org.apache.maven</groupId>
|
||||
- <artifactId>maven-resolver-provider</artifactId>
|
||||
- <version>3.8.5</version>
|
||||
- <version>3.9.6</version>
|
||||
- <scope>provided</scope>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
- <groupId>org.apache.maven.resolver</groupId>
|
||||
- <artifactId>maven-resolver-connector-basic</artifactId>
|
||||
- <version>1.7.3</version>
|
||||
- <version>1.9.18</version>
|
||||
- <scope>provided</scope>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
- <groupId>org.apache.maven.resolver</groupId>
|
||||
- <artifactId>maven-resolver-transport-http</artifactId>
|
||||
- <version>1.7.3</version>
|
||||
- <version>1.9.18</version>
|
||||
- <scope>provided</scope>
|
||||
- </dependency>
|
||||
- <!-- annotations -->
|
||||
|
@ -370,7 +370,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- </executions>
|
||||
- <configuration>
|
||||
- <configLocation>checkstyle.xml</configLocation>
|
||||
- <suppressionsLocation>checkstyle-suppressions.xml</suppressionsLocation>
|
||||
- <includeTestSourceDirectory>true</includeTestSourceDirectory>
|
||||
- </configuration>
|
||||
- <dependencies>
|
||||
|
|
|
@ -471,46 +471,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
* the player loaded the pack!
|
||||
- * <li>There is no concept of resetting resource packs back to default
|
||||
- * within Minecraft, so players will have to relog to do so or you
|
||||
- * have to send an empty pack.
|
||||
* <li>The request is sent with empty string as the hash when the hash is
|
||||
* not provided. This might result in newer versions not loading the
|
||||
* pack correctly.
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* case this method will have no affect on them. Use the
|
||||
* {@link PlayerResourcePackStatusEvent} to figure out whether or not
|
||||
* the player loaded the pack!
|
||||
- * <li>There is no concept of resetting resource packs back to default
|
||||
- * within Minecraft, so players will have to relog to do so or you
|
||||
- * have to send an empty pack.
|
||||
* <li>The request is sent with empty string as the hash when the hash is
|
||||
* not provided. This might result in newer versions not loading the
|
||||
* pack correctly.
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* case this method will have no affect on them. Use the
|
||||
* {@link PlayerResourcePackStatusEvent} to figure out whether or not
|
||||
* the player loaded the pack!
|
||||
- * <li>There is no concept of resetting resource packs back to default
|
||||
- * within Minecraft, so players will have to relog to do so or you
|
||||
- * have to send an empty pack.
|
||||
* <li>The request is sent with empty string as the hash when the hash is
|
||||
* not provided. This might result in newer versions not loading the
|
||||
* pack correctly.
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* case this method will have no affect on them. Use the
|
||||
* {@link PlayerResourcePackStatusEvent} to figure out whether or not
|
||||
* the player loaded the pack!
|
||||
- * <li>There is no concept of resetting resource packs back to default
|
||||
- * within Minecraft, so players will have to relog to do so or you
|
||||
- * have to send an empty pack.
|
||||
* <li>The request is sent with empty string as the hash when the hash is
|
||||
* not provided. This might result in newer versions not loading the
|
||||
* pack correctly.
|
||||
@@ -0,0 +0,0 @@ public interface Player extends HumanEntity, Conversable, OfflinePlayer, PluginM
|
||||
* case this method will have no affect on them. Use the
|
||||
* {@link PlayerResourcePackStatusEvent} to figure out whether or not
|
||||
* the player loaded the pack!
|
||||
- * <li>There is no concept of resetting resource packs back to default
|
||||
- * within Minecraft, so players will have to relog to do so or you
|
||||
- * have to send an empty pack.
|
||||
* <li>The request is sent with empty string as the hash when the hash is
|
||||
* not provided. This might result in newer versions not loading the
|
||||
|
|
|
@ -12,10 +12,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
implementation("org.ow2.asm:asm-commons:9.5")
|
||||
// Paper end
|
||||
|
||||
- compileOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
+ api("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
||||
- compileOnly("org.apache.maven:maven-resolver-provider:3.9.6")
|
||||
+ api("org.apache.maven:maven-resolver-provider:3.9.6") // Paper - make API dependency for Paper Plugins
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
||||
compileOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
|
||||
|
||||
@@ -0,0 +0,0 @@ tasks.withType<Javadoc> {
|
||||
"https://jd.advntr.dev/text-serializer-plain/$adventureVersion/",
|
||||
|
|
|
@ -18,7 +18,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ implementation("org.ow2.asm:asm-commons:9.5")
|
||||
// Paper end
|
||||
|
||||
compileOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
compileOnly("org.apache.maven:maven-resolver-provider:3.9.6")
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java b/src/main/java/com/destroystokyo/paper/event/executor/MethodHandleEventExecutor.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
|
|
|
@ -28,5 +28,5 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ // Paper end
|
||||
+
|
||||
@Override
|
||||
public Material getPlacementMaterial() {
|
||||
return CraftMagicNumbers.getMaterial(this.state.getBlock().asItem());
|
||||
public Color getMapColor() {
|
||||
return Color.fromRGB(this.state.getMapColor(null, null).col);
|
||||
|
|
|
@ -4227,14 +4227,14 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ } else {
|
||||
+ hash = "";
|
||||
+ }
|
||||
+ this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundResourcePackPopPacket(Optional.empty()));
|
||||
+ this.getHandle().connection.send(new ClientboundResourcePackPopPacket(Optional.empty()));
|
||||
+ this.getHandle().connection.send(new ClientboundResourcePackPushPacket(uuid, url, hash, force, io.papermc.paper.adventure.PaperAdventure.asVanilla(prompt)));
|
||||
+ }
|
||||
+ // Paper end - adventure
|
||||
+
|
||||
public void addChannel(String channel) {
|
||||
Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel);
|
||||
channel = StandardMessenger.validateAndCorrectChannel(channel);
|
||||
@Override
|
||||
public void removeResourcePack(UUID id) {
|
||||
Preconditions.checkArgument(id != null, "Resource pack id cannot be null");
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return (this.getHandle().requestedViewDistance() == 0) ? Bukkit.getViewDistance() : this.getHandle().requestedViewDistance();
|
||||
}
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aikar <aikar@aikar.co>
|
||||
Date: Mon, 4 Jun 2018 20:39:20 -0400
|
||||
Subject: [PATCH] Allow spawning Item entities with World.spawnEntity
|
||||
|
||||
This API has more capabilities than .dropItem with the Consumer function
|
||||
|
||||
Item can be set inside of the Consumer pre spawn function.
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
entity = net.minecraft.world.entity.EntityType.BOAT.create(world);
|
||||
}
|
||||
entity.moveTo(x, y, z, yaw, pitch);
|
||||
+ // Paper start
|
||||
+ } else if (org.bukkit.entity.Item.class.isAssignableFrom(clazz)) {
|
||||
+ entity = new net.minecraft.world.entity.item.ItemEntity(world, x, y, z, new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.DIRT));
|
||||
+ // Paper end
|
||||
} else if (FallingBlock.class.isAssignableFrom(clazz)) {
|
||||
BlockPos pos = BlockPos.containing(x, y, z);
|
||||
entity = FallingBlockEntity.fall(world, pos, this.getHandle().getBlockState(pos));
|
|
@ -1602,11 +1602,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
private Set<BlockPos> tiles;
|
||||
private final Set<BlockPos> lights = new HashSet<>();
|
||||
+ // Paper start - Anti-Xray - Add parameters
|
||||
+ private final World world;
|
||||
+ private final org.bukkit.World world;
|
||||
|
||||
- public OldCraftChunkData(int minHeight, int maxHeight, Registry<net.minecraft.world.level.biome.Biome> biomes) {
|
||||
+ @Deprecated @io.papermc.paper.annotation.DoNotUse public OldCraftChunkData(int minHeight, int maxHeight, Registry<net.minecraft.world.level.biome.Biome> biomes) { this(minHeight, maxHeight, biomes, null); }
|
||||
+ public OldCraftChunkData(int minHeight, int maxHeight, Registry<net.minecraft.world.level.biome.Biome> biomes, World world) {
|
||||
+ public OldCraftChunkData(int minHeight, int maxHeight, Registry<net.minecraft.world.level.biome.Biome> biomes, org.bukkit.World world) {
|
||||
+ this.world = world;
|
||||
+ // Paper end
|
||||
this.minHeight = minHeight;
|
||||
|
|
|
@ -24,7 +24,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ implementation("org.ow2.asm:asm-commons:9.5") // Paper - ASM event executor generation
|
||||
implementation("commons-lang:commons-lang:2.6")
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.2.0")
|
||||
@@ -0,0 +0,0 @@ tasks.jar {
|
||||
val gitHash = git("rev-parse", "--short=7", "HEAD").getText().trim()
|
||||
val implementationVersion = System.getenv("BUILD_NUMBER") ?: "\"$gitHash\""
|
||||
|
@ -148,7 +148,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ Date buildDate = new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(Main.class.getPackage().getImplementationVendor()); // Paper
|
||||
|
||||
Calendar deadline = Calendar.getInstance();
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -3);
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -7);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java b/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/util/Versioning.java
|
||||
|
|
|
@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+
|
||||
+ @Override
|
||||
+ public boolean hasCollisionsIn(@org.jetbrains.annotations.NotNull org.bukkit.util.BoundingBox boundingBox) {
|
||||
+ net.minecraft.world.phys.AABB aabb = new AABB(boundingBox.getMinX(), boundingBox.getMinY(), boundingBox.getMinZ(), boundingBox.getMaxX(), boundingBox.getMaxY(), boundingBox.getMaxZ(), false);
|
||||
+ net.minecraft.world.phys.AABB aabb = new net.minecraft.world.phys.AABB(boundingBox.getMinX(), boundingBox.getMinY(), boundingBox.getMinZ(), boundingBox.getMaxX(), boundingBox.getMaxY(), boundingBox.getMaxZ(), false);
|
||||
+
|
||||
+ return !this.getHandle().noCollision(aabb);
|
||||
+ }
|
||||
|
|
|
@ -46,7 +46,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ final net.minecraft.network.chat.Component promptComponent = resourcePackPrompt != null ?
|
||||
+ io.papermc.paper.adventure.PaperAdventure.asVanilla(resourcePackPrompt) :
|
||||
+ null;
|
||||
+ this.getHandle().connection.send(new net.minecraft.network.protocol.common.ClientboundResourcePackPopPacket(Optional.empty()));
|
||||
+ this.getHandle().connection.send(new ClientboundResourcePackPopPacket(Optional.empty()));
|
||||
+ this.getHandle().connection.send(new ClientboundResourcePackPushPacket(uuid, url, hash, required, promptComponent));
|
||||
+ }
|
||||
+
|
||||
|
@ -56,6 +56,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ // Paper end - more resource pack API
|
||||
+
|
||||
public void addChannel(String channel) {
|
||||
Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel);
|
||||
channel = StandardMessenger.validateAndCorrectChannel(channel);
|
||||
@Override
|
||||
public void removeResourcePack(UUID id) {
|
||||
Preconditions.checkArgument(id != null, "Resource pack id cannot be null");
|
||||
|
|
|
@ -38,7 +38,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
AttributeModifier attribMod = CraftAttributeInstance.convert(nmsModifier);
|
||||
|
||||
- String attributeName = entry.getString(CraftMetaItem.ATTRIBUTES_IDENTIFIER.NBT);
|
||||
+ String attributeName = CraftAttributeMap.convertIfNeeded(entry.getString(CraftMetaItem.ATTRIBUTES_IDENTIFIER.NBT)); // Paper
|
||||
+ String attributeName = org.bukkit.craftbukkit.attribute.CraftAttributeMap.convertIfNeeded(entry.getString(CraftMetaItem.ATTRIBUTES_IDENTIFIER.NBT)); // Paper
|
||||
if (attributeName == null || attributeName.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -15,7 +15,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
implementation("commons-lang:commons-lang:2.6")
|
||||
+ implementation("net.fabricmc:mapping-io:0.5.0") // Paper - needed to read mappings for stacktrace deobfuscation
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.2.0")
|
||||
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
|
||||
@@ -0,0 +0,0 @@ tasks.check {
|
||||
}
|
||||
|
|
|
@ -1,63 +0,0 @@
|
|||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Owen1212055 <23108066+Owen1212055@users.noreply.github.com>
|
||||
Date: Wed, 12 Jul 2023 17:38:26 -0400
|
||||
Subject: [PATCH] Don't tick signs
|
||||
|
||||
Minecraft now ticks signs in order to validate the playerWhoMayEdit field. This is a horrible idea, as this means that even waxed signs are ticked for essentially no reason. This moves the logic lazily onto the getter.
|
||||
|
||||
== AT ==
|
||||
private net.minecraft.world.level.block.entity.SignBlockEntity playerWhoMayEdit
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java b/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java
|
||||
@@ -0,0 +0,0 @@ public class CeilingHangingSignBlock extends SignBlock {
|
||||
@Nullable
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level world, BlockState state, BlockEntityType<T> type) {
|
||||
- return createTickerHelper(type, BlockEntityType.HANGING_SIGN, SignBlockEntity::tick);
|
||||
+ return null; // Paper
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/SignBlock.java b/src/main/java/net/minecraft/world/level/block/SignBlock.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/SignBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/SignBlock.java
|
||||
@@ -0,0 +0,0 @@ public abstract class SignBlock extends BaseEntityBlock implements SimpleWaterlo
|
||||
@Nullable
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level world, BlockState state, BlockEntityType<T> type) {
|
||||
- return createTickerHelper(type, BlockEntityType.SIGN, SignBlockEntity::tick);
|
||||
+ return null; // Paper
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java b/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java
|
||||
@@ -0,0 +0,0 @@ public class WallHangingSignBlock extends SignBlock {
|
||||
@Nullable
|
||||
@Override
|
||||
public <T extends BlockEntity> BlockEntityTicker<T> getTicker(Level world, BlockState state, BlockEntityType<T> type) {
|
||||
- return createTickerHelper(type, BlockEntityType.HANGING_SIGN, SignBlockEntity::tick);
|
||||
+ return null; // Paper
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/entity/SignBlockEntity.java
|
||||
@@ -0,0 +0,0 @@ public class SignBlockEntity extends BlockEntity implements CommandSource { // C
|
||||
|
||||
@Nullable
|
||||
public UUID getPlayerWhoMayEdit() {
|
||||
+ // Paper start
|
||||
+ if (this.hasLevel() && this.playerWhoMayEdit != null) {
|
||||
+ // Manually invalidate the value lazily.
|
||||
+ this.clearInvalidPlayerWhoMayEdit(this, this.getLevel(), this.playerWhoMayEdit);
|
||||
+ }
|
||||
+ // Paper end
|
||||
return this.playerWhoMayEdit;
|
||||
}
|
||||
|
|
@ -323,19 +323,19 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}
|
||||
|
||||
@Override
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
} else if (TNTPrimed.class.isAssignableFrom(clazz)) {
|
||||
entity = new PrimedTnt(world, x, y, z, null);
|
||||
} else if (ExperienceOrb.class.isAssignableFrom(clazz)) {
|
||||
- entity = new net.minecraft.world.entity.ExperienceOrb(world, x, y, z, 0);
|
||||
+ entity = new net.minecraft.world.entity.ExperienceOrb(world, x, y, z, 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null); // Paper
|
||||
} else if (LightningStrike.class.isAssignableFrom(clazz)) {
|
||||
entity = net.minecraft.world.entity.EntityType.LIGHTNING_BOLT.create(world);
|
||||
entity.moveTo(location.getX(), location.getY(), location.getZ());
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftEntityTypes {
|
||||
return item;
|
||||
}));
|
||||
register(new EntityTypeData<>(EntityType.EXPERIENCE_ORB, ExperienceOrb.class, CraftExperienceOrb::new,
|
||||
- spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), 0)
|
||||
+ spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null) // Paper
|
||||
));
|
||||
register(new EntityTypeData<>(EntityType.AREA_EFFECT_CLOUD, AreaEffectCloud.class, CraftAreaEffectCloud::new, spawnData -> new net.minecraft.world.entity.AreaEffectCloud(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
|
||||
register(new EntityTypeData<>(EntityType.EGG, Egg.class, CraftEgg::new, spawnData -> new ThrownEgg(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftExperienceOrb.java
|
||||
|
|
|
@ -14,7 +14,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@Override
|
||||
public boolean addPotionEffect(PotionEffect effect, boolean force) {
|
||||
- this.getHandle().addEffect(new MobEffectInstance(CraftPotionEffectType.bukkitToMinecraft(effect.getType()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles()), EntityPotionEffectEvent.Cause.PLUGIN);
|
||||
+ this.getHandle().addEffect(CraftPotionUtil.fromBukkit(effect), EntityPotionEffectEvent.Cause.PLUGIN); // Paper - Don't ignore icon
|
||||
+ this.getHandle().addEffect(org.bukkit.craftbukkit.potion.CraftPotionUtil.fromBukkit(effect), EntityPotionEffectEvent.Cause.PLUGIN); // Paper - Don't ignore icon
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -23,7 +23,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
public PotionEffect getPotionEffect(PotionEffectType type) {
|
||||
MobEffectInstance handle = this.getHandle().getEffect(CraftPotionEffectType.bukkitToMinecraft(type));
|
||||
- return (handle == null) ? null : new PotionEffect(CraftPotionEffectType.minecraftToBukkit(handle.getEffect()), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.isVisible());
|
||||
+ return (handle == null) ? null : CraftPotionUtil.toBukkit(handle); // Paper
|
||||
+ return (handle == null) ? null : org.bukkit.craftbukkit.potion.CraftPotionUtil.toBukkit(handle); // Paper
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -32,7 +32,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
List<PotionEffect> effects = new ArrayList<PotionEffect>();
|
||||
for (MobEffectInstance handle : this.getHandle().activeEffects.values()) {
|
||||
- effects.add(new PotionEffect(CraftPotionEffectType.minecraftToBukkit(handle.getEffect()), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.isVisible()));
|
||||
+ effects.add(CraftPotionUtil.toBukkit(handle)); // Paper
|
||||
+ effects.add(org.bukkit.craftbukkit.potion.CraftPotionUtil.toBukkit(handle)); // Paper
|
||||
}
|
||||
return effects;
|
||||
}
|
||||
|
|
|
@ -48,9 +48,6 @@ https://bugs.mojang.com/browse/MC-123848
|
|||
by: BillyGalbreath <blake.galbreath@gmail.com>
|
||||
Fixes item frames dropping items above when pointing down
|
||||
|
||||
https://bugs.mojang.com/browse/MC-264285
|
||||
Fix unbreakable flint and steel being consumed when igniting creepers
|
||||
|
||||
https://bugs.mojang.com/browse/MC-84789
|
||||
Fix wild wolves not considering bones interesting
|
||||
|
||||
|
@ -319,19 +316,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
private void removeFramedMap(ItemStack itemstack) {
|
||||
this.getFramedMapId().ifPresent((i) -> {
|
||||
MapItemSavedData worldmap = MapItem.getSavedData(i, this.level());
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/monster/Creeper.java b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||
+++ b/src/main/java/net/minecraft/world/entity/monster/Creeper.java
|
||||
@@ -0,0 +0,0 @@ public class Creeper extends Monster implements PowerableMob {
|
||||
this.level().playSound(player, this.getX(), this.getY(), this.getZ(), soundeffect, this.getSoundSource(), 1.0F, this.random.nextFloat() * 0.4F + 0.8F);
|
||||
if (!this.level().isClientSide) {
|
||||
this.ignite();
|
||||
- if (!itemstack.isDamageableItem()) {
|
||||
+ if (itemstack.getItem().getMaxDamage() == 0) { // Paper - fix MC-264285, only shrink the stack if the item type actually has no durability
|
||||
itemstack.shrink(1);
|
||||
} else {
|
||||
itemstack.hurtAndBreak(1, player, (entityhuman1) -> {
|
||||
diff --git a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java b/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/entity/npc/CatSpawner.java
|
||||
|
|
|
@ -10,19 +10,6 @@ Restores the API behavior from previous versions of the server
|
|||
== AT ==
|
||||
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/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
// Paper end
|
||||
} else if (FallingBlock.class.isAssignableFrom(clazz)) {
|
||||
BlockPos pos = BlockPos.containing(x, y, z);
|
||||
- entity = FallingBlockEntity.fall(world, pos, this.getHandle().getBlockState(pos));
|
||||
+ entity = new FallingBlockEntity(world, x, y, z, this.getHandle().getBlockState(pos)); // Paper
|
||||
} else if (Projectile.class.isAssignableFrom(clazz)) {
|
||||
if (Snowball.class.isAssignableFrom(clazz)) {
|
||||
entity = new net.minecraft.world.entity.projectile.Snowball(world, x, y, z);
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java
|
||||
|
@ -55,3 +42,16 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
return (FallingBlock) entity.getBukkitEntity();
|
||||
}
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
@@ -0,0 +0,0 @@ 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)));
|
||||
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.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)));
|
||||
|
|
|
@ -4,25 +4,31 @@ Date: Sat, 24 Jun 2023 09:42:53 -0700
|
|||
Subject: [PATCH] Fix possible NPE on painting creation
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
AABB bb = (ItemFrame.class.isAssignableFrom(clazz))
|
||||
? net.minecraft.world.entity.decoration.ItemFrame.calculateBoundingBox(null, pos, CraftBlock.blockFaceToNotch(dir).getOpposite(), width, height)
|
||||
: HangingEntity.calculateBoundingBox(null, pos, CraftBlock.blockFaceToNotch(dir).getOpposite(), width, height);
|
||||
+ if (!this.getHandle().noCollision(bb)) continue; // Paper - add collision check
|
||||
List<net.minecraft.world.entity.Entity> list = (List<net.minecraft.world.entity.Entity>) this.getHandle().getEntities(null, bb);
|
||||
for (Iterator<net.minecraft.world.entity.Entity> it = list.iterator(); !taken && it.hasNext(); ) {
|
||||
net.minecraft.world.entity.Entity e = it.next();
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
if (Painting.class.isAssignableFrom(clazz)) {
|
||||
if (this.isNormalWorld() && randomizeData) {
|
||||
entity = net.minecraft.world.entity.decoration.Painting.create(world, pos, dir).orElse(null);
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftEntityTypes {
|
||||
// Hanging
|
||||
register(new EntityTypeData<>(EntityType.PAINTING, Painting.class, CraftPainting::new, createHanging(Painting.class, (spawnData, hangingData) -> {
|
||||
if (spawnData.normalWorld && hangingData.randomize()) {
|
||||
- return net.minecraft.world.entity.decoration.Painting.create(spawnData.minecraftWorld(), hangingData.position(), hangingData.direction()).orElse(null);
|
||||
- } else {
|
||||
+ } // Paper
|
||||
+ if (entity == null) { // Paper - if randomizeData fails, force it
|
||||
entity = new net.minecraft.world.entity.decoration.Painting(net.minecraft.world.entity.EntityType.PAINTING, this.getHandle().getMinecraftWorld());
|
||||
entity.absMoveTo(x, y, z, yaw, pitch);
|
||||
((net.minecraft.world.entity.decoration.Painting) entity).setDirection(dir);
|
||||
+ // Paper start - if randomizeData fails, force it
|
||||
+ final net.minecraft.world.entity.decoration.Painting entity = net.minecraft.world.entity.decoration.Painting.create(spawnData.minecraftWorld(), hangingData.position(), hangingData.direction()).orElse(null);
|
||||
+ if (entity != null) {
|
||||
+ return entity;
|
||||
+ }
|
||||
+ } /*else*/ {
|
||||
+ // Paper end - if randomizeData fails, force it
|
||||
net.minecraft.world.entity.decoration.Painting entity = new net.minecraft.world.entity.decoration.Painting(net.minecraft.world.entity.EntityType.PAINTING, spawnData.minecraftWorld());
|
||||
entity.absMoveTo(spawnData.x(), spawnData.y(), spawnData.z(), spawnData.yaw(), spawnData.pitch());
|
||||
entity.setDirection(hangingData.direction());
|
||||
@@ -0,0 +0,0 @@ public final class CraftEntityTypes {
|
||||
AABB bb = (ItemFrame.class.isAssignableFrom(clazz))
|
||||
? net.minecraft.world.entity.decoration.ItemFrame.calculateBoundingBox(null, pos, CraftBlock.blockFaceToNotch(dir).getOpposite(), width, height)
|
||||
: HangingEntity.calculateBoundingBox(null, pos, CraftBlock.blockFaceToNotch(dir).getOpposite(), width, height);
|
||||
+ if (!spawnData.world.noCollision(bb)) continue; // Paper - add collision check
|
||||
List<net.minecraft.world.entity.Entity> list = spawnData.world().getEntities(null, bb);
|
||||
for (Iterator<net.minecraft.world.entity.Entity> it = list.iterator(); !taken && it.hasNext(); ) {
|
||||
net.minecraft.world.entity.Entity e = it.next();
|
||||
|
|
|
@ -4,15 +4,29 @@ Date: Sun, 30 Jul 2023 13:30:34 +0300
|
|||
Subject: [PATCH] Fix rotation when spawning display entities
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftEntityTypes {
|
||||
Vector direction = spawnData.location().getDirection().multiply(10);
|
||||
entity.setDirection(direction.getX(), direction.getY(), direction.getZ());
|
||||
};
|
||||
+ private static final BiConsumer<SpawnData, net.minecraft.world.entity.Entity> ROT = (spawnData, entity) -> entity.setRot(spawnData.yaw(), spawnData.pitch()); // Paper
|
||||
private static final Map<Class<?>, EntityTypeData<?, ?>> CLASS_TYPE_DATA = new HashMap<>();
|
||||
private static final Map<EntityType, EntityTypeData<?, ?>> ENTITY_TYPE_DATA = new HashMap<>();
|
||||
|
||||
if (entity != null) {
|
||||
entity.setPos(x, y, z);
|
||||
+ entity.setRot(yaw, pitch); // Paper - Set Display Rotation
|
||||
}
|
||||
}
|
||||
@@ -0,0 +0,0 @@ public final class CraftEntityTypes {
|
||||
|
||||
// Set pos
|
||||
register(new EntityTypeData<>(EntityType.MARKER, Marker.class, CraftMarker::new, createAndSetPos(net.minecraft.world.entity.EntityType.MARKER)));
|
||||
- register(new EntityTypeData<>(EntityType.BLOCK_DISPLAY, BlockDisplay.class, CraftBlockDisplay::new, createAndSetPos(net.minecraft.world.entity.EntityType.BLOCK_DISPLAY)));
|
||||
+ register(new EntityTypeData<>(EntityType.BLOCK_DISPLAY, BlockDisplay.class, CraftBlockDisplay::new, combine(createAndSetPos(net.minecraft.world.entity.EntityType.BLOCK_DISPLAY), ROT))); // Paper
|
||||
register(new EntityTypeData<>(EntityType.INTERACTION, Interaction.class, CraftInteraction::new, createAndSetPos(net.minecraft.world.entity.EntityType.INTERACTION)));
|
||||
- register(new EntityTypeData<>(EntityType.ITEM_DISPLAY, ItemDisplay.class, CraftItemDisplay::new, createAndSetPos(net.minecraft.world.entity.EntityType.ITEM_DISPLAY)));
|
||||
- register(new EntityTypeData<>(EntityType.TEXT_DISPLAY, TextDisplay.class, CraftTextDisplay::new, createAndSetPos(net.minecraft.world.entity.EntityType.TEXT_DISPLAY)));
|
||||
+ register(new EntityTypeData<>(EntityType.ITEM_DISPLAY, ItemDisplay.class, CraftItemDisplay::new, combine(createAndSetPos(net.minecraft.world.entity.EntityType.ITEM_DISPLAY), ROT))); // Paper
|
||||
+ register(new EntityTypeData<>(EntityType.TEXT_DISPLAY, TextDisplay.class, CraftTextDisplay::new, combine(createAndSetPos(net.minecraft.world.entity.EntityType.TEXT_DISPLAY), ROT))); // Paper
|
||||
|
||||
// MISC
|
||||
register(new EntityTypeData<>(EntityType.DROPPED_ITEM, Item.class, CraftItem::new, spawnData -> {
|
||||
|
|
|
@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -0,0 +0,0 @@ public class Main {
|
||||
Calendar deadline = Calendar.getInstance();
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -3);
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -7);
|
||||
if (buildDate.before(deadline.getTime())) {
|
||||
- System.err.println("*** Error, this build is outdated ***");
|
||||
+ // Paper start - This is some stupid bullshit
|
||||
|
|
|
@ -21,7 +21,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
public CraftPlayer(CraftServer server, ServerPlayer entity) {
|
||||
super(server, entity);
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
// Paper end - more resource pack API
|
||||
}
|
||||
|
||||
public void addChannel(String channel) {
|
||||
- Preconditions.checkState(this.channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel);
|
||||
|
|
|
@ -9,8 +9,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/build.gradle.kts
|
||||
+++ b/build.gradle.kts
|
||||
@@ -0,0 +0,0 @@ dependencies {
|
||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
|
||||
|
||||
+ testImplementation("io.github.classgraph:classgraph:4.8.47") // Paper - mob goal test
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
|
||||
|
|
|
@ -174,7 +174,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@Override
|
||||
public boolean addPotionEffect(PotionEffect effect, boolean force) {
|
||||
+ org.spigotmc.AsyncCatcher.catchOp("effect add"); // Paper
|
||||
this.getHandle().addEffect(CraftPotionUtil.fromBukkit(effect), EntityPotionEffectEvent.Cause.PLUGIN); // Paper - Don't ignore icon
|
||||
this.getHandle().addEffect(org.bukkit.craftbukkit.potion.CraftPotionUtil.fromBukkit(effect), EntityPotionEffectEvent.Cause.PLUGIN); // Paper - Don't ignore icon
|
||||
return true;
|
||||
}
|
||||
diff --git a/src/main/java/org/spigotmc/AsyncCatcher.java b/src/main/java/org/spigotmc/AsyncCatcher.java
|
||||
|
|
|
@ -193,40 +193,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
}));
|
||||
this.byName = Maps.newHashMap(builder.build()); // CraftBukkit
|
||||
RecipeManager.LOGGER.info("Loaded {} recipes", map1.size());
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java b/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/CeilingHangingSignBlock.java
|
||||
@@ -0,0 +0,0 @@ public class CeilingHangingSignBlock extends SignBlock {
|
||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||
BlockEntity itemStack = world.getBlockEntity(pos);
|
||||
if (itemStack instanceof SignBlockEntity signBlockEntity) {
|
||||
- ItemStack itemStack = player.getItemInHand(hand);
|
||||
- if (this.shouldTryToChainAnotherHangingSign(player, hit, signBlockEntity, itemStack)) {
|
||||
+ // Paper start - decompile fixes
|
||||
+ ItemStack itemStack0 = player.getItemInHand(hand);
|
||||
+ if (this.shouldTryToChainAnotherHangingSign(player, hit, signBlockEntity, itemStack0)) {
|
||||
+ // Paper end - decompile fixes
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java b/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java
|
||||
+++ b/src/main/java/net/minecraft/world/level/block/WallHangingSignBlock.java
|
||||
@@ -0,0 +0,0 @@ public class WallHangingSignBlock extends SignBlock {
|
||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||
BlockEntity itemStack = world.getBlockEntity(pos);
|
||||
if (itemStack instanceof SignBlockEntity signBlockEntity) {
|
||||
- ItemStack itemStack = player.getItemInHand(hand);
|
||||
- if (this.shouldTryToChainAnotherHangingSign(state, player, hit, signBlockEntity, itemStack)) {
|
||||
+ // Paper start - decompile fixes
|
||||
+ ItemStack itemStack0 = player.getItemInHand(hand);
|
||||
+ if (this.shouldTryToChainAnotherHangingSign(state, player, hit, signBlockEntity, itemStack0)) {
|
||||
+ // Paper end
|
||||
return InteractionResult.PASS;
|
||||
}
|
||||
}
|
||||
diff --git a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java b/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/world/level/chunk/PalettedContainer.java
|
||||
|
|
|
@ -370,36 +370,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@Nullable
|
||||
@Override
|
||||
protected EntityHitResult findHitEntity(Vec3 currentPosition, Vec3 nextPosition) {
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
} else if (Phantom.class.isAssignableFrom(clazz)) {
|
||||
entity = net.minecraft.world.entity.EntityType.PHANTOM.create(world);
|
||||
} else if (Fish.class.isAssignableFrom(clazz)) {
|
||||
- if (Cod.class.isAssignableFrom(clazz)) {
|
||||
- entity = net.minecraft.world.entity.EntityType.COD.create(world);
|
||||
+ // Paper start - Schooling Fish API
|
||||
+ if (io.papermc.paper.entity.SchoolableFish.class.isAssignableFrom(clazz)) {
|
||||
+ if (Cod.class.isAssignableFrom(clazz)) {
|
||||
+ entity = net.minecraft.world.entity.EntityType.COD.create(world);
|
||||
+ } else if (Salmon.class.isAssignableFrom(clazz)) {
|
||||
+ entity = net.minecraft.world.entity.EntityType.SALMON.create(world);
|
||||
+ } else if (TropicalFish.class.isAssignableFrom(clazz)) {
|
||||
+ entity = net.minecraft.world.entity.EntityType.TROPICAL_FISH.create(world);
|
||||
+ }
|
||||
+ // Paper stop
|
||||
} else if (PufferFish.class.isAssignableFrom(clazz)) {
|
||||
entity = net.minecraft.world.entity.EntityType.PUFFERFISH.create(world);
|
||||
- } else if (Salmon.class.isAssignableFrom(clazz)) {
|
||||
- entity = net.minecraft.world.entity.EntityType.SALMON.create(world);
|
||||
- } else if (TropicalFish.class.isAssignableFrom(clazz)) {
|
||||
- entity = net.minecraft.world.entity.EntityType.TROPICAL_FISH.create(world);
|
||||
+ // Paper - remove old fish impl
|
||||
} else if (Tadpole.class.isAssignableFrom(clazz)) {
|
||||
entity = net.minecraft.world.entity.EntityType.TADPOLE.create(world);
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftAbstractHorse.java
|
||||
|
@ -668,30 +638,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ // Paper end
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
|
||||
else { return new CraftSquid(server, (Squid) entity); }
|
||||
}
|
||||
else if (entity instanceof AbstractFish) {
|
||||
- if (entity instanceof Cod) { return new CraftCod(server, (Cod) entity); }
|
||||
+ // Paper start - Schooling Fish API
|
||||
+ if (entity instanceof net.minecraft.world.entity.animal.AbstractSchoolingFish abstractSchoolingFish) {
|
||||
+ if (entity instanceof Cod) { return new CraftCod(server, (Cod) entity); }
|
||||
+ else if (entity instanceof Salmon) { return new CraftSalmon(server, (Salmon) entity); }
|
||||
+ else if (entity instanceof TropicalFish) { return new CraftTropicalFish(server, (TropicalFish) entity); }
|
||||
+ else { return new io.papermc.paper.entity.PaperSchoolableFish(server, abstractSchoolingFish); }
|
||||
+ }
|
||||
+ // Paper end
|
||||
else if (entity instanceof Pufferfish) { return new CraftPufferFish(server, (Pufferfish) entity); }
|
||||
- else if (entity instanceof Salmon) { return new CraftSalmon(server, (Salmon) entity); }
|
||||
- else if (entity instanceof TropicalFish) { return new CraftTropicalFish(server, (TropicalFish) entity); }
|
||||
+ // Paper - move fish
|
||||
else if (entity instanceof Tadpole) { return new CraftTadpole(server, (Tadpole) entity); }
|
||||
else { return new CraftFish(server, (AbstractFish) entity); }
|
||||
}
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftFox.java
|
||||
|
|
|
@ -179,7 +179,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
|
||||
ServerPlayer entity = this.getHandle();
|
||||
@@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
- if (entity.isVehicle()) {
|
||||
|
|
|
@ -25,7 +25,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ implementation("org.spongepowered:configurate-yaml:4.2.0-SNAPSHOT") // Paper - config files
|
||||
implementation("commons-lang:commons-lang:2.6")
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.2.0")
|
||||
diff --git a/src/main/java/com/destroystokyo/paper/PaperConfig.java b/src/main/java/com/destroystokyo/paper/PaperConfig.java
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000
|
||||
|
|
|
@ -8,54 +8,61 @@ Subject: [PATCH] Respect randomizeData on more entities when spawning
|
|||
* FireworkRocketEntity
|
||||
* ExperienceOrb
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
} else if (org.bukkit.entity.Item.class.isAssignableFrom(clazz)) {
|
||||
entity = new net.minecraft.world.entity.item.ItemEntity(world, x, y, z, new net.minecraft.world.item.ItemStack(net.minecraft.world.item.Items.DIRT));
|
||||
// Paper end
|
||||
+ // Paper start - respect randomizeData
|
||||
+ if (!randomizeData) {
|
||||
+ entity.setDeltaMovement(net.minecraft.world.phys.Vec3.ZERO);
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftEntityTypes {
|
||||
entity.setDirection(direction.getX(), direction.getY(), direction.getZ());
|
||||
};
|
||||
private static final BiConsumer<SpawnData, net.minecraft.world.entity.Entity> ROT = (spawnData, entity) -> entity.setRot(spawnData.yaw(), spawnData.pitch()); // Paper
|
||||
+ // Paper start - respect randomizeData
|
||||
+ private static final BiConsumer<SpawnData, net.minecraft.world.entity.Entity> CLEAR_MOVE_IF_NOT_RANDOMIZED = (spawnData, entity) -> {
|
||||
+ if (!spawnData.randomizeData()) {
|
||||
+ entity.setDeltaMovement(net.minecraft.world.phys.Vec3.ZERO);
|
||||
+ }
|
||||
+ };
|
||||
+ // Paper end - respect randomizeData
|
||||
private static final Map<Class<?>, EntityTypeData<?, ?>> CLASS_TYPE_DATA = new HashMap<>();
|
||||
private static final Map<EntityType, EntityTypeData<?, ?>> ENTITY_TYPE_DATA = new HashMap<>();
|
||||
|
||||
@@ -0,0 +0,0 @@ public final class CraftEntityTypes {
|
||||
net.minecraft.world.item.ItemStack itemStack = new net.minecraft.world.item.ItemStack(Items.STONE);
|
||||
ItemEntity item = new ItemEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), itemStack);
|
||||
item.setPickUpDelay(10);
|
||||
+ CLEAR_MOVE_IF_NOT_RANDOMIZED.accept(spawnData, item); // Paper - respect randomizeData
|
||||
|
||||
return item;
|
||||
}));
|
||||
register(new EntityTypeData<>(EntityType.EXPERIENCE_ORB, ExperienceOrb.class, CraftExperienceOrb::new,
|
||||
- spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null) // Paper
|
||||
+ combine(combine(spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null), CLEAR_MOVE_IF_NOT_RANDOMIZED), (spawnData, experienceOrb) -> { if (!spawnData.randomizeData()) { experienceOrb.setYRot(0); } }) // Paper - respect randomizeData
|
||||
));
|
||||
register(new EntityTypeData<>(EntityType.AREA_EFFECT_CLOUD, AreaEffectCloud.class, CraftAreaEffectCloud::new, createAndMove(net.minecraft.world.entity.EntityType.AREA_EFFECT_CLOUD))); // Paper - set area effect cloud rotation
|
||||
register(new EntityTypeData<>(EntityType.EGG, Egg.class, CraftEgg::new, spawnData -> new ThrownEgg(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
|
||||
@@ -0,0 +0,0 @@ public final class CraftEntityTypes {
|
||||
entity.setItem(CraftItemStack.asNMSCopy(new ItemStack(Material.SPLASH_POTION, 1)));
|
||||
return entity;
|
||||
}));
|
||||
- register(new EntityTypeData<>(EntityType.PRIMED_TNT, TNTPrimed.class, CraftTNTPrimed::new, spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null)));
|
||||
+ register(new EntityTypeData<>(EntityType.PRIMED_TNT, TNTPrimed.class, CraftTNTPrimed::new, combine(spawnData -> new PrimedTnt(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), null), CLEAR_MOVE_IF_NOT_RANDOMIZED))); // Paper - respect randomizeData
|
||||
register(new EntityTypeData<>(EntityType.FALLING_BLOCK, FallingBlock.class, CraftFallingBlock::new, spawnData -> {
|
||||
BlockPos pos = BlockPos.containing(spawnData.x(), spawnData.y(), spawnData.z());
|
||||
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)));
|
||||
+ // Paper start - respect randomizeData
|
||||
+ register(new EntityTypeData<>(EntityType.FIREWORK, Firework.class, CraftFirework::new, spawnData -> {
|
||||
+ FireworkRocketEntity entity = new FireworkRocketEntity(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z(), net.minecraft.world.item.ItemStack.EMPTY);
|
||||
+ if (!spawnData.randomizeData()) {
|
||||
+ // logic below was taken from FireworkRocketEntity constructor
|
||||
+ entity.setDeltaMovement(0, 0.05, 0);
|
||||
+ //noinspection PointlessArithmeticExpression
|
||||
+ entity.lifetime = 10 * 1 + 6;
|
||||
+ }
|
||||
+ // Paper end - respect randomizeData
|
||||
} else if (FallingBlock.class.isAssignableFrom(clazz)) {
|
||||
BlockPos pos = BlockPos.containing(x, y, z);
|
||||
entity = new FallingBlockEntity(world, x, y, z, this.getHandle().getBlockState(pos)); // Paper
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
entity.moveTo(x, y, z, yaw, pitch);
|
||||
} else if (Firework.class.isAssignableFrom(clazz)) {
|
||||
entity = new FireworkRocketEntity(world, x, y, z, net.minecraft.world.item.ItemStack.EMPTY);
|
||||
+ // Paper start - respect randomizeData
|
||||
+ if (!randomizeData) {
|
||||
+ // logic below was taken from FireworkRocketEntity constructor
|
||||
+ entity.setDeltaMovement(0, 0.05, 0);
|
||||
+ //noinspection PointlessArithmeticExpression
|
||||
+ ((FireworkRocketEntity) entity).lifetime = 10 * 1 + 6;
|
||||
+ }
|
||||
+ // Paper end - respect randomizeData
|
||||
}
|
||||
} else if (Minecart.class.isAssignableFrom(clazz)) {
|
||||
if (PoweredMinecart.class.isAssignableFrom(clazz)) {
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
}
|
||||
} else if (TNTPrimed.class.isAssignableFrom(clazz)) {
|
||||
entity = new PrimedTnt(world, x, y, z, null);
|
||||
+ // Paper start - respect randomizeData
|
||||
+ if (!randomizeData) {
|
||||
+ entity.setDeltaMovement(net.minecraft.world.phys.Vec3.ZERO);
|
||||
+ }
|
||||
+ // Paper end - respect randomizeData
|
||||
} else if (ExperienceOrb.class.isAssignableFrom(clazz)) {
|
||||
entity = new net.minecraft.world.entity.ExperienceOrb(world, x, y, z, 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null); // Paper
|
||||
+ // Paper start - respect randomizeData
|
||||
+ if (!randomizeData) {
|
||||
+ entity.setDeltaMovement(net.minecraft.world.phys.Vec3.ZERO);
|
||||
+ entity.setYRot(0);
|
||||
+ }
|
||||
+ // Paper end - respect randomizeData
|
||||
} else if (LightningStrike.class.isAssignableFrom(clazz)) {
|
||||
entity = net.minecraft.world.entity.EntityType.LIGHTNING_BOLT.create(world);
|
||||
entity.moveTo(location.getX(), location.getY(), location.getZ());
|
||||
+ return entity;
|
||||
+ }));
|
||||
+ // Paper end - respect randomizeData
|
||||
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)));
|
||||
register(new EntityTypeData<>(EntityType.MINECART_COMMAND, CommandMinecart.class, CraftMinecartCommand::new, spawnData -> new MinecartCommandBlock(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
|
||||
register(new EntityTypeData<>(EntityType.MINECART, RideableMinecart.class, CraftMinecartRideable::new, spawnData -> new Minecart(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
|
||||
|
|
|
@ -4,15 +4,16 @@ Date: Mon, 5 Apr 2021 16:58:20 -0400
|
|||
Subject: [PATCH] Set area affect cloud rotation
|
||||
|
||||
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/CraftRegionAccessor.java
|
||||
@@ -0,0 +0,0 @@ public abstract class CraftRegionAccessor implements RegionAccessor {
|
||||
entity.moveTo(location.getX(), location.getY(), location.getZ());
|
||||
} else if (AreaEffectCloud.class.isAssignableFrom(clazz)) {
|
||||
entity = new net.minecraft.world.entity.AreaEffectCloud(world, x, y, z);
|
||||
+ entity.moveTo(x, y, z, yaw, pitch); // Paper - Set area effect cloud Rotation
|
||||
} else if (EvokerFangs.class.isAssignableFrom(clazz)) {
|
||||
entity = new net.minecraft.world.entity.projectile.EvokerFangs(world, x, y, z, (float) Math.toRadians(yaw), 0, null);
|
||||
} else if (Marker.class.isAssignableFrom(clazz)) {
|
||||
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftEntityTypes.java
|
||||
@@ -0,0 +0,0 @@ public final class CraftEntityTypes {
|
||||
register(new EntityTypeData<>(EntityType.EXPERIENCE_ORB, ExperienceOrb.class, CraftExperienceOrb::new,
|
||||
spawnData -> new net.minecraft.world.entity.ExperienceOrb(spawnData.minecraftWorld(), spawnData.x(), spawnData.z(), spawnData.z(), 0, org.bukkit.entity.ExperienceOrb.SpawnReason.CUSTOM, null, null) // Paper
|
||||
));
|
||||
- register(new EntityTypeData<>(EntityType.AREA_EFFECT_CLOUD, AreaEffectCloud.class, CraftAreaEffectCloud::new, spawnData -> new net.minecraft.world.entity.AreaEffectCloud(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
|
||||
+ register(new EntityTypeData<>(EntityType.AREA_EFFECT_CLOUD, AreaEffectCloud.class, CraftAreaEffectCloud::new, createAndMove(net.minecraft.world.entity.EntityType.AREA_EFFECT_CLOUD))); // Paper - set area effect cloud rotation
|
||||
register(new EntityTypeData<>(EntityType.EGG, Egg.class, CraftEgg::new, spawnData -> new ThrownEgg(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
|
||||
register(new EntityTypeData<>(EntityType.LEASH_HITCH, LeashHitch.class, CraftLeash::new, spawnData -> new LeashFenceKnotEntity(spawnData.minecraftWorld(), BlockPos.containing(spawnData.x(), spawnData.y(), spawnData.z())))); // SPIGOT-5732: LeashHitch has no direction and is always centered at a block
|
||||
register(new EntityTypeData<>(EntityType.SNOWBALL, Snowball.class, CraftSnowball::new, spawnData -> new net.minecraft.world.entity.projectile.Snowball(spawnData.minecraftWorld(), spawnData.x(), spawnData.y(), spawnData.z())));
|
||||
|
|
|
@ -49,11 +49,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ implementation("org.ow2.asm:asm:9.5")
|
||||
+ implementation("commons-lang:commons-lang:2.6")
|
||||
+ runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
|
||||
+ runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
|
||||
+ runtimeOnly("com.mysql:mysql-connector-j:8.2.0")
|
||||
+
|
||||
+ runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.7.3")
|
||||
+ runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6")
|
||||
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
||||
+ runtimeOnly("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18")
|
||||
+
|
||||
+ testImplementation("org.junit.jupiter:junit-jupiter:5.10.0")
|
||||
+ testImplementation("org.hamcrest:hamcrest:2.2")
|
||||
|
@ -420,26 +420,26 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
- <dependency>
|
||||
- <groupId>com.mysql</groupId>
|
||||
- <artifactId>mysql-connector-j</artifactId>
|
||||
- <version>8.1.0</version>
|
||||
- <version>8.2.0</version>
|
||||
- <scope>runtime</scope>
|
||||
- </dependency>
|
||||
- <!-- add these back in as they are not exposed by the API -->
|
||||
- <dependency>
|
||||
- <groupId>org.apache.maven</groupId>
|
||||
- <artifactId>maven-resolver-provider</artifactId>
|
||||
- <version>3.8.5</version>
|
||||
- <version>3.9.6</version>
|
||||
- <scope>runtime</scope>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
- <groupId>org.apache.maven.resolver</groupId>
|
||||
- <artifactId>maven-resolver-connector-basic</artifactId>
|
||||
- <version>1.7.3</version>
|
||||
- <version>1.9.18</version>
|
||||
- <scope>runtime</scope>
|
||||
- </dependency>
|
||||
- <dependency>
|
||||
- <groupId>org.apache.maven.resolver</groupId>
|
||||
- <artifactId>maven-resolver-transport-http</artifactId>
|
||||
- <version>1.7.3</version>
|
||||
- <version>1.9.18</version>
|
||||
- <scope>runtime</scope>
|
||||
- </dependency>
|
||||
- <!-- annotations -->
|
||||
|
|
|
@ -36,7 +36,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
--- a/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
+++ b/src/main/java/org/bukkit/craftbukkit/Main.java
|
||||
@@ -0,0 +0,0 @@ public class Main {
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -3);
|
||||
deadline.add(Calendar.DAY_OF_YEAR, -7);
|
||||
if (buildDate.before(deadline.getTime())) {
|
||||
System.err.println("*** Error, this build is outdated ***");
|
||||
- System.err.println("*** Please download a new build as per instructions from https://www.spigotmc.org/go/outdated-spigot ***");
|
||||
|
|
|
@ -11,11 +11,11 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
@@ -0,0 +0,0 @@ dependencies {
|
||||
implementation("commons-lang:commons-lang:2.6")
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.2.0")
|
||||
+ runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
|
||||
|
||||
runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||
runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6")
|
||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
||||
diff --git a/src/main/resources/log4j2.xml b/src/main/resources/log4j2.xml
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/resources/log4j2.xml
|
||||
|
|
|
@ -10,7 +10,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+++ b/build.gradle.kts
|
||||
@@ -0,0 +0,0 @@ dependencies {
|
||||
runtimeOnly("org.xerial:sqlite-jdbc:3.42.0.1")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.1.0")
|
||||
runtimeOnly("com.mysql:mysql-connector-j:8.2.0")
|
||||
runtimeOnly("com.lmax:disruptor:3.4.4") // Paper
|
||||
+ // Paper start - Use Velocity cipher
|
||||
+ implementation("com.velocitypowered:velocity-native:3.1.2-SNAPSHOT") {
|
||||
|
@ -18,8 +18,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||
+ }
|
||||
+ // Paper end
|
||||
|
||||
runtimeOnly("org.apache.maven:maven-resolver-provider:3.8.5")
|
||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.7.3")
|
||||
runtimeOnly("org.apache.maven:maven-resolver-provider:3.9.6")
|
||||
runtimeOnly("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
|
||||
diff --git a/src/main/java/net/minecraft/network/CipherDecoder.java b/src/main/java/net/minecraft/network/CipherDecoder.java
|
||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||
--- a/src/main/java/net/minecraft/network/CipherDecoder.java
|
||||
|
|
|
@ -5,7 +5,7 @@ PS1="$"
|
|||
|
||||
function changelog() {
|
||||
base=$(git ls-tree HEAD $1 | cut -d' ' -f3 | cut -f1)
|
||||
cd $1 && git log --oneline ${base}...HEAD | sed -E 's/(^[0-9a-f]{8,}( SPIGOT-[0-9]{1,4},?)* |Revert ")#([0-9]+)/\1PR-\3/'
|
||||
cd $1 && git log --oneline ${base}...HEAD | sed -E 's/(^[0-9a-f]{8,}( (SPIGOT-[0-9]{1,4}|MC-[0-9]{1,6}),?)* |Revert ")#([0-9]+)/\1PR-\4/'
|
||||
}
|
||||
bukkit=$(changelog work/Bukkit)
|
||||
cb=$(changelog work/CraftBukkit)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit 01bb6ba7d0add97af46db9ae8c2c991912033aa7
|
||||
Subproject commit f29cb8015897da1bca0c93522c5884c4c9f93601
|
|
@ -1 +1 @@
|
|||
Subproject commit cb2ea54def89e749d9d1f6a4a7ea029110f03a43
|
||||
Subproject commit b3b43a6ad21c9f7fc2dd0a1e7e94abae0057770d
|
|
@ -1 +1 @@
|
|||
Subproject commit ce0f71e4276e911707a258a968371f06f8718aca
|
||||
Subproject commit 06d602e7c3165ebf32f7419cb5873ec82d54ff7c
|
Loading…
Reference in a new issue