Compiler issues v4

This commit is contained in:
Bjarne Koll
2024-10-25 17:08:48 +02:00
parent 319032e137
commit f3f59e196d
11 changed files with 68 additions and 30 deletions

View File

@@ -14,7 +14,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+import io.papermc.paper.adventure.PaperAdventure;
+import net.kyori.adventure.sound.Sound;
+import net.minecraft.server.level.ServerLevel;
+import net.minecraft.world.entity.Shearable;
+import net.minecraft.world.item.ItemStack;
+import net.minecraft.world.item.Items;
+import org.jetbrains.annotations.NotNull;
+
+public interface PaperShearable extends io.papermc.paper.entity.Shearable {
@@ -28,9 +31,20 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ @Override
+ default void shear(@NotNull Sound.Source source) {
+ this.getHandle().shear(PaperAdventure.asVanilla(source));
+ if (!(this.getHandle().level() instanceof final ServerLevel serverLevel)) return;
+ this.getHandle().shear(serverLevel, PaperAdventure.asVanilla(source), new ItemStack(Items.SHEARS));
+ }
+}
diff --git a/src/main/java/net/minecraft/world/entity/Shearable.java b/src/main/java/net/minecraft/world/entity/Shearable.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/net/minecraft/world/entity/Shearable.java
+++ b/src/main/java/net/minecraft/world/entity/Shearable.java
@@ -0,0 +0,0 @@ public interface Shearable {
void shear(ServerLevel world, SoundSource shearedSoundCategory, ItemStack shears);
boolean readyForShearing();
+ net.minecraft.world.level.Level level(); // Shearable API - expose default level needed for shearing.
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBogged.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBogged.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBogged.java