diff --git a/README.md b/README.md index 771de02c..a9b41142 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Cardboard is an implementation of the popular Bukkit/Spigot/Paper Modding API fo Fabric version chart: | Supported| Minecraft | Git Branch | Download | |----------|----------------|------------|----------------------| -| ✅ | Fabric 1.20.1 | ver/1.20 | Work-in-Progress +| ✅ | Fabric 1.20.2 | ver/1.20 | Work-in-Progress | ✅ | Fabric 1.19.4 | ver/1.19.4 | [View Downloads](https://cardboardpowered.org/download/) | | ✅ | Fabric 1.19.2 | ver/1.19.2 | [View Downloads](https://cardboardpowered.org/download/) | | ✅ | Fabric 1.18.2 | ver/1.18.2 | [View Downloads](https://cardboardpowered.org/download/) | diff --git a/build.gradle b/build.gradle index 042ea727..00cd06e6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,4 @@ import org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency -import com.modrinth.minotaur.TaskModrinthUpload -import com.modrinth.minotaur.request.VersionType plugins { id 'fabric-loom' version '1.1-SNAPSHOT' @@ -101,7 +99,7 @@ dependencies { // NMS Remapping // srglib-0.1.2.jar extraLibs fileTree(dir: 'libs', include: "srglib-0.1.2.jar") - include(modImplementation("com.github.IsaiahPatton:SpecialSource:master-SNAPSHOT")) + include(modImplementation("net.md-5:SpecialSource:1.11.2")) compileOnly fileTree(dir: 'libs', include: "srglib-0.1.2.jar") @@ -198,4 +196,4 @@ modrinth { uploadFile = remapJar // With Loom, this MUST be set to `remapJar` instead of `jar`! gameVersions = ["1.19.4"] // Must be an array, even with only one version loaders = ["fabric"] // Must also be an array - no need to specify this if you're using Loom or ForgeGradle -} \ No newline at end of file +} diff --git a/gradle.properties b/gradle.properties index 9b0cef0e..e5f5ae6a 100644 --- a/gradle.properties +++ b/gradle.properties @@ -42,17 +42,17 @@ org.gradle.jvmargs=-Xmx1G #fabric_version=0.81.1+1.19.4 # 1.20 - minecraft_version=1.20 - yarn_mappings=1.20+build.1 - loader_version=0.14.21 - fabric_version=0.83.0+1.20 + minecraft_version=1.20.2 + yarn_mappings=1.20.2+build.1 + loader_version=0.14.22 + fabric_version=0.90.7+1.20.2 # Mod Properties - mod_version = 1.20 + mod_version = 1.20.2 maven_group = org.cardboardpowered archives_base_name = Cardboard # Paper API #paper_jar = paper-api-1.17-test.jar #paper_jar = paper-api-1.17.1-388.jar - paper_jar = paper-api-1.18.2-167.jar \ No newline at end of file + paper_jar = paper-api-1.18.2-167.jar diff --git a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java index bd234988..5ed2f84d 100644 --- a/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java +++ b/src/main/java/com/destroystokyo/paper/profile/CraftPlayerProfile.java @@ -8,9 +8,8 @@ import com.mojang.authlib.properties.Property; import com.mojang.authlib.properties.PropertyMap; import net.minecraft.server.MinecraftServer; -import net.minecraft.util.UserCache; import net.minecraft.util.Util; - +import org.apache.commons.lang.StringUtils; import org.apache.commons.lang3.Validate; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.profile.PlayerTextures; @@ -140,7 +139,7 @@ public CraftPlayerProfile clone() { @Override public boolean isComplete() { - return profile.isComplete(); + return this.getUniqueId() != null && this.getName() != null && !getTextures().isEmpty(); } @Override @@ -174,7 +173,7 @@ public boolean completeFromCache(boolean lookupUUID, boolean onlineMode) { if ((profile.getName() == null || !hasTextures()) && profile.getId() != null) { Optional o = userCache.card_getByUuid(this.profile.getId()); - if (!o.isEmpty()) { + if (o.isPresent()) { GameProfile profile = o.get(); if (profile != null) { // if old has it, assume its newer, so overwrite, else use cached if it was set and ours wasn't @@ -183,7 +182,8 @@ public boolean completeFromCache(boolean lookupUUID, boolean onlineMode) { } } } - return this.profile.isComplete(); + + return isProfileComplete(); } public boolean complete(boolean textures) { @@ -195,15 +195,19 @@ public boolean complete(boolean textures, boolean onlineMode) { boolean isCompleteFromCache = this.completeFromCache(true, onlineMode); if (onlineMode && (!isCompleteFromCache || textures && !hasTextures())) { - GameProfile result = server.getSessionService().fillProfileProperties(profile, true); + GameProfile result = null; // TODO if (result != null) copyProfileProperties(result, this.profile, true); - if (this.profile.isComplete()) { + if (isProfileComplete()) { CraftServer.server.getUserCache().add(this.profile); CraftServer.server.getUserCache().save(); } } - return profile.isComplete() && (!onlineMode || !textures || hasTextures()); + return isProfileComplete() && (!onlineMode || !textures || hasTextures()); + } + + private boolean isProfileComplete() { + return profile.getId() != null && StringUtils.isNotBlank(profile.getName()); } private static void copyProfileProperties(GameProfile source, GameProfile target) { @@ -217,13 +221,13 @@ private static void copyProfileProperties(GameProfile source, GameProfile target if (sourceProperties.isEmpty()) return; for (Property property : sourceProperties.values()) { - targetProperties.removeAll(property.getName()); - targetProperties.put(property.getName(), property); + targetProperties.removeAll(property.name()); + targetProperties.put(property.name(), property); } } private static ProfileProperty toBukkit(Property property) { - return new ProfileProperty(property.getName(), property.getValue(), property.getSignature()); + return new ProfileProperty(property.name(), property.value(), property.signature()); } public static PlayerProfile asBukkitCopy(GameProfile gameProfile) { @@ -350,4 +354,4 @@ public void setTextures(@Nullable PlayerTextures arg0) { } -} \ No newline at end of file +} diff --git a/src/main/java/com/javazilla/bukkitfabric/interfaces/IMixinRecipeManager.java b/src/main/java/com/javazilla/bukkitfabric/interfaces/IMixinRecipeManager.java index 3d1145bb..58803c51 100644 --- a/src/main/java/com/javazilla/bukkitfabric/interfaces/IMixinRecipeManager.java +++ b/src/main/java/com/javazilla/bukkitfabric/interfaces/IMixinRecipeManager.java @@ -18,18 +18,25 @@ */ package com.javazilla.bukkitfabric.interfaces; -import java.util.Map; - import net.minecraft.recipe.Recipe; +import net.minecraft.recipe.RecipeEntry; import net.minecraft.recipe.RecipeType; import net.minecraft.util.Identifier; +import org.bukkit.NamespacedKey; +import org.bukkit.craftbukkit.util.CraftNamespacedKey; -public interface IMixinRecipeManager { - - void addRecipe(Recipe irecipe); +import java.util.Map; - Map, Map>> getRecipes(); +public interface IMixinRecipeManager { + default void addRecipe(NamespacedKey key, Recipe recipe) { + addRecipe(new RecipeEntry<>( + CraftNamespacedKey.toMinecraft(key), + recipe + )); + } + void addRecipe(RecipeEntry recipeEntry); + Map, Map>> getRecipes(); void clearRecipes(); -} \ No newline at end of file +} diff --git a/src/main/java/com/javazilla/bukkitfabric/interfaces/IMixinResourcePackStatusC2SPacket.java b/src/main/java/com/javazilla/bukkitfabric/interfaces/IMixinResourcePackStatusC2SPacket.java index 8c6fa617..c32929ec 100644 --- a/src/main/java/com/javazilla/bukkitfabric/interfaces/IMixinResourcePackStatusC2SPacket.java +++ b/src/main/java/com/javazilla/bukkitfabric/interfaces/IMixinResourcePackStatusC2SPacket.java @@ -1,9 +1,9 @@ package com.javazilla.bukkitfabric.interfaces; -import net.minecraft.network.packet.c2s.play.ResourcePackStatusC2SPacket; +import net.minecraft.network.packet.c2s.common.ResourcePackStatusC2SPacket.Status; public interface IMixinResourcePackStatusC2SPacket { - public ResourcePackStatusC2SPacket.Status getStatus_Bukkit(); + public Status getStatus_Bukkit(); -} \ No newline at end of file +} diff --git a/src/main/java/com/javazilla/bukkitfabric/nms/ReflectionRemapper.java b/src/main/java/com/javazilla/bukkitfabric/nms/ReflectionRemapper.java index a5913ec7..7f476524 100644 --- a/src/main/java/com/javazilla/bukkitfabric/nms/ReflectionRemapper.java +++ b/src/main/java/com/javazilla/bukkitfabric/nms/ReflectionRemapper.java @@ -18,12 +18,10 @@ */ package com.javazilla.bukkitfabric.nms; -import java.lang.reflect.Field; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Map; -import java.util.regex.Pattern; - +import com.javazilla.bukkitfabric.BukkitFabricMod; +import net.minecraft.SharedConstants; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.ServerNetworkIo; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.plugin.PluginLoader; @@ -31,18 +29,18 @@ import org.bukkit.plugin.java.JavaPlugin; import org.bukkit.plugin.java.JavaPluginLoader; -import com.javazilla.bukkitfabric.BukkitFabricMod; - -import net.minecraft.SharedConstants; -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.ServerNetworkIo; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Map; +import java.util.regex.Pattern; /** * Very unsafe re-mapping of Reflection. */ public class ReflectionRemapper { - private static final String NMS_VERSION = "v1_20_R1";// "v1_19_R3"; + private static final String NMS_VERSION = "v1_20_R2"; public static JavaPlugin plugin; public static String mapClassName(String className) { @@ -345,4 +343,4 @@ public static Method getMethodByName(Class calling, String f, Class[] p) t return m; } -} \ No newline at end of file +} diff --git a/src/main/java/com/mohistmc/banner/bukkit/nms/utils/RemapUtils.java b/src/main/java/com/mohistmc/banner/bukkit/nms/utils/RemapUtils.java index 13c7b7b5..e5e4b715 100644 --- a/src/main/java/com/mohistmc/banner/bukkit/nms/utils/RemapUtils.java +++ b/src/main/java/com/mohistmc/banner/bukkit/nms/utils/RemapUtils.java @@ -1,19 +1,15 @@ package com.mohistmc.banner.bukkit.nms.utils; -import java.io.BufferedReader; -import java.io.InputStreamReader; -import java.lang.invoke.MethodType; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import com.mohistmc.banner.bukkit.nms.model.ClassMapping; -import com.mohistmc.banner.bukkit.nms.remappers.*; - +import com.mohistmc.banner.bukkit.nms.remappers.BannerInheritanceProvider; +import com.mohistmc.banner.bukkit.nms.remappers.BannerJarMapping; +import com.mohistmc.banner.bukkit.nms.remappers.BannerJarRemapper; +import com.mohistmc.banner.bukkit.nms.remappers.BannerSuperClassRemapper; +import com.mohistmc.banner.bukkit.nms.remappers.ClassRemapperSupplier; +import com.mohistmc.banner.bukkit.nms.remappers.ReflectMethodRemapper; +import com.mohistmc.banner.bukkit.nms.remappers.ReflectRemapper; import net.md_5.specialsource.InheritanceMap; import net.md_5.specialsource.provider.JointProvider; -import net.md_5.specialsource.transformer.MavenShade; import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.Type; @@ -21,6 +17,13 @@ import org.objectweb.asm.commons.Remapper; import org.objectweb.asm.tree.ClassNode; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.lang.invoke.MethodType; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + /** * * @author pyz @@ -36,7 +39,7 @@ public static void init() { System.out.println("REMAP UTIL DEBUG"); jarMapping = new BannerJarMapping(); // v1_20_R1 - jarMapping.packages.put("org/bukkit/craftbukkit/v1_20_R1/", "org/bukkit/craftbukkit/"); + jarMapping.packages.put("org/bukkit/craftbukkit/v1_20_R2/", "org/bukkit/craftbukkit/"); //jarMapping.packages.put("org/bukkit/craftbukkit/v1_19_R3/", "org/bukkit/craftbukkit/"); jarMapping.packages.put("org/bukkit/craftbukkit/libs/it/unimi/dsi/fastutil/", "it/unimi/dsi/fastutil/"); jarMapping.packages.put("org/bukkit/craftbukkit/libs/jline/", "jline/"); @@ -47,7 +50,7 @@ public static void init() { try { jarMapping.loadMappings( - new BufferedReader(new InputStreamReader(RemapUtils.class.getClassLoader().getResourceAsStream("mappings/spigot2srg-1.20.srg"))), + new BufferedReader(new InputStreamReader(RemapUtils.class.getClassLoader().getResourceAsStream("mappings/spigot2srg-1.20.2.srg"))), null, null, false); } catch (Exception e) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index ffde6a02..95d92c8e 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -18,56 +18,84 @@ */ package org.bukkit.craftbukkit; -import java.awt.image.BufferedImage; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FilenameFilter; -import java.io.IOException; -import java.io.InputStreamReader; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.util.ArrayList; -import java.util.Base64; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.Properties; -import java.util.Random; -import java.util.Set; -import java.util.UUID; -import java.util.function.Consumer; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.imageio.ImageIO; - +import com.destroystokyo.paper.entity.ai.MobGoals; +import com.destroystokyo.paper.profile.CraftPlayerProfile; +import com.google.common.base.Charsets; +import com.google.common.base.Function; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterators; +import com.google.common.collect.Lists; +import com.google.common.collect.MapMaker; +import com.google.common.collect.Sets; +import com.javazilla.bukkitfabric.BukkitLogger; +import com.javazilla.bukkitfabric.Utils; +import com.javazilla.bukkitfabric.impl.MetaDataStoreBase; +import com.javazilla.bukkitfabric.impl.MetadataStoreImpl; +import com.javazilla.bukkitfabric.impl.scheduler.BukkitSchedulerImpl; +import com.javazilla.bukkitfabric.interfaces.IMixinAdvancement; +import com.javazilla.bukkitfabric.interfaces.IMixinEntity; +import com.javazilla.bukkitfabric.interfaces.IMixinMapState; +import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; +import com.javazilla.bukkitfabric.interfaces.IMixinRecipe; +import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; +import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; +import com.javazilla.bukkitfabric.interfaces.IMixinWorld; +import com.javazilla.bukkitfabric.interfaces.IUserCache; +import com.mohistmc.banner.bukkit.nms.utils.RemapUtils; +import com.mojang.authlib.GameProfile; +import com.mojang.brigadier.StringReader; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import com.mojang.brigadier.tree.CommandNode; +import com.mojang.brigadier.tree.LiteralCommandNode; +import io.papermc.paper.datapack.DatapackManager; +import net.kyori.adventure.audience.Audience; +import net.kyori.adventure.text.Component; +import net.md_5.bungee.api.chat.BaseComponent; +import net.minecraft.SharedConstants; +import net.minecraft.advancement.AdvancementEntry; +import net.minecraft.block.Block; +import net.minecraft.command.CommandRegistryAccess; +import net.minecraft.command.argument.EntityArgumentType; +import net.minecraft.entity.EntityType; +import net.minecraft.entity.boss.CommandBossBar; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.fluid.Fluid; +import net.minecraft.inventory.CraftingInventory; +import net.minecraft.item.FilledMapItem; +import net.minecraft.item.Item; +import net.minecraft.item.Items; +import net.minecraft.item.map.MapState; +import net.minecraft.recipe.CraftingRecipe; +import net.minecraft.recipe.RecipeEntry; +import net.minecraft.recipe.RecipeType; +import net.minecraft.registry.DefaultedRegistry; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.resource.DataPackSettings; +import net.minecraft.resource.ResourcePackManager; +import net.minecraft.resource.featuretoggle.FeatureSet; +import net.minecraft.screen.ScreenHandler; +import net.minecraft.server.BannedIpEntry; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.command.CommandManager; +import net.minecraft.server.command.ServerCommandSource; +import net.minecraft.server.dedicated.MinecraftDedicatedServer; +import net.minecraft.server.dedicated.PendingServerCommand; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; +import net.minecraft.world.WorldSaveHandler; +import net.minecraft.world.event.GameEvent; import org.apache.commons.lang.Validate; -import org.bukkit.BanList; +import org.bukkit.*; import org.bukkit.BanList.Type; -import org.bukkit.Bukkit; -import org.bukkit.ChatColor; -import org.bukkit.GameMode; -import org.bukkit.Keyed; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.NamespacedKey; -import org.bukkit.OfflinePlayer; -import org.bukkit.Server; -import org.bukkit.StructureType; -import org.bukkit.Tag; -import org.bukkit.UnsafeValues; import org.bukkit.Warning.WarningState; -import org.bukkit.World; import org.bukkit.World.Environment; -import org.bukkit.WorldBorder; -import org.bukkit.WorldCreator; import org.bukkit.advancement.Advancement; import org.bukkit.block.data.BlockData; import org.bukkit.boss.BarColor; @@ -99,41 +127,22 @@ import org.bukkit.event.server.BroadcastMessageEvent; import org.bukkit.event.server.ServerLoadEvent; import org.bukkit.event.server.TabCompleteEvent; -import org.bukkit.event.world.WorldInitEvent; -import org.bukkit.event.world.WorldLoadEvent; import org.bukkit.event.world.WorldUnloadEvent; import org.bukkit.generator.ChunkGenerator; import org.bukkit.generator.ChunkGenerator.ChunkData; import org.bukkit.help.HelpMap; -import org.bukkit.inventory.BlastingRecipe; -import org.bukkit.inventory.CampfireRecipe; -import org.bukkit.inventory.ComplexRecipe; -import org.bukkit.inventory.FurnaceRecipe; -import org.bukkit.inventory.Inventory; -import org.bukkit.inventory.InventoryHolder; -import org.bukkit.inventory.InventoryView; -import org.bukkit.inventory.ItemFactory; -import org.bukkit.inventory.ItemStack; -import org.bukkit.inventory.Merchant; -import org.bukkit.inventory.Recipe; -import org.bukkit.inventory.ShapedRecipe; -import org.bukkit.inventory.ShapelessRecipe; -import org.bukkit.inventory.SmithingRecipe; -import org.bukkit.inventory.SmokingRecipe; -import org.bukkit.inventory.StonecuttingRecipe; +import org.bukkit.inventory.*; import org.bukkit.loot.LootTable; import org.bukkit.map.MapView; import org.bukkit.metadata.MetadataStoreBase; import org.bukkit.permissions.Permissible; import org.bukkit.permissions.Permission; -import org.bukkit.plugin.InvalidPluginException; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.PluginLoadOrder; import org.bukkit.plugin.PluginManager; import org.bukkit.plugin.ServicesManager; import org.bukkit.plugin.SimplePluginManager; import org.bukkit.plugin.SimpleServicesManager; -import org.bukkit.plugin.UnknownDependencyException; import org.bukkit.plugin.java.JavaPluginLoader; import org.bukkit.plugin.messaging.Messenger; import org.bukkit.plugin.messaging.StandardMessenger; @@ -147,10 +156,11 @@ import org.cardboardpowered.impl.IpBanList; import org.cardboardpowered.impl.ProfileBanList; import org.cardboardpowered.impl.command.BukkitCommandWrapper; -import org.cardboardpowered.impl.command.CommandMapImpl; import org.cardboardpowered.impl.command.CardboardConsoleCommandSender; +import org.cardboardpowered.impl.command.CommandMapImpl; import org.cardboardpowered.impl.command.MinecraftCommandWrapper; import org.cardboardpowered.impl.entity.PlayerImpl; +import org.cardboardpowered.impl.inventory.InventoryCreator; import org.cardboardpowered.impl.inventory.recipe.CardboardBlastingRecipe; import org.cardboardpowered.impl.inventory.recipe.CardboardCampfireRecipe; import org.cardboardpowered.impl.inventory.recipe.CardboardFurnaceRecipe; @@ -161,15 +171,12 @@ import org.cardboardpowered.impl.inventory.recipe.CardboardStonecuttingRecipe; import org.cardboardpowered.impl.inventory.recipe.RecipeInterface; import org.cardboardpowered.impl.inventory.recipe.RecipeIterator; -import org.cardboardpowered.impl.inventory.InventoryCreator; import org.cardboardpowered.impl.map.MapViewImpl; import org.cardboardpowered.impl.tag.BlockTagImpl; import org.cardboardpowered.impl.tag.CraftGameEventTag; import org.cardboardpowered.impl.tag.EntityTagImpl; import org.cardboardpowered.impl.tag.FluidTagImpl; import org.cardboardpowered.impl.tag.ItemTagImpl; -import org.cardboardpowered.impl.tag.TagImpl; -import org.cardboardpowered.impl.tag.Tags; import org.cardboardpowered.impl.util.CommandPermissions; import org.cardboardpowered.impl.util.IconCacheImpl; import org.cardboardpowered.impl.util.SimpleHelpMap; @@ -180,116 +187,35 @@ import org.jetbrains.annotations.Nullable; import org.spigotmc.SpigotConfig; -import com.destroystokyo.paper.entity.ai.MobGoals; -import com.destroystokyo.paper.profile.CraftPlayerProfile; -import com.google.common.base.Charsets; -import com.google.common.base.Function; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Iterators; -import com.google.common.collect.Lists; -import com.google.common.collect.MapMaker; -import com.google.common.collect.Sets; -import com.javazilla.bukkitfabric.BukkitLogger; -import com.javazilla.bukkitfabric.PaperMetrics; -import com.javazilla.bukkitfabric.Utils; -import com.javazilla.bukkitfabric.impl.MetaDataStoreBase; -import com.javazilla.bukkitfabric.impl.MetadataStoreImpl; -import com.javazilla.bukkitfabric.impl.scheduler.BukkitSchedulerImpl; -import com.javazilla.bukkitfabric.interfaces.IMixinAdvancement; -import com.javazilla.bukkitfabric.interfaces.IMixinEntity; -import com.javazilla.bukkitfabric.interfaces.IMixinMapState; -import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipe; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; -import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; -import com.javazilla.bukkitfabric.interfaces.IMixinWorld; -import com.javazilla.bukkitfabric.interfaces.IUserCache; -import com.mohistmc.banner.bukkit.nms.utils.RemapUtils; -import com.mojang.authlib.GameProfile; -import com.mojang.brigadier.StringReader; -import com.mojang.brigadier.exceptions.CommandSyntaxException; -import com.mojang.brigadier.tree.CommandNode; -import com.mojang.brigadier.tree.LiteralCommandNode; -import com.mojang.serialization.DynamicOps; -import com.mojang.serialization.Lifecycle; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufOutputStream; -import io.netty.buffer.Unpooled; -import io.papermc.paper.datapack.DatapackManager; -import net.kyori.adventure.audience.Audience; -import net.kyori.adventure.text.Component; -import net.md_5.bungee.api.chat.BaseComponent; -import net.minecraft.block.Block; -import net.minecraft.command.CommandRegistryAccess; -import net.minecraft.command.argument.EntityArgumentType; -import net.minecraft.entity.EntityType; -import net.minecraft.entity.boss.CommandBossBar; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.fluid.Fluid; -import net.minecraft.inventory.CraftingInventory; -import net.minecraft.item.FilledMapItem; -import net.minecraft.item.Item; -import net.minecraft.item.Items; -import net.minecraft.item.map.MapState; -import net.minecraft.nbt.NbtElement; -import net.minecraft.nbt.NbtOps; -import net.minecraft.recipe.CraftingRecipe; -import net.minecraft.recipe.RecipeType; -import net.minecraft.resource.DataPackSettings; -import net.minecraft.resource.ResourcePackManager; -import net.minecraft.resource.featuretoggle.FeatureSet; -import net.minecraft.screen.ScreenHandler; -import net.minecraft.server.BannedIpEntry; -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.command.CommandManager; -import net.minecraft.server.command.CommandManager.RegistrationEnvironment; -import net.minecraft.server.command.ServerCommandSource; -import net.minecraft.server.dedicated.MinecraftDedicatedServer; -import net.minecraft.server.dedicated.PendingServerCommand; -import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.registry.tag.BlockTags; -import net.minecraft.registry.tag.EntityTypeTags; -import net.minecraft.registry.tag.FluidTags; -import net.minecraft.registry.tag.ItemTags; -//import net.minecraft.tag.TagGroup; -import net.minecraft.registry.tag.TagKey; -import net.minecraft.util.Identifier; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; -import net.minecraft.registry.DefaultedRegistry; -import net.minecraft.registry.DynamicRegistryManager; -import net.minecraft.registry.Registries; -import net.minecraft.registry.Registry; -import net.minecraft.registry.entry.RegistryEntry; -import net.minecraft.registry.RegistryKey; -import net.minecraft.registry.RegistryKeys; -import net.minecraft.registry.SimpleRegistry; -import net.minecraft.village.ZombieSiegeManager; -import net.minecraft.world.Difficulty; -import net.minecraft.world.GameRules; -import net.minecraft.world.WanderingTraderManager; -import net.minecraft.world.WorldSaveHandler; -import net.minecraft.world.biome.source.BiomeAccess; -import net.minecraft.world.dimension.DimensionOptions; -import net.minecraft.world.dimension.DimensionType; -import net.minecraft.world.event.GameEvent; -//import net.minecraft.world.gen.CatSpawner; -import net.minecraft.world.gen.GeneratorOptions; -//import net.minecraft.world.gen.PhantomSpawner; -//import net.minecraft.world.gen.PillagerSpawner; -//import net.minecraft.world.gen.Spawner; -import net.minecraft.world.level.LevelInfo; -import net.minecraft.world.level.LevelProperties; -import net.minecraft.world.level.storage.LevelStorage; +import javax.imageio.ImageIO; +import java.awt.image.BufferedImage; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FilenameFilter; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.UUID; +import java.util.function.Consumer; +import java.util.logging.Level; +import java.util.logging.Logger; @SuppressWarnings("deprecation") public class CraftServer implements Server { public final String serverName = "Cardboard"; - public final String bukkitVersion = "1.20.1-R0.1-SNAPSHOT"; // "1.19.4-R0.1-SNAPSHOT"; // "1.19.2-R0.1-SNAPSHOT"; + public final String bukkitVersion = "1.20.2-R0.1-SNAPSHOT"; // "1.19.4-R0.1-SNAPSHOT"; // "1.19.2-R0.1-SNAPSHOT"; public final String serverVersion; public final String shortVersion; @@ -303,11 +229,10 @@ public class CraftServer implements Server { private final ConsoleCommandSender consoleCommandSender = new CardboardConsoleCommandSender(); private final Map offlinePlayers = new MapMaker().weakValues().makeMap(); public final List playerView; - private WarningState warningState = WarningState.DEFAULT; - public final Map worlds = new LinkedHashMap(); + public final Map worlds = new LinkedHashMap<>(); private final SimpleHelpMap helpMap = new SimpleHelpMap(this); private final StandardMessenger messenger = new StandardMessenger(); - private YamlConfiguration configuration; + private final YamlConfiguration configuration; private IconCacheImpl icon; public static MinecraftDedicatedServer server; @@ -528,7 +453,7 @@ public void sendPluginMessage(Plugin source, String channel, byte[] message) { @Override public String toString() { - return "CraftServer{" + "serverName=" + serverName + ",serverVersion=" + serverVersion + ",minecraftVersion=" + getServer().getVersion() + '}'; + return "CraftServer{" + "serverName=" + serverName + ",serverVersion=" + serverVersion + ",minecraftVersion=" + SharedConstants.getGameVersion().getName() + '}'; } @Override @@ -563,10 +488,10 @@ public boolean addRecipe(Recipe recipe) { @Override public Iterator advancementIterator() { - return Iterators.unmodifiableIterator(Iterators.transform(server.getAdvancementLoader().getAdvancements().iterator(), new Function() { + return Iterators.unmodifiableIterator(Iterators.transform(server.getAdvancementLoader().getAdvancements().iterator(), new Function() { @Override - public org.bukkit.advancement.Advancement apply(net.minecraft.advancement.Advancement advancement) { - return ((IMixinAdvancement)advancement).getBukkitAdvancement(); + public Advancement apply(AdvancementEntry advancement) { + return ((IMixinAdvancement)(Object) advancement).getBukkitAdvancement(); } })); } @@ -932,8 +857,9 @@ public boolean dispatchCommand(CommandSender sender, String commandLine) throws @Override public Advancement getAdvancement(NamespacedKey arg0) { - net.minecraft.advancement.Advancement advancement = server.getAdvancementLoader().get(CraftNamespacedKey.toMinecraft(arg0)); - return (advancement == null) ? null : ((IMixinAdvancement)advancement).getBukkitAdvancement(); + AdvancementEntry advancement = server.getAdvancementLoader().get(CraftNamespacedKey.toMinecraft(arg0)); + return (advancement == null) ? null : ((IMixinAdvancement)(Object) advancement) + .getBukkitAdvancement(); } @Override @@ -1212,7 +1138,7 @@ public int getPort() { public List getRecipesFor(ItemStack result) { Validate.notNull(result, "Result cannot be null"); - List results = new ArrayList(); + List results = new ArrayList<>(); Iterator iter = recipeIterator(); while (iter.hasNext()) { Recipe recipe = iter.next(); @@ -1410,7 +1336,7 @@ public int getViewDistance() { @Override public WarningState getWarningState() { - return warningState; + return WarningState.DEFAULT; } @Override @@ -1664,7 +1590,7 @@ public boolean removeRecipe(NamespacedKey recipeKey) { Preconditions.checkArgument(recipeKey != null, "recipeKey == null"); Identifier mcKey = CraftNamespacedKey.toMinecraft(recipeKey); - for (Map> recipes : ((IMixinRecipeManager)getServer().getRecipeManager()).getRecipes().values()) + for (Map> recipes : ((IMixinRecipeManager)getServer().getRecipeManager()).getRecipes().values()) if (recipes.remove(mcKey) != null) return true; @@ -1797,9 +1723,9 @@ public int getTicksPerWaterAmbientSpawns() { @Override public Recipe getRecipe(NamespacedKey recipeKey) { Preconditions.checkArgument(recipeKey != null, "recipeKey == null"); - Optional> opt = getServer().getRecipeManager().get(CraftNamespacedKey.toMinecraft(recipeKey)); + Optional> opt = getServer().getRecipeManager().get(CraftNamespacedKey.toMinecraft(recipeKey)); - return !opt.isPresent() ? null : ((IMixinRecipe)opt.get()).toBukkitRecipe(); + return !opt.isPresent() ? null : ((IMixinRecipe)(Object) opt.get()).toBukkitRecipe(); } public boolean dispatchServerCommand(CommandSender sender, PendingServerCommand serverCommand) { @@ -2038,13 +1964,13 @@ public net.minecraft.item.ItemStack quickMove(PlayerEntity player, int slot) { } }; CraftingInventory inventoryCrafting = new CraftingInventory(container, 3, 3); - Optional opt = this.getNMSRecipe(craftingMatrix, inventoryCrafting, (WorldImpl)world); + Optional> opt = this.getNMSRecipe(craftingMatrix, inventoryCrafting, (WorldImpl)world); if (opt.isEmpty()) { return null; } - - return ((IMixinRecipe)opt.get()).toBukkitRecipe(); + + return ((IMixinRecipe)(Object) opt.get()).toBukkitRecipe(); } - private Optional getNMSRecipe(ItemStack[] craftingMatrix, CraftingInventory inventoryCrafting, WorldImpl world) { + private Optional> getNMSRecipe(ItemStack[] craftingMatrix, CraftingInventory inventoryCrafting, WorldImpl world) { Preconditions.checkArgument(craftingMatrix != null, "craftingMatrix must not be null"); Preconditions.checkArgument(craftingMatrix.length == 9, "craftingMatrix must be an array of length 9"); Preconditions.checkArgument(world != null, "world must not be null"); @@ -2180,4 +2106,4 @@ public boolean isResourcePackRequired() { return false; } -} \ No newline at end of file +} diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index 49659515..def71776 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -1,11 +1,32 @@ package org.bukkit.craftbukkit.entity; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Optional; -import java.util.Set; - +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import com.javazilla.bukkitfabric.impl.BukkitEventFactory; +import com.javazilla.bukkitfabric.interfaces.IMixinEntity; +import com.javazilla.bukkitfabric.interfaces.IMixinScreenHandler; +import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; +import net.fabricmc.loader.api.FabricLoader; +import net.kyori.adventure.text.Component; +import net.minecraft.block.BedBlock; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.CraftingTableBlock; +import net.minecraft.block.EnchantingTableBlock; +import net.minecraft.block.entity.BlockEntity; +import net.minecraft.block.entity.LockableContainerBlockEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket; +import net.minecraft.network.packet.s2c.play.OpenScreenS2CPacket; +import net.minecraft.recipe.RecipeEntry; +import net.minecraft.recipe.RecipeManager; +import net.minecraft.screen.NamedScreenHandlerFactory; +import net.minecraft.screen.ScreenHandler; +import net.minecraft.screen.ScreenHandlerListener; +import net.minecraft.screen.ScreenHandlerType; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.util.Arm; +import net.minecraft.util.math.BlockPos; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; @@ -14,14 +35,6 @@ import org.bukkit.block.Block; import org.bukkit.block.Sign; import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.craftbukkit.entity.CraftEntity; -import org.cardboardpowered.impl.entity.LivingEntityImpl; -import org.cardboardpowered.impl.entity.PlayerImpl; -import org.cardboardpowered.impl.inventory.CardboardDoubleChestInventory; -import org.cardboardpowered.impl.inventory.CardboardInventoryView; -import org.cardboardpowered.impl.inventory.CardboardPlayerInventory; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; import org.bukkit.craftbukkit.inventory.CraftContainer; import org.bukkit.craftbukkit.inventory.CraftInventory; import org.bukkit.craftbukkit.inventory.CraftItemStack; @@ -46,36 +59,18 @@ import org.bukkit.permissions.PermissionAttachment; import org.bukkit.permissions.PermissionAttachmentInfo; import org.bukkit.plugin.Plugin; +import org.cardboardpowered.impl.entity.LivingEntityImpl; +import org.cardboardpowered.impl.inventory.CardboardDoubleChestInventory; +import org.cardboardpowered.impl.inventory.CardboardInventoryView; +import org.cardboardpowered.impl.inventory.CardboardPlayerInventory; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableSet; -import com.javazilla.bukkitfabric.impl.BukkitEventFactory; -import com.javazilla.bukkitfabric.interfaces.IMixinEntity; -import com.javazilla.bukkitfabric.interfaces.IMixinScreenHandler; -import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; - -import net.fabricmc.loader.api.FabricLoader; -import net.kyori.adventure.text.Component; -import net.minecraft.block.BedBlock; -import net.minecraft.block.BlockState; -import net.minecraft.block.Blocks; -import net.minecraft.block.CraftingTableBlock; -import net.minecraft.block.EnchantingTableBlock; -import net.minecraft.block.entity.BlockEntity; -import net.minecraft.block.entity.LockableContainerBlockEntity; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.network.packet.c2s.play.CloseHandledScreenC2SPacket; -import net.minecraft.network.packet.s2c.play.OpenScreenS2CPacket; -import net.minecraft.recipe.Recipe; -import net.minecraft.recipe.RecipeManager; -import net.minecraft.screen.NamedScreenHandlerFactory; -import net.minecraft.screen.ScreenHandler; -import net.minecraft.screen.ScreenHandlerListener; -import net.minecraft.screen.ScreenHandlerType; -import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.util.Arm; -import net.minecraft.util.math.BlockPos; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Optional; +import java.util.Set; public class CraftHumanEntity extends LivingEntityImpl implements HumanEntity { @@ -115,15 +110,13 @@ public int discoverRecipes(Collection recipes) { return getHandle().unlockRecipes(bukkitKeysToMinecraftRecipes(recipes)); } - private Collection> bukkitKeysToMinecraftRecipes(Collection recipeKeys) { - Collection> recipes = new ArrayList<>(); + private Collection> bukkitKeysToMinecraftRecipes(Collection recipeKeys) { + Collection> recipes = new ArrayList<>(); RecipeManager manager = getHandle().getWorld().getServer().getRecipeManager(); for (NamespacedKey recipeKey : recipeKeys) { - Optional> recipe = manager.get(CraftNamespacedKey.toMinecraft(recipeKey)); - if (!recipe.isPresent()) - continue; - recipes.add(recipe.get()); + Optional> recipe = manager.get(CraftNamespacedKey.toMinecraft(recipeKey)); + recipe.ifPresent(recipes::add); } return recipes; @@ -711,4 +704,4 @@ public void setUnsaturatedRegenRate(int arg0) { return CraftItemStack.asBukkitCopy(nms.getActiveItem()); } -} \ No newline at end of file +} diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java index a260c6df..ebdaf85c 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftContainer.java @@ -1,43 +1,19 @@ package org.bukkit.craftbukkit.inventory; +import com.javazilla.bukkitfabric.interfaces.IMixinEntity; +import com.javazilla.bukkitfabric.interfaces.IMixinScreenHandler; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; import net.minecraft.network.packet.s2c.play.OpenScreenS2CPacket; -import net.minecraft.screen.AnvilScreenHandler; -import net.minecraft.screen.ArrayPropertyDelegate; -import net.minecraft.screen.BeaconScreenHandler; -import net.minecraft.screen.BlastFurnaceScreenHandler; -import net.minecraft.screen.BrewingStandScreenHandler; -import net.minecraft.screen.CartographyTableScreenHandler; -import net.minecraft.screen.CraftingScreenHandler; -import net.minecraft.screen.EnchantmentScreenHandler; -import net.minecraft.screen.FurnaceScreenHandler; -import net.minecraft.screen.Generic3x3ContainerScreenHandler; -import net.minecraft.screen.GenericContainerScreenHandler; -import net.minecraft.screen.GrindstoneScreenHandler; -import net.minecraft.screen.HopperScreenHandler; -import net.minecraft.screen.LecternScreenHandler; -import net.minecraft.screen.LoomScreenHandler; -import net.minecraft.screen.MerchantScreenHandler; -import net.minecraft.screen.NamedScreenHandlerFactory; -import net.minecraft.screen.ScreenHandler; -import net.minecraft.screen.ScreenHandlerType; -import net.minecraft.screen.ShulkerBoxScreenHandler; -import net.minecraft.screen.SmithingScreenHandler; -import net.minecraft.screen.SmokerScreenHandler; -import net.minecraft.screen.StonecutterScreenHandler; +import net.minecraft.screen.*; import net.minecraft.screen.slot.Slot; import net.minecraft.text.Text; - -import org.cardboardpowered.impl.entity.PlayerImpl; import org.bukkit.entity.HumanEntity; import org.bukkit.event.inventory.InventoryType; import org.bukkit.inventory.Inventory; import org.bukkit.inventory.InventoryView; - -import com.javazilla.bukkitfabric.interfaces.IMixinEntity; -import com.javazilla.bukkitfabric.interfaces.IMixinScreenHandler; +import org.cardboardpowered.impl.entity.PlayerImpl; public class CraftContainer extends ScreenHandler { @@ -283,4 +259,4 @@ public ScreenHandlerType getType() { return getNotchInventoryType(view.getTopInventory()); } -} \ No newline at end of file +} diff --git a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java index 4714c827..11ecd46f 100644 --- a/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/inventory/CraftMetaSkull.java @@ -3,9 +3,6 @@ import com.destroystokyo.paper.profile.PlayerProfile; import com.google.common.collect.ImmutableMap.Builder; import com.mojang.authlib.GameProfile; -import java.util.Map; -import java.util.UUID; - import net.minecraft.block.entity.SkullBlockEntity; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtElement; @@ -14,11 +11,14 @@ import org.bukkit.Material; import org.bukkit.OfflinePlayer; import org.bukkit.configuration.serialization.DelegateDeserialization; -import org.cardboardpowered.impl.entity.PlayerImpl; -import org.jetbrains.annotations.Nullable; import org.bukkit.craftbukkit.inventory.CraftMetaItem.SerializableMeta; import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.inventory.meta.SkullMeta; +import org.cardboardpowered.impl.entity.PlayerImpl; +import org.jetbrains.annotations.Nullable; + +import java.util.Map; +import java.util.UUID; @DelegateDeserialization(SerializableMeta.class) class CraftMetaSkull extends CraftMetaItem implements SkullMeta { @@ -88,12 +88,13 @@ private void setProfile(GameProfile profile) { void applyToItem(NbtCompound tag) { super.applyToItem(tag); - if (profile != null) { - tag.put(SKULL_OWNER.NBT, serializedProfile); - - SkullBlockEntity.loadProperties(profile, (filledProfile) -> { - setProfile(filledProfile); - tag.put(SKULL_OWNER.NBT, serializedProfile); + if (this.profile != null) { + tag.put(SKULL_OWNER.NBT, this.serializedProfile); + SkullBlockEntity.fetchProfileWithTextures(this.profile).thenAccept((optional) -> { + optional.ifPresent((filledProfile) -> { + this.setProfile(filledProfile); + tag.put(SKULL_OWNER.NBT, this.serializedProfile); + }); }); } } @@ -233,4 +234,4 @@ public void setOwnerProfile(org.bukkit.profile.@Nullable PlayerProfile arg0) { } -} \ No newline at end of file +} diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CardboardObjective.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CardboardObjective.java index 2eb79317..d14f8e72 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CardboardObjective.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CardboardObjective.java @@ -2,6 +2,7 @@ import net.kyori.adventure.text.Component; import net.minecraft.scoreboard.Scoreboard; +import net.minecraft.scoreboard.ScoreboardDisplaySlot; import net.minecraft.scoreboard.ScoreboardObjective; import org.apache.commons.lang.Validate; import org.bukkit.OfflinePlayer; @@ -14,6 +15,8 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.Objects; + public class CardboardObjective extends CardboardScoreboardComponent implements Objective { private final ScoreboardObjective objective; @@ -67,11 +70,15 @@ public void setDisplaySlot(DisplaySlot slot) throws IllegalStateException { Scoreboard board = scoreboard.board; ScoreboardObjective objective = this.objective; - for (int i = 0; i < CardboardScoreboardTranslations.MAX_DISPLAY_SLOT; i++) - if (board.getObjectiveForSlot(i) == objective) board.setObjectiveSlot(i, null); + for(ScoreboardDisplaySlot nmsSlot : ScoreboardDisplaySlot.values()) { + if(board.getObjectiveForSlot(nmsSlot) == objective) + board.setObjectiveSlot(nmsSlot, null); + } - if (slot != null) - board.setObjectiveSlot(CardboardScoreboardTranslations.fromBukkitSlot(slot), getHandle()); + if (slot != null) { + ScoreboardDisplaySlot nmsSlot = CardboardScoreboardTranslations.fromBukkitSlot(slot); + board.setObjectiveSlot(nmsSlot, objective); + } } @Override @@ -79,9 +86,13 @@ public DisplaySlot getDisplaySlot() throws IllegalStateException { CardboardScoreboard scoreboard = checkState(); Scoreboard board = scoreboard.board; ScoreboardObjective objective = this.objective; - for (int i = 0; i < CardboardScoreboardTranslations.MAX_DISPLAY_SLOT; i++) - if (board.getObjectiveForSlot(i) == objective) - return CardboardScoreboardTranslations.toBukkitSlot(i); + + for(ScoreboardDisplaySlot slot : ScoreboardDisplaySlot.values()) { + if(board.getObjectiveForSlot(slot) == objective) { + return CardboardScoreboardTranslations.toBukkitSlot(slot); + } + } + return null; } @@ -138,7 +149,7 @@ public boolean equals(Object obj) { if (obj == null || getClass() != obj.getClass()) return false; final CardboardObjective other = (CardboardObjective) obj; - return !(this.objective != other.objective && (this.objective == null || !this.objective.equals(other.objective))); + return Objects.equals(this.objective, other.objective); } // 1.18.2 api: @@ -161,4 +172,4 @@ public void displayName(@Nullable Component arg0) throws IllegalStateException, return null; } -} \ No newline at end of file +} diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CardboardScoreboardManager.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CardboardScoreboardManager.java index 4bdb1296..579b19c6 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CardboardScoreboardManager.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CardboardScoreboardManager.java @@ -1,28 +1,27 @@ package org.bukkit.craftbukkit.scoreboard; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Map; -import java.util.function.Consumer; +import com.javazilla.bukkitfabric.interfaces.IMixinPlayerManager; import net.minecraft.network.packet.s2c.play.ScoreboardObjectiveUpdateS2CPacket; -import net.minecraft.network.packet.s2c.play.TeamS2CPacket; import net.minecraft.scoreboard.Scoreboard; import net.minecraft.scoreboard.ScoreboardCriterion; +import net.minecraft.scoreboard.ScoreboardDisplaySlot; import net.minecraft.scoreboard.ScoreboardObjective; import net.minecraft.scoreboard.ScoreboardPlayerScore; import net.minecraft.scoreboard.ServerScoreboard; -import net.minecraft.scoreboard.Team; import net.minecraft.server.MinecraftServer; import net.minecraft.server.network.ServerPlayerEntity; import org.apache.commons.lang.Validate; -import org.cardboardpowered.impl.entity.PlayerImpl; -import org.cardboardpowered.impl.util.WeakCollection; import org.bukkit.entity.Player; import org.bukkit.scoreboard.ScoreboardManager; +import org.cardboardpowered.impl.entity.PlayerImpl; +import org.cardboardpowered.impl.util.WeakCollection; -import com.javazilla.bukkitfabric.interfaces.IMixinPlayerManager; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Map; +import java.util.function.Consumer; public final class CardboardScoreboardManager implements ScoreboardManager { @@ -73,7 +72,7 @@ public void setPlayerBoard(PlayerImpl player, org.bukkit.scoreboard.Scoreboard b // Old objective tracking HashSet removed = new HashSet(); for (int i = 0; i < 3; ++i) { - ScoreboardObjective scoreboardobjective = oldboard.getObjectiveForSlot(i); + ScoreboardObjective scoreboardobjective = oldboard.getObjectiveForSlot(ScoreboardDisplaySlot.values()[i]); if (scoreboardobjective != null && !removed.contains(scoreboardobjective)) { entityplayer.networkHandler.sendPacket(new ScoreboardObjectiveUpdateS2CPacket(scoreboardobjective, 1)); removed.add(scoreboardobjective); @@ -102,4 +101,4 @@ public void getScoreboardScores(ScoreboardCriterion criteria, String name, Consu } } -} \ No newline at end of file +} diff --git a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java index b0c58e2b..6801c1a6 100644 --- a/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java +++ b/src/main/java/org/bukkit/craftbukkit/scoreboard/CraftScoreboardTranslations.java @@ -1,26 +1,19 @@ package org.bukkit.craftbukkit.scoreboard; -import com.google.common.collect.ImmutableBiMap; -import net.minecraft.scoreboard.Scoreboard; import net.minecraft.scoreboard.ScoreboardCriterion; +import net.minecraft.scoreboard.ScoreboardDisplaySlot; import org.bukkit.scoreboard.DisplaySlot; import org.bukkit.scoreboard.RenderType; final class CardboardScoreboardTranslations { - static final int MAX_DISPLAY_SLOT = 3; - static ImmutableBiMap SLOTS = ImmutableBiMap.of( - DisplaySlot.BELOW_NAME, "belowName", - DisplaySlot.PLAYER_LIST, "list", - DisplaySlot.SIDEBAR, "sidebar"); - private CardboardScoreboardTranslations() {} - static DisplaySlot toBukkitSlot(int i) { - return SLOTS.inverse().get(Scoreboard.getDisplaySlotName(i)); + static DisplaySlot toBukkitSlot(ScoreboardDisplaySlot slot) { + return DisplaySlot.values()[slot.ordinal()]; } - static int fromBukkitSlot(DisplaySlot slot) { - return Scoreboard.getDisplaySlotId(SLOTS.get(slot)); + static ScoreboardDisplaySlot fromBukkitSlot(DisplaySlot slot) { + return ScoreboardDisplaySlot.values()[slot.ordinal()]; } static RenderType toBukkitRender(ScoreboardCriterion.RenderType display) { diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java index ad97c6b4..17637397 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftMagicNumbers.java @@ -1,13 +1,30 @@ package org.bukkit.craftbukkit.util; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.logging.Level; - +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Multimap; +import com.javazilla.bukkitfabric.BukkitFabricMod; +import com.javazilla.bukkitfabric.BukkitLogger; +import com.javazilla.bukkitfabric.interfaces.IMixinMaterial; +import com.mojang.brigadier.exceptions.CommandSyntaxException; +import com.mojang.serialization.Dynamic; +import io.izzel.arclight.api.EnumHelper; +import io.izzel.arclight.api.Unsafe; +import io.papermc.paper.inventory.ItemRarity; +import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; +import net.minecraft.SharedConstants; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.datafixer.Schemas; +import net.minecraft.datafixer.TypeReferences; +import net.minecraft.item.Item; +import net.minecraft.nbt.NbtCompound; +import net.minecraft.nbt.NbtElement; +import net.minecraft.nbt.NbtOps; +import net.minecraft.nbt.NbtString; +import net.minecraft.nbt.StringNbtReader; +import net.minecraft.registry.Registries; +import net.minecraft.util.Identifier; import org.bukkit.Bukkit; import org.bukkit.Fluid; import org.bukkit.Keyed; @@ -21,6 +38,7 @@ import org.bukkit.attribute.AttributeModifier; import org.bukkit.block.data.BlockData; import org.bukkit.craftbukkit.block.data.CraftBlockData; +import org.bukkit.craftbukkit.block.data.IMagicNumbers; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; @@ -30,41 +48,20 @@ import org.bukkit.material.MaterialData; import org.bukkit.plugin.InvalidPluginException; import org.bukkit.plugin.PluginDescriptionFile; +import org.cardboardpowered.BlockImplUtil; import org.cardboardpowered.adventure.CardboardAdventure; import org.cardboardpowered.impl.CardboardModdedBlock; import org.cardboardpowered.impl.CardboardModdedItem; import org.cardboardpowered.util.GameVersion; import org.jetbrains.annotations.NotNull; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableList; -import com.google.common.collect.Multimap; -import com.javazilla.bukkitfabric.BukkitFabricMod; -import com.javazilla.bukkitfabric.BukkitLogger; -import com.javazilla.bukkitfabric.interfaces.IMixinMaterial; -import com.mojang.brigadier.exceptions.CommandSyntaxException; -import com.mojang.serialization.Dynamic; - -import io.izzel.arclight.api.EnumHelper; -import io.izzel.arclight.api.Unsafe; -import io.papermc.paper.inventory.ItemRarity; -import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer; -import net.minecraft.SharedConstants; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.datafixer.Schemas; -import net.minecraft.datafixer.TypeReferences; -import net.minecraft.item.Item; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.nbt.NbtElement; -import net.minecraft.nbt.NbtOps; -import net.minecraft.nbt.NbtString; -import net.minecraft.nbt.StringNbtReader; -import net.minecraft.util.Identifier; -import net.minecraft.registry.Registries; - -import org.bukkit.craftbukkit.block.data.IMagicNumbers; -import org.cardboardpowered.BlockImplUtil; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.logging.Level; @SuppressWarnings("deprecation") public final class CraftMagicNumbers implements UnsafeValues, IMagicNumbers { @@ -308,17 +305,7 @@ public static Material getMaterial(Block block) { } public static Material getMaterial(Item item) { - for (Item item1 : Registries.ITEM) { - Identifier id = Registries.ITEM.getId(item1); - if (!id.getNamespace().toLowerCase().contains("minecraft")) - ITEM_MATERIAL.put(item1, Material.getMaterial(id.getNamespace().toUpperCase(Locale.ROOT) + "_" + id.getPath().toUpperCase(Locale.ROOT))); - } - - Identifier id = Registries.ITEM.getId(item); - Material m = ITEM_MATERIAL.getOrDefault(item, Material.getMaterial(id.getNamespace().toUpperCase(Locale.ROOT) + "_" + id.getPath().toUpperCase(Locale.ROOT))); - ITEM_MATERIAL.put(item, m); - MATERIAL_ITEM.put(m,item); - return m; + return ITEM_MATERIAL.getOrDefault(item, Material.AIR); } public static Item getItem(Material material) { @@ -412,7 +399,7 @@ public Material getMaterial(String material, int version) { @Deprecated public String getMappingsVersion() { - return "20b026e774dbf715e40a0b2afe114792"; + return "3478a65bfd04b15b431fe107b3617dfc"; } @Override @@ -446,7 +433,7 @@ public boolean removeAdvancement(NamespacedKey key) { return false; } - private static final List SUPPORTED_API = Arrays.asList("1.13", "1.14", "1.15", "1.16", "1.17", "1.18", "1.19"); + private static final List SUPPORTED_API = Arrays.asList("1.13", "1.14", "1.15", "1.16", "1.17", "1.18", "1.19", "1.20"); @Override public void checkSupported(PluginDescriptionFile pdf) throws InvalidPluginException { @@ -678,4 +665,4 @@ public PlainTextComponentSerializer plainTextSerializer() { return null; } -} \ No newline at end of file +} diff --git a/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java b/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java index 38872055..450e74de 100644 --- a/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java +++ b/src/main/java/org/bukkit/craftbukkit/util/CraftNamespacedKey.java @@ -1,7 +1,7 @@ package org.bukkit.craftbukkit.util; -import org.bukkit.NamespacedKey; import net.minecraft.util.Identifier; +import org.bukkit.NamespacedKey; public final class CraftNamespacedKey { @@ -18,7 +18,6 @@ public static NamespacedKey fromString(String string) { return fromMinecraft(new Identifier(string)); } - @SuppressWarnings("deprecation") public static NamespacedKey fromMinecraft(Identifier minecraft) { return new NamespacedKey(minecraft.getNamespace(), minecraft.getPath()); } @@ -27,4 +26,4 @@ public static Identifier toMinecraft(NamespacedKey key) { return new Identifier(key.getNamespace(), key.getKey()); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/CardboardConfig.java b/src/main/java/org/cardboardpowered/CardboardConfig.java index 4345ff8d..75ed5ba3 100644 --- a/src/main/java/org/cardboardpowered/CardboardConfig.java +++ b/src/main/java/org/cardboardpowered/CardboardConfig.java @@ -1,22 +1,27 @@ package org.cardboardpowered; +import me.isaiah.config.FileConfiguration; +import net.fabricmc.loader.api.FabricLoader; + import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.util.ArrayList; -import net.fabricmc.loader.api.FabricLoader; - -import me.isaiah.config.FileConfiguration; - public class CardboardConfig { - private static String DEFAULT = + private static final String DEFAULT = "# This is the configuration file for Cardboard\n\n" + "# Invoke ChatEvent from PlayerManager instead of NetworkHandler\n" + "# This can solve issues with other mods that overwrite the chat method,\n" + "use_alternative_chat_mixin: false\n" + "\n"+ + "# Registry Command Fix\n" + + "# Commands like \"/give\" or \"/setblock\" don't work when\n" + + "# executed by entities unless \"minecraft:\" prefix is specified.\n" + + "# Enabling will break chat signatures.\n" + + "registry-command-fix: true\n" + + "\n"+ "# Reflection Remapper Skip\n" + "# Our current Reflection remapper might cause issues with some plugins\n" + "# You can add plugin names here (that dont use Reflection) to our SKIP array\n" + @@ -27,8 +32,8 @@ public class CardboardConfig { public static ArrayList disabledMixins = new ArrayList<>(); public static boolean ALT_CHAT = false; + public static boolean REGISTRY_COMMAND_FIX = true; - @SuppressWarnings("unchecked") public static void setup() throws Exception { File fabDir = FabricLoader.getInstance().getConfigDir().toFile(); File oldDir = new File(fabDir, "bukkit4fabric"); @@ -49,6 +54,7 @@ public static void setup() throws Exception { FileConfiguration config = new FileConfiguration(f); ALT_CHAT = config.getBoolean("use_alternative_chat_mixin"); + REGISTRY_COMMAND_FIX = config.getBoolean("registry-command-fix"); ArrayList disables = (ArrayList)config.getObject("mixin-force-disable"); disabledMixins.addAll(disables); @@ -77,10 +83,11 @@ private static void migrate_config(File oldConfig, File newConfig) throws IOExce } } - String con = ""; - for (String line : Files.readAllLines(newConfig.toPath())){con += line + "\n";} - con = con.replace("use_alternative_chat_mixin: false", "use_alternative_chat_mixin: " + ALT_CHAT); - Files.write(newConfig.toPath(), con.getBytes()); + StringBuilder con = new StringBuilder(); + for (String line : Files.readAllLines(newConfig.toPath())){con.append(line).append("\n");} + con = new StringBuilder(con.toString() + .replace("use_alternative_chat_mixin: false", "use_alternative_chat_mixin: " + ALT_CHAT)); + Files.write(newConfig.toPath(), con.toString().getBytes()); oldConfig.delete(); } diff --git a/src/main/java/org/cardboardpowered/impl/AdvancementImpl.java b/src/main/java/org/cardboardpowered/impl/AdvancementImpl.java index 0d557098..9e755911 100644 --- a/src/main/java/org/cardboardpowered/impl/AdvancementImpl.java +++ b/src/main/java/org/cardboardpowered/impl/AdvancementImpl.java @@ -1,42 +1,42 @@ package org.cardboardpowered.impl; -import java.util.Collection; -import java.util.Collections; -import net.minecraft.advancement.Advancement; +import io.papermc.paper.advancement.AdvancementDisplay; +import net.minecraft.advancement.AdvancementEntry; import org.bukkit.NamespacedKey; import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Unmodifiable; -import io.papermc.paper.advancement.AdvancementDisplay; +import java.util.Collection; +import java.util.Collections; public class AdvancementImpl implements org.bukkit.advancement.Advancement { - private final Advancement handle; + private final AdvancementEntry handle; - public AdvancementImpl(Advancement handle) { + public AdvancementImpl(AdvancementEntry handle) { this.handle = handle; } - public Advancement getHandle() { + public AdvancementEntry getHandle() { return handle; } @Override public NamespacedKey getKey() { - return CraftNamespacedKey.fromMinecraft(handle.getId()); + return CraftNamespacedKey.fromMinecraft(handle.id()); } @Override public Collection getCriteria() { - return Collections.unmodifiableCollection(handle.getCriteria().keySet()); + return Collections.unmodifiableCollection(handle.value().criteria().keySet()); } @Override public @NotNull @Unmodifiable Collection getChildren() { // TODO Auto-generated method stub - return null; + return Collections.emptyList(); } @Override @@ -57,4 +57,4 @@ public Collection getCriteria() { return null; } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/AdvancementProgressImpl.java b/src/main/java/org/cardboardpowered/impl/AdvancementProgressImpl.java index 90dba94b..daf35259 100644 --- a/src/main/java/org/cardboardpowered/impl/AdvancementProgressImpl.java +++ b/src/main/java/org/cardboardpowered/impl/AdvancementProgressImpl.java @@ -1,14 +1,15 @@ package org.cardboardpowered.impl; import com.google.common.collect.Lists; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; import net.minecraft.advancement.PlayerAdvancementTracker; import net.minecraft.advancement.criterion.CriterionProgress; import org.bukkit.advancement.Advancement; import org.bukkit.advancement.AdvancementProgress; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; + public class AdvancementProgressImpl implements AdvancementProgress { private final AdvancementImpl advancement; @@ -44,7 +45,7 @@ public boolean revokeCriteria(String criteria) { @Override public Date getDateAwarded(String criteria) { CriterionProgress criterion = handle.getCriterionProgress(criteria); - return (criterion == null) ? null : criterion.getObtainedDate(); + return (criterion == null) ? null : Date.from(criterion.getObtainedDate()); } @Override @@ -57,4 +58,4 @@ public Collection getAwardedCriteria() { return Collections.unmodifiableCollection(Lists.newArrayList(handle.getObtainedCriteria())); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/CardboardAttributeInstance.java b/src/main/java/org/cardboardpowered/impl/CardboardAttributeInstance.java index cd10bf07..59657e7f 100644 --- a/src/main/java/org/cardboardpowered/impl/CardboardAttributeInstance.java +++ b/src/main/java/org/cardboardpowered/impl/CardboardAttributeInstance.java @@ -1,15 +1,14 @@ package org.cardboardpowered.impl; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; - +import net.minecraft.entity.attribute.EntityAttributeInstance; +import net.minecraft.entity.attribute.EntityAttributeModifier; import org.bukkit.attribute.Attribute; import org.bukkit.attribute.AttributeInstance; import org.bukkit.attribute.AttributeModifier; -import net.minecraft.entity.attribute.EntityAttributeInstance; -import net.minecraft.entity.attribute.EntityAttributeModifier; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; public class CardboardAttributeInstance implements AttributeInstance { @@ -50,7 +49,7 @@ public void addModifier(AttributeModifier modifier) { @Override public void removeModifier(AttributeModifier modifier) { - handle.removeModifier(convert(modifier)); + handle.removeModifier(modifier.getUniqueId()); } @Override @@ -71,4 +70,4 @@ public static AttributeModifier convert(EntityAttributeModifier nms) { return new AttributeModifier(nms.getId(), nms.getName(), nms.getValue(), AttributeModifier.Operation.values()[nms.getOperation().ordinal()]); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/CardboardPotionEffectType.java b/src/main/java/org/cardboardpowered/impl/CardboardPotionEffectType.java index 12572daf..51539655 100644 --- a/src/main/java/org/cardboardpowered/impl/CardboardPotionEffectType.java +++ b/src/main/java/org/cardboardpowered/impl/CardboardPotionEffectType.java @@ -2,23 +2,21 @@ import net.minecraft.entity.effect.StatusEffect; import net.minecraft.registry.Registries; - -import java.util.Map; - import org.bukkit.Color; -import org.bukkit.NamespacedKey; import org.bukkit.attribute.Attribute; import org.bukkit.attribute.AttributeModifier; import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.NotNull; +import java.util.Map; + public class CardboardPotionEffectType extends PotionEffectType { private final StatusEffect handle; public CardboardPotionEffectType(StatusEffect handle) { - super(StatusEffect.getRawId(handle), CraftNamespacedKey.fromMinecraft(Registries.STATUS_EFFECT.getId(handle))); + super(Registries.STATUS_EFFECT.getRawId(handle), CraftNamespacedKey.fromMinecraft(Registries.STATUS_EFFECT.getId(handle))); this.handle = handle; } @@ -138,4 +136,4 @@ public double getAttributeModifierAmount(@NotNull Attribute arg0, int arg1) { return null; } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/CardboardPotionUtil.java b/src/main/java/org/cardboardpowered/impl/CardboardPotionUtil.java index afd0cae6..473d9842 100644 --- a/src/main/java/org/cardboardpowered/impl/CardboardPotionUtil.java +++ b/src/main/java/org/cardboardpowered/impl/CardboardPotionUtil.java @@ -5,6 +5,7 @@ import com.google.common.collect.ImmutableBiMap; import net.minecraft.entity.effect.StatusEffect; import net.minecraft.entity.effect.StatusEffectInstance; +import net.minecraft.registry.Registries; import org.bukkit.potion.PotionData; import org.bukkit.potion.PotionEffect; import org.bukkit.potion.PotionEffectType; @@ -88,16 +89,16 @@ public static PotionData toBukkit(String type) { } public static StatusEffectInstance fromBukkit(PotionEffect effect) { - return new StatusEffectInstance(StatusEffect.byRawId(effect.getType().getId()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles()); + return new StatusEffectInstance(Registries.STATUS_EFFECT.get(effect.getType().getId()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles()); } public static PotionEffect toBukkit(StatusEffectInstance effect) { - PotionEffectType type = PotionEffectType.getById(StatusEffect.getRawId(effect.getEffectType())); + PotionEffectType type = PotionEffectType.getById(Registries.STATUS_EFFECT.getRawId(effect.getEffectType())); return new PotionEffect(type, effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.shouldShowParticles()); } public static boolean equals(StatusEffect mobEffect, PotionEffectType type) { - return PotionEffectType.getById(StatusEffect.getRawId(mobEffect)).equals(type); + return PotionEffectType.getById(Registries.STATUS_EFFECT.getRawId(mobEffect)).equals(type); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/block/CardboardBeacon.java b/src/main/java/org/cardboardpowered/impl/block/CardboardBeacon.java index 837751d5..31b9346d 100644 --- a/src/main/java/org/cardboardpowered/impl/block/CardboardBeacon.java +++ b/src/main/java/org/cardboardpowered/impl/block/CardboardBeacon.java @@ -1,12 +1,9 @@ package org.cardboardpowered.impl.block; -import java.util.ArrayList; -import java.util.Collection; - import net.kyori.adventure.text.Component; import net.minecraft.block.entity.BeaconBlockEntity; -import net.minecraft.entity.effect.StatusEffect; import net.minecraft.inventory.ContainerLock; +import net.minecraft.registry.Registries; import org.bukkit.Material; import org.bukkit.block.Beacon; import org.bukkit.block.Block; @@ -16,6 +13,9 @@ import org.bukkit.potion.PotionEffectType; import org.jetbrains.annotations.Nullable; +import java.util.ArrayList; +import java.util.Collection; + public class CardboardBeacon extends CardboardBlockEntityState implements Beacon { public CardboardBeacon(final Block block) { @@ -45,7 +45,7 @@ public PotionEffect getPrimaryEffect() { @Override public void setPrimaryEffect(PotionEffectType effect) { - this.getSnapshot().primary = (effect != null) ? StatusEffect.byRawId(effect.getId()) : null; + this.getSnapshot().primary = (effect != null) ? Registries.STATUS_EFFECT.get(effect.getId()) : null; } @Override @@ -56,7 +56,7 @@ public PotionEffect getSecondaryEffect() { @Override public void setSecondaryEffect(PotionEffectType effect) { - this.getSnapshot().secondary = (effect != null) ? StatusEffect.byRawId(effect.getId()) : null; + this.getSnapshot().secondary = (effect != null) ? Registries.STATUS_EFFECT.get(effect.getId()) : null; } @Override @@ -113,4 +113,4 @@ public void customName(@Nullable Component arg0) { } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/block/CardboardDispenser.java b/src/main/java/org/cardboardpowered/impl/block/CardboardDispenser.java index 731d245d..c01d08b9 100644 --- a/src/main/java/org/cardboardpowered/impl/block/CardboardDispenser.java +++ b/src/main/java/org/cardboardpowered/impl/block/CardboardDispenser.java @@ -1,7 +1,10 @@ package org.cardboardpowered.impl.block; -import java.util.UUID; - +import net.kyori.adventure.text.Component; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.DispenserBlock; +import net.minecraft.block.entity.DispenserBlockEntity; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.Dispenser; @@ -11,111 +14,108 @@ import org.cardboardpowered.impl.world.WorldImpl; import org.jetbrains.annotations.Nullable; -import net.kyori.adventure.text.Component; -import net.minecraft.block.Blocks; -import net.minecraft.block.DispenserBlock; -import net.minecraft.block.entity.DispenserBlockEntity; -import net.minecraft.server.world.ServerWorld; +import java.util.UUID; public class CardboardDispenser extends CardboardLootableBlock implements Dispenser { - public CardboardDispenser(final Block block) { - super(block, DispenserBlockEntity.class); - } - - public CardboardDispenser(final Material material, final DispenserBlockEntity te) { - super(material, te); - } - - @Override - public Inventory getSnapshotInventory() { - return new CraftInventory(this.getSnapshot()); - } - - @Override - public Inventory getInventory() { - return (!this.isPlaced()) ? this.getSnapshotInventory() : new CraftInventory(this.getTileEntity()); - } - - @Override - public BlockProjectileSource getBlockProjectileSource() { - if (getBlock().getType() != Material.DISPENSER) return null; - return new CardboardBlockProjectileSource((DispenserBlockEntity) this.getTileEntityFromWorld()); - } - - @Override - public boolean dispense() { - Block block = getBlock(); - if (block.getType() == Material.DISPENSER) { - ((DispenserBlock) Blocks.DISPENSER).dispense((ServerWorld)((WorldImpl) this.getWorld()).getHandle(), this.getPosition()); - return true; - } else return false; - } - - @Override - public long getLastFilled() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public Long getLastLooted(UUID arg0) { - // TODO Auto-generated method stub - return null; - } - - @Override - public long getNextRefill() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public boolean hasBeenFilled() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean hasPendingRefill() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean hasPlayerLooted(UUID arg0) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isRefillEnabled() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean setHasPlayerLooted(UUID arg0, boolean arg1) { - // TODO Auto-generated method stub - return false; - } - - @Override - public long setNextRefill(long arg0) { - // TODO Auto-generated method stub - return 0; - } - - @Override - public @Nullable Component customName() { - // TODO Auto-generated method stub - return null; - } - - @Override - public void customName(@Nullable Component arg0) { - // TODO Auto-generated method stub - - } - -} \ No newline at end of file + public CardboardDispenser(final Block block) { + super(block, DispenserBlockEntity.class); + } + + public CardboardDispenser(final Material material, final DispenserBlockEntity te) { + super(material, te); + } + + @Override + public Inventory getSnapshotInventory() { + return new CraftInventory(this.getSnapshot()); + } + + @Override + public Inventory getInventory() { + return (!this.isPlaced()) ? this.getSnapshotInventory() : new CraftInventory(this.getTileEntity()); + } + + @Override + public BlockProjectileSource getBlockProjectileSource() { + if(getBlock().getType() != Material.DISPENSER) return null; + return new CardboardBlockProjectileSource((DispenserBlockEntity) this.getTileEntityFromWorld()); + } + + @Override + public boolean dispense() { + Block block = getBlock(); + if(block.getType() != Material.DISPENSER) return false; + + BlockState state = world.getHandle().getBlockState(getPosition()); + ((DispenserBlock) Blocks.DISPENSER).dispense(((WorldImpl) this.getWorld()).getHandle(), state, this.getPosition()); + return true; + } + + @Override + public long getLastFilled() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public Long getLastLooted(UUID arg0) { + // TODO Auto-generated method stub + return null; + } + + @Override + public long getNextRefill() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public boolean hasBeenFilled() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean hasPendingRefill() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean hasPlayerLooted(UUID arg0) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isRefillEnabled() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean setHasPlayerLooted(UUID arg0, boolean arg1) { + // TODO Auto-generated method stub + return false; + } + + @Override + public long setNextRefill(long arg0) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public @Nullable Component customName() { + // TODO Auto-generated method stub + return null; + } + + @Override + public void customName(@Nullable Component arg0) { + // TODO Auto-generated method stub + + } + +} diff --git a/src/main/java/org/cardboardpowered/impl/block/CardboardDropper.java b/src/main/java/org/cardboardpowered/impl/block/CardboardDropper.java index ca3a0e3d..eceb91cd 100644 --- a/src/main/java/org/cardboardpowered/impl/block/CardboardDropper.java +++ b/src/main/java/org/cardboardpowered/impl/block/CardboardDropper.java @@ -1,7 +1,10 @@ package org.cardboardpowered.impl.block; -import java.util.UUID; - +import net.kyori.adventure.text.Component; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.block.DropperBlock; +import net.minecraft.block.entity.DropperBlockEntity; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.Dropper; @@ -10,11 +13,7 @@ import org.cardboardpowered.impl.world.WorldImpl; import org.jetbrains.annotations.Nullable; -import net.kyori.adventure.text.Component; -import net.minecraft.block.Blocks; -import net.minecraft.block.DropperBlock; -import net.minecraft.block.entity.DropperBlockEntity; -import net.minecraft.server.world.ServerWorld; +import java.util.UUID; public class CardboardDropper extends CardboardLootableBlock implements Dropper { @@ -43,7 +42,8 @@ public void drop() { if (block.getType() == Material.DROPPER) { WorldImpl world = (WorldImpl) this.getWorld(); DropperBlock drop = (DropperBlock) Blocks.DROPPER; - drop.dispense((ServerWorld) world.getHandle(), this.getPosition()); + BlockState state = world.getHandle().getBlockState(getPosition()); + drop.dispense(world.getHandle(), state, this.getPosition()); } } @@ -113,4 +113,4 @@ public void customName(@Nullable Component arg0) { } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/command/MinecraftCommandWrapper.java b/src/main/java/org/cardboardpowered/impl/command/MinecraftCommandWrapper.java index a25ac38a..9c8df01b 100644 --- a/src/main/java/org/cardboardpowered/impl/command/MinecraftCommandWrapper.java +++ b/src/main/java/org/cardboardpowered/impl/command/MinecraftCommandWrapper.java @@ -3,13 +3,8 @@ import com.google.common.base.Joiner; import com.mojang.brigadier.ParseResults; import com.mojang.brigadier.tree.CommandNode; - import net.minecraft.server.command.CommandManager; import net.minecraft.server.command.ServerCommandSource; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; import org.bukkit.Location; import org.bukkit.command.CommandSender; import org.bukkit.command.ConsoleCommandSender; @@ -18,6 +13,10 @@ import org.bukkit.craftbukkit.entity.CraftEntity; import org.cardboardpowered.impl.entity.PlayerImpl; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + public final class MinecraftCommandWrapper extends BukkitCommand { private final CommandManager dispatcher; @@ -34,8 +33,6 @@ public MinecraftCommandWrapper(CommandManager dispatcher, CommandNode vanilla public boolean execute(CommandSender sender, String commandLabel, String[] args) { if (!testPermission(sender)) return true; - // dispatcher.execute(getCommandSource(sender), toDispatcher(args, commandLabel)); - ServerCommandSource icommandlistener = MinecraftCommandWrapper.getCommandSource(sender); this.dispatcher.executeWithPrefix(icommandlistener, this.toDispatcher(args, this.getName())); @@ -71,4 +68,4 @@ public static ServerCommandSource getCommandSource(CommandSender s) { return null; } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/entity/LivingEntityImpl.java b/src/main/java/org/cardboardpowered/impl/entity/LivingEntityImpl.java index c0dcc86f..b6055bb1 100644 --- a/src/main/java/org/cardboardpowered/impl/entity/LivingEntityImpl.java +++ b/src/main/java/org/cardboardpowered/impl/entity/LivingEntityImpl.java @@ -1,79 +1,13 @@ package org.cardboardpowered.impl.entity; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Set; -import java.util.UUID; - -import org.apache.commons.lang.Validate; -import org.bukkit.Chunk; -import org.bukkit.FluidCollisionMode; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.attribute.Attribute; -import org.bukkit.attribute.AttributeInstance; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.craftbukkit.entity.CraftEntity; -import org.bukkit.craftbukkit.entity.CraftHumanEntity; -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.entity.AbstractArrow; -import org.bukkit.entity.DragonFireball; -import org.bukkit.entity.Egg; -import org.bukkit.entity.EnderPearl; -import org.bukkit.entity.Entity; -import org.bukkit.entity.EntityCategory; -import org.bukkit.entity.EntityType; -import org.bukkit.entity.Fireball; -import org.bukkit.entity.Firework; -import org.bukkit.entity.FishHook; -import org.bukkit.entity.HumanEntity; -import org.bukkit.entity.Item; -import org.bukkit.entity.LingeringPotion; -import org.bukkit.entity.LivingEntity; -import org.bukkit.entity.LlamaSpit; -import org.bukkit.entity.Player; -import org.bukkit.entity.Projectile; -import org.bukkit.entity.ShulkerBullet; -import org.bukkit.entity.SmallFireball; -import org.bukkit.entity.Snowball; -import org.bukkit.entity.SpectralArrow; -import org.bukkit.entity.ThrownExpBottle; -import org.bukkit.entity.ThrownPotion; -import org.bukkit.entity.TippedArrow; -import org.bukkit.entity.Trident; -import org.bukkit.entity.WitherSkull; -import org.bukkit.entity.memory.MemoryKey; -import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; -import org.bukkit.inventory.EntityEquipment; -import org.bukkit.inventory.EquipmentSlot; -import org.bukkit.inventory.ItemStack; -import org.bukkit.potion.PotionData; -import org.bukkit.potion.PotionEffect; -import org.bukkit.potion.PotionEffectType; -import org.bukkit.potion.PotionType; -import org.bukkit.util.BlockIterator; -import org.bukkit.util.RayTraceResult; -import org.bukkit.util.Vector; - import com.destroystokyo.paper.block.TargetBlockInfo; import com.destroystokyo.paper.block.TargetBlockInfo.FluidMode; import com.destroystokyo.paper.entity.TargetEntityInfo; import com.google.common.collect.Sets; import com.javazilla.bukkitfabric.Utils; -import org.cardboardpowered.impl.world.WorldImpl; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.cardboardpowered.impl.CardboardPotionUtil; -import org.cardboardpowered.impl.inventory.CardboardEntityEquipment; - import com.javazilla.bukkitfabric.interfaces.IMixinArrowEntity; import com.javazilla.bukkitfabric.interfaces.IMixinEntity; import com.javazilla.bukkitfabric.interfaces.IMixinLivingEntity; - import net.kyori.adventure.text.Component; import net.minecraft.entity.boss.WitherEntity; import net.minecraft.entity.damage.DamageSource; @@ -84,7 +18,6 @@ import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.projectile.ArrowEntity; import net.minecraft.entity.projectile.DragonFireballEntity; -import net.minecraft.entity.projectile.FireballEntity; import net.minecraft.entity.projectile.FireworkRocketEntity; import net.minecraft.entity.projectile.FishingBobberEntity; import net.minecraft.entity.projectile.LlamaSpitEntity; @@ -100,7 +33,46 @@ import net.minecraft.entity.projectile.thrown.PotionEntity; import net.minecraft.entity.projectile.thrown.SnowballEntity; import net.minecraft.entity.projectile.thrown.ThrownEntity; +import net.minecraft.registry.Registries; import net.minecraft.util.Hand; +import org.apache.commons.lang.Validate; +import org.bukkit.Chunk; +import org.bukkit.FluidCollisionMode; +import org.bukkit.Location; +import org.bukkit.Material; +import org.bukkit.attribute.Attribute; +import org.bukkit.attribute.AttributeInstance; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.craftbukkit.entity.CraftEntity; +import org.bukkit.craftbukkit.entity.CraftHumanEntity; +import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.entity.*; +import org.bukkit.entity.memory.MemoryKey; +import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; +import org.bukkit.inventory.EntityEquipment; +import org.bukkit.inventory.EquipmentSlot; +import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionData; +import org.bukkit.potion.PotionEffect; +import org.bukkit.potion.PotionEffectType; +import org.bukkit.potion.PotionType; +import org.bukkit.util.BlockIterator; +import org.bukkit.util.RayTraceResult; +import org.bukkit.util.Vector; +import org.cardboardpowered.impl.CardboardPotionUtil; +import org.cardboardpowered.impl.inventory.CardboardEntityEquipment; +import org.cardboardpowered.impl.world.WorldImpl; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.UUID; @SuppressWarnings("deprecation") public class LivingEntityImpl extends CraftEntity implements LivingEntity { @@ -289,7 +261,8 @@ public boolean addPotionEffect(PotionEffect effect) { @Override public boolean addPotionEffect(PotionEffect effect, boolean force) { - nms.addStatusEffect(new StatusEffectInstance(StatusEffect.byRawId(effect.getType().getId()), effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles())/*, EntityPotionEffectEvent.Cause.PLUGIN*/); + StatusEffect type = Registries.STATUS_EFFECT.get(effect.getType().getId()); + nms.addStatusEffect(new StatusEffectInstance(type, effect.getDuration(), effect.getAmplifier(), effect.isAmbient(), effect.hasParticles())/*, EntityPotionEffectEvent.Cause.PLUGIN*/); return true; } @@ -308,9 +281,9 @@ public void attack(Entity arg0) { @Override public Collection getActivePotionEffects() { - List effects = new ArrayList(); + List effects = new ArrayList<>(); for (StatusEffectInstance handle : nms.activeStatusEffects.values()) - effects.add(new PotionEffect(PotionEffectType.getById(StatusEffect.getRawId(handle.getEffectType())), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.shouldShowParticles())); + effects.add(new PotionEffect(PotionEffectType.getById(Registries.STATUS_EFFECT.getRawId(handle.getEffectType())), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.shouldShowParticles())); return effects; } @@ -412,8 +385,8 @@ public int getNoDamageTicks() { @Override public PotionEffect getPotionEffect(PotionEffectType arg0) { - StatusEffectInstance handle = nms.getStatusEffect(StatusEffect.byRawId(arg0.getId())); - return (handle == null) ? null : new PotionEffect(PotionEffectType.getById(StatusEffect.getRawId(handle.getEffectType())), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.shouldShowParticles()); + StatusEffectInstance handle = nms.getStatusEffect(Registries.STATUS_EFFECT.get(arg0.getId())); + return (handle == null) ? null : new PotionEffect(PotionEffectType.getById(Registries.STATUS_EFFECT.getRawId(handle.getEffectType())), handle.getDuration(), handle.getAmplifier(), handle.isAmbient(), handle.shouldShowParticles()); } @Override @@ -456,7 +429,7 @@ public boolean hasLineOfSight(Entity arg0) { @Override public boolean hasPotionEffect(PotionEffectType arg0) { - return nms.hasStatusEffect(StatusEffect.byRawId(arg0.getId())); + return nms.hasStatusEffect(Registries.STATUS_EFFECT.get(arg0.getId())); } @Override @@ -507,7 +480,7 @@ public RayTraceResult rayTraceBlocks(double maxDistance, FluidCollisionMode flui @Override public void removePotionEffect(PotionEffectType type) { - nms.removeStatusEffect(StatusEffect.byRawId(type.getId())/*, EntityPotionEffectEvent.Cause.PLUGIN*/); + nms.removeStatusEffect(Registries.STATUS_EFFECT.get(type.getId())/*, EntityPotionEffectEvent.Cause.PLUGIN*/); } @Override @@ -864,4 +837,4 @@ public void setBeeStingersInBody(int i) { } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/entity/PlayerImpl.java b/src/main/java/org/cardboardpowered/impl/entity/PlayerImpl.java index a77b0dee..2e5c1b44 100644 --- a/src/main/java/org/cardboardpowered/impl/entity/PlayerImpl.java +++ b/src/main/java/org/cardboardpowered/impl/entity/PlayerImpl.java @@ -1,55 +1,69 @@ /** * CardboardPowered - Bukkit/Spigot for Fabric * Copyright (C) CardboardPowered.org and contributors - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either + * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.cardboardpowered.impl.entity; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.net.InetSocketAddress; -import java.net.SocketAddress; -import java.util.HashMap; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.UUID; -import java.util.logging.Level; - +import com.destroystokyo.paper.ClientOption; +import com.destroystokyo.paper.Title; +import com.destroystokyo.paper.profile.PlayerProfile; +import com.google.common.base.Preconditions; +import com.google.common.collect.ImmutableSet; +import com.javazilla.bukkitfabric.BukkitFabricMod; +import com.javazilla.bukkitfabric.interfaces.IMixinClientConnection; +import com.javazilla.bukkitfabric.interfaces.IMixinEntity; +import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; +import com.javazilla.bukkitfabric.interfaces.IMixinPlayNetworkHandler; +import com.javazilla.bukkitfabric.interfaces.IMixinPlayerManager; +import com.javazilla.bukkitfabric.interfaces.IMixinSignBlockEntity; +import com.javazilla.bukkitfabric.interfaces.IMixinWorld; +import com.javazilla.bukkitfabric.nms.ReflectionRemapper; +import com.mojang.authlib.GameProfile; +import me.isaiah.common.GameVersion; +import net.kyori.adventure.text.Component; +import net.md_5.bungee.api.chat.BaseComponent; +import net.minecraft.advancement.PlayerAdvancementTracker; +import net.minecraft.block.entity.SignBlockEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.network.PacketByteBuf; +import net.minecraft.network.packet.CustomPayload; +import net.minecraft.network.packet.s2c.common.CustomPayloadS2CPacket; +import net.minecraft.network.packet.s2c.common.ResourcePackSendS2CPacket; +import net.minecraft.network.packet.s2c.play.BlockBreakingProgressS2CPacket; +import net.minecraft.network.packet.s2c.play.BlockUpdateS2CPacket; +import net.minecraft.network.packet.s2c.play.ClearTitleS2CPacket; +import net.minecraft.network.packet.s2c.play.ExperienceBarUpdateS2CPacket; +import net.minecraft.network.packet.s2c.play.ParticleS2CPacket; +import net.minecraft.network.packet.s2c.play.StopSoundS2CPacket; +import net.minecraft.network.packet.s2c.play.SubtitleS2CPacket; +import net.minecraft.network.packet.s2c.play.TitleFadeS2CPacket; +import net.minecraft.network.packet.s2c.play.TitleS2CPacket; +import net.minecraft.network.packet.s2c.play.WorldEventS2CPacket; +import net.minecraft.server.PlayerManager; +import net.minecraft.server.WhitelistEntry; +import net.minecraft.server.network.ServerPlayNetworkHandler; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.server.world.ServerWorld; +import net.minecraft.text.Text; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3d; import org.apache.commons.lang.NotImplementedException; -import org.bukkit.Bukkit; -import org.bukkit.DyeColor; -import org.bukkit.Effect; -import org.bukkit.GameMode; -import org.bukkit.Instrument; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.Note; -import org.bukkit.OfflinePlayer; -import org.bukkit.Particle; -import org.bukkit.Sound; -import org.bukkit.SoundCategory; -import org.bukkit.Statistic; -import org.bukkit.WeatherType; -import org.bukkit.World; -import org.bukkit.WorldBorder; +import org.bukkit.*; import org.bukkit.block.Block; import org.bukkit.block.Sign; import org.bukkit.block.data.BlockData; @@ -87,1720 +101,1717 @@ import org.cardboardpowered.impl.AdvancementImpl; import org.cardboardpowered.impl.AdvancementProgressImpl; import org.cardboardpowered.impl.block.CardboardSign; - -import com.destroystokyo.paper.ClientOption; -import com.destroystokyo.paper.Title; -import com.destroystokyo.paper.profile.PlayerProfile; -import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableSet; -import com.javazilla.bukkitfabric.BukkitFabricMod; import org.cardboardpowered.impl.world.WorldImpl; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import com.javazilla.bukkitfabric.interfaces.IMixinClientConnection; -import com.javazilla.bukkitfabric.interfaces.IMixinEntity; -import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; -import com.javazilla.bukkitfabric.interfaces.IMixinPlayNetworkHandler; -import com.javazilla.bukkitfabric.interfaces.IMixinPlayerManager; -import com.javazilla.bukkitfabric.interfaces.IMixinSignBlockEntity; -import com.javazilla.bukkitfabric.interfaces.IMixinWorld; -import com.javazilla.bukkitfabric.nms.ReflectionRemapper; -import com.mojang.authlib.GameProfile; - -import io.netty.buffer.Unpooled; -import me.isaiah.common.GameVersion; -import net.kyori.adventure.text.Component; -import net.md_5.bungee.api.chat.BaseComponent; -import net.minecraft.advancement.PlayerAdvancementTracker; -import net.minecraft.block.entity.SignBlockEntity; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.network.packet.s2c.play.BlockBreakingProgressS2CPacket; -import net.minecraft.network.packet.s2c.play.BlockUpdateS2CPacket; -import net.minecraft.network.packet.s2c.play.ClearTitleS2CPacket; -import net.minecraft.network.packet.s2c.play.CustomPayloadS2CPacket; -import net.minecraft.network.packet.s2c.play.ExperienceBarUpdateS2CPacket; -import net.minecraft.network.packet.s2c.play.ParticleS2CPacket; -import net.minecraft.network.packet.s2c.play.StopSoundS2CPacket; -import net.minecraft.network.packet.s2c.play.SubtitleS2CPacket; -import net.minecraft.network.packet.s2c.play.TitleFadeS2CPacket; -import net.minecraft.network.packet.s2c.play.TitleS2CPacket; -import net.minecraft.network.packet.s2c.play.WorldEventS2CPacket; -import net.minecraft.server.PlayerManager; -import net.minecraft.server.WhitelistEntry; -import net.minecraft.server.network.ServerPlayNetworkHandler; -import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.server.world.ServerWorld; -import net.minecraft.text.Text; -import net.minecraft.util.Identifier; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; -import net.minecraft.network.PacketByteBuf; -import net.minecraft.network.packet.s2c.play.MapUpdateS2CPacket; -import org.bukkit.map.MapCursor; -import org.bukkit.map.MapView; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.UUID; +import java.util.logging.Level; @DelegateDeserialization(CraftOfflinePlayer.class) public class PlayerImpl extends CraftHumanEntity implements Player { - private final Set channels = new HashSet(); - public ServerPlayerEntity nms; - - public PlayerImpl(ServerPlayerEntity entity) { - super(entity); - super.nms = entity; - this.nms = entity; - } - - @Override - public ServerPlayerEntity getHandle() { - return nms; - } - - @Override - public UUID getUniqueId() { - return super.getUniqueId(); - } - - @Override - public void abandonConversation(Conversation arg0) { - // TODO Auto-generated method stub - } - - @Override - public void abandonConversation(Conversation arg0, ConversationAbandonedEvent arg1) { - // TODO Auto-generated method stub - } - - @Override - public void acceptConversationInput(String arg0) { - // TODO Auto-generated method stub - } - - @Override - public boolean beginConversation(Conversation arg0) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isConversing() { - // TODO Auto-generated method stub - return false; - } - - @Override - public void incrementStatistic(Statistic statistic) { - CraftStatistic.incrementStatistic(getHandle().getStatHandler(), statistic); - } - - @Override - public void decrementStatistic(Statistic statistic) { - CraftStatistic.decrementStatistic(getHandle().getStatHandler(), statistic); - } - - @Override - public int getStatistic(Statistic statistic) { - return CraftStatistic.getStatistic(getHandle().getStatHandler(), statistic); - } - - @Override - public void incrementStatistic(Statistic statistic, int amount) { - CraftStatistic.incrementStatistic(getHandle().getStatHandler(), statistic, amount); - } - - @Override - public void decrementStatistic(Statistic statistic, int amount) { - CraftStatistic.decrementStatistic(getHandle().getStatHandler(), statistic, amount); - } - - @Override - public void setStatistic(Statistic statistic, int newValue) { - CraftStatistic.setStatistic(getHandle().getStatHandler(), statistic, newValue); - } - - @Override - public void incrementStatistic(Statistic statistic, Material material) { - CraftStatistic.incrementStatistic(getHandle().getStatHandler(), statistic, material); - } - - @Override - public void decrementStatistic(Statistic statistic, Material material) { - CraftStatistic.decrementStatistic(getHandle().getStatHandler(), statistic, material); - } - - @Override - public int getStatistic(Statistic statistic, Material material) { - return CraftStatistic.getStatistic(getHandle().getStatHandler(), statistic, material); - } - - @Override - public void incrementStatistic(Statistic statistic, Material material, int amount) { - CraftStatistic.incrementStatistic(getHandle().getStatHandler(), statistic, material, amount); - } - - @Override - public void decrementStatistic(Statistic statistic, Material material, int amount) { - CraftStatistic.decrementStatistic(getHandle().getStatHandler(), statistic, material, amount); - } - - @Override - public void setStatistic(Statistic statistic, Material material, int newValue) { - CraftStatistic.setStatistic(getHandle().getStatHandler(), statistic, material, newValue); - } - - @Override - public void incrementStatistic(Statistic statistic, EntityType entityType) { - CraftStatistic.incrementStatistic(getHandle().getStatHandler(), statistic, entityType); - } - - @Override - public void decrementStatistic(Statistic statistic, EntityType entityType) { - CraftStatistic.decrementStatistic(getHandle().getStatHandler(), statistic, entityType); - } - - @Override - public int getStatistic(Statistic statistic, EntityType entityType) { - return CraftStatistic.getStatistic(getHandle().getStatHandler(), statistic, entityType); - } - - @Override - public void incrementStatistic(Statistic statistic, EntityType entityType, int amount) { - CraftStatistic.incrementStatistic(getHandle().getStatHandler(), statistic, entityType, amount); - } - - @Override - public void decrementStatistic(Statistic statistic, EntityType entityType, int amount) { - CraftStatistic.decrementStatistic(getHandle().getStatHandler(), statistic, entityType, amount); - } - - @Override - public void setStatistic(Statistic statistic, EntityType entityType, int newValue) { - CraftStatistic.setStatistic(getHandle().getStatHandler(), statistic, entityType, newValue); - } - - @Override - public long getFirstPlayed() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public long getLastPlayed() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public void sendMessage(String message) { - // nms.sendSystemMessage(new LiteralText(message), UUID.randomUUID()); - nms.sendMessage(Text.literal(message)); - } - - @Override - public PlayerImpl getPlayer() { - return this; - } - - @Override - public boolean hasPlayedBefore() { - // TODO Auto-generated method stub - return true; - } - - @Override - public boolean isBanned() { - return getServer().getBanList(org.bukkit.BanList.Type.NAME).isBanned(getName()); - } - - @Override - public String getName() { - return nms.getEntityName(); - } - - @Override - public boolean isOnline() { - return getServer().getPlayer(getUniqueId()) != null; - } - - @Override - public boolean isWhitelisted() { - return CraftServer.server.getPlayerManager().isWhitelisted(nms.getGameProfile()); - } - - @Override - public void setWhitelisted(boolean arg0) { - if (arg0) - nms.getServer().getPlayerManager().getWhitelist().add(new WhitelistEntry(nms.getGameProfile())); - else nms.getServer().getPlayerManager().getWhitelist().remove(nms.getGameProfile()); - } - - @Override - public Map serialize() { - Map result = new LinkedHashMap(); - result.put("name", getName()); - return result; - } - - public void addChannel(String channel) { - Preconditions.checkState(channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel); - channel = StandardMessenger.validateAndCorrectChannel(channel); - if (channels.add(channel)) - server.getPluginManager().callEvent(new PlayerRegisterChannelEvent(this, channel)); - } - - public void removeChannel(String channel) { - channel = StandardMessenger.validateAndCorrectChannel(channel); - if (channels.remove(channel)) - server.getPluginManager().callEvent(new PlayerUnregisterChannelEvent(this, channel)); - } - - @Override - public Set getListeningPluginChannels() { - return ImmutableSet.copyOf(channels); - } - - public void sendSupportedChannels() { - if (getHandle().networkHandler == null) return; - Set listening = server.getMessenger().getIncomingChannels(); - - if (!listening.isEmpty()) { - ByteArrayOutputStream stream = new ByteArrayOutputStream(); - - for (String channel : listening) { - try { - stream.write(channel.getBytes("UTF8")); - stream.write((byte) 0); - } catch (IOException ex) { - BukkitFabricMod.LOGGER.log(Level.SEVERE, "Could not send Plugin Channel REGISTER to " + getName(), ex); - } - } + private final Set channels = new HashSet(); + public ServerPlayerEntity nms; + + public PlayerImpl(ServerPlayerEntity entity) { + super(entity); + super.nms = entity; + this.nms = entity; + } + + @Override + public ServerPlayerEntity getHandle() { + return nms; + } + + @Override + public UUID getUniqueId() { + return super.getUniqueId(); + } + + @Override + public void abandonConversation(Conversation arg0) { + // TODO Auto-generated method stub + } + + @Override + public void abandonConversation(Conversation arg0, ConversationAbandonedEvent arg1) { + // TODO Auto-generated method stub + } + + @Override + public void acceptConversationInput(String arg0) { + // TODO Auto-generated method stub + } + + @Override + public boolean beginConversation(Conversation arg0) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isConversing() { + // TODO Auto-generated method stub + return false; + } + + @Override + public void incrementStatistic(Statistic statistic) { + CraftStatistic.incrementStatistic(getHandle().getStatHandler(), statistic); + } + + @Override + public void decrementStatistic(Statistic statistic) { + CraftStatistic.decrementStatistic(getHandle().getStatHandler(), statistic); + } + + @Override + public int getStatistic(Statistic statistic) { + return CraftStatistic.getStatistic(getHandle().getStatHandler(), statistic); + } + + @Override + public void incrementStatistic(Statistic statistic, int amount) { + CraftStatistic.incrementStatistic(getHandle().getStatHandler(), statistic, amount); + } + + @Override + public void decrementStatistic(Statistic statistic, int amount) { + CraftStatistic.decrementStatistic(getHandle().getStatHandler(), statistic, amount); + } + + @Override + public void setStatistic(Statistic statistic, int newValue) { + CraftStatistic.setStatistic(getHandle().getStatHandler(), statistic, newValue); + } + + @Override + public void incrementStatistic(Statistic statistic, Material material) { + CraftStatistic.incrementStatistic(getHandle().getStatHandler(), statistic, material); + } + + @Override + public void decrementStatistic(Statistic statistic, Material material) { + CraftStatistic.decrementStatistic(getHandle().getStatHandler(), statistic, material); + } + + @Override + public int getStatistic(Statistic statistic, Material material) { + return CraftStatistic.getStatistic(getHandle().getStatHandler(), statistic, material); + } + + @Override + public void incrementStatistic(Statistic statistic, Material material, int amount) { + CraftStatistic.incrementStatistic(getHandle().getStatHandler(), statistic, material, amount); + } + + @Override + public void decrementStatistic(Statistic statistic, Material material, int amount) { + CraftStatistic.decrementStatistic(getHandle().getStatHandler(), statistic, material, amount); + } + + @Override + public void setStatistic(Statistic statistic, Material material, int newValue) { + CraftStatistic.setStatistic(getHandle().getStatHandler(), statistic, material, newValue); + } + + @Override + public void incrementStatistic(Statistic statistic, EntityType entityType) { + CraftStatistic.incrementStatistic(getHandle().getStatHandler(), statistic, entityType); + } + + @Override + public void decrementStatistic(Statistic statistic, EntityType entityType) { + CraftStatistic.decrementStatistic(getHandle().getStatHandler(), statistic, entityType); + } + + @Override + public int getStatistic(Statistic statistic, EntityType entityType) { + return CraftStatistic.getStatistic(getHandle().getStatHandler(), statistic, entityType); + } + + @Override + public void incrementStatistic(Statistic statistic, EntityType entityType, int amount) { + CraftStatistic.incrementStatistic(getHandle().getStatHandler(), statistic, entityType, amount); + } + + @Override + public void decrementStatistic(Statistic statistic, EntityType entityType, int amount) { + CraftStatistic.decrementStatistic(getHandle().getStatHandler(), statistic, entityType, amount); + } + + @Override + public void setStatistic(Statistic statistic, EntityType entityType, int newValue) { + CraftStatistic.setStatistic(getHandle().getStatHandler(), statistic, entityType, newValue); + } + + @Override + public long getFirstPlayed() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public long getLastPlayed() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void sendMessage(String message) { + // nms.sendSystemMessage(new LiteralText(message), UUID.randomUUID()); + nms.sendMessage(Text.literal(message)); + } + + @Override + public PlayerImpl getPlayer() { + return this; + } + + @Override + public boolean hasPlayedBefore() { + // TODO Auto-generated method stub + return true; + } + + @Override + public boolean isBanned() { + return getServer().getBanList(org.bukkit.BanList.Type.NAME).isBanned(getName()); + } + + @Override + public String getName() { + return nms.getEntityName(); + } + + @Override + public boolean isOnline() { + return getServer().getPlayer(getUniqueId()) != null; + } + + @Override + public boolean isWhitelisted() { + return CraftServer.server.getPlayerManager().isWhitelisted(nms.getGameProfile()); + } + + @Override + public void setWhitelisted(boolean arg0) { + if(arg0) + nms.getServer().getPlayerManager().getWhitelist().add(new WhitelistEntry(nms.getGameProfile())); + else nms.getServer().getPlayerManager().getWhitelist().remove(nms.getGameProfile()); + } + + @Override + public Map serialize() { + Map result = new LinkedHashMap(); + result.put("name", getName()); + return result; + } + + public void addChannel(String channel) { + Preconditions.checkState(channels.size() < 128, "Cannot register channel '%s'. Too many channels registered!", channel); + channel = StandardMessenger.validateAndCorrectChannel(channel); + if(channels.add(channel)) + server.getPluginManager().callEvent(new PlayerRegisterChannelEvent(this, channel)); + } + + public void removeChannel(String channel) { + channel = StandardMessenger.validateAndCorrectChannel(channel); + if(channels.remove(channel)) + server.getPluginManager().callEvent(new PlayerUnregisterChannelEvent(this, channel)); + } + + @Override + public Set getListeningPluginChannels() { + return ImmutableSet.copyOf(channels); + } + + public void sendSupportedChannels() { + if(getHandle().networkHandler == null) return; + Set listening = server.getMessenger().getIncomingChannels(); + + if(!listening.isEmpty()) { + ByteArrayOutputStream stream = new ByteArrayOutputStream(); + + for(String channel : listening) { + try { + stream.write(channel.getBytes("UTF8")); + stream.write((byte) 0); + } catch(IOException ex) { + BukkitFabricMod.LOGGER.log(Level.SEVERE, "Could not send Plugin Channel REGISTER to " + getName(), ex); + } + } + + sendPayload(new Identifier("register"), stream.toByteArray()); + } + } + + @SuppressWarnings("deprecation") + @Override + public void sendPluginMessage(Plugin source, String channel, byte[] message) { + StandardMessenger.validatePluginMessage(Bukkit.getMessenger(), source, channel, message); + if(getHandle().networkHandler == null) return; + + if(channels.contains(channel)) { + channel = StandardMessenger.validateAndCorrectChannel(channel); + + sendPayload(new Identifier(channel), message); + } + } + + private void sendPayload(Identifier id, byte[] message) { + CustomPayloadS2CPacket packet = new CustomPayloadS2CPacket(new CustomPayload() { + @Override + public void write(PacketByteBuf packetByteBuf) { + packetByteBuf.writeBytes(message); + } + @Override + public Identifier id() { + return id; + } + }); + getHandle().networkHandler.sendPacket(packet); + } + + @Override + public boolean canSee(Player arg0) { + // TODO Auto-generated method stub + return true; + } + + @Override + public void chat(String message) { + ((IMixinPlayNetworkHandler) (Object) nms.networkHandler).chat(message, false); + } + + @Override + public InetSocketAddress getAddress() { + if(nms.networkHandler == null) return null; + + SocketAddress addr = getHandle().networkHandler.getConnectionAddress(); //.connection.getAddress(); + return addr instanceof InetSocketAddress ? (InetSocketAddress) addr : null; + } + + @Override + public org.bukkit.advancement.AdvancementProgress getAdvancementProgress(org.bukkit.advancement.Advancement advancement) { + Preconditions.checkArgument(advancement != null, "advancement"); + + AdvancementImpl craft = (AdvancementImpl) advancement; + PlayerAdvancementTracker data = getHandle().getAdvancementTracker(); + net.minecraft.advancement.AdvancementProgress progress = data.getProgress(craft.getHandle()); + + return new AdvancementProgressImpl(craft, data, progress); + } + + @Override + public boolean getAllowFlight() { + return getHandle().getAbilities().allowFlying; + } + + @Override + public int getClientViewDistance() { + return Bukkit.getViewDistance(); // TODO Get Client view distance not server + } + + @Override + public Location getCompassTarget() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getDisplayName() { + + + return (null == nms.getCustomName()) ? this.getName() : nms.getCustomName().getString(); + } + + @Override + public float getExhaustion() { + return nms.getHungerManager().exhaustion; + } + + @Override + public float getExp() { + return nms.experienceProgress; + } + + @Override + public float getFlySpeed() { + // return nms.airStrafingSpeed; + return (float) getHandle().getAbilities().getFlySpeed() * 2f; + } + + @Override + public int getFoodLevel() { + return nms.getHungerManager().getFoodLevel(); + } + + @Override + public double getHealthScale() { + // TODO Auto-generated method stub + return 20; + } + + @Override + public int getLevel() { + return nms.experienceLevel; + } + + @Override + public String getLocale() { + return "en_US"; // TODO + } + + @Override + public String getPlayerListFooter() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getPlayerListHeader() { + // TODO Auto-generated method stub + return null; + } + + @Override + public String getPlayerListName() { + return getHandle().getPlayerListName() == null ? getName() : CraftChatMessage.fromComponent(getHandle().getPlayerListName()); + } + + @Override + public long getPlayerTime() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public long getPlayerTimeOffset() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public WeatherType getPlayerWeather() { + // TODO Auto-generated method stub + return WeatherType.CLEAR; + } + + @Override + public float getSaturation() { + return nms.getHungerManager().getSaturationLevel(); + } + + @Override + public CardboardScoreboard getScoreboard() { + return server.getScoreboardManager().getPlayerBoard(this); + } + + @Override + public Entity getSpectatorTarget() { + net.minecraft.entity.Entity followed = getHandle().getCameraEntity(); + return followed == getHandle() ? null : ((IMixinEntity) followed).getBukkitEntity(); + } + + @Override + public int getTotalExperience() { + return nms.totalExperience; + } + + @Override + public float getWalkSpeed() { + return nms.forwardSpeed; + } + + @Override + public void giveExp(int arg0) { + nms.addExperience(arg0); + } + + @Override + public void giveExpLevels(int arg0) { + nms.addExperienceLevels(arg0); + } + + @Override + public void hidePlayer(Player arg0) { + // TODO Auto-generated method stub + } + + @Override + public void hidePlayer(Plugin arg0, Player arg1) { + // TODO Auto-generated method stub + } + + @Override + public boolean isFlying() { + return nms.getAbilities().flying; + } + + @Override + public boolean isHealthScaled() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isPlayerTimeRelative() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isSleepingIgnored() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isSneaking() { + return nms.isSneaking(); + } + + @Override + public boolean isSprinting() { + return nms.isSprinting(); + } + + @Override + public void kickPlayer(String arg0) { + nms.networkHandler.disconnect(Text.of(arg0)); + } + + @Override + public void loadData() { + ((IMixinMinecraftServer) CraftServer.server).getSaveHandler_BF().loadPlayerData(nms); + } + + @Override + public void openBook(ItemStack book) { + ItemStack hand = getInventory().getItemInMainHand(); + getInventory().setItemInMainHand(book); + getHandle().useBook(org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(book), net.minecraft.util.Hand.MAIN_HAND); + getInventory().setItemInMainHand(hand); + } + + @Override + public boolean performCommand(String arg0) { + return getServer().dispatchCommand(this, arg0); + } + + @Override + public void playEffect(Location loc, Effect effect, int data) { + if(getHandle().networkHandler == null) return; + + int packetData = effect.getId(); + WorldEventS2CPacket packet = new WorldEventS2CPacket(packetData, new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), data, false); + getHandle().networkHandler.sendPacket(packet); + } + + @Override + public void playEffect(Location arg0, Effect arg1, T arg2) { + // TODO Auto-generated method stub + } + + @Override + public void playNote(Location loc, byte instrument, byte note) { + if(getHandle().networkHandler == null) return; + + String name = null; + switch(instrument) { + case 0: + name = "harp"; + break; + case 1: + name = "basedrum"; + break; + case 2: + name = "snare"; + break; + case 3: + name = "hat"; + break; + case 4: + name = "bass"; + break; + case 5: + name = "flute"; + break; + case 6: + name = "bell"; + break; + case 7: + name = "guitar"; + break; + case 8: + name = "chime"; + break; + case 9: + name = "xylophone"; + break; + } + + float f = (float) Math.pow(2.0D, (note - 12.0D) / 12.0D); + // TODO: 1.19 + // getHandle().networkHandler.sendPacket(new PlaySoundS2CPacket(CraftSound.getSoundEffect("block.note_block." + name), net.minecraft.sound.SoundCategory.RECORDS, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), 3.0f, f)); + } + + @SuppressWarnings("deprecation") + @Override + public void playNote(Location loc, Instrument instrument, Note note) { + if(getHandle().networkHandler == null) return; + + String instrumentName = null; + switch(instrument.ordinal()) { + case 0: + instrumentName = "harp"; + break; + case 1: + instrumentName = "basedrum"; + break; + case 2: + instrumentName = "snare"; + break; + case 3: + instrumentName = "hat"; + break; + case 4: + instrumentName = "bass"; + break; + case 5: + instrumentName = "flute"; + break; + case 6: + instrumentName = "bell"; + break; + case 7: + instrumentName = "guitar"; + break; + case 8: + instrumentName = "chime"; + break; + case 9: + instrumentName = "xylophone"; + break; + case 10: + instrumentName = "iron_xylophone"; + break; + case 11: + instrumentName = "cow_bell"; + break; + case 12: + instrumentName = "didgeridoo"; + break; + case 13: + instrumentName = "bit"; + break; + case 14: + instrumentName = "banjo"; + break; + case 15: + instrumentName = "pling"; + break; + case 16: + instrumentName = "xylophone"; + break; + } + float f = (float) Math.pow(2.0D, (note.getId() - 12.0D) / 12.0D); + // TODO: 1.19 + // getHandle().networkHandler.sendPacket(new PlaySoundS2CPacket(CraftSound.getSoundEffect("block.note_block." + instrumentName), net.minecraft.sound.SoundCategory.RECORDS, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), 3.0f, f)); + } + + @Override + public void playSound(Location loc, Sound sound, float volume, float pitch) { + playSound(loc, sound, org.bukkit.SoundCategory.MASTER, volume, pitch); + } + + @Override + public void playSound(Location loc, String sound, float volume, float pitch) { + playSound(loc, sound, org.bukkit.SoundCategory.MASTER, volume, pitch); + } + + @Override + public void playSound(Location loc, Sound sound, org.bukkit.SoundCategory category, float volume, float pitch) { + if(loc == null || sound == null || category == null || getHandle().networkHandler == null) return; + + // TODO: 1.19 + // PlaySoundS2CPacket packet = new PlaySoundS2CPacket(CraftSound.getSoundEffect(CraftSound.getSound(sound)), net.minecraft.sound.SoundCategory.valueOf(category.name()), loc.getX(), loc.getY(), loc.getZ(), volume, pitch); + // getHandle().networkHandler.sendPacket(packet); + } + + @Override + public void playSound(Location loc, String sound, org.bukkit.SoundCategory category, float volume, float pitch) { + if(loc == null || sound == null || category == null || getHandle().networkHandler == null) return; + // TODO: 1.19 + // PlaySoundIdS2CPacket packet = new PlaySoundIdS2CPacket(new Identifier(sound), net.minecraft.sound.SoundCategory.valueOf(category.name()), new Vec3d(loc.getX(), loc.getY(), loc.getZ()), volume, pitch); + // getHandle().networkHandler.sendPacket(packet); + } + + @Override + public void resetPlayerTime() { + // TODO Auto-generated method stub + } + + @Override + public void resetPlayerWeather() { + // TODO Auto-generated method stub + } + + @Override + public void resetTitle() { + nms.networkHandler.sendPacket(new ClearTitleS2CPacket(true)); + } + + @Override + public void saveData() { + ((IMixinMinecraftServer) CraftServer.server).getSaveHandler_BF().savePlayerData(nms); + } + + @Override + public void sendBlockChange(Location loc, BlockData block) { + if(getHandle().networkHandler == null) return; + + BlockUpdateS2CPacket packet = new BlockUpdateS2CPacket(new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), ((CraftBlockData) block).getState()); + getHandle().networkHandler.sendPacket(packet); + } + + @Override + public void sendBlockChange(Location loc, Material material, byte data) { + if(getHandle().networkHandler == null) return; + + BlockUpdateS2CPacket packet = new BlockUpdateS2CPacket(new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), CraftMagicNumbers.getBlock(material, data)); + getHandle().networkHandler.sendPacket(packet); + } + + // @Override + public boolean sendChunkChange(Location arg0, int arg1, int arg2, int arg3, byte[] arg4) { + throw new NotImplementedException("Also not in Spigot"); + } + + @Override + public void sendExperienceChange(float progress) { + sendExperienceChange(progress, getLevel()); + } + + @Override + public void sendExperienceChange(float progress, int level) { + if(getHandle().networkHandler == null) return; + + ExperienceBarUpdateS2CPacket packet = new ExperienceBarUpdateS2CPacket(progress, getTotalExperience(), level); + getHandle().networkHandler.sendPacket(packet); + } + + @Override + public void sendMap(MapView map) { + if(getHandle().networkHandler == null) return; + + /* 1.19: RenderData data = ((CraftMapView) map).render(this); + Collection icons = new ArrayList(); + for (MapCursor cursor : data.cursors) { + if (cursor.isVisible()) { + icons.add(new MapIcon(MapIcon.Type.byId(cursor.getRawType()), cursor.getX(), cursor.getY(), cursor.getDirection(), CraftChatMessage.fromStringOrNull(cursor.getCaption()))); + } + } + + MapUpdateS2CPacket packet = new MapUpdateS2CPacket(map.getId(), map.getScale().getValue(), map.isLocked(), icons, new MapState.UpdateData(0, 0, 128, 128, data.buffer)); + getHandle().networkHandler.sendPacket(packet); + */ + // TODO 1.17ify + /*if (getHandle().networkHandler == null) return; + + RenderData data = ((MapViewImpl) map).render(this); + Collection icons = new ArrayList(); + for (MapCursor cursor : data.cursors) { + if (cursor.isVisible()) + icons.add(new MapIcon(MapIcon.Type.byId(cursor.getRawType()), cursor.getX(), cursor.getY(), cursor.getDirection(), CraftChatMessage.fromStringOrNull(cursor.getCaption()))); + } + + MapUpdateS2CPacket packet = new MapUpdateS2CPacket(map.getId(), map.getScale().getValue(), true, map.isLocked(), icons, data.buffer, 0, 0, 128, 128); + getHandle().networkHandler.sendPacket(packet);*/ + } + + @Override + public void sendRawMessage(String arg0) { + if(getHandle().networkHandler == null) return; + + // for (Text component : CraftChatMessage.fromString(arg0)) + // getHandle().networkHandler.sendPacket(new GameMessageS2CPacket(component, MessageType.CHAT, Util.NIL_UUID)); + + for(Text component : CraftChatMessage.fromString(arg0)) { + this.getHandle().sendMessage(component); + } + } + + @Override + public void sendSignChange(Location loc, String[] lines) { + sendSignChange(loc, lines, DyeColor.BLACK); + } + + @Override + public void sendSignChange(Location loc, String[] lines, DyeColor dyeColor) { + if(getHandle().networkHandler == null) return; + if(lines == null) lines = new String[4]; + if(lines.length < 4) + throw new IllegalArgumentException("Must have at least 4 lines"); + + Text[] components = CardboardSign.sanitizeLines(lines); + SignBlockEntity sign = new SignBlockEntity(new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), null); + // sign.setPos(new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); + sign.getFrontText().withColor(net.minecraft.util.DyeColor.byId(dyeColor.getWoolData())); + System.arraycopy(components, 0, ((IMixinSignBlockEntity) sign).getTextBF(), 0, ((IMixinSignBlockEntity) sign).getTextBF().length); + + getHandle().networkHandler.sendPacket(sign.toUpdatePacket()); + } + + @Override + public void sendTitle(String arg0, String arg1) { + sendTitle(arg0, arg1, 10, 70, 20); + } + + @Override + public void sendTitle(String title, String subtitle, int fadeIn, int stay, int fadeOut) { + TitleFadeS2CPacket times = new TitleFadeS2CPacket(fadeIn, stay, fadeOut); + this.getHandle().networkHandler.sendPacket(times); + if(title != null) { + TitleS2CPacket packetTitle = new TitleS2CPacket(CraftChatMessage.fromStringOrNull(title)); + this.getHandle().networkHandler.sendPacket(packetTitle); + } + if(subtitle != null) { + SubtitleS2CPacket packetSubtitle = new SubtitleS2CPacket(CraftChatMessage.fromStringOrNull(subtitle)); + this.getHandle().networkHandler.sendPacket(packetSubtitle); + } + } + + @Override + public void setAllowFlight(boolean arg0) { + if(isFlying() && !arg0) + getHandle().getAbilities().flying = false; + + getHandle().getAbilities().allowFlying = arg0; + getHandle().sendAbilitiesUpdate(); + } + + @Override + public void setCompassTarget(Location arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setDisplayName(String arg0) { + nms.setCustomNameVisible(true); + nms.setCustomName(Text.literal(arg0)); + } + + @Override + public void setExhaustion(float arg0) { + nms.addExhaustion(arg0); + } + + @Override + public void setExp(float arg0) { + nms.setExperiencePoints((int) arg0); + } + + @Override + public void setFlySpeed(float arg0) throws IllegalArgumentException { + // nms.airStrafingSpeed = arg0; + ServerPlayerEntity player = getHandle(); + player.getAbilities().setFlySpeed(arg0 / 2f); + player.sendAbilitiesUpdate(); + } + + @Override + public void setFlying(boolean arg0) { + if(!getAllowFlight() && arg0) + throw new IllegalArgumentException("getAllowFlight() is false, cannot set player flying"); + + getHandle().getAbilities().flying = arg0; + getHandle().sendAbilitiesUpdate(); + } + + @Override + public void setFoodLevel(int arg0) { + nms.getHungerManager().setFoodLevel(arg0); + } + + @Override + public void setHealthScale(double arg0) throws IllegalArgumentException { + // TODO Auto-generated method stub + } + + @Override + public void setHealthScaled(boolean arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setLevel(int level) { + nms.setExperienceLevel(level); + } + + @Override + public void setPlayerListFooter(String arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setPlayerListHeader(String arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setPlayerListHeaderFooter(String arg0, String arg1) { + // TODO Auto-generated method stub + } + + @Override + public void setPlayerListName(String arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setPlayerTime(long arg0, boolean arg1) { + // TODO Auto-generated method stub + } + + @Override + public void setPlayerWeather(WeatherType arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setSaturation(float arg0) { + nms.getHungerManager().setSaturationLevel(arg0); + } + + @Override + public void setScoreboard(Scoreboard scoreboard) { + ServerPlayNetworkHandler playerConnection = getHandle().networkHandler; + if(playerConnection == null) throw new IllegalStateException("Cannot set scoreboard yet"); + if(((IMixinPlayNetworkHandler) playerConnection).isDisconnected()) + throw new IllegalStateException("Cannot set scoreboard for invalid PlayerImpl"); + + this.server.getScoreboardManager().setPlayerBoard(this, scoreboard); + } + + @Override + public void setSleepingIgnored(boolean arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setSneaking(boolean arg0) { + nms.setSneaking(arg0); + } + + @Override + public void setSpectatorTarget(Entity arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setSprinting(boolean arg0) { + nms.setSprinting(arg0); + } + + @Override + public void setTexturePack(String arg0) { + setResourcePack(arg0); + } + + @Override + public void setResourcePack(@NotNull String url) { + sendPack(url, "null", false, null); + } + @Override + public void setResourcePack(@NotNull String url, @Nullable byte[] hash) { + sendPack(url, hash == null ? "null" : new String(hash), false, null); + } + @Override + public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt) { + sendPack(url, hash == null ? "null" : new String(hash), false, prompt); + } + @Override + public void setResourcePack(@NotNull String url, @Nullable byte[] hash, boolean force) { + sendPack(url, hash == null ? "null" : new String(hash), force, null); + } + + @Override + public void setResourcePack(@NotNull String url, @Nullable byte[] hash, @Nullable String prompt, boolean force) { + sendPack(url, hash == null ? "null" : new String(hash), force, prompt); + } + + @Override + public void setResourcePack(@NotNull String url, byte @Nullable [] hash, @Nullable Component component, boolean required) { + sendPack(url, hash == null ? "null" : new String(hash), required, component == null ? null : component.toString()); + } + + private void sendPack(String url, String hash, boolean required, String text) { + nms.networkHandler.sendPacket(new ResourcePackSendS2CPacket(url, hash, required, text == null ? null : Text.literal(text))); + } + + @Override + public void setTotalExperience(int arg0) { + nms.totalExperience = arg0; + } + + @Override + public void setWalkSpeed(float arg0) throws IllegalArgumentException { + nms.getAbilities().setWalkSpeed(arg0); + } + + @Override + public void showPlayer(Player arg0) { + // TODO Auto-generated method stub + } + + @Override + public void showPlayer(Plugin arg0, Player arg1) { + // TODO Auto-generated method stub + } + + @Override + public void spawnParticle(Particle particle, Location location, int count) { + spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count) { + spawnParticle(particle, x, y, z, count, null); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, T data) { + spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, data); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, T data) { + spawnParticle(particle, x, y, z, count, 0, 0, 0, data); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ) { + spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) { + spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, null); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data) { + spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, data); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) { + spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, 1, data); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) { + spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) { + spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, extra, null); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { + spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra, data); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { + if(data != null && !particle.getDataType().isInstance(data)) + throw new IllegalArgumentException("data should be " + particle.getDataType() + " got " + data.getClass()); + ParticleS2CPacket packetplayoutworldparticles = new ParticleS2CPacket(CraftParticle.toNMS(particle, data), true, (float) x, (float) y, (float) z, (float) offsetX, (float) offsetY, (float) offsetZ, (float) extra, count); + getHandle().networkHandler.sendPacket(packetplayoutworldparticles); + + } + + @Override + public void stopSound(Sound sound) { + stopSound(sound, null); + } + + @Override + public void stopSound(String sound) { + stopSound(sound, null); + } + + @Override + public void stopSound(Sound sound, org.bukkit.SoundCategory category) { + stopSound(CraftSound.getSound(sound), category); + } + + @Override + public void stopSound(String sound, org.bukkit.SoundCategory category) { + if(getHandle().networkHandler == null) return; + + getHandle().networkHandler.sendPacket(new StopSoundS2CPacket(new Identifier(sound), category == null ? net.minecraft.sound.SoundCategory.MASTER : net.minecraft.sound.SoundCategory.valueOf(category.name()))); + } + + @Override + public void updateCommands() { + if(getHandle().networkHandler == null) return; + + nms.server.getCommandManager().sendCommandTree(nms); + } + + @Override + public void updateInventory() { + this.getHandle().currentScreenHandler.syncState(); + } + + @SuppressWarnings("deprecation") + @Override + public GameMode getGameMode() { + return GameMode.getByValue(getHandle().interactionManager.getGameMode().getId()); + } + + @SuppressWarnings("deprecation") + @Override + public void setGameMode(GameMode mode) { + if(getHandle().networkHandler == null) return; + + if(mode == null) + throw new IllegalArgumentException("GameMode cannot be null"); + + getHandle().changeGameMode(net.minecraft.world.GameMode.byId(mode.getValue())); + } + + public GameProfile getProfile() { + Optional opt = CraftServer.getUC().card_getByUuid(getUniqueId()); + + // TODO Add a GameProfile API to iCommon + return opt.isEmpty() ? null : opt.get(); + } + + @Override + public boolean isOp() { + try { + return CraftServer.server.getPlayerManager().isOperator(getProfile()); + } catch(NullPointerException e) { + try { + return CraftServer.INSTANCE.getOperatorList().contains(getUniqueId().toString()); + } catch(IOException ex) { + GameProfile gp = new GameProfile(super.getUniqueId(), this.getName()); + return CraftServer.server.getPlayerManager().isOperator(gp); + } + } + } + + @Override + public void setOp(boolean value) { + if(value == isOp()) return; + + if(value) + nms.server.getPlayerManager().addToOperators(nms.getGameProfile()); + else nms.server.getPlayerManager().removeFromOperators(nms.getGameProfile()); + + perm.recalculatePermissions(); + } + + @Override + public boolean teleport(Location location, PlayerTeleportEvent.TeleportCause cause) { + Preconditions.checkArgument(location != null, "location"); + Preconditions.checkArgument(location.getWorld() != null, "location.world"); + location.checkFinite(); + ServerPlayerEntity entity = getHandle(); + + if(getHealth() == 0 || entity.isRemoved() || entity.networkHandler == null || entity.hasPassengers()) + return false; + + Location from = this.getLocation(); + Location to = location; + + PlayerTeleportEvent event = new PlayerTeleportEvent(this, from, to, cause); + Bukkit.getPluginManager().callEvent(event); + + if(event.isCancelled()) + return false; + + entity.stopRiding(); + + from = event.getFrom(); + to = event.getTo(); + + ServerWorld toWorld = (ServerWorld) ((WorldImpl) to.getWorld()).getHandle(); + + if(getHandle().inventory != getHandle().inventory) + getHandle().closeHandledScreen(); + + System.out.println("Hello! " + from.getWorld() + " / " + to.getWorld()); + + if(from.getWorld().equals(to.getWorld())) + ((IMixinPlayNetworkHandler) (Object) entity.networkHandler).teleport(to); + else { + // entity.moveToWorld(toWorld); + // entity.teleport + + ((IMixinPlayerManager) (PlayerManager) CraftServer.server.getPlayerManager()).moveToWorld(entity, toWorld, true, to, true); + } + + return true; + } + + @Override + public boolean equals(Object obj) { + if(!(obj instanceof OfflinePlayer)) + return false; + + OfflinePlayer other = (OfflinePlayer) obj; + if((this.getUniqueId() == null) || (other.getUniqueId() == null)) + return false; + + boolean uuidEquals = this.getUniqueId().equals(other.getUniqueId()); + boolean idEquals = true; + + if(other instanceof PlayerImpl) + idEquals = this.getEntityId() == ((PlayerImpl) other).getEntityId(); + + return uuidEquals && idEquals; + } + + public InetSocketAddress getRawAddress_BF() { + if(Bukkit.getPluginManager().isPluginEnabled("ProtocolSupport")) { + System.out.println("PS getRawAddress"); + try { + Class ps = ReflectionRemapper.getClassFromJPL("protocolsupport.zplatform.impl.fabric.FabricMiscUtils"); + HashMap map = (HashMap) ps.getField("rawAddressMap") + .get(null); + return map.get(this.getAddress()); + } catch(NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { + e.printStackTrace(); + } + } + IMixinPlayNetworkHandler im = (IMixinPlayNetworkHandler) nms.networkHandler; + return (InetSocketAddress) ((IMixinClientConnection) (im.cb_get_connection())).getRawAddress(); + } + + private final Player.Spigot spigot = new Player.Spigot() { + + int err = 0; + + @Override + public InetSocketAddress getRawAddress() { + try { + return getRawAddress_BF(); + } catch(NullPointerException ex) { + // What is going on? + if(err > 3) { + System.exit(0); + return null; + } + err++; + ex.printStackTrace(); + return ((java.net.InetSocketAddress) PlayerImpl.this.getAddress()); + } + } + + @Override + public boolean getCollidesWithEntities() { + return PlayerImpl.this.isCollidable(); + } + + @Override + public void setCollidesWithEntities(boolean collides) { + PlayerImpl.this.setCollidable(collides); + } + + @Override + public void respawn() { + if(getHealth() <= 0 && isOnline()) + nms.getServer().getPlayerManager().respawnPlayer(getHandle(), false); + } + + @Override + public Set getHiddenPlayers() { + return java.util.Collections.emptySet(); + } + + @Override + public void sendMessage(BaseComponent component) { + sendMessage(new BaseComponent[] {component}); + } + + @Override + public void sendMessage(BaseComponent... components) { + if(null == getHandle().networkHandler) return; + + // TODO: 1.19 + // GameMessageS2CPacket packet = new GameMessageS2CPacket(null, MessageType.SYSTEM, nms.getUuid()); + //((IGameMessagePacket)packet).setBungeeComponents(components); + // getHandle().networkHandler.sendPacket(packet); + + getHandle().sendMessage(Text.literal(BaseComponent.toLegacyText(components))); + } + + @Override + public void sendMessage(net.md_5.bungee.api.ChatMessageType position, BaseComponent component) { + sendMessage(position, new BaseComponent[] {component}); + } + + @Override + public void sendMessage(net.md_5.bungee.api.ChatMessageType position, BaseComponent... components) { + if(null == getHandle().networkHandler) return; + + // TODO: 1.19 + + /* GameMessageS2CPacket packet = new GameMessageS2CPacket(null, MessageType.byId((byte) position.ordinal()), nms.getUuid()); + if (position == net.md_5.bungee.api.ChatMessageType.ACTION_BAR) + components = new BaseComponent[]{new net.md_5.bungee.api.chat.TextComponent(BaseComponent.toLegacyText(components))}; + + ((IGameMessagePacket)packet).setBungeeComponents(components); + getHandle().networkHandler.sendPacket(packet);*/ + + getHandle().sendMessage(Text.literal(BaseComponent.toLegacyText(components))); + + // getHandle().networkHandler.sendPacket(new GameMessageS2CPacket(components, position == ChatMessageType.ACTION_BAR)); + } + }; + + @Override + public org.bukkit.entity.Player.Spigot spigot() { + return spigot; + } + + @Override + public Location getBedSpawnLocation() { + World world = ((IMixinWorld) getHandle().server.getWorld(getHandle().getSpawnPointDimension())).getWorldImpl(); + BlockPos bed = getHandle().getSpawnPointPosition(); + + if(world != null && bed != null) { + Optional spawnLoc = PlayerEntity.findRespawnPosition((ServerWorld) ((WorldImpl) world).getHandle(), bed, getHandle().getSpawnAngle(), getHandle().isSpawnForced(), true); + if(spawnLoc.isPresent()) { + Vec3d vec = spawnLoc.get(); + return new Location(world, vec.x, vec.y, vec.z); + } + } + return null; + } + + @Override + public void setBedSpawnLocation(Location location) { + setBedSpawnLocation(location, false); + } + + @Override + public void setBedSpawnLocation(Location location, boolean override) { + if(location == null) { + getHandle().setSpawnPoint(null, null, 0, override, false); + } else getHandle().setSpawnPoint(((WorldImpl) location.getWorld()).getHandle() + .getRegistryKey(), new BlockPos(location.getBlockX(), location.getBlockY(), location.getBlockZ()), location.getYaw(), override, false); + } + + public void setFirstPlayed(long modified) { + // TODO Auto-generated method stub + } + + @Override + public EntityType getType() { + return EntityType.PLAYER; + } + + public void updateScaledHealth() { + // TODO Auto-generated method stub + } + + // SPIGOT-759 + public void sendRawMessage(UUID uuid, String msg) { + this.sendRawMessage(msg); + } + + public void setHandle(ServerPlayerEntity plr) { + this.nms = plr; + super.nms = plr; + } + + // PaperAPI - START + public void setTitleTimes(int fadeInTicks, int stayTicks, int fadeOutTicks) { + // TODO 1.17ify getHandle().networkHandler.sendPacket(new TitleS2CPacket(TitleS2CPacket.Action.TIMES, null, 0, 0, 0)); + } + + public void showTitle(BaseComponent[] title) { + // TODO 1.17ify getHandle().networkHandler.sendPacket(new TitleS2CPacket(TitleS2CPacket.Action.TITLE, Text.of(ComponentSerializer.toString(title)), 0, 0, 0)); + } + + public void setSubtitle(BaseComponent[] subtitle) { + // TODO 1.17ify getHandle().networkHandler.sendPacket(new TitleS2CPacket(TitleS2CPacket.Action.SUBTITLE, Text.of(ComponentSerializer.toString(subtitle)), 0, 0, 0)); + } + + public void showTitle(BaseComponent title) { + showTitle(new BaseComponent[] {title}); + } + + public void setSubtitle(BaseComponent subtitle) { + showTitle(new BaseComponent[] {subtitle}); + } + + public void showTitle(BaseComponent[] title, BaseComponent[] subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks) { + setTitleTimes(fadeInTicks, stayTicks, fadeOutTicks); + setSubtitle(subtitle); + showTitle(title); + } + + public void showTitle(BaseComponent title, BaseComponent subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks) { + setTitleTimes(fadeInTicks, stayTicks, fadeOutTicks); + setSubtitle(subtitle); + showTitle(title); + } + + public void sendTitle(Title title) { + Preconditions.checkNotNull(title, "Title is null"); + setTitleTimes(title.getFadeIn(), title.getStay(), title.getFadeOut()); + setSubtitle(title.getSubtitle() == null ? new BaseComponent[0] : title.getSubtitle()); + showTitle(title.getTitle()); + } + + public void updateTitle(Title title) { + Preconditions.checkNotNull(title, "Title is null"); + setTitleTimes(title.getFadeIn(), title.getStay(), title.getFadeOut()); + if(title.getSubtitle() != null) { + setSubtitle(title.getSubtitle()); + } + showTitle(title.getTitle()); + } + + public void sendActionBar(BaseComponent[] message) { + if(getHandle().networkHandler == null) return; + // TODO 1.17ify getHandle().networkHandler.sendPacket(new TitleS2CPacket(TitleS2CPacket.Action.TITLE, Text.of(ComponentSerializer.toString(message)), 0, 0, 0)); + } + + public void sendActionBar(String message) { + if(getHandle().networkHandler == null || message == null || message.isEmpty()) return; + // TODO 1.17ifygetHandle().networkHandler.sendPacket(new TitleS2CPacket(TitleS2CPacket.Action.TITLE, CraftChatMessage.fromStringOrNull(message), 0, 0, 0)); + } + + public void sendActionBar(char alternateChar, String message) { + if(message == null || message.isEmpty()) return; + sendActionBar(org.bukkit.ChatColor.translateAlternateColorCodes(alternateChar, message)); + } + + public int getViewDistance() { + throw new NotImplementedException("Was Removed from Paper"); + } + + public void setViewDistance(int viewDistance) { + throw new NotImplementedException("Was Removed from Paper"); + } + // PaperAPI - END + + @Override + public void closeInventory(Reason arg0) { + // TODO Auto-generated method stub + + } + + @Override + public Location getPotentialBedLocation() { + // TODO Auto-generated method stub + return null; + } + + @Override + public InventoryView openAnvil(Location arg0, boolean arg1) { + // TODO Auto-generated method stub + return null; + } + + @Override + public InventoryView openCartographyTable(Location arg0, boolean arg1) { + // TODO Auto-generated method stub + return null; + } + + @Override + public InventoryView openGrindstone(Location arg0, boolean arg1) { + // TODO Auto-generated method stub + return null; + } + + @Override + public InventoryView openLoom(Location arg0, boolean arg1) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void openSign(Sign arg0) { + // TODO Auto-generated method stub + + } + + @Override + public InventoryView openSmithingTable(Location arg0, boolean arg1) { + // TODO Auto-generated method stub + return null; + } + + @Override + public InventoryView openStonecutter(Location arg0, boolean arg1) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Entity releaseLeftShoulderEntity() { + // TODO Auto-generated method stub + return null; + } + + @Override + public Entity releaseRightShoulderEntity() { + // TODO Auto-generated method stub + return null; + } + + @Override + public long getLastLogin() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public long getLastSeen() { + // TODO Auto-generated method stub + return 0; + } - getHandle().networkHandler.sendPacket(new CustomPayloadS2CPacket(new Identifier("register"), new PacketByteBuf(Unpooled.wrappedBuffer(stream.toByteArray())))); - } - } - - @SuppressWarnings("deprecation") - @Override - public void sendPluginMessage(Plugin source, String channel, byte[] message) { - StandardMessenger.validatePluginMessage(Bukkit.getMessenger(), source, channel, message); - if (getHandle().networkHandler == null) return; - - if (channels.contains(channel)) { - channel = StandardMessenger.validateAndCorrectChannel(channel); - CustomPayloadS2CPacket packet = new CustomPayloadS2CPacket(new Identifier(channel), new PacketByteBuf(Unpooled.wrappedBuffer(message))); - getHandle().networkHandler.sendPacket(packet); - } - } - - @Override - public boolean canSee(Player arg0) { - // TODO Auto-generated method stub - return true; - } - - @Override - public void chat(String message) { - ((IMixinPlayNetworkHandler)(Object)nms.networkHandler).chat(message, false); - } - - @Override - public InetSocketAddress getAddress() { - if (nms.networkHandler == null) return null; - - SocketAddress addr = getHandle().networkHandler.getConnectionAddress(); //.connection.getAddress(); - return addr instanceof InetSocketAddress ? (InetSocketAddress) addr : null; - } - - @Override - public org.bukkit.advancement.AdvancementProgress getAdvancementProgress(org.bukkit.advancement.Advancement advancement) { - Preconditions.checkArgument(advancement != null, "advancement"); - - AdvancementImpl craft = (AdvancementImpl) advancement; - PlayerAdvancementTracker data = getHandle().getAdvancementTracker(); - net.minecraft.advancement.AdvancementProgress progress = data.getProgress(craft.getHandle()); - - return new AdvancementProgressImpl(craft, data, progress); - } - - @Override - public boolean getAllowFlight() { - return getHandle().getAbilities().allowFlying; - } - - @Override - public int getClientViewDistance() { - return Bukkit.getViewDistance(); // TODO Get Client view distance not server - } - - @Override - public Location getCompassTarget() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getDisplayName() { - - - return (null == nms.getCustomName()) ? this.getName() : nms.getCustomName().getString(); - } - - @Override - public float getExhaustion() { - return nms.getHungerManager().exhaustion; - } - - @Override - public float getExp() { - return nms.experienceProgress; - } - - @Override - public float getFlySpeed() { - // return nms.airStrafingSpeed; - return (float) getHandle().getAbilities().getFlySpeed() * 2f; - } - - @Override - public int getFoodLevel() { - return nms.getHungerManager().getFoodLevel(); - } - - @Override - public double getHealthScale() { - // TODO Auto-generated method stub - return 20; - } - - @Override - public int getLevel() { - return nms.experienceLevel; - } - - @Override - public String getLocale() { - return "en_US"; // TODO - } - - @Override - public String getPlayerListFooter() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getPlayerListHeader() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getPlayerListName() { - return getHandle().getPlayerListName() == null ? getName() : CraftChatMessage.fromComponent(getHandle().getPlayerListName()); - } - - @Override - public long getPlayerTime() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public long getPlayerTimeOffset() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public WeatherType getPlayerWeather() { - // TODO Auto-generated method stub - return WeatherType.CLEAR; - } - - @Override - public float getSaturation() { - return nms.getHungerManager().getSaturationLevel(); - } - - @Override - public CardboardScoreboard getScoreboard() { - return server.getScoreboardManager().getPlayerBoard(this); - } - - @Override - public Entity getSpectatorTarget() { - net.minecraft.entity.Entity followed = getHandle().getCameraEntity(); - return followed == getHandle() ? null : ((IMixinEntity)followed).getBukkitEntity(); - } - - @Override - public int getTotalExperience() { - return nms.totalExperience; - } - - @Override - public float getWalkSpeed() { - return nms.forwardSpeed; - } - - @Override - public void giveExp(int arg0) { - nms.addExperience(arg0); - } - - @Override - public void giveExpLevels(int arg0) { - nms.addExperienceLevels(arg0); - } - - @Override - public void hidePlayer(Player arg0) { - // TODO Auto-generated method stub - } - - @Override - public void hidePlayer(Plugin arg0, Player arg1) { - // TODO Auto-generated method stub - } - - @Override - public boolean isFlying() { - return nms.getAbilities().flying; - } - - @Override - public boolean isHealthScaled() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isPlayerTimeRelative() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isSleepingIgnored() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isSneaking() { - return nms.isSneaking(); - } - - @Override - public boolean isSprinting() { - return nms.isSprinting(); - } - - @Override - public void kickPlayer(String arg0) { - nms.networkHandler.disconnect(Text.of(arg0)); - } - - @Override - public void loadData() { - ((IMixinMinecraftServer)CraftServer.server).getSaveHandler_BF().loadPlayerData(nms); - } - - @Override - public void openBook(ItemStack book) { - ItemStack hand = getInventory().getItemInMainHand(); - getInventory().setItemInMainHand(book); - getHandle().useBook(org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(book), net.minecraft.util.Hand.MAIN_HAND); - getInventory().setItemInMainHand(hand); - } - - @Override - public boolean performCommand(String arg0) { - return getServer().dispatchCommand(this, arg0); - } - - @Override - public void playEffect(Location loc, Effect effect, int data) { - if (getHandle().networkHandler == null) return; - - int packetData = effect.getId(); - WorldEventS2CPacket packet = new WorldEventS2CPacket(packetData, new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), data, false); - getHandle().networkHandler.sendPacket(packet); - } - - @Override - public void playEffect(Location arg0, Effect arg1, T arg2) { - // TODO Auto-generated method stub - } - - @Override - public void playNote(Location loc, byte instrument, byte note) { - if (getHandle().networkHandler == null) return; - - String name = null; - switch (instrument) { - case 0: - name = "harp"; - break; - case 1: - name = "basedrum"; - break; - case 2: - name = "snare"; - break; - case 3: - name = "hat"; - break; - case 4: - name = "bass"; - break; - case 5: - name = "flute"; - break; - case 6: - name = "bell"; - break; - case 7: - name = "guitar"; - break; - case 8: - name = "chime"; - break; - case 9: - name = "xylophone"; - break; - } + @Override + public int getProtocolVersion() { + // TODO Auto-generated method stub + return GameVersion.INSTANCE.getProtocolVersion(); + } - float f = (float) Math.pow(2.0D, (note - 12.0D) / 12.0D); - // TODO: 1.19 - //getHandle().networkHandler.sendPacket(new PlaySoundS2CPacket(CraftSound.getSoundEffect("block.note_block." + name), net.minecraft.sound.SoundCategory.RECORDS, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), 3.0f, f)); - } - - @SuppressWarnings("deprecation") - @Override - public void playNote(Location loc, Instrument instrument, Note note) { - if (getHandle().networkHandler == null) return; - - String instrumentName = null; - switch (instrument.ordinal()) { - case 0: - instrumentName = "harp"; - break; - case 1: - instrumentName = "basedrum"; - break; - case 2: - instrumentName = "snare"; - break; - case 3: - instrumentName = "hat"; - break; - case 4: - instrumentName = "bass"; - break; - case 5: - instrumentName = "flute"; - break; - case 6: - instrumentName = "bell"; - break; - case 7: - instrumentName = "guitar"; - break; - case 8: - instrumentName = "chime"; - break; - case 9: - instrumentName = "xylophone"; - break; - case 10: - instrumentName = "iron_xylophone"; - break; - case 11: - instrumentName = "cow_bell"; - break; - case 12: - instrumentName = "didgeridoo"; - break; - case 13: - instrumentName = "bit"; - break; - case 14: - instrumentName = "banjo"; - break; - case 15: - instrumentName = "pling"; - break; - case 16: - instrumentName = "xylophone"; - break; - } - float f = (float) Math.pow(2.0D, (note.getId() - 12.0D) / 12.0D); - // TODO: 1.19 - //getHandle().networkHandler.sendPacket(new PlaySoundS2CPacket(CraftSound.getSoundEffect("block.note_block." + instrumentName), net.minecraft.sound.SoundCategory.RECORDS, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), 3.0f, f)); - } - - @Override - public void playSound(Location loc, Sound sound, float volume, float pitch) { - playSound(loc, sound, org.bukkit.SoundCategory.MASTER, volume, pitch); - } - - @Override - public void playSound(Location loc, String sound, float volume, float pitch) { - playSound(loc, sound, org.bukkit.SoundCategory.MASTER, volume, pitch); - } - - @Override - public void playSound(Location loc, Sound sound, org.bukkit.SoundCategory category, float volume, float pitch) { - if (loc == null || sound == null || category == null || getHandle().networkHandler == null) return; - - // TODO: 1.19 - //PlaySoundS2CPacket packet = new PlaySoundS2CPacket(CraftSound.getSoundEffect(CraftSound.getSound(sound)), net.minecraft.sound.SoundCategory.valueOf(category.name()), loc.getX(), loc.getY(), loc.getZ(), volume, pitch); - // getHandle().networkHandler.sendPacket(packet); - } - - @Override - public void playSound(Location loc, String sound, org.bukkit.SoundCategory category, float volume, float pitch) { - if (loc == null || sound == null || category == null || getHandle().networkHandler == null) return; - // TODO: 1.19 - // PlaySoundIdS2CPacket packet = new PlaySoundIdS2CPacket(new Identifier(sound), net.minecraft.sound.SoundCategory.valueOf(category.name()), new Vec3d(loc.getX(), loc.getY(), loc.getZ()), volume, pitch); - // getHandle().networkHandler.sendPacket(packet); - } - - @Override - public void resetPlayerTime() { - // TODO Auto-generated method stub - } - - @Override - public void resetPlayerWeather() { - // TODO Auto-generated method stub - } - - @Override - public void resetTitle() { - nms.networkHandler.sendPacket(new ClearTitleS2CPacket(true)); - } - - @Override - public void saveData() { - ((IMixinMinecraftServer)CraftServer.server).getSaveHandler_BF().savePlayerData(nms); - } - - @Override - public void sendBlockChange(Location loc, BlockData block) { - if (getHandle().networkHandler == null) return; - - BlockUpdateS2CPacket packet = new BlockUpdateS2CPacket(new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), ((CraftBlockData) block).getState()); - getHandle().networkHandler.sendPacket(packet); - } + @Override + public InetSocketAddress getVirtualHost() { + // TODO Auto-generated method stub + return null; + } - @Override - public void sendBlockChange(Location loc, Material material, byte data) { - if (getHandle().networkHandler == null) return; + @Override + public int applyMending(int arg0) { + // TODO Auto-generated method stub + return 0; + } - BlockUpdateS2CPacket packet = new BlockUpdateS2CPacket(new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), CraftMagicNumbers.getBlock(material, data)); - getHandle().networkHandler.sendPacket(packet); - } + @Override + public Firework boostElytra(ItemStack arg0) { + // TODO Auto-generated method stub + return null; + } - // @Override - public boolean sendChunkChange(Location arg0, int arg1, int arg2, int arg3, byte[] arg4) { - throw new NotImplementedException("Also not in Spigot"); - } + @Override + public boolean getAffectsSpawning() { + // TODO Auto-generated method stub + return false; + } - @Override - public void sendExperienceChange(float progress) { - sendExperienceChange(progress, getLevel()); - } + @Override + public String getClientBrandName() { + // TODO Auto-generated method stub + return "Vanilla"; + } - @Override - public void sendExperienceChange(float progress, int level) { - if (getHandle().networkHandler == null) return; + @Override + public T getClientOption(ClientOption arg0) { + // TODO Auto-generated method stub + return null; + } - ExperienceBarUpdateS2CPacket packet = new ExperienceBarUpdateS2CPacket(progress, getTotalExperience(), level); - getHandle().networkHandler.sendPacket(packet); - } + @Override + public float getCooldownPeriod() { + // TODO Auto-generated method stub + return 0; + } - @Override - public void sendMap(MapView map) { - if (getHandle().networkHandler == null) return; + @Override + public float getCooledAttackStrength(float arg0) { + // TODO Auto-generated method stub + return 0; + } - /* 1.19: RenderData data = ((CraftMapView) map).render(this); - Collection icons = new ArrayList(); - for (MapCursor cursor : data.cursors) { - if (cursor.isVisible()) { - icons.add(new MapIcon(MapIcon.Type.byId(cursor.getRawType()), cursor.getX(), cursor.getY(), cursor.getDirection(), CraftChatMessage.fromStringOrNull(cursor.getCaption()))); - } - } + @Override + public PlayerProfile getPlayerProfile() { + // TODO Auto-generated method stub + return null; + } - MapUpdateS2CPacket packet = new MapUpdateS2CPacket(map.getId(), map.getScale().getValue(), map.isLocked(), icons, new MapState.UpdateData(0, 0, 128, 128, data.buffer)); - getHandle().networkHandler.sendPacket(packet); - */ - // TODO 1.17ify - /*if (getHandle().networkHandler == null) return; + @Override + public String getResourcePackHash() { + // TODO Auto-generated method stub + return null; + } - RenderData data = ((MapViewImpl) map).render(this); - Collection icons = new ArrayList(); - for (MapCursor cursor : data.cursors) { - if (cursor.isVisible()) - icons.add(new MapIcon(MapIcon.Type.byId(cursor.getRawType()), cursor.getX(), cursor.getY(), cursor.getDirection(), CraftChatMessage.fromStringOrNull(cursor.getCaption()))); - } + @Override + public Status getResourcePackStatus() { + // TODO Auto-generated method stub + return Status.SUCCESSFULLY_LOADED; + } - MapUpdateS2CPacket packet = new MapUpdateS2CPacket(map.getId(), map.getScale().getValue(), true, map.isLocked(), icons, data.buffer, 0, 0, 128, 128); - getHandle().networkHandler.sendPacket(packet);*/ - } + @Override + public void giveExp(int arg0, boolean arg1) { + // TODO Auto-generated method stub - @Override - public void sendRawMessage(String arg0) { - if (getHandle().networkHandler == null) return; + } - //for (Text component : CraftChatMessage.fromString(arg0)) - // getHandle().networkHandler.sendPacket(new GameMessageS2CPacket(component, MessageType.CHAT, Util.NIL_UUID)); - - for (Text component : CraftChatMessage.fromString(arg0)) { - this.getHandle().sendMessage(component); - } - } - - @Override - public void sendSignChange(Location loc, String[] lines) { - sendSignChange(loc, lines, DyeColor.BLACK); - } - - @Override - public void sendSignChange(Location loc, String[] lines, DyeColor dyeColor) { - if (getHandle().networkHandler == null) return; - if (lines == null) lines = new String[4]; - if (lines.length < 4) - throw new IllegalArgumentException("Must have at least 4 lines"); - - Text[] components = CardboardSign.sanitizeLines(lines); - SignBlockEntity sign = new SignBlockEntity(new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), null); - //sign.setPos(new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); - sign.getFrontText().withColor(net.minecraft.util.DyeColor.byId(dyeColor.getWoolData())); - System.arraycopy(components, 0, ((IMixinSignBlockEntity)sign).getTextBF(), 0, ((IMixinSignBlockEntity)sign).getTextBF().length); - - getHandle().networkHandler.sendPacket(sign.toUpdatePacket()); - } - - @Override - public void sendTitle(String arg0, String arg1) { - sendTitle(arg0, arg1, 10, 70, 20); - } - - @Override - public void sendTitle(String title, String subtitle, int fadeIn, int stay, int fadeOut) { - TitleFadeS2CPacket times = new TitleFadeS2CPacket(fadeIn, stay, fadeOut); - this.getHandle().networkHandler.sendPacket(times); - if (title != null) { - TitleS2CPacket packetTitle = new TitleS2CPacket(CraftChatMessage.fromStringOrNull(title)); - this.getHandle().networkHandler.sendPacket(packetTitle); - } - if (subtitle != null) { - SubtitleS2CPacket packetSubtitle = new SubtitleS2CPacket(CraftChatMessage.fromStringOrNull(subtitle)); - this.getHandle().networkHandler.sendPacket(packetSubtitle); - } - } - - @Override - public void setAllowFlight(boolean arg0) { - if (isFlying() && !arg0) - getHandle().getAbilities().flying = false; - - getHandle().getAbilities().allowFlying = arg0; - getHandle().sendAbilitiesUpdate(); - } - - @Override - public void setCompassTarget(Location arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setDisplayName(String arg0) { - nms.setCustomNameVisible(true); - nms.setCustomName(Text.literal(arg0)); - } - - @Override - public void setExhaustion(float arg0) { - nms.addExhaustion(arg0); - } - - @Override - public void setExp(float arg0) { - nms.setExperiencePoints((int) arg0); - } - - @Override - public void setFlySpeed(float arg0) throws IllegalArgumentException { - // nms.airStrafingSpeed = arg0; - ServerPlayerEntity player = getHandle(); - player.getAbilities().setFlySpeed(arg0 / 2f); - player.sendAbilitiesUpdate(); - } - - @Override - public void setFlying(boolean arg0) { - if (!getAllowFlight() && arg0) - throw new IllegalArgumentException("getAllowFlight() is false, cannot set player flying"); - - getHandle().getAbilities().flying = arg0; - getHandle().sendAbilitiesUpdate(); - } - - @Override - public void setFoodLevel(int arg0) { - nms.getHungerManager().setFoodLevel(arg0); - } - - @Override - public void setHealthScale(double arg0) throws IllegalArgumentException { - // TODO Auto-generated method stub - } - - @Override - public void setHealthScaled(boolean arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setLevel(int level) { - nms.setExperienceLevel(level); - } - - @Override - public void setPlayerListFooter(String arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setPlayerListHeader(String arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setPlayerListHeaderFooter(String arg0, String arg1) { - // TODO Auto-generated method stub - } - - @Override - public void setPlayerListName(String arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setPlayerTime(long arg0, boolean arg1) { - // TODO Auto-generated method stub - } - - @Override - public void setPlayerWeather(WeatherType arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setResourcePack(String url) { - nms.sendResourcePackUrl(url, "null", false, null); - } - - @Override - public void setResourcePack(String url, byte[] hash) { - nms.sendResourcePackUrl(url, new String(hash), false, null); - } - - @Override - public void setSaturation(float arg0) { - nms.getHungerManager().setSaturationLevel(arg0); - } - - @Override - public void setScoreboard(Scoreboard scoreboard) { - ServerPlayNetworkHandler playerConnection = getHandle().networkHandler; - if (playerConnection == null) throw new IllegalStateException("Cannot set scoreboard yet"); - if (((IMixinPlayNetworkHandler)playerConnection).isDisconnected()) - throw new IllegalStateException("Cannot set scoreboard for invalid PlayerImpl"); - - this.server.getScoreboardManager().setPlayerBoard(this, scoreboard); - } - - @Override - public void setSleepingIgnored(boolean arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setSneaking(boolean arg0) { - nms.setSneaking(arg0); - } - - @Override - public void setSpectatorTarget(Entity arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setSprinting(boolean arg0) { - nms.setSprinting(arg0); - } - - @Override - public void setTexturePack(String arg0) { - setResourcePack(arg0); - } - - @Override - public void setTotalExperience(int arg0) { - nms.totalExperience = arg0; - } - - @Override - public void setWalkSpeed(float arg0) throws IllegalArgumentException { - nms.getAbilities().setWalkSpeed(arg0); - } - - @Override - public void showPlayer(Player arg0) { - // TODO Auto-generated method stub - } - - @Override - public void showPlayer(Plugin arg0, Player arg1) { - // TODO Auto-generated method stub - } - - @Override - public void spawnParticle(Particle particle, Location location, int count) { - spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count); - } - - @Override - public void spawnParticle(Particle particle, double x, double y, double z, int count) { - spawnParticle(particle, x, y, z, count, null); - } - - @Override - public void spawnParticle(Particle particle, Location location, int count, T data) { - spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, data); - } - - @Override - public void spawnParticle(Particle particle, double x, double y, double z, int count, T data) { - spawnParticle(particle, x, y, z, count, 0, 0, 0, data); - } - - @Override - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ) { - spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ); - } - - @Override - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) { - spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, null); - } - - @Override - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data) { - spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, data); - } - - @Override - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) { - spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, 1, data); - } - - @Override - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) { - spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra); - } - - @Override - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) { - spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, extra, null); - } - - @Override - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { - spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra, data); - } - - @Override - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { - if (data != null && !particle.getDataType().isInstance(data)) - throw new IllegalArgumentException("data should be " + particle.getDataType() + " got " + data.getClass()); - ParticleS2CPacket packetplayoutworldparticles = new ParticleS2CPacket(CraftParticle.toNMS(particle, data), true, (float) x, (float) y, (float) z, (float) offsetX, (float) offsetY, (float) offsetZ, (float) extra, count); - getHandle().networkHandler.sendPacket(packetplayoutworldparticles); - - } - - @Override - public void stopSound(Sound sound) { - stopSound(sound, null); - } - - @Override - public void stopSound(String sound) { - stopSound(sound, null); - } - - @Override - public void stopSound(Sound sound, org.bukkit.SoundCategory category) { - stopSound(CraftSound.getSound(sound), category); - } - - @Override - public void stopSound(String sound, org.bukkit.SoundCategory category) { - if (getHandle().networkHandler == null) return; - - getHandle().networkHandler.sendPacket(new StopSoundS2CPacket(new Identifier(sound), category == null ? net.minecraft.sound.SoundCategory.MASTER : net.minecraft.sound.SoundCategory.valueOf(category.name()))); - } - - @Override - public void updateCommands() { - if (getHandle().networkHandler == null) return; - - nms.server.getCommandManager().sendCommandTree(nms); - } - - @Override - public void updateInventory() { - this.getHandle().currentScreenHandler.syncState(); - } - - @SuppressWarnings("deprecation") - @Override - public GameMode getGameMode() { - return GameMode.getByValue(getHandle().interactionManager.getGameMode().getId()); - } - - @SuppressWarnings("deprecation") - @Override - public void setGameMode(GameMode mode) { - if (getHandle().networkHandler == null) return; - - if (mode == null) - throw new IllegalArgumentException("GameMode cannot be null"); - - getHandle().changeGameMode(net.minecraft.world.GameMode.byId(mode.getValue())); - } - - public GameProfile getProfile() { - Optional opt = CraftServer.getUC().card_getByUuid(getUniqueId()); - - // TODO Add a GameProfile API to iCommon - return opt.isEmpty() ? null : opt.get(); - } - - @Override - public boolean isOp() { - try { - return CraftServer.server.getPlayerManager().isOperator(getProfile()); - } catch (NullPointerException e) { - try { - return CraftServer.INSTANCE.getOperatorList().contains(getUniqueId().toString()); - } catch (IOException ex) { - GameProfile gp = new GameProfile(super.getUniqueId(), this.getName()); - return CraftServer.server.getPlayerManager().isOperator(gp); - } - } - } + @Override + public boolean hasResourcePack() { + // TODO Auto-generated method stub + return false; + } - @Override - public void setOp(boolean value) { - if (value == isOp()) return; + @Override + public void hideTitle() { + // TODO Auto-generated method stub - if (value) - nms.server.getPlayerManager().addToOperators(nms.getGameProfile()); - else nms.server.getPlayerManager().removeFromOperators(nms.getGameProfile()); + } - perm.recalculatePermissions(); - } + @Override + public void resetCooldown() { + // TODO Auto-generated method stub - @Override - public boolean teleport(Location location, PlayerTeleportEvent.TeleportCause cause) { - Preconditions.checkArgument(location != null, "location"); - Preconditions.checkArgument(location.getWorld() != null, "location.world"); - location.checkFinite(); - ServerPlayerEntity entity = getHandle(); + } - if (getHealth() == 0 || entity.isRemoved() || entity.networkHandler == null || entity.hasPassengers()) - return false; + @Override + public void setAffectsSpawning(boolean arg0) { + // TODO Auto-generated method stub - Location from = this.getLocation(); - Location to = location; + } - PlayerTeleportEvent event = new PlayerTeleportEvent(this, from, to, cause); - Bukkit.getPluginManager().callEvent(event); + @Override + public void setPlayerListHeaderFooter(BaseComponent[] arg0, BaseComponent[] arg1) { + // TODO Auto-generated method stub - if (event.isCancelled()) - return false; + } - entity.stopRiding(); + @Override + public void setPlayerListHeaderFooter(BaseComponent arg0, BaseComponent arg1) { + // TODO Auto-generated method stub - from = event.getFrom(); - to = event.getTo(); + } - ServerWorld toWorld = (ServerWorld) ((WorldImpl) to.getWorld()).getHandle(); + @Override + public void setPlayerProfile(PlayerProfile arg0) { + // TODO Auto-generated method stub - if (getHandle().inventory != getHandle().inventory) - getHandle().closeHandledScreen(); - - System.out.println("Hello! " + from.getWorld() + " / " + to.getWorld()); + } - if (from.getWorld().equals(to.getWorld())) - ((IMixinPlayNetworkHandler)(Object)entity.networkHandler).teleport(to); - else { - //entity.moveToWorld(toWorld); - //entity.teleport - - ((IMixinPlayerManager)(PlayerManager)CraftServer.server.getPlayerManager()).moveToWorld(entity, toWorld, true, to, true); - } + @Override + public @NotNull Component displayName() { + return null; + } - return true; - } + @Override + public void displayName(@Nullable Component arg0) { + // TODO Auto-generated method stub - @Override - public boolean equals(Object obj) { - if (!(obj instanceof OfflinePlayer)) - return false; + } - OfflinePlayer other = (OfflinePlayer) obj; - if ((this.getUniqueId() == null) || (other.getUniqueId() == null)) - return false; + @Override + public int getPing() { + return this.getHandle().networkHandler.getLatency(); + } - boolean uuidEquals = this.getUniqueId().equals(other.getUniqueId()); - boolean idEquals = true; + @Override + public @NotNull Set getTrackedPlayers() { + return Collections.emptySet(); + } - if (other instanceof PlayerImpl) - idEquals = this.getEntityId() == ((PlayerImpl) other).getEntityId(); + @Override + public void kick(@Nullable Component arg0) { + // TODO Auto-generated method stub - return uuidEquals && idEquals; - } + } - public InetSocketAddress getRawAddress_BF() { - if (Bukkit.getPluginManager().isPluginEnabled("ProtocolSupport")) { - System.out.println("PS getRawAddress"); - try { - Class ps = ReflectionRemapper.getClassFromJPL("protocolsupport.zplatform.impl.fabric.FabricMiscUtils"); - HashMap map = (HashMap) ps.getField("rawAddressMap").get(null); - return map.get(this.getAddress()); - } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) { - e.printStackTrace(); - } - } - IMixinPlayNetworkHandler im = (IMixinPlayNetworkHandler) nms.networkHandler; - return (InetSocketAddress) ((IMixinClientConnection) (im.cb_get_connection())).getRawAddress(); - } - - private final Player.Spigot spigot = new Player.Spigot() { - - int err = 0; - - @Override - public InetSocketAddress getRawAddress() { - try { - return getRawAddress_BF(); - } catch (NullPointerException ex) { - // What is going on? - if (err > 3) { - System.exit(0); - return null; - } - err++; - ex.printStackTrace(); - return ((java.net.InetSocketAddress)PlayerImpl.this.getAddress()); - } - } + @Override + public void kick(@Nullable Component arg0, @NotNull Cause arg1) { + // TODO Auto-generated method stub - @Override - public boolean getCollidesWithEntities() { - return PlayerImpl.this.isCollidable(); - } + } - @Override - public void setCollidesWithEntities(boolean collides) { - PlayerImpl.this.setCollidable(collides); - } + @Override + public @NotNull Locale locale() { + // TODO Auto-generated method stub + return Locale.ENGLISH; + } - @Override - public void respawn() { - if (getHealth() <= 0 && isOnline()) - nms.getServer().getPlayerManager().respawnPlayer( getHandle(), false ); - } + @Override + public @Nullable Component playerListFooter() { + // TODO Auto-generated method stub + return null; + } - @Override - public Set getHiddenPlayers() { - return java.util.Collections.emptySet(); - } + @Override + public @Nullable Component playerListHeader() { + // TODO Auto-generated method stub + return null; + } - @Override - public void sendMessage(BaseComponent component) { - sendMessage(new BaseComponent[] { component }); - } + @Override + public @Nullable Component playerListName() { + // TODO Auto-generated method stub + return null; + } - @Override - public void sendMessage(BaseComponent... components) { - if (null == getHandle().networkHandler) return; + @Override + public void playerListName(@Nullable Component arg0) { + // TODO Auto-generated method stub + } - // TODO: 1.19 - //GameMessageS2CPacket packet = new GameMessageS2CPacket(null, MessageType.SYSTEM, nms.getUuid()); - //((IGameMessagePacket)packet).setBungeeComponents(components); - //getHandle().networkHandler.sendPacket(packet); - - getHandle().sendMessage( Text.literal( BaseComponent.toLegacyText(components) ) ); - } + @Override + public void sendBlockDamage(@NotNull Location loc, float progress) { + Preconditions.checkArgument(loc != null, "loc must not be null"); + Preconditions.checkArgument((double) progress >= 0.0 && (double) progress <= 1.0, "progress must be between 0.0 and 1.0 (inclusive)"); + if(this.getHandle().networkHandler == null) { + return; + } + int stage = (int) (9.0f * progress); + BlockBreakingProgressS2CPacket packet = new BlockBreakingProgressS2CPacket(this.getHandle() + .getId(), new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), stage); + this.getHandle().networkHandler.sendPacket(packet); + } - @Override - public void sendMessage(net.md_5.bungee.api.ChatMessageType position, BaseComponent component) { - sendMessage( position, new BaseComponent[] { component } ); - } + @Override + public void sendOpLevel(byte arg0) { + // TODO Auto-generated method stub + } - @Override - public void sendMessage(net.md_5.bungee.api.ChatMessageType position, BaseComponent... components) { - if (null == getHandle().networkHandler) return; + @Override + public void sendSignChange(@NotNull Location arg0, @Nullable List arg1) throws IllegalArgumentException { + // TODO Auto-generated method stub + } - // TODO: 1.19 - - /* GameMessageS2CPacket packet = new GameMessageS2CPacket(null, MessageType.byId((byte) position.ordinal()), nms.getUuid()); - if (position == net.md_5.bungee.api.ChatMessageType.ACTION_BAR) - components = new BaseComponent[]{new net.md_5.bungee.api.chat.TextComponent(BaseComponent.toLegacyText(components))}; - - ((IGameMessagePacket)packet).setBungeeComponents(components); - getHandle().networkHandler.sendPacket(packet);*/ - - getHandle().sendMessage( Text.literal( BaseComponent.toLegacyText(components) ) ); + @Override + public void sendSignChange(@NotNull Location arg0, @Nullable List arg1, @NotNull DyeColor arg2) + throws IllegalArgumentException { + // TODO Auto-generated method stub + } - //getHandle().networkHandler.sendPacket(new GameMessageS2CPacket(components, position == ChatMessageType.ACTION_BAR)); - } - }; - - @Override - public org.bukkit.entity.Player.Spigot spigot() { - return spigot; - } - - @Override - public Location getBedSpawnLocation() { - World world = ((IMixinWorld)getHandle().server.getWorld(getHandle().getSpawnPointDimension())).getWorldImpl(); - BlockPos bed = getHandle().getSpawnPointPosition(); - - if (world != null && bed != null) { - Optional spawnLoc = PlayerEntity.findRespawnPosition((ServerWorld) ((WorldImpl) world).getHandle(), bed, getHandle().getSpawnAngle(), getHandle().isSpawnForced(), true); - if (spawnLoc.isPresent()) { - Vec3d vec = spawnLoc.get(); - return new Location(world, vec.x, vec.y, vec.z); - } - } - return null; - } - - @Override - public void setBedSpawnLocation(Location location) { - setBedSpawnLocation(location, false); - } - - @Override - public void setBedSpawnLocation(Location location, boolean override) { - if (location == null) { - getHandle().setSpawnPoint(null, null, 0, override, false); - } else getHandle().setSpawnPoint(((WorldImpl) location.getWorld()).getHandle().getRegistryKey(), new BlockPos(location.getBlockX(), location.getBlockY(), location.getBlockZ()), location.getYaw(), override, false); - } - - public void setFirstPlayed(long modified) { - // TODO Auto-generated method stub - } - - @Override - public EntityType getType() { - return EntityType.PLAYER; - } - - public void updateScaledHealth() { - // TODO Auto-generated method stub - } - - // SPIGOT-759 - public void sendRawMessage(UUID uuid, String msg) { - this.sendRawMessage(msg); - } - - public void setHandle(ServerPlayerEntity plr) { - this.nms = plr; - super.nms = plr; - } - - // PaperAPI - START - public void setTitleTimes(int fadeInTicks, int stayTicks, int fadeOutTicks) { - // TODO 1.17ify getHandle().networkHandler.sendPacket(new TitleS2CPacket(TitleS2CPacket.Action.TIMES, null, 0, 0, 0)); - } - - public void showTitle(BaseComponent[] title) { - // TODO 1.17ify getHandle().networkHandler.sendPacket(new TitleS2CPacket(TitleS2CPacket.Action.TITLE, Text.of(ComponentSerializer.toString(title)), 0, 0, 0)); - } - - public void setSubtitle(BaseComponent[] subtitle) { - // TODO 1.17ify getHandle().networkHandler.sendPacket(new TitleS2CPacket(TitleS2CPacket.Action.SUBTITLE, Text.of(ComponentSerializer.toString(subtitle)), 0, 0, 0)); - } - - public void showTitle(BaseComponent title) { - showTitle(new BaseComponent[]{title}); - } - - public void setSubtitle(BaseComponent subtitle) { - showTitle(new BaseComponent[]{subtitle}); - } - - public void showTitle(BaseComponent[] title, BaseComponent[] subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks) { - setTitleTimes(fadeInTicks, stayTicks, fadeOutTicks); - setSubtitle(subtitle); - showTitle(title); - } - - public void showTitle(BaseComponent title, BaseComponent subtitle, int fadeInTicks, int stayTicks, int fadeOutTicks) { - setTitleTimes(fadeInTicks, stayTicks, fadeOutTicks); - setSubtitle(subtitle); - showTitle(title); - } - - public void sendTitle(Title title) { - Preconditions.checkNotNull(title, "Title is null"); - setTitleTimes(title.getFadeIn(), title.getStay(), title.getFadeOut()); - setSubtitle(title.getSubtitle() == null ? new BaseComponent[0] : title.getSubtitle()); - showTitle(title.getTitle()); - } - - public void updateTitle(Title title) { - Preconditions.checkNotNull(title, "Title is null"); - setTitleTimes(title.getFadeIn(), title.getStay(), title.getFadeOut()); - if (title.getSubtitle() != null) { - setSubtitle(title.getSubtitle()); - } - showTitle(title.getTitle()); - } - - public void sendActionBar(BaseComponent[] message) { - if (getHandle().networkHandler == null) return; - // TODO 1.17ify getHandle().networkHandler.sendPacket(new TitleS2CPacket(TitleS2CPacket.Action.TITLE, Text.of(ComponentSerializer.toString(message)), 0, 0, 0)); - } - - public void sendActionBar(String message) { - if (getHandle().networkHandler == null || message == null || message.isEmpty()) return; - // TODO 1.17ifygetHandle().networkHandler.sendPacket(new TitleS2CPacket(TitleS2CPacket.Action.TITLE, CraftChatMessage.fromStringOrNull(message), 0, 0, 0)); - } - - public void sendActionBar(char alternateChar, String message) { - if (message == null || message.isEmpty()) return; - sendActionBar(org.bukkit.ChatColor.translateAlternateColorCodes(alternateChar, message)); - } - - public int getViewDistance() { - throw new NotImplementedException("Was Removed from Paper"); - } - - public void setViewDistance(int viewDistance) { - throw new NotImplementedException("Was Removed from Paper"); - } - // PaperAPI - END - - @Override - public void closeInventory(Reason arg0) { - // TODO Auto-generated method stub - - } - - @Override - public Location getPotentialBedLocation() { - // TODO Auto-generated method stub - return null; - } - - @Override - public InventoryView openAnvil(Location arg0, boolean arg1) { - // TODO Auto-generated method stub - return null; - } - - @Override - public InventoryView openCartographyTable(Location arg0, boolean arg1) { - // TODO Auto-generated method stub - return null; - } - - @Override - public InventoryView openGrindstone(Location arg0, boolean arg1) { - // TODO Auto-generated method stub - return null; - } - - @Override - public InventoryView openLoom(Location arg0, boolean arg1) { - // TODO Auto-generated method stub - return null; - } - - @Override - public void openSign(Sign arg0) { - // TODO Auto-generated method stub - - } - - @Override - public InventoryView openSmithingTable(Location arg0, boolean arg1) { - // TODO Auto-generated method stub - return null; - } - - @Override - public InventoryView openStonecutter(Location arg0, boolean arg1) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Entity releaseLeftShoulderEntity() { - // TODO Auto-generated method stub - return null; - } - - @Override - public Entity releaseRightShoulderEntity() { - // TODO Auto-generated method stub - return null; - } - - @Override - public long getLastLogin() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public long getLastSeen() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public int getProtocolVersion() { - // TODO Auto-generated method stub - return GameVersion.INSTANCE.getProtocolVersion(); - } - - @Override - public InetSocketAddress getVirtualHost() { - // TODO Auto-generated method stub - return null; - } - - @Override - public int applyMending(int arg0) { - // TODO Auto-generated method stub - return 0; - } - - @Override - public Firework boostElytra(ItemStack arg0) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean getAffectsSpawning() { - // TODO Auto-generated method stub - return false; - } - - @Override - public String getClientBrandName() { - // TODO Auto-generated method stub - return "Vanilla"; - } - - @Override - public T getClientOption(ClientOption arg0) { - // TODO Auto-generated method stub - return null; - } - - @Override - public float getCooldownPeriod() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public float getCooledAttackStrength(float arg0) { - // TODO Auto-generated method stub - return 0; - } - - @Override - public PlayerProfile getPlayerProfile() { - // TODO Auto-generated method stub - return null; - } - - @Override - public String getResourcePackHash() { - // TODO Auto-generated method stub - return null; - } - - @Override - public Status getResourcePackStatus() { - // TODO Auto-generated method stub - return Status.SUCCESSFULLY_LOADED; - } - - @Override - public void giveExp(int arg0, boolean arg1) { - // TODO Auto-generated method stub - - } - - @Override - public boolean hasResourcePack() { - // TODO Auto-generated method stub - return false; - } - - @Override - public void hideTitle() { - // TODO Auto-generated method stub - - } - - @Override - public void resetCooldown() { - // TODO Auto-generated method stub - - } - - @Override - public void setAffectsSpawning(boolean arg0) { - // TODO Auto-generated method stub - - } - - @Override - public void setPlayerListHeaderFooter(BaseComponent[] arg0, BaseComponent[] arg1) { - // TODO Auto-generated method stub - - } - - @Override - public void setPlayerListHeaderFooter(BaseComponent arg0, BaseComponent arg1) { - // TODO Auto-generated method stub - - } - - @Override - public void setPlayerProfile(PlayerProfile arg0) { - // TODO Auto-generated method stub - - } - - @Override - public void setResourcePack(String arg0, String arg1) { - // TODO Auto-generated method stub - - } - - @Override - public @NotNull Component displayName() { - // TODO Auto-generated method stub - return null; - } - - @Override - public void displayName(@Nullable Component arg0) { - // TODO Auto-generated method stub - - } - - @Override - public int getPing() { - return this.getHandle().pingMilliseconds; - } - - @Override - public @NotNull Set getTrackedPlayers() { - // TODO Auto-generated method stub - return null; - } - - @Override - public void kick(@Nullable Component arg0) { - // TODO Auto-generated method stub - - } - - @Override - public void kick(@Nullable Component arg0, @NotNull Cause arg1) { - // TODO Auto-generated method stub - - } - - @Override - public @NotNull Locale locale() { - // TODO Auto-generated method stub - return Locale.ENGLISH; - } - - @Override - public @Nullable Component playerListFooter() { - // TODO Auto-generated method stub - return null; - } - - @Override - public @Nullable Component playerListHeader() { - // TODO Auto-generated method stub - return null; - } - - @Override - public @Nullable Component playerListName() { - // TODO Auto-generated method stub - return null; - } - - @Override - public void playerListName(@Nullable Component arg0) { - // TODO Auto-generated method stub - } - - @Override - public void sendBlockDamage(@NotNull Location loc, float progress) { - Preconditions.checkArgument(loc != null, "loc must not be null"); - Preconditions.checkArgument((double)progress >= 0.0 && (double)progress <= 1.0, "progress must be between 0.0 and 1.0 (inclusive)"); - if (this.getHandle().networkHandler == null) { - return; - } - int stage = (int)(9.0f * progress); - BlockBreakingProgressS2CPacket packet = new BlockBreakingProgressS2CPacket(this.getHandle().getId(), new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()), stage); - this.getHandle().networkHandler.sendPacket(packet); - } - - @Override - public void sendOpLevel(byte arg0) { - // TODO Auto-generated method stub - } - - @Override - public void sendSignChange(@NotNull Location arg0, @Nullable List arg1) throws IllegalArgumentException { - // TODO Auto-generated method stub - } - - @Override - public void sendSignChange(@NotNull Location arg0, @Nullable List arg1, @NotNull DyeColor arg2) - throws IllegalArgumentException { - // TODO Auto-generated method stub - } - - //public BlockPos posAtLogin; - //public boolean in; + // public BlockPos posAtLogin; + // public boolean in; /* * Save BlockPos from {@link PlayerManager#onPlayerConnect} @@ -1810,71 +1821,59 @@ public void setLoginPos(BlockPos pos) { this.in = nms.isInvulnerable(); }*/ - // 1.17 API Start - - @Override - public boolean breakBlock(@NotNull Block b) { - return nms.interactionManager.tryBreakBlock(new BlockPos(b.getX(), b.getY(), b.getZ())); - } - - @Override - public int getNoTickViewDistance() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public int getSendViewDistance() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public void sendSignChange(@NotNull Location arg0, @Nullable List arg1, @NotNull DyeColor arg2, - boolean arg3) throws IllegalArgumentException { - // TODO Auto-generated method stub - - } - - @Override - public void sendSignChange(@NotNull Location arg0, @Nullable String[] arg1, @NotNull DyeColor arg2, boolean arg3) - throws IllegalArgumentException { - // TODO Auto-generated method stub - - } - - @Override - public void setNoTickViewDistance(int i) { - // TODO Auto-generated method stub - - } - - @Override - public void setResourcePack(@NotNull String arg0, @NotNull String arg1, boolean arg2) { - // TODO Auto-generated method stub - - } - - @Override - public void setResourcePack(@NotNull String arg0, @NotNull String arg1, boolean arg2, @Nullable Component arg3) { - // TODO Auto-generated method stub - this.setResourcePack(arg0, arg1, arg2); - } - - @Override - public void setSendViewDistance(int i) { - // TODO Auto-generated method stub - - } - - @Override - public void stopAllSounds() { - // TODO Auto-generated method stub - - } - - // 1.18.2 api: - + // 1.17 API Start + + @Override + public boolean breakBlock(@NotNull Block b) { + return nms.interactionManager.tryBreakBlock(new BlockPos(b.getX(), b.getY(), b.getZ())); + } + + @Override + public int getNoTickViewDistance() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getSendViewDistance() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void sendSignChange(@NotNull Location arg0, @Nullable List arg1, @NotNull DyeColor arg2, + boolean arg3) throws IllegalArgumentException { + // TODO Auto-generated method stub + + } + + @Override + public void sendSignChange(@NotNull Location arg0, @Nullable String[] arg1, @NotNull DyeColor arg2, boolean arg3) + throws IllegalArgumentException { + // TODO Auto-generated method stub + + } + + @Override + public void setNoTickViewDistance(int i) { + // TODO Auto-generated method stub + + } + + @Override + public void setSendViewDistance(int i) { + // TODO Auto-generated method stub + + } + + @Override + public void stopAllSounds() { + // TODO Auto-generated method stub + + } + + // 1.18.2 api: + @Override public boolean canSee(@NotNull Entity arg0) { // TODO Auto-generated method stub @@ -1902,7 +1901,7 @@ public int getSimulationDistance() { @Override public void hideEntity(@NotNull Plugin arg0, @NotNull Entity arg1) { // TODO Auto-generated method stub - + } @Override @@ -1910,96 +1909,84 @@ public boolean isAllowingServerListings() { // TODO Auto-generated method stub return false; } + @Override + public void setResourcePack(@NotNull String s, @NotNull String s1) { + + } + @Override + public void setResourcePack(@NotNull String s, @NotNull String s1, boolean b) { + + } + @Override + public void setResourcePack(@NotNull String s, @NotNull String s1, boolean b, @Nullable Component component) { + + } @Override public void kick() { // TODO Auto-generated method stub - + } @Override public void playSound(@NotNull Entity arg0, @NotNull Sound arg1, float arg2, float arg3) { // TODO Auto-generated method stub - + } @Override public void playSound(@NotNull Entity arg0, @NotNull Sound arg1, @NotNull SoundCategory arg2, float arg3, - float arg4) { + float arg4) { // TODO Auto-generated method stub - + } @Override public void sendEquipmentChange(@NotNull LivingEntity arg0, @NotNull EquipmentSlot arg1, @NotNull ItemStack arg2) { // TODO Auto-generated method stub - - } - @Override - public void sendHealthUpdate() { - // TODO Auto-generated method stub - } @Override - public void sendHealthUpdate(double arg0, int arg1, float arg2) { + public void sendHealthUpdate() { // TODO Auto-generated method stub - - } - @Override - public void sendMultiBlockChange(@NotNull Map arg0, boolean arg1) { - // TODO Auto-generated method stub - } @Override - public void setResourcePack(@NotNull String arg0, @Nullable byte[] arg1, @Nullable String arg2) { + public void sendHealthUpdate(double arg0, int arg1, float arg2) { // TODO Auto-generated method stub - - } - @Override - public void setResourcePack(@NotNull String arg0, @Nullable byte[] arg1, boolean arg2) { - // TODO Auto-generated method stub - } @Override - public void setResourcePack(@NotNull String arg0, @Nullable byte[] arg1, @Nullable String arg2, boolean arg3) { + public void sendMultiBlockChange(@NotNull Map arg0, boolean arg1) { // TODO Auto-generated method stub - - } - @Override - public void setResourcePack(@NotNull String arg0, byte @Nullable [] arg1, @Nullable Component arg2, boolean arg3) { - // TODO Auto-generated method stub - } @Override public void setSimulationDistance(int arg0) { // TODO Auto-generated method stub - + } @Override public void setWorldBorder(@Nullable WorldBorder arg0) { // TODO Auto-generated method stub - + } @Override public void showDemoScreen() { // TODO Auto-generated method stub - + } @Override public void showEntity(@NotNull Plugin arg0, @NotNull Entity arg1) { // TODO Auto-generated method stub - + } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/inventory/CardboardPlayerInventory.java b/src/main/java/org/cardboardpowered/impl/inventory/CardboardPlayerInventory.java index dfac8ae8..3f541acf 100644 --- a/src/main/java/org/cardboardpowered/impl/inventory/CardboardPlayerInventory.java +++ b/src/main/java/org/cardboardpowered/impl/inventory/CardboardPlayerInventory.java @@ -1,17 +1,12 @@ package org.cardboardpowered.impl.inventory; -import com.javazilla.bukkitfabric.interfaces.IMixinInventory; import com.google.common.base.Preconditions; +import com.javazilla.bukkitfabric.interfaces.IMixinInventory; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket; import net.minecraft.network.packet.s2c.play.UpdateSelectedSlotS2CPacket; import net.minecraft.server.network.ServerPlayerEntity; - -import java.util.HashMap; - import org.apache.commons.lang.Validate; -import org.cardboardpowered.impl.entity.PlayerImpl; -import org.jetbrains.annotations.NotNull; import org.bukkit.craftbukkit.inventory.CraftInventory; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.entity.HumanEntity; @@ -19,6 +14,10 @@ import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.InventoryHolder; import org.bukkit.inventory.ItemStack; +import org.cardboardpowered.impl.entity.PlayerImpl; +import org.jetbrains.annotations.NotNull; + +import java.util.HashMap; public class CardboardPlayerInventory extends CraftInventory implements org.bukkit.inventory.PlayerInventory, EntityEquipment { @@ -367,4 +366,4 @@ public void setDropChance(@NotNull EquipmentSlot arg0, float arg1) { } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardBlastingRecipe.java b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardBlastingRecipe.java index 6d5180dd..e66265b0 100644 --- a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardBlastingRecipe.java +++ b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardBlastingRecipe.java @@ -1,16 +1,14 @@ package org.cardboardpowered.impl.inventory.recipe; +import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; +import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; import org.bukkit.NamespacedKey; import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.inventory.BlastingRecipe; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.RecipeChoice; import org.bukkit.inventory.recipe.CookingBookCategory; -import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; - public class CardboardBlastingRecipe extends BlastingRecipe implements RecipeInterface { public CardboardBlastingRecipe(NamespacedKey key, ItemStack result, RecipeChoice source, float experience, int cookingTime) { @@ -28,7 +26,7 @@ public static CardboardBlastingRecipe fromBukkitRecipe(BlastingRecipe recipe) { @Override public void addToCraftingManager() { ItemStack result = this.getResult(); - ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(new net.minecraft.recipe.BlastingRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), RecipeInterface.getCategory(this.getCategory()), toNMS(this.getInputChoice(), true), CraftItemStack.asNMSCopy(result), getExperience(), getCookingTime())); + ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(getKey(), new net.minecraft.recipe.BlastingRecipe(this.getGroup(), RecipeInterface.getCategory(this.getCategory()), toNMS(this.getInputChoice(), true), CraftItemStack.asNMSCopy(result), getExperience(), getCookingTime())); } // TODO: Update API to 1.19.4 @@ -37,4 +35,4 @@ public CookingBookCategory getCategory() { } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardCampfireRecipe.java b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardCampfireRecipe.java index bbac927b..79995d2e 100644 --- a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardCampfireRecipe.java +++ b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardCampfireRecipe.java @@ -1,16 +1,14 @@ package org.cardboardpowered.impl.inventory.recipe; +import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; +import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; import org.bukkit.NamespacedKey; import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.inventory.CampfireRecipe; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.RecipeChoice; import org.bukkit.inventory.recipe.CookingBookCategory; -import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; - public class CardboardCampfireRecipe extends CampfireRecipe implements RecipeInterface { public CardboardCampfireRecipe(NamespacedKey key, ItemStack result, RecipeChoice source, float experience, int cookingTime) { @@ -28,7 +26,7 @@ public static CardboardCampfireRecipe fromBukkitRecipe(CampfireRecipe recipe) { @Override public void addToCraftingManager() { ItemStack result = this.getResult(); - ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(new net.minecraft.recipe.CampfireCookingRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), RecipeInterface.getCategory(this.getCategory()), toNMS(this.getInputChoice(), true), CraftItemStack.asNMSCopy(result), getExperience(), getCookingTime())); + ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(getKey(), new net.minecraft.recipe.CampfireCookingRecipe(this.getGroup(), RecipeInterface.getCategory(this.getCategory()), toNMS(this.getInputChoice(), true), CraftItemStack.asNMSCopy(result), getExperience(), getCookingTime())); } // TODO: Update API to 1.19.4 @@ -36,4 +34,4 @@ public CookingBookCategory getCategory() { return CookingBookCategory.MISC; } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardComplexRecipe.java b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardComplexRecipe.java index f132f678..65bfbcaf 100644 --- a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardComplexRecipe.java +++ b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardComplexRecipe.java @@ -1,33 +1,32 @@ package org.cardboardpowered.impl.inventory.recipe; +import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; +import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; +import net.minecraft.recipe.RecipeEntry; +import net.minecraft.recipe.SpecialCraftingRecipe; +import net.minecraft.registry.DynamicRegistryManager; import org.bukkit.NamespacedKey; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.inventory.ComplexRecipe; import org.bukkit.inventory.ItemStack; -import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; - -import net.minecraft.recipe.SpecialCraftingRecipe; -import net.minecraft.registry.DynamicRegistryManager; - public class CardboardComplexRecipe implements RecipeInterface, ComplexRecipe { - private final SpecialCraftingRecipe recipe; + private final RecipeEntry recipe; - public CardboardComplexRecipe(SpecialCraftingRecipe recipe) { + public CardboardComplexRecipe(RecipeEntry recipe) { this.recipe = recipe; } @Override public ItemStack getResult() { - return CraftItemStack.asCraftMirror(recipe.getOutput(DynamicRegistryManager.EMPTY)); + return CraftItemStack.asCraftMirror(recipe.value().getResult(DynamicRegistryManager.EMPTY)); } @Override public NamespacedKey getKey() { - return CraftNamespacedKey.fromMinecraft(recipe.getId()); + return CraftNamespacedKey.fromMinecraft(recipe.id()); } @Override @@ -35,4 +34,4 @@ public void addToCraftingManager() { ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(recipe); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardFurnaceRecipe.java b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardFurnaceRecipe.java index 8e4280f4..b0cd029e 100644 --- a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardFurnaceRecipe.java +++ b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardFurnaceRecipe.java @@ -1,16 +1,14 @@ package org.cardboardpowered.impl.inventory.recipe; +import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; +import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; import org.bukkit.NamespacedKey; import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.inventory.FurnaceRecipe; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.RecipeChoice; import org.bukkit.inventory.recipe.CookingBookCategory; -import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; - public class CardboardFurnaceRecipe extends FurnaceRecipe implements RecipeInterface { public CardboardFurnaceRecipe(NamespacedKey key, ItemStack result, RecipeChoice source, float experience, int cookingTime) { @@ -28,7 +26,7 @@ public static CardboardFurnaceRecipe fromBukkitRecipe(FurnaceRecipe recipe) { @Override public void addToCraftingManager() { ItemStack result = this.getResult(); - ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(new net.minecraft.recipe.SmeltingRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), RecipeInterface.getCategory(this.getCategory()), toNMS(this.getInputChoice(), true), CraftItemStack.asNMSCopy(result), getExperience(), getCookingTime())); + ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(getKey(), new net.minecraft.recipe.SmeltingRecipe(this.getGroup(), RecipeInterface.getCategory(this.getCategory()), toNMS(this.getInputChoice(), true), CraftItemStack.asNMSCopy(result), getExperience(), getCookingTime())); } // TODO: Update API to 1.19.4 @@ -36,4 +34,4 @@ public CookingBookCategory getCategory() { return CookingBookCategory.MISC; } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardShapedRecipe.java b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardShapedRecipe.java index 64cd551e..db6c3606 100644 --- a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardShapedRecipe.java +++ b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardShapedRecipe.java @@ -1,21 +1,19 @@ package org.cardboardpowered.impl.inventory.recipe; -import java.util.Map; - +import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; +import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; +import net.minecraft.recipe.Ingredient; +import net.minecraft.util.Identifier; +import net.minecraft.util.collection.DefaultedList; import org.bukkit.NamespacedKey; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.RecipeChoice; import org.bukkit.inventory.ShapedRecipe; -import org.bukkit.inventory.recipe.CookingBookCategory; import org.bukkit.inventory.recipe.CraftingBookCategory; -import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; - -import net.minecraft.recipe.Ingredient; -import net.minecraft.util.collection.DefaultedList; +import java.util.Map; public class CardboardShapedRecipe extends ShapedRecipe implements RecipeInterface { @@ -26,8 +24,8 @@ public CardboardShapedRecipe(NamespacedKey key, ItemStack result) { super(key, result); } - public CardboardShapedRecipe(ItemStack result, net.minecraft.recipe.ShapedRecipe recipe) { - this(CraftNamespacedKey.fromMinecraft(recipe.getId()), result); + public CardboardShapedRecipe(Identifier id, ItemStack result, net.minecraft.recipe.ShapedRecipe recipe) { + this(CraftNamespacedKey.fromMinecraft(id), result); this.recipe = recipe; } @@ -60,7 +58,7 @@ public void addToCraftingManager() { data.set(i * width + j, toNMS(ingred.get(row.charAt(j)), false)); } - ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(new net.minecraft.recipe.ShapedRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), RecipeInterface.getCategory(this.getCategory()), width, shape.length, data, CraftItemStack.asNMSCopy(this.getResult()))); + ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(getKey(), new net.minecraft.recipe.ShapedRecipe(this.getGroup(), RecipeInterface.getCategory(this.getCategory()), width, shape.length, data, CraftItemStack.asNMSCopy(this.getResult()))); } // TODO: Update API to 1.19.4 @@ -68,4 +66,4 @@ public CraftingBookCategory getCategory() { return CraftingBookCategory.MISC; } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardShapelessRecipe.java b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardShapelessRecipe.java index 881b007b..e1179148 100644 --- a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardShapelessRecipe.java +++ b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardShapelessRecipe.java @@ -1,8 +1,9 @@ package org.cardboardpowered.impl.inventory.recipe; -import java.util.List; +import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; +import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; import net.minecraft.recipe.Ingredient; -import net.minecraft.server.MinecraftServer; +import net.minecraft.util.Identifier; import net.minecraft.util.collection.DefaultedList; import org.bukkit.NamespacedKey; import org.bukkit.craftbukkit.inventory.CraftItemStack; @@ -12,8 +13,7 @@ import org.bukkit.inventory.ShapelessRecipe; import org.bukkit.inventory.recipe.CraftingBookCategory; -import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; +import java.util.List; public class CardboardShapelessRecipe extends ShapelessRecipe implements RecipeInterface { @@ -23,8 +23,8 @@ public CardboardShapelessRecipe(NamespacedKey key, ItemStack result) { super(key, result); } - public CardboardShapelessRecipe(ItemStack result, net.minecraft.recipe.ShapelessRecipe recipe) { - this(CraftNamespacedKey.fromMinecraft(recipe.getId()), result); + public CardboardShapelessRecipe(Identifier id, ItemStack result, net.minecraft.recipe.ShapelessRecipe recipe) { + this(CraftNamespacedKey.fromMinecraft(id), result); this.recipe = recipe; } @@ -43,7 +43,7 @@ public void addToCraftingManager() { DefaultedList data = DefaultedList.ofSize(ingred.size(), Ingredient.EMPTY); for (int i = 0; i < ingred.size(); i++) data.set(i, toNMS(ingred.get(i), true)); - ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(new net.minecraft.recipe.ShapelessRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), RecipeInterface.getCategory(this.getCategory()), CraftItemStack.asNMSCopy(this.getResult()), data)); + ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(getKey(), new net.minecraft.recipe.ShapelessRecipe(this.getGroup(), RecipeInterface.getCategory(this.getCategory()), CraftItemStack.asNMSCopy(this.getResult()), data)); } // TODO: Update API to 1.19.4 @@ -51,4 +51,4 @@ public CraftingBookCategory getCategory() { return CraftingBookCategory.MISC; } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardSmithingRecipe.java b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardSmithingRecipe.java index 7679155e..199ff9fc 100644 --- a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardSmithingRecipe.java +++ b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardSmithingRecipe.java @@ -1,15 +1,10 @@ package org.cardboardpowered.impl.inventory.recipe; import org.bukkit.NamespacedKey; -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.RecipeChoice; import org.bukkit.inventory.SmithingRecipe; -import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; - public class CardboardSmithingRecipe extends SmithingRecipe implements RecipeInterface { public CardboardSmithingRecipe(NamespacedKey key, ItemStack result, RecipeChoice base, RecipeChoice addition) { @@ -29,4 +24,4 @@ public void addToCraftingManager() { // ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(new net.minecraft.recipe.LegacySmithingRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), toNMS(this.getBase(), true), toNMS(this.getAddition(), true), CraftItemStack.asNMSCopy(result))); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardSmokingRecipe.java b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardSmokingRecipe.java index 69b7c0fc..46d44e7c 100644 --- a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardSmokingRecipe.java +++ b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardSmokingRecipe.java @@ -1,16 +1,14 @@ package org.cardboardpowered.impl.inventory.recipe; +import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; +import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; import org.bukkit.NamespacedKey; import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.RecipeChoice; import org.bukkit.inventory.SmokingRecipe; import org.bukkit.inventory.recipe.CookingBookCategory; -import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; - public class CardboardSmokingRecipe extends SmokingRecipe implements RecipeInterface { public CardboardSmokingRecipe(NamespacedKey key, ItemStack result, RecipeChoice source, float experience, int cookingTime) { @@ -27,7 +25,7 @@ public static CardboardSmokingRecipe fromBukkitRecipe(SmokingRecipe recipe) { @Override public void addToCraftingManager() { ItemStack result = this.getResult(); - ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(new net.minecraft.recipe.SmokingRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), RecipeInterface.getCategory(this.getCategory()), toNMS(this.getInputChoice(), true), CraftItemStack.asNMSCopy(result), getExperience(), getCookingTime())); + ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(getKey(), new net.minecraft.recipe.SmokingRecipe(this.getGroup(), RecipeInterface.getCategory(this.getCategory()), toNMS(this.getInputChoice(), true), CraftItemStack.asNMSCopy(result), getExperience(), getCookingTime())); } @@ -36,4 +34,4 @@ public CookingBookCategory getCategory() { return CookingBookCategory.MISC; } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardStonecuttingRecipe.java b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardStonecuttingRecipe.java index 9292a1ad..fac484d6 100644 --- a/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardStonecuttingRecipe.java +++ b/src/main/java/org/cardboardpowered/impl/inventory/recipe/CardboardStonecuttingRecipe.java @@ -1,16 +1,13 @@ package org.cardboardpowered.impl.inventory.recipe; -import net.minecraft.server.MinecraftServer; +import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; +import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; import org.bukkit.NamespacedKey; import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.RecipeChoice; import org.bukkit.inventory.StonecuttingRecipe; -import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; - public class CardboardStonecuttingRecipe extends StonecuttingRecipe implements RecipeInterface { public CardboardStonecuttingRecipe(NamespacedKey key, ItemStack result, RecipeChoice source) { @@ -28,7 +25,7 @@ public static CardboardStonecuttingRecipe fromBukkitRecipe(StonecuttingRecipe re @Override public void addToCraftingManager() { ItemStack result = this.getResult(); - ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(new net.minecraft.recipe.StonecuttingRecipe(CraftNamespacedKey.toMinecraft(this.getKey()), this.getGroup(), toNMS(this.getInputChoice(), true), CraftItemStack.asNMSCopy(result))); + ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).addRecipe(getKey(), new net.minecraft.recipe.StonecuttingRecipe(this.getGroup(), toNMS(this.getInputChoice(), true), CraftItemStack.asNMSCopy(result))); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/inventory/recipe/RecipeIterator.java b/src/main/java/org/cardboardpowered/impl/inventory/recipe/RecipeIterator.java index 7b34e71d..5eb9832a 100644 --- a/src/main/java/org/cardboardpowered/impl/inventory/recipe/RecipeIterator.java +++ b/src/main/java/org/cardboardpowered/impl/inventory/recipe/RecipeIterator.java @@ -1,22 +1,21 @@ package org.cardboardpowered.impl.inventory.recipe; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; - -import org.bukkit.inventory.Recipe; - import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; import com.javazilla.bukkitfabric.interfaces.IMixinRecipe; import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; - +import net.minecraft.recipe.RecipeEntry; import net.minecraft.recipe.RecipeType; import net.minecraft.util.Identifier; +import org.bukkit.inventory.Recipe; + +import java.util.Iterator; +import java.util.Map; +import java.util.Map.Entry; public class RecipeIterator implements Iterator { - private final Iterator, Map>>> recipes; - private Iterator> current; + private final Iterator, Map>>> recipes; + private Iterator> current; public RecipeIterator() { this.recipes = ((IMixinRecipeManager)IMixinMinecraftServer.getServer().getRecipeManager()).getRecipes().entrySet().iterator(); @@ -30,7 +29,7 @@ public boolean hasNext() { @Override public Recipe next() { if (current == null || !current.hasNext()) current = recipes.next().getValue().values().iterator(); - return ((IMixinRecipe)current.next()).toBukkitRecipe(); + return ((IMixinRecipe)(Object) current.next()).toBukkitRecipe(); } @Override @@ -39,4 +38,4 @@ public void remove() { current.remove(); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/impl/world/WorldImpl.java b/src/main/java/org/cardboardpowered/impl/world/WorldImpl.java index 6e66b148..86046fec 100644 --- a/src/main/java/org/cardboardpowered/impl/world/WorldImpl.java +++ b/src/main/java/org/cardboardpowered/impl/world/WorldImpl.java @@ -1,131 +1,39 @@ /** * CardboardPowered - Bukkit/Spigot for Fabric * Copyright (C) CardboardPowered.org and contributors - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either + * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.cardboardpowered.impl.world; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Random; -import java.util.Set; -import java.util.UUID; -import java.util.concurrent.CompletableFuture; -import java.util.function.Predicate; - -import org.apache.commons.lang.Validate; -import org.bukkit.BlockChangeDelegate; -import org.bukkit.Bukkit; -import org.bukkit.Chunk; -import org.bukkit.ChunkSnapshot; -import org.bukkit.Difficulty; -import org.bukkit.Effect; -import org.bukkit.FluidCollisionMode; -import org.bukkit.GameEvent; -import org.bukkit.GameRule; -import org.bukkit.HeightMap; -import org.bukkit.Location; -import org.bukkit.Material; -import org.bukkit.NamespacedKey; -import org.bukkit.Particle; -import org.bukkit.Raid; -import org.bukkit.Sound; -import org.bukkit.SoundCategory; -import org.bukkit.StructureType; -import org.bukkit.TreeType; -import org.bukkit.World; -import org.bukkit.WorldBorder; -import org.bukkit.WorldType; -import org.bukkit.block.Biome; -import org.bukkit.block.Block; -import org.bukkit.block.BlockFace; -import org.bukkit.block.BlockState; -import org.bukkit.block.data.BlockData; -import org.bukkit.boss.DragonBattle; -import org.bukkit.craftbukkit.CraftParticle; -import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.craftbukkit.CraftSound; -import org.bukkit.craftbukkit.block.CraftBlock; -import org.bukkit.craftbukkit.block.data.CraftBlockData; -import org.bukkit.craftbukkit.entity.CraftEntity; -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.util.CraftMagicNumbers; -import org.bukkit.entity.*; -import org.bukkit.entity.minecart.CommandMinecart; -import org.bukkit.entity.minecart.ExplosiveMinecart; -import org.bukkit.entity.minecart.HopperMinecart; -import org.bukkit.entity.minecart.PoweredMinecart; -import org.bukkit.entity.minecart.SpawnerMinecart; -import org.bukkit.entity.minecart.StorageMinecart; -import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; -import org.bukkit.event.weather.LightningStrikeEvent; -import org.bukkit.event.world.SpawnChangeEvent; -import org.bukkit.event.world.TimeSkipEvent; -import org.bukkit.generator.BiomeProvider; -import org.bukkit.generator.BlockPopulator; -import org.bukkit.generator.ChunkGenerator; -import org.bukkit.inventory.ItemStack; -import org.bukkit.material.MaterialData; -import org.bukkit.metadata.MetadataStoreBase; -import org.bukkit.metadata.MetadataValue; -import org.bukkit.persistence.PersistentDataContainer; -import org.bukkit.plugin.Plugin; -import org.bukkit.potion.PotionData; -import org.bukkit.potion.PotionType; -import org.bukkit.util.BoundingBox; -import org.bukkit.util.Consumer; -import org.bukkit.util.RayTraceResult; -import org.bukkit.util.Vector; -import org.cardboardpowered.impl.entity.PlayerImpl; -import org.cardboardpowered.impl.util.CardboardFluidRaytraceMode; -import org.cardboardpowered.impl.util.CardboardRayTraceResult; -import org.cardboardpowered.interfaces.IServerWorld; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - import com.destroystokyo.paper.HeightmapType; import com.google.common.base.Preconditions; import com.javazilla.bukkitfabric.Utils; import com.javazilla.bukkitfabric.impl.MetaDataStoreBase; import com.javazilla.bukkitfabric.impl.MetadataStoreImpl; -import org.cardboardpowered.impl.CardboardPotionUtil; import com.javazilla.bukkitfabric.interfaces.IMixinArrowEntity; import com.javazilla.bukkitfabric.interfaces.IMixinChunkHolder; import com.javazilla.bukkitfabric.interfaces.IMixinEntity; import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; import com.javazilla.bukkitfabric.interfaces.IMixinThreadedAnvilChunkStorage; -import org.cardboardpowered.interfaces.IWorldChunk; - import io.papermc.paper.world.MoonPhase; import it.unimi.dsi.fastutil.longs.Long2ObjectLinkedOpenHashMap; import me.isaiah.common.cmixin.IMixinWorld; -// import net.fabricmc.fabric.mixin.structure.StructureFeatureAccessor; import net.minecraft.block.AbstractRedstoneGateBlock; import net.minecraft.block.Blocks; -import net.minecraft.block.ChorusFlowerBlock; import net.minecraft.entity.AreaEffectCloudEntity; -import net.minecraft.entity.EntityData; import net.minecraft.entity.ExperienceOrbEntity; import net.minecraft.entity.FallingBlockEntity; import net.minecraft.entity.ItemEntity; @@ -135,11 +43,8 @@ import net.minecraft.entity.decoration.ArmorStandEntity; import net.minecraft.entity.decoration.ItemFrameEntity; import net.minecraft.entity.decoration.LeashKnotEntity; -import net.minecraft.entity.decoration.painting.PaintingEntity; import net.minecraft.entity.mob.EvokerFangsEntity; -import net.minecraft.entity.mob.MobEntity; import net.minecraft.entity.mob.ZombieEntity; -import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.projectile.FireworkRocketEntity; import net.minecraft.entity.projectile.PersistentProjectileEntity; import net.minecraft.entity.projectile.thrown.EggEntity; @@ -169,154 +74,219 @@ import net.minecraft.util.math.Direction; import net.minecraft.util.math.Vec3d; import net.minecraft.world.GameRules; +import net.minecraft.world.Heightmap.Type; import net.minecraft.world.RaycastContext; import net.minecraft.world.chunk.ChunkStatus; -import net.minecraft.world.chunk.WrapperProtoChunk; import net.minecraft.world.chunk.WorldChunk; +import net.minecraft.world.chunk.WrapperProtoChunk; +import net.minecraft.world.dimension.DimensionTypes; import net.minecraft.world.explosion.Explosion; import net.minecraft.world.gen.feature.ConfiguredFeature; -import net.minecraft.world.gen.feature.ConfiguredFeatures; -// import net.minecraft.world.gen.feature.StructureFeature; +import net.minecraft.world.level.LevelProperties; import net.minecraft.world.level.ServerWorldProperties; +import org.apache.commons.lang.Validate; +import org.bukkit.*; +import org.bukkit.block.Biome; +import org.bukkit.block.Block; +import org.bukkit.block.BlockFace; +import org.bukkit.block.BlockState; +import org.bukkit.block.data.BlockData; +import org.bukkit.boss.DragonBattle; +import org.bukkit.craftbukkit.CraftParticle; +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.craftbukkit.CraftSound; +import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.craftbukkit.block.data.CraftBlockData; +import org.bukkit.craftbukkit.entity.CraftEntity; +import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.craftbukkit.util.CraftMagicNumbers; +import org.bukkit.entity.*; +import org.bukkit.entity.minecart.CommandMinecart; +import org.bukkit.entity.minecart.ExplosiveMinecart; +import org.bukkit.entity.minecart.HopperMinecart; +import org.bukkit.entity.minecart.PoweredMinecart; +import org.bukkit.entity.minecart.SpawnerMinecart; +import org.bukkit.entity.minecart.StorageMinecart; +import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason; +import org.bukkit.event.world.SpawnChangeEvent; +import org.bukkit.event.world.TimeSkipEvent; +import org.bukkit.generator.BiomeProvider; +import org.bukkit.generator.BlockPopulator; +import org.bukkit.generator.ChunkGenerator; +import org.bukkit.inventory.ItemStack; +import org.bukkit.material.MaterialData; +import org.bukkit.metadata.MetadataStoreBase; +import org.bukkit.metadata.MetadataValue; +import org.bukkit.persistence.PersistentDataContainer; +import org.bukkit.plugin.Plugin; +import org.bukkit.potion.PotionData; +import org.bukkit.potion.PotionType; +import org.bukkit.util.BoundingBox; +import org.bukkit.util.Consumer; +import org.bukkit.util.RayTraceResult; +import org.bukkit.util.Vector; +import org.cardboardpowered.impl.CardboardPotionUtil; +import org.cardboardpowered.impl.entity.PlayerImpl; +import org.cardboardpowered.impl.util.CardboardFluidRaytraceMode; +import org.cardboardpowered.impl.util.CardboardRayTraceResult; +import org.cardboardpowered.interfaces.IServerWorld; +import org.cardboardpowered.interfaces.IWorldChunk; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Random; +import java.util.Set; +import java.util.UUID; +import java.util.concurrent.CompletableFuture; +import java.util.function.Predicate; @SuppressWarnings("deprecation") public class WorldImpl implements World { - public static final int CUSTOM_DIMENSION_OFFSET = 10; - private final MetaDataStoreBase blockMetadata = MetadataStoreImpl.newBlockMetadataStore(this); - - private ServerWorld nms; - private String name; - private WorldBorder worldBorder; - private final List populators = new ArrayList(); - - private static final Random rand = new Random(); - - public WorldImpl(String name, ServerWorld world) { - this.nms = world; - this.name = name; - } - - public WorldImpl(ServerWorld world) { - this(((ServerWorldProperties) world.getLevelProperties()).getLevelName(), world); - } - - @Override - public Set getListeningPluginChannels() { - Set result = new HashSet(); - - for (Player player : getPlayers()) - result.addAll(player.getListeningPluginChannels()); - - return result; - } - - @Override - public void sendPluginMessage(Plugin plugin, String channel, byte[] message) { - for (Player player : getPlayers()) - player.sendPluginMessage(plugin, channel, message); - } - - @Override - public void setMetadata(String metadataKey, MetadataValue newMetadataValue) { - CraftServer.INSTANCE.getWorldMetadata().setMetadata(this, metadataKey, newMetadataValue); - } - - @Override - public List getMetadata(String metadataKey) { - return CraftServer.INSTANCE.getWorldMetadata().getMetadata(this, metadataKey); - } - - @Override - public boolean hasMetadata(String metadataKey) { - return CraftServer.INSTANCE.getWorldMetadata().hasMetadata(this, metadataKey); - } - - @Override - public void removeMetadata(String metadataKey, Plugin owningPlugin) { - CraftServer.INSTANCE.getWorldMetadata().removeMetadata(this, metadataKey, owningPlugin); - } - - @Override - public boolean addPluginChunkTicket(int arg0, int arg1, Plugin arg2) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean canGenerateStructures() { - // FIXME BROKEN!!! - return true;//nms.getLevelProperties().hasStructures(); - } - - @Override - public boolean createExplosion(double x, double y, double z, float power) { - return createExplosion(x, y, z, power, false, true); - } - - @Override - public boolean createExplosion(double x, double y, double z, float power, boolean setFire) { - return createExplosion(x, y, z, power, setFire, true); - } - - @Override - public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks) { - return createExplosion(x, y, z, power, setFire, breakBlocks, null); - } - - @Override - public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source) { - nms.createExplosion(source == null ? null : ((CraftEntity) source).getHandle(), x, y, z, power, setFire, breakBlocks ? net.minecraft.world.World.ExplosionSourceType.MOB : net.minecraft.world.World.ExplosionSourceType.NONE); - return true; // TODO return wasCanceled - } - - @Override - public boolean createExplosion(Location loc, float power) { - return createExplosion(loc, power, false); - } - - @Override - public boolean createExplosion(Location loc, float power, boolean setFire) { - return createExplosion(loc, power, setFire, true); - } - - @Override - public boolean createExplosion(Location loc, float power, boolean setFire, boolean breakBlocks) { - return createExplosion(loc, power, setFire, breakBlocks, null); - } - - @Override - public boolean createExplosion(Location loc, float power, boolean setFire, boolean breakBlocks, Entity source) { - Preconditions.checkArgument(loc != null, "Location is null"); - Preconditions.checkArgument(this.equals(loc.getWorld()), "Location not in world"); - - return createExplosion(loc.getX(), loc.getY(), loc.getZ(), power, setFire, breakBlocks, source); - } - - @Override - public Item dropItem(Location loc, ItemStack arg1) { - ItemEntity entity = new ItemEntity(nms, loc.getX(), loc.getY(), loc.getZ(), CraftItemStack.asNMSCopy(arg1)); - entity.pickupDelay = 10; - nms.addEntity(entity); - return (org.bukkit.entity.Item) (((IMixinEntity)entity).getBukkitEntity()); - } - - @Override - public Item dropItemNaturally(Location loc, ItemStack arg1) { - double xs = (nms.random.nextFloat() * 0.5F) + 0.25D; - double ys = (nms.random.nextFloat() * 0.5F) + 0.25D; - double zs = (nms.random.nextFloat() * 0.5F) + 0.25D; - loc = loc.clone(); - loc.setX(loc.getX() + xs); - loc.setY(loc.getY() + ys); - loc.setZ(loc.getZ() + zs); - return dropItem(loc, arg1); - } - - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Override - public boolean generateTree(Location loc, TreeType type) { - BlockPos pos = new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); + public static final int CUSTOM_DIMENSION_OFFSET = 10; + private final MetaDataStoreBase blockMetadata = MetadataStoreImpl.newBlockMetadataStore(this); + + private ServerWorld nms; + private String name; + private WorldBorder worldBorder; + private final List populators = new ArrayList(); + + private static final Random rand = new Random(); + + public WorldImpl(String name, ServerWorld world) { + this.nms = world; + this.name = name; + } + + public WorldImpl(ServerWorld world) { + this(((ServerWorldProperties) world.getLevelProperties()).getLevelName(), world); + } + + @Override + public Set getListeningPluginChannels() { + Set result = new HashSet(); + + for(Player player : getPlayers()) + result.addAll(player.getListeningPluginChannels()); + + return result; + } + + @Override + public void sendPluginMessage(Plugin plugin, String channel, byte[] message) { + for(Player player : getPlayers()) + player.sendPluginMessage(plugin, channel, message); + } + + @Override + public void setMetadata(String metadataKey, MetadataValue newMetadataValue) { + CraftServer.INSTANCE.getWorldMetadata().setMetadata(this, metadataKey, newMetadataValue); + } + + @Override + public List getMetadata(String metadataKey) { + return CraftServer.INSTANCE.getWorldMetadata().getMetadata(this, metadataKey); + } + + @Override + public boolean hasMetadata(String metadataKey) { + return CraftServer.INSTANCE.getWorldMetadata().hasMetadata(this, metadataKey); + } + + @Override + public void removeMetadata(String metadataKey, Plugin owningPlugin) { + CraftServer.INSTANCE.getWorldMetadata().removeMetadata(this, metadataKey, owningPlugin); + } + + @Override + public boolean addPluginChunkTicket(int arg0, int arg1, Plugin arg2) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean canGenerateStructures() { + return nms.getLevelProperties() instanceof LevelProperties prop + && prop.getGeneratorOptions().shouldGenerateStructures(); + } + + @Override + public boolean createExplosion(double x, double y, double z, float power) { + return createExplosion(x, y, z, power, false, true); + } + + @Override + public boolean createExplosion(double x, double y, double z, float power, boolean setFire) { + return createExplosion(x, y, z, power, setFire, true); + } + + @Override + public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks) { + return createExplosion(x, y, z, power, setFire, breakBlocks, null); + } + + @Override + public boolean createExplosion(double x, double y, double z, float power, boolean setFire, boolean breakBlocks, Entity source) { + Explosion explosion = nms.createExplosion(source == null ? null : ((CraftEntity) source).getHandle(), x, y, z, power, setFire, breakBlocks ? net.minecraft.world.World.ExplosionSourceType.MOB : net.minecraft.world.World.ExplosionSourceType.NONE); + return true; // TODO return wasCanceled + } + + @Override + public boolean createExplosion(Location loc, float power) { + return createExplosion(loc, power, false); + } + + @Override + public boolean createExplosion(Location loc, float power, boolean setFire) { + return createExplosion(loc, power, setFire, true); + } + + @Override + public boolean createExplosion(Location loc, float power, boolean setFire, boolean breakBlocks) { + return createExplosion(loc, power, setFire, breakBlocks, null); + } + + @Override + public boolean createExplosion(Location loc, float power, boolean setFire, boolean breakBlocks, Entity source) { + Preconditions.checkArgument(loc != null, "Location is null"); + Preconditions.checkArgument(this.equals(loc.getWorld()), "Location not in world"); + + return createExplosion(loc.getX(), loc.getY(), loc.getZ(), power, setFire, breakBlocks, source); + } + + @Override + public Item dropItem(Location loc, ItemStack arg1) { + ItemEntity entity = new ItemEntity(nms, loc.getX(), loc.getY(), loc.getZ(), CraftItemStack.asNMSCopy(arg1)); + entity.pickupDelay = 10; + nms.addEntity(entity); + return (org.bukkit.entity.Item) (((IMixinEntity) entity).getBukkitEntity()); + } + + @Override + public Item dropItemNaturally(Location loc, ItemStack arg1) { + double xs = (nms.random.nextFloat() * 0.5F) + 0.25D; + double ys = (nms.random.nextFloat() * 0.5F) + 0.25D; + double zs = (nms.random.nextFloat() * 0.5F) + 0.25D; + loc = loc.clone(); + loc.setX(loc.getX() + xs); + loc.setY(loc.getY() + ys); + loc.setZ(loc.getZ() + zs); + return dropItem(loc, arg1); + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + @Override + public boolean generateTree(Location loc, TreeType type) { + BlockPos pos = new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); /*ConfiguredFeature gen; switch (type) { @@ -379,16 +349,16 @@ public boolean generateTree(Location loc, TreeType type) { gen = ConfiguredFeatures.OAK; break; }*/ - // TODO 1.18 + // TODO 1.18 - return false; // TODO 1.17ify: return gen.feature.generate(nms, nms.getChunkManager().getChunkGenerator(), rand, pos, gen.config); - } + return false; // TODO 1.17ify: return gen.feature.generate(nms, nms.getChunkManager().getChunkGenerator(), rand, pos, gen.config); + } - @SuppressWarnings({ "rawtypes", "unchecked" }) - @Override - public boolean generateTree(Location loc, TreeType arg1, BlockChangeDelegate arg2) { - BlockPos pos = new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); - ConfiguredFeature gen = null; + @SuppressWarnings({"rawtypes", "unchecked"}) + @Override + public boolean generateTree(Location loc, TreeType arg1, BlockChangeDelegate arg2) { + BlockPos pos = new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); + ConfiguredFeature gen = null; /*switch (arg1) { case ACACIA: gen = ConfiguredFeatures.ACACIA; @@ -447,2095 +417,2120 @@ public boolean generateTree(Location loc, TreeType arg1, BlockChangeDelegate arg break; }*/ - // TODO 1.18 - // TODO 1.17ify gen.feature.generate(nms, nms.getChunkManager().getChunkGenerator(), rand, pos, gen.config); - return false; - } - - @Override - public boolean getAllowAnimals() { - // TODO Auto-generated method stub - return true; - } - - @Override - public boolean getAllowMonsters() { - // TODO Auto-generated method stub - return true; - } - - @Override - public int getAmbientSpawnLimit() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public int getAnimalSpawnLimit() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public Biome getBiome(int arg0, int arg1) { - return getBiome(arg0, 0, arg1); - } - - @Override - public Biome getBiome(int arg0, int arg1, int arg2) { - try { - return CraftBlock.biomeBaseToBiome(getHandle().getRegistryManager().get(RegistryKeys.BIOME), nms.getBiomeForNoiseGen(arg0 >> 2, arg1 >> 2, arg2 >> 2).value()); - } catch (Exception e) { - return CraftBlock.biomeBaseToBiome(getHandle().getRegistryManager().get(RegistryKeys.BIOME), - (net.minecraft.world.biome.Biome) (Object) nms.getBiomeForNoiseGen(arg0 >> 2, arg1 >> 2, arg2 >> 2)); - } - } - - @Override - public Block getBlockAt(Location loc) { - return getBlockAt(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); - } - - @Override - public Block getBlockAt(int x, int y, int z) { - return CraftBlock.at(nms, new BlockPos(x, y, z)); - } - - @Override - public Chunk getChunkAt(Location arg0) { - return getChunkAt(arg0.getBlockX() >> 4, arg0.getBlockZ() >> 4); - } - - @Override - public Chunk getChunkAt(Block arg0) { - return getChunkAt(arg0.getX() >> 4, arg0.getZ() >> 4); - } - - @Override - public Chunk getChunkAt(int x, int z) { - return ((IWorldChunk)nms.getChunkManager().getWorldChunk(x, z, true)).getBukkitChunk(); - } - - @Override - public Difficulty getDifficulty() { - return Difficulty.valueOf(nms.getDifficulty().getName().toUpperCase()); - } - - @Override - public ChunkSnapshot getEmptyChunkSnapshot(int arg0, int arg1, boolean arg2, boolean arg3) { - return CardboardChunk.getEmptyChunkSnapshot(arg0, arg1, this, arg2, arg3); - } - - @Override - public DragonBattle getEnderDragonBattle() { - // TODO Auto-generated method stub - return null; - } - - @Override - public List getEntities() { - List list = new ArrayList(); - - nms.iterateEntities().forEach(entity -> { - Entity bukkitEntity = ((IMixinEntity)entity).getBukkitEntity(); - if (bukkitEntity != null && bukkitEntity.isValid()) - list.add(bukkitEntity); - }); - - return list; - } - - @SuppressWarnings("unchecked") - @Override - public Collection getEntitiesByClass(Class... arg0) { - return (Collection) getEntitiesByClasses(arg0); - } - - @SuppressWarnings("unchecked") - @Override - public Collection getEntitiesByClass(Class arg0) { - Collection list = new ArrayList(); - - for (Object entity: nms.iterateEntities()) { - if (entity instanceof net.minecraft.entity.Entity) { - Entity bukkitEntity = ((IMixinEntity)(net.minecraft.entity.Entity) entity).getBukkitEntity(); - - if (bukkitEntity == null) - continue; - - Class bukkitClass = bukkitEntity.getClass(); - - if (arg0.isAssignableFrom(bukkitClass) && bukkitEntity.isValid()) - list.add((T) bukkitEntity); - } - } - - return list; - } - - @Override - public Collection getEntitiesByClasses(Class... arg0) { - Collection list = new ArrayList(); - - for (Object entity: nms.iterateEntities()) { - if (entity instanceof net.minecraft.entity.Entity) { - Entity bukkitEntity = ((IMixinEntity)(net.minecraft.entity.Entity) entity).getBukkitEntity(); - - if (bukkitEntity == null) - continue; - - Class bukkitClass = bukkitEntity.getClass(); - - for (Class clazz : arg0) { - if (clazz.isAssignableFrom(bukkitClass)) { - if (bukkitEntity.isValid()) - list.add(bukkitEntity); - break; - } - } - } - } - return list; - } - - @Override - public Environment getEnvironment() { - // TODO Auto-generated method stub - return Environment.NORMAL; - } - - @Override - public Collection getForceLoadedChunks() { - Set chunks = new HashSet<>(); - - for (long coord : nms.getForcedChunks()) - chunks.add(getChunkAt(ChunkPos.getPackedX(coord), ChunkPos.getPackedZ(coord))); - - return Collections.unmodifiableCollection(chunks); - } - - @Override - public long getFullTime() { - return nms.getTimeOfDay(); - } - - @Override - public T getGameRuleDefault(GameRule arg0) { - return convert(arg0, getGameRuleDefinitions().get(arg0.getName()).createRule()); - } - - @Override - public String getGameRuleValue(String arg0) { - // In method contract for some reason - if (arg0 == null) - return null; - - GameRules.Rule value = getHandle().getGameRules().get(getGameRulesNMS().get(arg0)); - return value != null ? value.toString() : ""; - } - - @Override - public T getGameRuleValue(GameRule arg0) { - return convert(arg0, getHandle().getGameRules().get(getGameRulesNMS().get(arg0.getName()))); - } - - private static Map> gamerules; - public static synchronized Map> getGameRulesNMS() { - if (gamerules != null) { - return gamerules; - } - - Map> gamerules = new HashMap<>(); - GameRules.accept(new GameRules.Visitor() { - @Override - public > void visit(GameRules.Key gamerules_gamerulekey, GameRules.Type gamerules_gameruledefinition) { - gamerules.put(gamerules_gamerulekey.getName(), gamerules_gamerulekey); - } - }); - - return WorldImpl.gamerules = gamerules; - } - - private T convert(GameRule rule, GameRules.Rule value) { - if (value == null) - return null; - - if (value instanceof GameRules.BooleanRule) { - return rule.getType().cast(((GameRules.BooleanRule) value).get()); - } else if (value instanceof GameRules.IntRule) { - return rule.getType().cast(value.getCommandResult()); - } else throw new IllegalArgumentException("Invalid GameRule type (" + value + ") for GameRule " + rule.getName()); - } - - private static Map> gameruleDefinitions; - public static synchronized Map> getGameRuleDefinitions() { - if (gameruleDefinitions != null) - return gameruleDefinitions; - - Map> gameruleDefinitions = new HashMap<>(); - GameRules.accept(new GameRules.Visitor() { - @Override - public > void visit(GameRules.Key gamerules_gamerulekey, GameRules.Type gamerules_gameruledefinition) { - gameruleDefinitions.put(gamerules_gamerulekey.getName(), gamerules_gameruledefinition); - } - }); - - return WorldImpl.gameruleDefinitions = gameruleDefinitions; - } - - @Override - public String[] getGameRules() { - return getGameRulesNMS().keySet().toArray(new String[getGameRulesNMS().size()]); - } - - @Override - public ChunkGenerator getGenerator() { - // TODO Auto-generated method stub - return null; - } - - @Override - public Block getHighestBlockAt(Location arg0) { - System.out.println("GET HIGH Y!"); - return getHighestBlockAt(arg0.getBlockX(), arg0.getBlockY()); - } - - @Override - public Block getHighestBlockAt(int x, int z) { - System.out.println("GET HIGH Y!"); - return getBlockAt(x, getHighestBlockYAt(x, z), z); - } - - @Override - public Block getHighestBlockAt(Location arg0, HeightMap arg1) { - System.out.println("GET HIGH Y!"); - return getHighestBlockAt(arg0.getBlockX(), arg0.getBlockY()); - } - - @Override - public Block getHighestBlockAt(int x, int z, org.bukkit.HeightMap heightMap) { - return getBlockAt(x, getHighestBlockYAt(x, z, heightMap), z); - } - - @Override - public int getHighestBlockYAt(Location arg0) { - return getHighestBlockYAt(arg0.getBlockX(), arg0.getBlockZ()); - } - - @Override - public int getHighestBlockYAt(int arg0, int arg1) { - return getHighestBlockYAt(arg0, arg1, HeightMap.MOTION_BLOCKING); - } - - @Override - public int getHighestBlockYAt(Location arg0, HeightMap arg1) { - // TODO Auto-generated method stub - System.out.println("GET HIGH Y!"); - return 0; - } - - @Override - public int getHighestBlockYAt(int x, int z, HeightMap heightMap) { - // TODO Auto-generated method stub - System.out.println("GET HIGH Y!"); - // return getHandle().getChunk(x >> 4, z >> 4).sampleHeightmap(CardboardHeightMap.toNMS(heightMap), x, z); - return 0; - } - - @Override - public double getHumidity(int x, int z) { - return getHumidity(x, 0, z); - } - - @Override - public double getHumidity(int x, int y, int z) { - - // TODO 1.19.4 add AW for - // return nms.getBiomeForNoiseGen(x >> 2, y >> 2, z >> 2).value().weather.downfall(); - - try { - return 0; // nms.getBiomeForNoiseGen(x >> 2, y >> 2, z >> 2).value().getDownfall(); - } catch (Exception e) { - // 1.18.1 - // return ((net.minecraft.world.biome.Biome) (Object) nms.getBiomeForNoiseGen(x >> 2, y >> 2, z >> 2) ).getDownfall(); - } - return 0; - } - - @Override - public boolean getKeepSpawnInMemory() { - // TODO Auto-generated method stub - return false; - } - - @Override - public List getLivingEntities() { - List list = new ArrayList(); - - for (Object o : nms.iterateEntities()) { - if (o instanceof net.minecraft.entity.Entity) { - net.minecraft.entity.Entity mcEnt = (net.minecraft.entity.Entity) o; - Entity bukkitEntity = ((IMixinEntity)mcEnt).getBukkitEntity(); - - // Assuming that bukkitEntity isn't null - if (bukkitEntity != null && bukkitEntity instanceof LivingEntity && bukkitEntity.isValid()) - list.add((LivingEntity) bukkitEntity); - } - } - return list; - } - - @SuppressWarnings("resource") - @Override - public Chunk[] getLoadedChunks() { - Long2ObjectLinkedOpenHashMap chunks = ((IMixinThreadedAnvilChunkStorage)(nms.getChunkManager().threadedAnvilChunkStorage)).getChunkHoldersBF(); - return chunks.values().stream().map(IMixinChunkHolder::getFullChunkNow).filter(Objects::nonNull).map(WorldImpl::getBukkitChunkForChunk).toArray(Chunk[]::new); - } - - private static Chunk getBukkitChunkForChunk(WorldChunk mc) { - return ((IWorldChunk)mc).getBukkitChunk(); - } - - @Override - public int getMaxHeight() { - return nms.getHeight(); - } - - @Override - public int getMonsterSpawnLimit() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public String getName() { - return name; - } - - @Override - public Collection getNearbyEntities(Location location, double x, double y, double z) { - return this.getNearbyEntities(location, x, y, z, null); - } - - @Override - public Collection getNearbyEntities(Location location, double x, double y, double z, Predicate filter) { - BoundingBox aabb = BoundingBox.of(location, x, y, z); - return this.getNearbyEntities(aabb, filter); - } - - @Override - public Collection getNearbyEntities(BoundingBox boundingBox) { - return this.getNearbyEntities(boundingBox, null); - } - - @Override - public Collection getNearbyEntities(BoundingBox boundingBox, Predicate filter) { - Box bb = new Box(boundingBox.getMinX(), boundingBox.getMinY(), boundingBox.getMinZ(), boundingBox.getMaxX(), boundingBox.getMaxY(), boundingBox.getMaxZ()); - List entityList = nms.getOtherEntities((net.minecraft.entity.Entity) null, bb, null); - List bukkitEntityList = new ArrayList(entityList.size()); - - for (net.minecraft.entity.Entity entity : entityList) { - Entity bukkitEntity = ((IMixinEntity)entity).getBukkitEntity(); - if (filter == null || filter.test(bukkitEntity)) - bukkitEntityList.add(bukkitEntity); - } - - return bukkitEntityList; - } - - @Override - public boolean getPVP() { - return nms.getServer().isPvpEnabled(); - } - - @Override - public List getPlayers() { - List list = new ArrayList(nms.getPlayers().size()); - - for (PlayerEntity human : nms.getPlayers()) - if (human instanceof ServerPlayerEntity) - list.add((Player) ((IMixinServerEntityPlayer)human).getBukkitEntity()); - - return list; - } - - @Override - public Map> getPluginChunkTickets() { - // TODO Auto-generated method stub - return null; - } - - @Override - public Collection getPluginChunkTickets(int arg0, int arg1) { - // TODO Auto-generated method stub - return null; - } - - @Override - public List getPopulators() { - return populators; - } - - @Override - public List getRaids() { - // TODO Auto-generated method stub - return null; - } - - @Override - public int getSeaLevel() { - return nms.getSeaLevel(); - } - - @Override - public long getSeed() { - return nms.getSeed(); - } - - @Override - public Location getSpawnLocation() { - BlockPos pos = nms.getSpawnPos(); - return new Location(this, pos.getX(), pos.getY(), pos.getZ()); - } - - @Override - public double getTemperature(int x, int z) { - return getTemperature(x, 0, z); - } - - @Override - public double getTemperature(int x, int y, int z) { - BlockPos pos = new BlockPos(x, y, z); - IMixinWorld icommon = (IMixinWorld) nms; - return icommon.I_get_biome_for_noise_gen(x >> 2, y >> 2, z >> 2).getTemperature(pos); - } - - @Override - public int getThunderDuration() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public long getTicksPerAmbientSpawns() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public long getTicksPerAnimalSpawns() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public long getTicksPerMonsterSpawns() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public long getTicksPerWaterSpawns() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public long getTime() { - return nms.getTime(); - } - - @Override - public UUID getUID() { - return Utils.getWorldUUID(getWorldFolder()); - } - - @Override - public boolean equals(Object obj) { - return (obj == null || getClass() != obj.getClass()) ? false : this.getName().equals(((WorldImpl)obj).getName()); - } - - @Override - public int getWaterAnimalSpawnLimit() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public int getWeatherDuration() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public WorldBorder getWorldBorder() { - if (this.worldBorder == null) - this.worldBorder = new WorldBorderImpl(this); - - return this.worldBorder; - } - - @Override - public File getWorldFolder() { - // FIXME BROKEN - return new File(getName());//((ServerWorld)nms).getSaveHandler().getWorldDir(); - } - - @Override - public WorldType getWorldType() { - return nms.isFlat() ? WorldType.FLAT : WorldType.NORMAL; - } - - @Override - public boolean hasStorm() { - return nms.getLevelProperties().isRaining(); - } - - @Override - public boolean isAutoSave() { - return !nms.isSavingDisabled(); - } - - @Override - public boolean isChunkForceLoaded(int arg0, int arg1) { - return nms.getForcedChunks().contains(ChunkPos.toLong(arg0, arg1)); - } - - @Override - public boolean isChunkGenerated(int x, int z) { - try { - return isChunkLoaded(x, z) || nms.getChunkManager().threadedAnvilChunkStorage.getNbt(new ChunkPos(x, z)) != null; - } catch (Exception ex) { - throw new RuntimeException(ex); - } - } - - @Override - public boolean isChunkInUse(int arg0, int arg1) { - return isChunkLoaded(arg0, arg1); - } - - @Override - public boolean isChunkLoaded(Chunk arg0) { - return isChunkLoaded(arg0.getX(), arg0.getZ()); - } - - @Override - public boolean isChunkLoaded(int x, int z) { - return (null != nms.getChunkManager().getWorldChunk(x, z, false)); - } - - @Override - public boolean isGameRule(String arg0) { - return getGameRulesNMS().containsKey(arg0); - } - - @Override - public boolean isHardcore() { - return nms.getLevelProperties().isHardcore(); - } - - @Override - public boolean isThundering() { - return nms.getLevelProperties().isThundering(); - } - - @Override - public void loadChunk(Chunk arg0) { - loadChunk(arg0.getX(), arg0.getZ()); - } - - @Override - public void loadChunk(int arg0, int arg1) { - loadChunk(arg0, arg1, true); - } - - @Override - public boolean loadChunk(int x, int z, boolean generate) { - net.minecraft.world.chunk.Chunk chunk = nms.getChunkManager().getChunk(x, z, generate ? ChunkStatus.FULL : ChunkStatus.EMPTY, true); - - if (chunk instanceof WrapperProtoChunk) - chunk = nms.getChunkManager().getChunk(x, z, ChunkStatus.FULL, true); - - if (chunk instanceof net.minecraft.world.chunk.WorldChunk) { - nms.getChunkManager().addTicket(ChunkTicketType.START, new ChunkPos(x, z), 1, Unit.INSTANCE); - return true; - } - - return false; - } - - @Override - public Raid locateNearestRaid(Location arg0, int arg1) { - // TODO Auto-generated method stub - return null; - } - - @Override - public Location locateNearestStructure(Location origin, StructureType structureType, int radius, boolean findUnexplored) { - //BlockPos originPos = new BlockPos(origin.getX(), origin.getY(), origin.getZ()); - // FIXME: 1.18.2 - return null; - // BlockPos nearest = this.getHandle().getChunkManager().getChunkGenerator().locateStructure(this.getHandle(), StructureFeature..STRUCTURES.get(structureType.getName()), originPos, radius, findUnexplored); - //return (nearest == null) ? null : new Location(this, nearest.getX(), nearest.getY(), nearest.getZ()); - } - - public void playEffect(Player player, Effect effect, int data) { - this.playEffect(player.getLocation(), effect, data, 0); - } - - @Override - public void playEffect(Location location, Effect effect, int data) { - this.playEffect(location, effect, data, 64); - } - - @Override - public void playEffect(Location loc, Effect effect, T data) { - this.playEffect(loc, effect, data, 64); - } - - @Override - public void playEffect(Location loc, Effect effect, T data, int radius) { - if (data != null) { - Validate.isTrue(effect.getData() != null && effect.getData().isAssignableFrom(data.getClass()), "Wrong kind of data for this effect!"); - } else { - Validate.isTrue(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for this effect!"); - } - int datavalue = 0;//CraftEffect.getDataValue(effect, data); - this.playEffect(loc, effect, datavalue, radius); - } - - @Override - public void playEffect(Location location, Effect effect, int data, int radius) { - Validate.notNull(location, "Location cannot be null"); - Validate.notNull((Object)effect, "Effect cannot be null"); - Validate.notNull(location.getWorld(), "World cannot be null"); - int packetData = effect.getId(); - WorldEventS2CPacket packet = new WorldEventS2CPacket(packetData, new BlockPos(location.getBlockX(), location.getBlockY(), location.getBlockZ()), data, false); - radius *= radius; - for (Player player : this.getPlayers()) { - int distance; - if (((PlayerImpl)player).getHandle().networkHandler == null || !location.getWorld().equals(player.getWorld()) || (distance = (int)player.getLocation().distanceSquared(location)) > radius) continue; - ((PlayerImpl)player).getHandle().networkHandler.sendPacket(packet); - } - } - - - @Override - public void playSound(Location loc, Sound sound, float volume, float pitch) { - playSound(loc, sound, org.bukkit.SoundCategory.MASTER, volume, pitch); - } - - @Override - public void playSound(Location loc, String sound, float volume, float pitch) { - playSound(loc, sound, org.bukkit.SoundCategory.MASTER, volume, pitch); - } - - @Override - public void playSound(Location loc, Sound sound, org.bukkit.SoundCategory category, float volume, float pitch) { - if (loc == null || sound == null || category == null) return; - - double x = loc.getX(); - double y = loc.getY(); - double z = loc.getZ(); - - getHandle().playSound(null, x, y, z, CraftSound.getSoundEffect(CraftSound.getSound(sound)), net.minecraft.sound.SoundCategory.valueOf(category.name()), volume, pitch); - } - - @Override - public void playSound(Location loc, String sound, org.bukkit.SoundCategory category, float volume, float pitch) { - // TODO: 1.19 - - /*if (loc == null || sound == null || category == null) return; - - double x = loc.getX(); - double y = loc.getY(); - double z = loc.getZ(); - - PlaySoundIdS2CPacket packet = new PlaySoundIdS2CPacket(new Identifier(sound), net.minecraft.sound.SoundCategory.valueOf(category.name()), new Vec3d(x, y, z), volume, pitch); - nms.getServer().getPlayerManager().sendToAround(null, x, y, z, volume > 1.0F ? 16.0F * volume : 16.0D, nms.getRegistryKey(), packet); - */} - - @Override - public RayTraceResult rayTrace(Location start, Vector direction, double maxDistance, FluidCollisionMode mode, boolean ignorePassableBlocks, double raySize, Predicate filter) { - RayTraceResult blockHit = this.rayTraceBlocks(start, direction, maxDistance, mode, ignorePassableBlocks); - Vector startVec = null; - double blockHitDistance = maxDistance; - - if (blockHit != null) { - startVec = start.toVector(); - blockHitDistance = startVec.distance(blockHit.getHitPosition()); - } - - RayTraceResult entityHit = this.rayTraceEntities(start, direction, blockHitDistance, raySize, filter); - if (blockHit == null) return entityHit; - if (entityHit == null) return blockHit; - - double entityHitDistanceSquared = startVec.distanceSquared(entityHit.getHitPosition()); - return (entityHitDistanceSquared < (blockHitDistance * blockHitDistance)) ? entityHit : blockHit; - } - - @Override - public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance) { - return this.rayTraceBlocks(start, direction, maxDistance, FluidCollisionMode.NEVER, false); - } - - @Override - public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode) { - return this.rayTraceBlocks(start, direction, maxDistance, fluidCollisionMode, false); - } - - @Override - public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode mode, boolean ignorePassableBlocks) { - Validate.notNull(start, "Start location equals null"); - Validate.isTrue(this.equals(start.getWorld()), "Start location a different world"); - start.checkFinite(); - - Validate.notNull(direction, "Direction equals null"); - direction.checkFinite(); - - Validate.isTrue(direction.lengthSquared() > 0, "Direction's magnitude is 0"); - Validate.notNull(mode, "mode equals null"); - - if (maxDistance < 0.0D) return null; - - Vector dir = direction.clone().normalize().multiply(maxDistance); - Vec3d startPos = new Vec3d(start.getX(), start.getY(), start.getZ()); - Vec3d endPos = new Vec3d(start.getX() + dir.getX(), start.getY() + dir.getY(), start.getZ() + dir.getZ()); - HitResult nmsHitResult = this.getHandle().raycast(new RaycastContext(startPos, endPos, ignorePassableBlocks ? - RaycastContext.ShapeType.COLLIDER : RaycastContext.ShapeType.OUTLINE, CardboardFluidRaytraceMode.toMc(mode), null)); - - return CardboardRayTraceResult.fromNMS(this, nmsHitResult); - } - - @Override - public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance) { - return this.rayTraceEntities(start, direction, maxDistance, null); - } - - @Override - public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize) { - return this.rayTraceEntities(start, direction, maxDistance, raySize, null); - } - - @Override - public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, Predicate filter) { - return this.rayTraceEntities(start, direction, maxDistance, 0.0, filter); - } - - @Override - public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize, Predicate filter) { - Validate.notNull(start, "Start location is null!"); - Validate.isTrue(this.equals(start.getWorld()), "Start location is from different world!"); - start.checkFinite(); - Validate.notNull(direction, "Direction is null!"); - direction.checkFinite(); - Validate.isTrue(direction.lengthSquared() > 0.0, "Direction's magnitude is 0!"); - if (maxDistance < 0.0) { - return null; - } - Vector startPos = start.toVector(); - Vector dir = direction.clone().normalize().multiply(maxDistance); - BoundingBox aabb = BoundingBox.of(startPos, startPos).expandDirectional(dir).expand(raySize); - Collection entities = this.getNearbyEntities(aabb, filter); - Entity nearestHitEntity = null; - RayTraceResult nearestHitResult = null; - double nearestDistanceSq = Double.MAX_VALUE; - for (Entity entity : entities) { - double distanceSq; - BoundingBox boundingBox = entity.getBoundingBox().expand(raySize); - RayTraceResult hitResult = boundingBox.rayTrace(startPos, direction, maxDistance); - if (hitResult == null || !((distanceSq = startPos.distanceSquared(hitResult.getHitPosition())) < nearestDistanceSq)) continue; - nearestHitEntity = entity; - nearestHitResult = hitResult; - nearestDistanceSq = distanceSq; - } - return nearestHitEntity == null ? null : new RayTraceResult(nearestHitResult.getHitPosition(), nearestHitEntity, nearestHitResult.getHitBlockFace()); - } - - @Override - public boolean refreshChunk(int x, int z) { - if (!this.isChunkLoaded(x, z)) return false; - - int px = x << 4; - int pz = z << 4; - - int height = this.getMaxHeight() / 16; - for (int idx = 0; idx < 64; idx++) - this.nms.updateListeners(new BlockPos(px + (idx / height), ((idx % height) * 16), pz), Blocks.AIR.getDefaultState(), Blocks.STONE.getDefaultState(), 3); - this.nms.updateListeners(new BlockPos(px + 15, (height * 16) - 1, pz + 15), Blocks.AIR.getDefaultState(), Blocks.STONE.getDefaultState(), 3); - - return true; - } - - @Override - public boolean regenerateChunk(int arg0, int arg1) { - throw new UnsupportedOperationException("Not supported in Spigot 1.17"); - } - - @Override - public boolean removePluginChunkTicket(int arg0, int arg1, Plugin arg2) { - // TODO Auto-generated method stub - return false; - } - - @Override - public void removePluginChunkTickets(Plugin arg0) { - // TODO Auto-generated method stub - } - - @Override - public void save() { - boolean oldSave = nms.savingDisabled; - nms.savingDisabled = false; - nms.save(null, false, false); - nms.savingDisabled = oldSave; - } - - @Override - public void setAmbientSpawnLimit(int arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setAnimalSpawnLimit(int arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setAutoSave(boolean arg0) { - nms.savingDisabled = !arg0; - } - - @Override - public void setBiome(int arg0, int arg1, Biome arg2) { - for (int y = 0; y < getMaxHeight(); y++) - setBiome(arg0, y, arg1, arg2); - } - - @Override - public void setBiome(int x, int y, int z, Biome bio) { - // TODO Auto-generated method stub - } - - @Override - public void setChunkForceLoaded(int arg0, int arg1, boolean arg2) { - // TODO Auto-generated method stub - } - - @Override - public void setDifficulty(Difficulty diff) { - // FIXME BROKEN - //nms.getLevelProperties().setDifficulty(net.minecraft.world.Difficulty.byOrdinal(diff.ordinal())); - } - - @Override - public void setFullTime(long time) { - TimeSkipEvent event = new TimeSkipEvent(this, TimeSkipEvent.SkipReason.CUSTOM, time - nms.getTimeOfDay()); - CraftServer.INSTANCE.getPluginManager().callEvent(event); - if (event.isCancelled()) - return; - - nms.setTimeOfDay(nms.getTimeOfDay() + event.getSkipAmount()); - - for (Player p : getPlayers()) { - PlayerImpl cp = (PlayerImpl) p; - if (cp.getHandle().networkHandler == null) continue; - - cp.getHandle().networkHandler.sendPacket(new WorldTimeUpdateS2CPacket(cp.getHandle().getWorld().getTime(), cp.getHandle().getWorld().getTime(), cp.getHandle().getWorld().getGameRules().getBoolean(GameRules.DO_DAYLIGHT_CYCLE))); - } - } - - @Override - public boolean setGameRule(GameRule arg0, T arg1) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean setGameRuleValue(String arg0, String arg1) { - // TODO Auto-generated method stub - return false; - } - - @Override - public void setHardcore(boolean arg0) { - // FIXME BROKEN!! - //nms.getLevelProperties().setHardcore(arg0); - } - - @Override - public void setKeepSpawnInMemory(boolean arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setMonsterSpawnLimit(int arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setPVP(boolean arg0) { - nms.getServer().setPvpEnabled(arg0); - } - - @Override - public void setSpawnFlags(boolean arg0, boolean arg1) { - // TODO Auto-generated method stub - } - - @Override - public boolean setSpawnLocation(Location location) { - return equals(location.getWorld()) ? setSpawnLocation(location.getBlockX(), location.getBlockY(), location.getBlockZ()) : false; - } - - @Override - public boolean setSpawnLocation(int x, int y, int z) { - try { - Location previousLocation = getSpawnLocation(); - nms.setSpawnPos(new BlockPos(x, y, z), 0); - - // Notify anyone who's listening. - SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation); - Bukkit.getPluginManager().callEvent(event); - - return true; - } catch (Exception e) { - return false; - } - } - - @Override - public void setStorm(boolean arg0) { - nms.getLevelProperties().setRaining(arg0); - } - - @Override - public void setThunderDuration(int arg0) { - worldProperties().setThunderTime(arg0); - } - - @Override - public void setThundering(boolean arg0) { - worldProperties().setThundering(arg0); - } - - @Override - public void setTicksPerAmbientSpawns(int arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setTicksPerAnimalSpawns(int arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setTicksPerMonsterSpawns(int arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setTicksPerWaterSpawns(int arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setTime(long arg0) { - nms.setTimeOfDay(arg0); - } - - @Override - public void setWaterAnimalSpawnLimit(int arg0) { - // TODO Auto-generated method stub - } - - @Override - public void setWeatherDuration(int arg0) { - worldProperties().setRainTime(arg0); - } - - private ServerWorldProperties worldProperties() { - return ((IServerWorld)nms).cardboard_worldProperties(); - } - - @Override - public T spawn(Location location, Class clazz) throws IllegalArgumentException { - return spawn(location, clazz, null, SpawnReason.CUSTOM); - } - - @Override - public T spawn(Location location, Class clazz, Consumer function) throws IllegalArgumentException { - return spawn(location, clazz, function, SpawnReason.CUSTOM); - } - - public T spawn(Location location, Class clazz, Consumer function, SpawnReason reason) throws IllegalArgumentException { - net.minecraft.entity.Entity entity = createEntity(location, clazz); - - return addEntity(entity, reason, function); - } - - public net.minecraft.entity.Entity createEntity(Location location, Class clazz) throws IllegalArgumentException { - if (location == null || clazz == null) - throw new IllegalArgumentException("Location or entity class cannot be null"); - - net.minecraft.entity.Entity entity = null; - - double x = location.getX(); - double y = location.getY(); - double z = location.getZ(); - float pitch = location.getPitch(); - float yaw = location.getYaw(); - - if (Boat.class.isAssignableFrom(clazz)) { - entity = new BoatEntity(nms, x, y, z); - entity.refreshPositionAndAngles(x, y, z, yaw, pitch); - } else if (FallingBlock.class.isAssignableFrom(clazz)) { - // TODO 1.18.2 - // entity = new FallingBlockEntity(nms, x, y, z, nms.getBlockState(new BlockPos(x, y, z))); - } else if (Projectile.class.isAssignableFrom(clazz)) { - if (Snowball.class.isAssignableFrom(clazz)) { - entity = new SnowballEntity(nms, x, y, z); - } else if (Egg.class.isAssignableFrom(clazz)) { - entity = new EggEntity(nms, x, y, z); - } else if (AbstractArrow.class.isAssignableFrom(clazz)) { - if (TippedArrow.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.ARROW.create(nms); - // TODO set type - } else if (SpectralArrow.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.SPECTRAL_ARROW.create(nms); - } else if (Trident.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.TRIDENT.create(nms); - } else { - entity = net.minecraft.entity.EntityType.ARROW.create(nms); - } - entity.refreshPositionAndAngles(x, y, z, 0, 0); - } else if (ThrownExpBottle.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.EXPERIENCE_BOTTLE.create(nms); - entity.refreshPositionAndAngles(x, y, z, 0, 0); - } else if (EnderPearl.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.ENDER_PEARL.create(nms); - entity.refreshPositionAndAngles(x, y, z, 0, 0); - } else if (ThrownPotion.class.isAssignableFrom(clazz)) { - if (LingeringPotion.class.isAssignableFrom(clazz)) { - entity = new PotionEntity(nms, x, y, z); - ((PotionEntity) entity).setItem(CraftItemStack.asNMSCopy(new ItemStack(org.bukkit.Material.LINGERING_POTION, 1))); - } else { - entity = new PotionEntity(nms, x, y, z); - ((PotionEntity) entity).setItem(CraftItemStack.asNMSCopy(new ItemStack(org.bukkit.Material.SPLASH_POTION, 1))); - } - } else if (Fireball.class.isAssignableFrom(clazz)) { - // TODO Fireball - } else if (ShulkerBullet.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.SHULKER_BULLET.create(nms); - entity.refreshPositionAndAngles(x, y, z, yaw, pitch); - } else if (LlamaSpit.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.LLAMA_SPIT.create(nms); - entity.refreshPositionAndAngles(x, y, z, yaw, pitch); - } else if (Firework.class.isAssignableFrom(clazz)) { - entity = new FireworkRocketEntity(nms, x, y, z, net.minecraft.item.ItemStack.EMPTY); - } - } else if (Minecart.class.isAssignableFrom(clazz)) { - if (PoweredMinecart.class.isAssignableFrom(clazz)) { - entity = new FurnaceMinecartEntity(nms, x, y, z); - } else if (StorageMinecart.class.isAssignableFrom(clazz)) { - entity = new ChestMinecartEntity(nms, x, y, z); - } else if (ExplosiveMinecart.class.isAssignableFrom(clazz)) { - entity = new TntMinecartEntity(nms, x, y, z); - } else if (HopperMinecart.class.isAssignableFrom(clazz)) { - entity = new HopperMinecartEntity(nms, x, y, z); - } else if (SpawnerMinecart.class.isAssignableFrom(clazz)) { - entity = new SpawnerMinecartEntity(nms, x, y, z); - } else if (CommandMinecart.class.isAssignableFrom(clazz)) { - entity = new CommandBlockMinecartEntity(nms, x, y, z); - } else entity = new MinecartEntity(nms, x, y, z); - } else if (EnderSignal.class.isAssignableFrom(clazz)) { - // TODO EnderSignal - } else if (EnderCrystal.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.END_CRYSTAL.create(nms); - entity.refreshPositionAndAngles(x, y, z, 0, 0); - } else if (LivingEntity.class.isAssignableFrom(clazz)) { - if (Chicken.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.CHICKEN.create(nms); - } else if (Cow.class.isAssignableFrom(clazz)) { - if (MushroomCow.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.MOOSHROOM.create(nms); - } else { - entity = net.minecraft.entity.EntityType.COW.create(nms); - } - } else if (Golem.class.isAssignableFrom(clazz)) { - if (Snowman.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.SNOW_GOLEM.create(nms); - } else if (IronGolem.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.IRON_GOLEM.create(nms); - } else if (Shulker.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.SHULKER.create(nms); - } - } else if (Creeper.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.CREEPER.create(nms); - } else if (Ghast.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.GHAST.create(nms); - } else if (Pig.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.PIG.create(nms); - } else if (Player.class.isAssignableFrom(clazz)) { - // need a net server handler for this one - } else if (Sheep.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.SHEEP.create(nms); - } else if (AbstractHorse.class.isAssignableFrom(clazz)) { - if (ChestedHorse.class.isAssignableFrom(clazz)) { - if (Donkey.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.DONKEY.create(nms); - } else if (Mule.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.MULE.create(nms); - } else if (Llama.class.isAssignableFrom(clazz)) { - entity = TraderLlama.class.isAssignableFrom(clazz) ? - net.minecraft.entity.EntityType.TRADER_LLAMA.create(nms) : net.minecraft.entity.EntityType.LLAMA.create(nms); - } - } else if (SkeletonHorse.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.SKELETON_HORSE.create(nms); - } else if (ZombieHorse.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.ZOMBIE_HORSE.create(nms); - } else entity = net.minecraft.entity.EntityType.HORSE.create(nms); - } else if (Skeleton.class.isAssignableFrom(clazz)) { - if (Stray.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.STRAY.create(nms); - } else if (WitherSkeleton.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.WITHER_SKELETON.create(nms); - } else { - entity = net.minecraft.entity.EntityType.SKELETON.create(nms); - } - } else if (Slime.class.isAssignableFrom(clazz)) { - if (MagmaCube.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.MAGMA_CUBE.create(nms); - } else { - entity = net.minecraft.entity.EntityType.SLIME.create(nms); - } - } else if (Spider.class.isAssignableFrom(clazz)) { - if (CaveSpider.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.CAVE_SPIDER.create(nms); - } else { - entity = net.minecraft.entity.EntityType.SPIDER.create(nms); - } - } else if (Squid.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.SQUID.create(nms); - } else if (Tameable.class.isAssignableFrom(clazz)) { - if (Wolf.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.WOLF.create(nms); - } else if (Parrot.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.PARROT.create(nms); - } else if (Cat.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.CAT.create(nms); - } - } else if (PigZombie.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.ZOMBIFIED_PIGLIN.create(nms); - } else if (Zombie.class.isAssignableFrom(clazz)) { - if (Husk.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.HUSK.create(nms); - } else if (ZombieVillager.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.ZOMBIE_VILLAGER.create(nms); - } else if (Drowned.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.DROWNED.create(nms); - } else { - entity = new ZombieEntity(nms); - } - } else if (Giant.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.GIANT.create(nms); - } else if (Silverfish.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.SILVERFISH.create(nms); - } else if (Enderman.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.ENDERMAN.create(nms); - } else if (Blaze.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.BLAZE.create(nms); - } else if (AbstractVillager.class.isAssignableFrom(clazz)) { - if (Villager.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.VILLAGER.create(nms); - } else if (WanderingTrader.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.WANDERING_TRADER.create(nms); - } - } else if (Witch.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.WITCH.create(nms); - } else if (Wither.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.WITHER.create(nms); - } else if (ComplexLivingEntity.class.isAssignableFrom(clazz)) { - if (EnderDragon.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.ENDER_DRAGON.create(nms); - } - } else if (Ambient.class.isAssignableFrom(clazz)) { - if (Bat.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.BAT.create(nms); - } - } else if (Rabbit.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.RABBIT.create(nms); - } else if (Endermite.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.ENDERMITE.create(nms); - } else if (Guardian.class.isAssignableFrom(clazz)) { - if (ElderGuardian.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.ELDER_GUARDIAN.create(nms); - } else { - entity = net.minecraft.entity.EntityType.GUARDIAN.create(nms); - } - } else if (ArmorStand.class.isAssignableFrom(clazz)) { - entity = new ArmorStandEntity(nms, x, y, z); - } else if (PolarBear.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.POLAR_BEAR.create(nms); - } else if (Vex.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.VEX.create(nms); - } else if (Illager.class.isAssignableFrom(clazz)) { - if (Spellcaster.class.isAssignableFrom(clazz)) { - if (Evoker.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.EVOKER.create(nms); - } else if (Illusioner.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.ILLUSIONER.create(nms); - } - } else if (Vindicator.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.VINDICATOR.create(nms); - } else if (Pillager.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.PILLAGER.create(nms); - } - } else if (Turtle.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.TURTLE.create(nms); - } else if (Phantom.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.PHANTOM.create(nms); - } else if (Fish.class.isAssignableFrom(clazz)) { - if (Cod.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.COD.create(nms); - } else if (PufferFish.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.PUFFERFISH.create(nms); - } else if (Salmon.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.SALMON.create(nms); - } else if (TropicalFish.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.TROPICAL_FISH.create(nms); - } - } else if (Dolphin.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.DOLPHIN.create(nms); - } else if (Ocelot.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.OCELOT.create(nms); - } else if (Ravager.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.RAVAGER.create(nms); - } else if (Panda.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.PANDA.create(nms); - } else if (Fox.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.FOX.create(nms); - } else if (Bee.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.BEE.create(nms); - } else if (Hoglin.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.HOGLIN.create(nms); - } else if (Piglin.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.PIGLIN.create(nms); - } else if (PiglinBrute.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.PIGLIN_BRUTE.create(nms); - } else if (Strider.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.STRIDER.create(nms); - } else if (Zoglin.class.isAssignableFrom(clazz)) - entity = net.minecraft.entity.EntityType.ZOGLIN.create(nms); - - if (entity != null) { - entity.updatePositionAndAngles(x, y, z, yaw, pitch); - entity.setHeadYaw(yaw); // SPIGOT-3587 - } - } else if (Hanging.class.isAssignableFrom(clazz)) { - BlockFace face = BlockFace.SELF; - - int width = 16; // 1 full block, also painting smallest size. - int height = 16; // 1 full block, also painting smallest size. - - if (ItemFrame.class.isAssignableFrom(clazz)) { - width = 12; - height = 12; - } else if (LeashHitch.class.isAssignableFrom(clazz)) { - width = 9; - height = 9; - } - - BlockFace[] faces = new BlockFace[]{BlockFace.EAST, BlockFace.NORTH, BlockFace.WEST, BlockFace.SOUTH, BlockFace.UP, BlockFace.DOWN}; - final BlockPos pos = BlockPos.ofFloored(x, y, z); - for (BlockFace dir : faces) { - net.minecraft.block.BlockState nmsBlock = nms.getBlockState(pos.offset(CraftBlock.blockFaceToNotch(dir))); - if (nmsBlock.isSolid() || AbstractRedstoneGateBlock.isRedstoneGate(nmsBlock)) { - // TODO - } - } - - if (LeashHitch.class.isAssignableFrom(clazz)) { - entity = new LeashKnotEntity(nms, BlockPos.ofFloored(x, y, z)); - // TODO 1.17ify entity.teleporting = true; - } else { - // No valid face found - Preconditions.checkArgument(face != BlockFace.SELF, "Cannot spawn hanging entity for %s at %s (no free face)", clazz.getName(), location); - - Direction dir = CraftBlock.blockFaceToNotch(face).getOpposite(); - if (Painting.class.isAssignableFrom(clazz)) { - // TODO: 1.19 - // entity = new PaintingEntity(nms, new BlockPos(x, y, z), dir); - } else if (ItemFrame.class.isAssignableFrom(clazz)) { - entity = new ItemFrameEntity(nms, BlockPos.ofFloored(x, y, z), dir); - } - } - - if (entity != null && !((AbstractDecorationEntity) entity).canStayAttached()) - throw new IllegalArgumentException("Cannot spawn hanging entity for " + clazz.getName() + " at " + location); - } else if (TNTPrimed.class.isAssignableFrom(clazz)) { - entity = new TntEntity(nms, x, y, z, null); - } else if (ExperienceOrb.class.isAssignableFrom(clazz)) { - entity = new ExperienceOrbEntity(nms, x, y, z, 0); - } else if (LightningStrike.class.isAssignableFrom(clazz)) { - entity = net.minecraft.entity.EntityType.LIGHTNING_BOLT.create(nms); - } else if (AreaEffectCloud.class.isAssignableFrom(clazz)) { - entity = new AreaEffectCloudEntity(nms, x, y, z); - } else if (EvokerFangs.class.isAssignableFrom(clazz)) - entity = new EvokerFangsEntity(nms, x, y, z, (float) Math.toRadians(yaw), 0, null); - - if (entity != null) - return entity; - throw new IllegalArgumentException("Cannot spawn an entity for " + clazz.getName()); - } - - public T addEntity(net.minecraft.entity.Entity entity, SpawnReason reason) throws IllegalArgumentException { - return addEntity(entity, reason, null); - } - - @SuppressWarnings("unchecked") - public T addEntity(net.minecraft.entity.Entity entity, SpawnReason reason, Consumer function) throws IllegalArgumentException { - Preconditions.checkArgument(entity != null, "Cannot spawn null entity"); - - //if (entity instanceof MobEntity) - // ((MobEntity) entity).initialize(nms, getHandle().getLocalDifficulty(entity.getBlockPos()), net.minecraft.entity.SpawnReason.COMMAND, (EntityData) null, null); - - if (function != null) - function.accept((T) ((IMixinEntity)entity).getBukkitEntity()); - - nms.addEntity(entity); // TODO spawn reason - return (T) ((IMixinEntity)entity).getBukkitEntity(); - } - - @Override - public Arrow spawnArrow(Location loc, Vector velocity, float speed, float spread) { - return spawnArrow(loc, velocity, speed, spread, Arrow.class); - } - - @SuppressWarnings("unchecked") - @Override - public T spawnArrow(Location loc, Vector velocity, float speed, float spread, Class clazz) { - Validate.notNull(loc, "Cant spawn arrow with a null location"); - Validate.notNull(velocity, "Cant spawn arrow with a null velocity"); - Validate.notNull(clazz, "Cant spawn an arrow with no class"); - - PersistentProjectileEntity arrow; - if (TippedArrow.class.isAssignableFrom(clazz)) { - arrow = net.minecraft.entity.EntityType.ARROW.create(nms); - ((IMixinArrowEntity) arrow).setType(CardboardPotionUtil.fromBukkit(new PotionData(PotionType.WATER, false, false))); - } else if (SpectralArrow.class.isAssignableFrom(clazz)) { - arrow = net.minecraft.entity.EntityType.SPECTRAL_ARROW.create(nms); - } else if (Trident.class.isAssignableFrom(clazz)) { - arrow = net.minecraft.entity.EntityType.TRIDENT.create(nms); - } else arrow = net.minecraft.entity.EntityType.ARROW.create(nms); - - arrow.refreshPositionAndAngles(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch()); - arrow.setVelocity(velocity.getX(), velocity.getY(), velocity.getZ(), speed, spread); - nms.spawnEntity(arrow); - return (T) ((IMixinEntity)arrow).getBukkitEntity(); - } - - @Override - public Entity spawnEntity(Location loc, EntityType entityType) { - return spawn(loc, entityType.getEntityClass()); - } - - @Override - public FallingBlock spawnFallingBlock(Location location, MaterialData data) throws IllegalArgumentException { - Validate.notNull(data, "MaterialData cannot be null"); - return spawnFallingBlock(location, data.getItemType(), data.getData()); - } - - @Override - public FallingBlock spawnFallingBlock(Location location, BlockData data) throws IllegalArgumentException { - Validate.notNull(location, "Location cannot be null"); - Validate.notNull(data, "Material cannot be null"); - - //FallingBlockEntity entity = new FallingBlockEntity(nms, location.getX(), location.getY(), location.getZ(), ((CraftBlockData) data).getState()); - FallingBlockEntity entity = FallingBlockEntity.spawnFromBlock(nms, BlockPos.ofFloored(location.getX(), location.getY(), location.getZ()), ((CraftBlockData) data).getState()); - entity.timeFalling = 1; - - nms.addEntity(entity/*, SpawnReason.CUSTOM*/); - return (FallingBlock) ((IMixinEntity)entity).getBukkitEntity(); - } - - @Override - public FallingBlock spawnFallingBlock(Location location, org.bukkit.Material material, byte data) throws IllegalArgumentException { - Validate.notNull(location, "Location cannot be null"); - Validate.notNull(material, "Material cannot be null"); - Validate.isTrue(material.isBlock(), "Material must be a block"); - - // TODO 1.18.1 / 1.18.2 - FallingBlockEntity entity = FallingBlockEntity.spawnFromBlock(nms, BlockPos.ofFloored(location.getX(), location.getY(), location.getZ()), CraftMagicNumbers.getBlock(material).getDefaultState()); - //FallingBlockEntity entity = new FallingBlockEntity(nms, location.getX(), location.getY(), location.getZ(), CraftMagicNumbers.getBlock(material).getDefaultState()); - entity.timeFalling = 1; - - nms.addEntity(entity/*, SpawnReason.CUSTOM*/); - return (FallingBlock) ((IMixinEntity)entity).getBukkitEntity(); - } - - @Override - public void spawnParticle(Particle particle, Location location, int count) { - spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count); - } - - @Override - public void spawnParticle(Particle particle, double x, double y, double z, int count) { - spawnParticle(particle, x, y, z, count, null); - } - - @Override - public void spawnParticle(Particle particle, Location location, int count, T data) { - spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, data); - } - - @Override - public void spawnParticle(Particle particle, double x, double y, double z, int count, T data) { - spawnParticle(particle, x, y, z, count, 0, 0, 0, data); - } - - @Override - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ) { - spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ); - } - - @Override - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) { - spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, null); - } - - @Override - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data) { - spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, data); - } - - @Override - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) { - spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, 1, data); - } - - @Override - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) { - spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra); - } - - @Override - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) { - spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, extra, null); - } - - @Override - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { - spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra, data); - } - - @Override - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { - spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, false); - } - - @Override - public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { - spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra, data, force); - } - - @Override - public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { - if (data != null && !particle.getDataType().isInstance(data)) - throw new IllegalArgumentException("data should be " + particle.getDataType() + " got " + data.getClass()); - // TODO Bukkit4Fabric: method - getHandle().addParticle( - //null, // Sender - CraftParticle.toNMS(particle, data), // Particle - x, y, z, // Position - (double)count, // Count - offsetX, offsetY//, offsetZ // Random offset - //extra // Speed? - //force - ); - } - - @Override - public LightningStrike strikeLightning(Location loc) { - LightningEntity lightning = net.minecraft.entity.EntityType.LIGHTNING_BOLT.create(nms); - lightning.refreshPositionAfterTeleport(loc.getX(), loc.getY(), loc.getZ()); - // nms.strikeLightning(lightning); - return (LightningStrike) ((IMixinEntity) lightning).getBukkitEntity(); - } - - @Override - public LightningStrike strikeLightningEffect(Location arg0) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean unloadChunk(Chunk chunk) { - return unloadChunk(chunk.getX(), chunk.getZ()); - } - - @Override - public boolean unloadChunk(int x, int z) { - return unloadChunk(x, z, true); - } - - @Override - public boolean unloadChunk(int x, int z, boolean save) { - return unloadChunk0(x, z, save); - } - - private boolean unloadChunk0(int x, int z, boolean save) { - net.minecraft.world.chunk.WorldChunk chunk = nms.getChunk(x, z); - - //chunk.mustNotSave = !save; - unloadChunkRequest(x, z); - - nms.getChunkManager().executeQueuedTasks(); - return !isChunkLoaded(x, z); - } - - - @Override - public boolean unloadChunkRequest(int arg0, int arg1) { - // TODO Auto-generated method stub - return false; - } - - public ServerWorld getHandle() { - return nms; - } - - @Override - public int getViewDistance() { - // TODO Auto-generated method stub - return 8; - } - - public void setWaterAmbientSpawnLimit(int i) { - // TODO Auto-generated method stub - } - - @Override - public Spigot spigot() { - return new Spigot() { - // TODO Auto-generated method stub - }; - } - - public MetadataStoreBase getBlockMetadata() { - return blockMetadata; - } - - @Override - public long getTicksPerWaterAmbientSpawns() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public int getWaterAmbientSpawnLimit() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public void setTicksPerWaterAmbientSpawns(int arg0) { - // TODO Auto-generated method stub - } - - @Override - public boolean setSpawnLocation(int x, int y, int z, float angle) { - try { - Location previousLocation = getSpawnLocation(); - nms.setSpawnPos(new BlockPos(x, y, z), angle); - - SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation); - CraftServer.INSTANCE.getPluginManager().callEvent(event); - - return true; - } catch (Exception e) { - return false; - } - } - - @Override - public boolean createExplosion(Entity arg0, Location arg1, float arg2, boolean arg3, boolean arg4) { - // TODO Auto-generated method stub - return false; - } - - @Override - public CompletableFuture getChunkAtAsync(int arg0, int arg1, boolean arg2, boolean arg3) { - Chunk c = this.getChunkAt(arg0, arg1); - return CompletableFuture.completedFuture(c); - } - - @Override - public int getChunkCount() { - return nms.getChunkManager().getTotalChunksLoadedCount(); - } - - @Override - public int getClearWeatherDuration() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public Entity getEntity(UUID arg0) { - return ((IMixinEntity)nms.getEntity(arg0)).getBukkitEntity(); - } - - @Override - public int getEntityCount() { - return (int)nms.iterateEntities().spliterator().getExactSizeIfKnown();//.entitiesByUuid.size(); - } - - @Override - public int getHighestBlockYAt(int arg0, int arg1, HeightmapType arg2) throws UnsupportedOperationException { - return this.getHighestBlockYAt(arg0, arg1); - } - - @Override - public MoonPhase getMoonPhase() { - return MoonPhase.getPhase(nms.getLunarTime()); - } - - @Override - public int getNoTickViewDistance() { - return 0; - } - - @Override - public int getPlayerCount() { - return nms.getPlayers().size(); - } - - @Override - public int getTickableTileEntityCount() { - return 0; // TODO: 1.17ify return nms.tickingBlockEntities.size(); - } - - @Override - public int getTileEntityCount() { - return 0; // TODO: 1.17ify return nms.blockEntities.size(); - } - - @Override - public boolean isClearWeather() { - return !nms.isRaining(); - } - - @Override - public boolean isDayTime() { - return nms.isDay(); - } - - @Override - public void setClearWeatherDuration(int arg0) { - nms.setWeather(arg0, 0, false, false); - } - - @Override - public void setNoTickViewDistance(int arg0) { - // TODO Auto-generated method stub - - } - - @Override - public void setViewDistance(int arg0) { - // TODO Auto-generated method stub - } - - @Override - public void spawnParticle(Particle arg0, List arg1, Player arg2, double arg3, double arg4, double arg5, - int arg6, double arg7, double arg8, double arg9, double arg10, T arg11, boolean arg12) { - // TODO Auto-generated method stub - } - - @Override - public boolean doesBedWork() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean doesRespawnAnchorWork() { - // TODO Auto-generated method stub - return false; - } - - @Override - public @NotNull Item dropItem(@NotNull Location arg0, @NotNull ItemStack arg1, @Nullable Consumer arg2) { - // TODO Auto-generated method stub - return null; - } - - @Override - public @NotNull Item dropItemNaturally(@NotNull Location arg0, @NotNull ItemStack arg1, - @Nullable Consumer arg2) { - // TODO Auto-generated method stub - return null; - } - - @Override - public double getCoordinateScale() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public long getGameTime() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public @NotNull Collection getInfiniburn() { - // TODO Auto-generated method stub - return null; - } - - @Override - public @NotNull NamespacedKey getKey() { - // TODO Auto-generated method stub - return NamespacedKey.minecraft(this.getName()); - } - - @Override - public int getMinHeight() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public boolean hasBedrockCeiling() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean hasRaids() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean hasSkylight() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isFixedTime() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isNatural() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isPiglinSafe() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isUltrawarm() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean lineOfSightExists(@NotNull Location arg0, @NotNull Location arg1) { - // TODO Auto-generated method stub - return false; - } - - @Override - public @Nullable Location locateNearestBiome(@NotNull Location arg0, @NotNull Biome arg1, int arg2) { - // TODO Auto-generated method stub - return null; - } - - @Override - public @Nullable Location locateNearestBiome(@NotNull Location arg0, @NotNull Biome arg1, int arg2, int arg3) { - // TODO Auto-generated method stub - return null; - } - - @Override - public boolean generateTree(@NotNull Location arg0, @NotNull Random arg1, @NotNull TreeType arg2) { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean generateTree(@NotNull Location arg0, @NotNull Random arg1, @NotNull TreeType arg2, - @Nullable Consumer arg3) { - // TODO Auto-generated method stub - return false; - } - - @Override - public @NotNull Biome getBiome(@NotNull Location arg0) { - // TODO Auto-generated method stub - return null; - } - - @Override - public @NotNull BlockData getBlockData(@NotNull Location arg0) { - // TODO Auto-generated method stub - return null; - } - - @Override - public @NotNull BlockData getBlockData(int arg0, int arg1, int arg2) { - // TODO Auto-generated method stub - return null; - } - - @Override - public @NotNull BlockState getBlockState(@NotNull Location arg0) { - // TODO Auto-generated method stub - return null; - } - - @Override - public @NotNull BlockState getBlockState(int arg0, int arg1, int arg2) { - // TODO Auto-generated method stub - return null; - } - - @Override - public @NotNull Material getType(@NotNull Location arg0) { - // TODO Auto-generated method stub - return null; - } - - @Override - public @NotNull Material getType(int arg0, int arg1, int arg2) { - // TODO Auto-generated method stub - return null; - } - - @Override - public void setBiome(@NotNull Location arg0, @NotNull Biome arg1) { - // TODO Auto-generated method stub - - } - - @Override - public void setBlockData(@NotNull Location arg0, @NotNull BlockData arg1) { - // TODO Auto-generated method stub - - } - - @Override - public void setBlockData(int arg0, int arg1, int arg2, @NotNull BlockData arg3) { - // TODO Auto-generated method stub - - } - - @Override - public void setType(@NotNull Location arg0, @NotNull Material arg1) { - // TODO Auto-generated method stub - - } - - @Override - public void setType(int arg0, int arg1, int arg2, @NotNull Material arg3) { - // TODO Auto-generated method stub - - } - - @Override - public @NotNull T spawn(@NotNull Location arg0, @NotNull Class arg1, boolean arg2, - @Nullable Consumer arg3) throws IllegalArgumentException { - // TODO Auto-generated method stub - return null; - } - - @Override - public @NotNull Entity spawnEntity(@NotNull Location arg0, @NotNull EntityType arg1, boolean arg2) { - // TODO Auto-generated method stub - return null; - } - - @Override - public @Nullable Location findLightningRod(@NotNull Location arg0) { - // TODO Auto-generated method stub - return null; - } - - @Override - public @Nullable Location findLightningTarget(@NotNull Location arg0) { - // TODO Auto-generated method stub - return null; - } - - @Override - public @Nullable BiomeProvider getBiomeProvider() { - // TODO Auto-generated method stub - return null; - } - - @Override - public int getLogicalHeight() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public int getSendViewDistance() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public long getTicksPerWaterUndergroundCreatureSpawns() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public int getWaterUndergroundCreatureSpawnLimit() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public boolean hasCeiling() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean hasSkyLight() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isBedWorks() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isRespawnAnchorWorks() { - // TODO Auto-generated method stub - return false; - } - - @Override - public boolean isUltraWarm() { - // TODO Auto-generated method stub - return false; - } - - @Override - public void sendGameEvent(@Nullable Entity arg0, @NotNull GameEvent arg1, @NotNull Vector arg2) { - // TODO Auto-generated method stub - } - - @Override - public void setSendViewDistance(int i) { - // TODO Auto-generated method stub - - } - - @Override - public void setTicksPerWaterUndergroundCreatureSpawns(int i) { - // TODO Auto-generated method stub - - } - - @Override - public void setWaterUndergroundCreatureSpawnLimit(int i) { - // TODO Auto-generated method stub - - } - - // 1.18.2 API: - - @Override - public boolean generateTree(@NotNull Location arg0, @NotNull Random arg1, @NotNull TreeType arg2, - @Nullable Predicate arg3) { - // TODO Auto-generated method stub + // TODO 1.18 + // TODO 1.17ify gen.feature.generate(nms, nms.getChunkManager().getChunkGenerator(), rand, pos, gen.config); return false; } @Override - public @NotNull Biome getComputedBiome(int arg0, int arg1, int arg2) { + public boolean getAllowAnimals() { // TODO Auto-generated method stub - return null; + return true; } @Override - public @NotNull BiomeProvider vanillaBiomeProvider() { + public boolean getAllowMonsters() { // TODO Auto-generated method stub - return null; + return true; } @Override - public @NotNull PersistentDataContainer getPersistentDataContainer() { + public int getAmbientSpawnLimit() { // TODO Auto-generated method stub - return null; + return 0; } @Override - public int getSimulationDistance() { + public int getAnimalSpawnLimit() { // TODO Auto-generated method stub return 0; } @Override - public int getSpawnLimit(@NotNull SpawnCategory arg0) { - // TODO Auto-generated method stub - return 0; + public Biome getBiome(int arg0, int arg1) { + return getBiome(arg0, 0, arg1); } @Override - public long getTicksPerSpawns(@NotNull SpawnCategory arg0) { - // TODO Auto-generated method stub - return 0; + public Biome getBiome(int arg0, int arg1, int arg2) { + try { + return CraftBlock.biomeBaseToBiome(getHandle().getRegistryManager() + .get(RegistryKeys.BIOME), nms.getBiomeForNoiseGen(arg0 >> 2, arg1 >> 2, arg2 >> 2).value()); + } catch(Exception e) { + return CraftBlock.biomeBaseToBiome(getHandle().getRegistryManager().get(RegistryKeys.BIOME), + (net.minecraft.world.biome.Biome) (Object) nms.getBiomeForNoiseGen(arg0 >> 2, arg1 >> 2, arg2 >> 2)); + } } @Override - public void playSound(@NotNull Entity arg0, @NotNull Sound arg1, float arg2, float arg3) { - // TODO Auto-generated method stub - + public Block getBlockAt(Location loc) { + return getBlockAt(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()); } @Override - public void playSound(@NotNull Entity arg0, @NotNull Sound arg1, @NotNull SoundCategory arg2, float arg3, - float arg4) { - // TODO Auto-generated method stub - + public Block getBlockAt(int x, int y, int z) { + return CraftBlock.at(nms, new BlockPos(x, y, z)); } @Override - public void setSimulationDistance(int arg0) { - // TODO Auto-generated method stub - + public Chunk getChunkAt(Location arg0) { + return getChunkAt(arg0.getBlockX() >> 4, arg0.getBlockZ() >> 4); } @Override - public void setSpawnLimit(@NotNull SpawnCategory arg0, int arg1) { - // TODO Auto-generated method stub - + public Chunk getChunkAt(Block arg0) { + return getChunkAt(arg0.getX() >> 4, arg0.getZ() >> 4); } @Override - public void setTicksPerSpawns(@NotNull SpawnCategory arg0, int arg1) { + public Chunk getChunkAt(int x, int z) { + return ((IWorldChunk) nms.getChunkManager().getWorldChunk(x, z, true)).getBukkitChunk(); + } + + @Override + public Difficulty getDifficulty() { + return Difficulty.valueOf(nms.getDifficulty().getName().toUpperCase()); + } + + @Override + public ChunkSnapshot getEmptyChunkSnapshot(int arg0, int arg1, boolean arg2, boolean arg3) { + return CardboardChunk.getEmptyChunkSnapshot(arg0, arg1, this, arg2, arg3); + } + + @Override + public DragonBattle getEnderDragonBattle() { // TODO Auto-generated method stub - + return null; + } + + @Override + public List getEntities() { + List list = new ArrayList<>(); + + nms.iterateEntities().forEach(entity -> { + Entity bukkitEntity = ((IMixinEntity) entity).getBukkitEntity(); + if(bukkitEntity != null && bukkitEntity.isValid()) + list.add(bukkitEntity); + }); + + return list; + } + + @SuppressWarnings("unchecked") + @Override + public Collection getEntitiesByClass(Class... arg0) { + return (Collection) getEntitiesByClasses(arg0); + } + + @Override + public Collection getEntitiesByClass(Class arg0) { + Collection list = new ArrayList<>(); + + for(Object entity : nms.iterateEntities()) { + if(entity instanceof net.minecraft.entity.Entity) { + Entity bukkitEntity = ((IMixinEntity) (net.minecraft.entity.Entity) entity).getBukkitEntity(); + + if(bukkitEntity == null) + continue; + + Class bukkitClass = bukkitEntity.getClass(); + + if(arg0.isAssignableFrom(bukkitClass) && bukkitEntity.isValid()) + list.add((T) bukkitEntity); + } + } + + return list; + } + + @Override + public Collection getEntitiesByClasses(Class... arg0) { + Collection list = new ArrayList(); + + for(Object entity : nms.iterateEntities()) { + if(entity instanceof net.minecraft.entity.Entity) { + Entity bukkitEntity = ((IMixinEntity) (net.minecraft.entity.Entity) entity).getBukkitEntity(); + + if(bukkitEntity == null) + continue; + + Class bukkitClass = bukkitEntity.getClass(); + + for(Class clazz : arg0) { + if(clazz.isAssignableFrom(bukkitClass)) { + if(bukkitEntity.isValid()) + list.add(bukkitEntity); + break; + } + } + } + } + return list; + } + + @Override + public Environment getEnvironment() { + Identifier id = nms.getDimension().effects(); + + if(DimensionTypes.OVERWORLD_ID.equals(id)) + return Environment.NORMAL; + else if(DimensionTypes.THE_NETHER_ID.equals(id)) + return Environment.NETHER; + else if(DimensionTypes.THE_END_ID.equals(id)) + return Environment.THE_END; + else + return Environment.CUSTOM; + } + + @Override + public Collection getForceLoadedChunks() { + Set chunks = new HashSet<>(); + + for(long coord : nms.getForcedChunks()) + chunks.add(getChunkAt(ChunkPos.getPackedX(coord), ChunkPos.getPackedZ(coord))); + + return Collections.unmodifiableCollection(chunks); + } + + @Override + public long getFullTime() { + return nms.getTimeOfDay(); + } + + @Override + public T getGameRuleDefault(GameRule arg0) { + return convert(arg0, getGameRuleDefinitions().get(arg0.getName()).createRule()); + } + + @Override + public String getGameRuleValue(String arg0) { + // In method contract for some reason + if(arg0 == null) + return null; + + GameRules.Rule value = getHandle().getGameRules().get(getGameRulesNMS().get(arg0)); + return value != null ? value.toString() : ""; + } + + @Override + public T getGameRuleValue(GameRule arg0) { + return convert(arg0, getHandle().getGameRules().get(getGameRulesNMS().get(arg0.getName()))); + } + + private static Map> gamerules; + public static synchronized Map> getGameRulesNMS() { + if(gamerules != null) { + return gamerules; + } + + Map> gamerules = new HashMap<>(); + GameRules.accept(new GameRules.Visitor() { + @Override + public > void visit(GameRules.Key gamerules_gamerulekey, GameRules.Type gamerules_gameruledefinition) { + gamerules.put(gamerules_gamerulekey.getName(), gamerules_gamerulekey); + } + }); + + return WorldImpl.gamerules = gamerules; + } + + private T convert(GameRule rule, GameRules.Rule value) { + if(value == null) + return null; + + if(value instanceof GameRules.BooleanRule) { + return rule.getType().cast(((GameRules.BooleanRule) value).get()); + } else if(value instanceof GameRules.IntRule) { + return rule.getType().cast(value.getCommandResult()); + } else + throw new IllegalArgumentException("Invalid GameRule type (" + value + ") for GameRule " + rule.getName()); + } + + private static Map> gameruleDefinitions; + public static synchronized Map> getGameRuleDefinitions() { + if(gameruleDefinitions != null) + return gameruleDefinitions; + + Map> gameruleDefinitions = new HashMap<>(); + GameRules.accept(new GameRules.Visitor() { + @Override + public > void visit(GameRules.Key gamerules_gamerulekey, GameRules.Type gamerules_gameruledefinition) { + gameruleDefinitions.put(gamerules_gamerulekey.getName(), gamerules_gameruledefinition); + } + }); + + return WorldImpl.gameruleDefinitions = gameruleDefinitions; + } + + @Override + public String[] getGameRules() { + return getGameRulesNMS().keySet().toArray(new String[getGameRulesNMS().size()]); + } + + @Override + public ChunkGenerator getGenerator() { + return null; + } + + @Override + public Block getHighestBlockAt(Location arg0) { + return getHighestBlockAt(arg0.getBlockX(), arg0.getBlockY()); + } + + @Override + public Block getHighestBlockAt(int x, int z) { + return getBlockAt(x, getHighestBlockYAt(x, z), z); + } + + @Override + public Block getHighestBlockAt(Location arg0, HeightMap arg1) { + return getHighestBlockAt(arg0.getBlockX(), arg0.getBlockY()); + } + + @Override + public Block getHighestBlockAt(int x, int z, org.bukkit.HeightMap heightMap) { + return getBlockAt(x, getHighestBlockYAt(x, z, heightMap), z); + } + + @Override + public int getHighestBlockYAt(Location arg0) { + return getHighestBlockYAt(arg0.getBlockX(), arg0.getBlockZ()); + } + + @Override + public int getHighestBlockYAt(int arg0, int arg1) { + return getHighestBlockYAt(arg0, arg1, HeightMap.MOTION_BLOCKING); + } + + @Override + public int getHighestBlockYAt(int x, int z, HeightMap map) { + return nms.getTopY( + switch(map) { + case WORLD_SURFACE -> Type.WORLD_SURFACE; + case OCEAN_FLOOR -> Type.OCEAN_FLOOR; + case MOTION_BLOCKING -> Type.MOTION_BLOCKING; + case WORLD_SURFACE_WG -> Type.WORLD_SURFACE_WG; + case OCEAN_FLOOR_WG -> Type.OCEAN_FLOOR_WG; + case MOTION_BLOCKING_NO_LEAVES -> Type.MOTION_BLOCKING_NO_LEAVES; + }, + x, z + ); + } + + @Override + public int getHighestBlockYAt(Location loc, HeightMap heightMap) { + return getHighestBlockYAt(loc.getBlockX(), loc.getBlockZ()); + } + + @Override + public double getHumidity(int x, int z) { + return getHumidity(x, 0, z); + } + + @Override + public double getHumidity(int x, int y, int z) { + + // TODO 1.19.4 add AW for + // return nms.getBiomeForNoiseGen(x >> 2, y >> 2, z >> 2).value().weather.downfall(); + + try { + return 0; // nms.getBiomeForNoiseGen(x >> 2, y >> 2, z >> 2).value().getDownfall(); + } catch(Exception e) { + // 1.18.1 + // return ((net.minecraft.world.biome.Biome) (Object) nms.getBiomeForNoiseGen(x >> 2, y >> 2, z >> 2) ).getDownfall(); + } + return 0; + } + + @Override + public boolean getKeepSpawnInMemory() { + // TODO Auto-generated method stub + return false; + } + + @Override + public List getLivingEntities() { + List list = new ArrayList(); + + for(Object o : nms.iterateEntities()) { + if(o instanceof net.minecraft.entity.Entity) { + net.minecraft.entity.Entity mcEnt = (net.minecraft.entity.Entity) o; + Entity bukkitEntity = ((IMixinEntity) mcEnt).getBukkitEntity(); + + // Assuming that bukkitEntity isn't null + if(bukkitEntity != null && bukkitEntity instanceof LivingEntity && bukkitEntity.isValid()) + list.add((LivingEntity) bukkitEntity); + } + } + return list; + } + + @SuppressWarnings("resource") + @Override + public Chunk[] getLoadedChunks() { + Long2ObjectLinkedOpenHashMap chunks = ((IMixinThreadedAnvilChunkStorage) (nms.getChunkManager().threadedAnvilChunkStorage)).getChunkHoldersBF(); + return chunks.values() + .stream() + .map(IMixinChunkHolder::getFullChunkNow) + .filter(Objects::nonNull) + .map(WorldImpl::getBukkitChunkForChunk) + .toArray(Chunk[]::new); + } + + private static Chunk getBukkitChunkForChunk(WorldChunk mc) { + return ((IWorldChunk) mc).getBukkitChunk(); + } + + @Override + public int getMaxHeight() { + return nms.getHeight(); + } + + @Override + public int getMonsterSpawnLimit() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public String getName() { + return name; + } + + @Override + public Collection getNearbyEntities(Location location, double x, double y, double z) { + return this.getNearbyEntities(location, x, y, z, null); + } + + @Override + public Collection getNearbyEntities(Location location, double x, double y, double z, Predicate filter) { + BoundingBox aabb = BoundingBox.of(location, x, y, z); + return this.getNearbyEntities(aabb, filter); + } + + @Override + public Collection getNearbyEntities(BoundingBox boundingBox) { + return this.getNearbyEntities(boundingBox, null); + } + + @Override + public Collection getNearbyEntities(BoundingBox boundingBox, Predicate filter) { + Box bb = new Box(boundingBox.getMinX(), boundingBox.getMinY(), boundingBox.getMinZ(), boundingBox.getMaxX(), boundingBox.getMaxY(), boundingBox.getMaxZ()); + List entityList = nms.getOtherEntities((net.minecraft.entity.Entity) null, bb, null); + List bukkitEntityList = new ArrayList(entityList.size()); + + for(net.minecraft.entity.Entity entity : entityList) { + Entity bukkitEntity = ((IMixinEntity) entity).getBukkitEntity(); + if(filter == null || filter.test(bukkitEntity)) + bukkitEntityList.add(bukkitEntity); + } + + return bukkitEntityList; + } + + @Override + public boolean getPVP() { + return nms.getServer().isPvpEnabled(); + } + + @Override + public List getPlayers() { + List list = new ArrayList<>(nms.getPlayers().size()); + + for(ServerPlayerEntity player : nms.getPlayers()) + list.add((Player) ((IMixinServerEntityPlayer) player).getBukkitEntity()); + + return list; + } + + @Override + public Map> getPluginChunkTickets() { + return Collections.emptyMap(); + } + + @Override + public Collection getPluginChunkTickets(int arg0, int arg1) { + return Collections.emptySet(); + } + + @Override + public List getPopulators() { + return populators; + } + + @Override + public List getRaids() { + return Collections.emptyList(); + } + + @Override + public int getSeaLevel() { + return nms.getSeaLevel(); + } + + @Override + public long getSeed() { + return nms.getSeed(); + } + + @Override + public Location getSpawnLocation() { + BlockPos pos = nms.getSpawnPos(); + return new Location(this, pos.getX(), pos.getY(), pos.getZ()); + } + + @Override + public double getTemperature(int x, int z) { + return getTemperature(x, 0, z); + } + + @Override + public double getTemperature(int x, int y, int z) { + BlockPos pos = new BlockPos(x, y, z); + IMixinWorld icommon = (IMixinWorld) nms; + return icommon.I_get_biome_for_noise_gen(x >> 2, y >> 2, z >> 2).getTemperature(pos); + } + + @Override + public int getThunderDuration() { + return nms.getLevelProperties() instanceof LevelProperties prop + ? prop.getThunderTime() + : 0; + } + + @Override + public long getTicksPerAmbientSpawns() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public long getTicksPerAnimalSpawns() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public long getTicksPerMonsterSpawns() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public long getTicksPerWaterSpawns() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public long getTime() { + return nms.getTime(); + } + + @Override + public UUID getUID() { + return Utils.getWorldUUID(getWorldFolder()); + } + + @Override + public boolean equals(Object obj) { + return obj != null && this.getClass() == obj.getClass() && + this.getName().equals(((WorldImpl) obj).getName()); + } + + @Override + public int getWaterAnimalSpawnLimit() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getWeatherDuration() { + return nms.getLevelProperties() instanceof LevelProperties prop + ? prop.getRainTime() + : 0; + } + + @Override + public WorldBorder getWorldBorder() { + if(this.worldBorder == null) + this.worldBorder = new WorldBorderImpl(this); + + return this.worldBorder; + } + + @Override + public File getWorldFolder() { + // FIXME BROKEN (check for DMM1 & DMM-1) + return nms.getServer().getRunDirectory(); + } + + @Override + public WorldType getWorldType() { + return nms.isFlat() ? WorldType.FLAT : WorldType.NORMAL; + } + + @Override + public boolean hasStorm() { + return nms.getLevelProperties().isRaining(); + } + + @Override + public boolean isAutoSave() { + return !nms.isSavingDisabled(); + } + + @Override + public boolean isChunkForceLoaded(int arg0, int arg1) { + return nms.getForcedChunks().contains(ChunkPos.toLong(arg0, arg1)); + } + + @Override + public boolean isChunkGenerated(int x, int z) { + try { + return isChunkLoaded(x, z) || nms.getChunkManager().threadedAnvilChunkStorage.getNbt(new ChunkPos(x, z)) != null; + } catch(Exception ex) { + throw new RuntimeException(ex); + } + } + + @Override + public boolean isChunkInUse(int arg0, int arg1) { + return isChunkLoaded(arg0, arg1); + } + + @Override + public boolean isChunkLoaded(Chunk arg0) { + return isChunkLoaded(arg0.getX(), arg0.getZ()); + } + + @Override + public boolean isChunkLoaded(int x, int z) { + return (null != nms.getChunkManager().getWorldChunk(x, z, false)); + } + + @Override + public boolean isGameRule(String arg0) { + return getGameRulesNMS().containsKey(arg0); + } + + @Override + public boolean isHardcore() { + return nms.getLevelProperties().isHardcore(); + } + + @Override + public boolean isThundering() { + return nms.getLevelProperties().isThundering(); + } + + @Override + public void loadChunk(Chunk arg0) { + loadChunk(arg0.getX(), arg0.getZ()); + } + + @Override + public void loadChunk(int arg0, int arg1) { + loadChunk(arg0, arg1, true); + } + + @Override + public boolean loadChunk(int x, int z, boolean generate) { + net.minecraft.world.chunk.Chunk chunk = nms.getChunkManager() + .getChunk(x, z, generate ? ChunkStatus.FULL : ChunkStatus.EMPTY, true); + + if(chunk instanceof WrapperProtoChunk) + chunk = nms.getChunkManager().getChunk(x, z, ChunkStatus.FULL, true); + + if(chunk instanceof net.minecraft.world.chunk.WorldChunk) { + nms.getChunkManager().addTicket(ChunkTicketType.START, new ChunkPos(x, z), 1, Unit.INSTANCE); + return true; + } + + return false; + } + + @Override + public Raid locateNearestRaid(Location arg0, int arg1) { + // TODO Auto-generated method stub + return null; + } + + @Override + public Location locateNearestStructure(Location origin, StructureType structureType, int radius, boolean findUnexplored) { + // BlockPos originPos = new BlockPos(origin.getX(), origin.getY(), origin.getZ()); + // FIXME: 1.18.2 + return null; + // BlockPos nearest = this.getHandle().getChunkManager().getChunkGenerator().locateStructure(this.getHandle(), StructureFeature..STRUCTURES.get(structureType.getName()), originPos, radius, findUnexplored); + // return (nearest == null) ? null : new Location(this, nearest.getX(), nearest.getY(), nearest.getZ()); + } + + public void playEffect(Player player, Effect effect, int data) { + this.playEffect(player.getLocation(), effect, data, 0); + } + + @Override + public void playEffect(Location location, Effect effect, int data) { + this.playEffect(location, effect, data, 64); + } + + @Override + public void playEffect(Location loc, Effect effect, T data) { + this.playEffect(loc, effect, data, 64); + } + + @Override + public void playEffect(Location loc, Effect effect, T data, int radius) { + if(data != null) { + Validate.isTrue(effect.getData() != null && effect.getData() + .isAssignableFrom(data.getClass()), "Wrong kind of data for this effect!"); + } else { + Validate.isTrue(effect.getData() == null || effect == Effect.ELECTRIC_SPARK, "Wrong kind of data for this effect!"); + } + int datavalue = 0;// CraftEffect.getDataValue(effect, data); + this.playEffect(loc, effect, datavalue, radius); + } + + @Override + public void playEffect(Location location, Effect effect, int data, int radius) { + Validate.notNull(location, "Location cannot be null"); + Validate.notNull(effect, "Effect cannot be null"); + Validate.notNull(location.getWorld(), "World cannot be null"); + int packetData = effect.getId(); + WorldEventS2CPacket packet = new WorldEventS2CPacket(packetData, new BlockPos(location.getBlockX(), location.getBlockY(), location.getBlockZ()), data, false); + radius *= radius; + for(Player player : this.getPlayers()) { + if(((PlayerImpl) player).getHandle().networkHandler == null || !location.getWorld() + .equals(player.getWorld()) || (int) player.getLocation() + .distanceSquared(location) > radius) continue; + ((PlayerImpl) player).getHandle().networkHandler.sendPacket(packet); + } + } + + + @Override + public void playSound(Location loc, Sound sound, float volume, float pitch) { + playSound(loc, sound, org.bukkit.SoundCategory.MASTER, volume, pitch); + } + + @Override + public void playSound(Location loc, String sound, float volume, float pitch) { + playSound(loc, sound, org.bukkit.SoundCategory.MASTER, volume, pitch); + } + + @Override + public void playSound(Location loc, Sound sound, org.bukkit.SoundCategory category, float volume, float pitch) { + if(loc == null || sound == null || category == null) return; + + double x = loc.getX(); + double y = loc.getY(); + double z = loc.getZ(); + + getHandle().playSound(null, x, y, z, CraftSound.getSoundEffect(CraftSound.getSound(sound)), net.minecraft.sound.SoundCategory.valueOf(category.name()), volume, pitch); + } + + @Override + public void playSound(Location loc, String sound, org.bukkit.SoundCategory category, float volume, float pitch) { + // TODO: 1.19 + + /*if (loc == null || sound == null || category == null) return; + + double x = loc.getX(); + double y = loc.getY(); + double z = loc.getZ(); + + PlaySoundIdS2CPacket packet = new PlaySoundIdS2CPacket(new Identifier(sound), net.minecraft.sound.SoundCategory.valueOf(category.name()), new Vec3d(x, y, z), volume, pitch); + nms.getServer().getPlayerManager().sendToAround(null, x, y, z, volume > 1.0F ? 16.0F * volume : 16.0D, nms.getRegistryKey(), packet); + */ + } + + @Override + public RayTraceResult rayTrace(Location start, Vector direction, double maxDistance, FluidCollisionMode mode, boolean ignorePassableBlocks, double raySize, Predicate filter) { + RayTraceResult blockHit = this.rayTraceBlocks(start, direction, maxDistance, mode, ignorePassableBlocks); + Vector startVec = null; + double blockHitDistance = maxDistance; + + if(blockHit != null) { + startVec = start.toVector(); + blockHitDistance = startVec.distance(blockHit.getHitPosition()); + } + + RayTraceResult entityHit = this.rayTraceEntities(start, direction, blockHitDistance, raySize, filter); + if(blockHit == null) return entityHit; + if(entityHit == null) return blockHit; + + double entityHitDistanceSquared = startVec.distanceSquared(entityHit.getHitPosition()); + return (entityHitDistanceSquared < (blockHitDistance * blockHitDistance)) ? entityHit : blockHit; + } + + @Override + public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance) { + return this.rayTraceBlocks(start, direction, maxDistance, FluidCollisionMode.NEVER, false); + } + + @Override + public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode fluidCollisionMode) { + return this.rayTraceBlocks(start, direction, maxDistance, fluidCollisionMode, false); + } + + @Override + public RayTraceResult rayTraceBlocks(Location start, Vector direction, double maxDistance, FluidCollisionMode mode, boolean ignorePassableBlocks) { + Validate.notNull(start, "Start location equals null"); + Validate.isTrue(this.equals(start.getWorld()), "Start location a different world"); + start.checkFinite(); + + Validate.notNull(direction, "Direction equals null"); + direction.checkFinite(); + + Validate.isTrue(direction.lengthSquared() > 0, "Direction's magnitude is 0"); + Validate.notNull(mode, "mode equals null"); + + if(maxDistance < 0.0D) return null; + + Vector dir = direction.clone().normalize().multiply(maxDistance); + Vec3d startPos = new Vec3d(start.getX(), start.getY(), start.getZ()); + Vec3d endPos = new Vec3d(start.getX() + dir.getX(), start.getY() + dir.getY(), start.getZ() + dir.getZ()); + HitResult nmsHitResult = this.getHandle().raycast(new RaycastContext(startPos, endPos, ignorePassableBlocks ? + RaycastContext.ShapeType.COLLIDER : RaycastContext.ShapeType.OUTLINE, CardboardFluidRaytraceMode.toMc(mode), null)); + + return CardboardRayTraceResult.fromNMS(this, nmsHitResult); + } + + @Override + public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance) { + return this.rayTraceEntities(start, direction, maxDistance, null); + } + + @Override + public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize) { + return this.rayTraceEntities(start, direction, maxDistance, raySize, null); + } + + @Override + public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, Predicate filter) { + return this.rayTraceEntities(start, direction, maxDistance, 0.0, filter); + } + + @Override + public RayTraceResult rayTraceEntities(Location start, Vector direction, double maxDistance, double raySize, Predicate filter) { + Validate.notNull(start, "Start location is null!"); + Validate.isTrue(this.equals(start.getWorld()), "Start location is from different world!"); + start.checkFinite(); + Validate.notNull(direction, "Direction is null!"); + direction.checkFinite(); + Validate.isTrue(direction.lengthSquared() > 0.0, "Direction's magnitude is 0!"); + if(maxDistance < 0.0) { + return null; + } + Vector startPos = start.toVector(); + Vector dir = direction.clone().normalize().multiply(maxDistance); + BoundingBox aabb = BoundingBox.of(startPos, startPos).expandDirectional(dir).expand(raySize); + Collection entities = this.getNearbyEntities(aabb, filter); + Entity nearestHitEntity = null; + RayTraceResult nearestHitResult = null; + double nearestDistanceSq = Double.MAX_VALUE; + for(Entity entity : entities) { + double distanceSq; + BoundingBox boundingBox = entity.getBoundingBox().expand(raySize); + RayTraceResult hitResult = boundingBox.rayTrace(startPos, direction, maxDistance); + if(hitResult == null || !((distanceSq = startPos.distanceSquared(hitResult.getHitPosition())) < nearestDistanceSq)) + continue; + nearestHitEntity = entity; + nearestHitResult = hitResult; + nearestDistanceSq = distanceSq; + } + return nearestHitEntity == null ? null : new RayTraceResult(nearestHitResult.getHitPosition(), nearestHitEntity, nearestHitResult.getHitBlockFace()); + } + + @Override + public boolean refreshChunk(int x, int z) { + if(!this.isChunkLoaded(x, z)) return false; + + int px = x << 4; + int pz = z << 4; + + int height = this.getMaxHeight() / 16; + for(int idx = 0; idx < 64; idx++) + this.nms.updateListeners(new BlockPos(px + (idx / height), ((idx % height) * 16), pz), Blocks.AIR.getDefaultState(), Blocks.STONE.getDefaultState(), 3); + this.nms.updateListeners(new BlockPos(px + 15, (height * 16) - 1, pz + 15), Blocks.AIR.getDefaultState(), Blocks.STONE.getDefaultState(), 3); + + return true; + } + + @Override + public boolean regenerateChunk(int arg0, int arg1) { + throw new UnsupportedOperationException("Not supported in Spigot 1.17"); + } + + @Override + public boolean removePluginChunkTicket(int arg0, int arg1, Plugin arg2) { + // TODO Auto-generated method stub + return false; + } + + @Override + public void removePluginChunkTickets(Plugin arg0) { + // TODO Auto-generated method stub + } + + @Override + public void save() { + boolean oldSave = nms.savingDisabled; + nms.savingDisabled = false; + nms.save(null, false, false); + nms.savingDisabled = oldSave; + } + + @Override + public void setAmbientSpawnLimit(int arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setAnimalSpawnLimit(int arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setAutoSave(boolean arg0) { + nms.savingDisabled = !arg0; + } + + @Override + public void setBiome(int arg0, int arg1, Biome arg2) { + for(int y = 0; y < getMaxHeight(); y++) + setBiome(arg0, y, arg1, arg2); + } + + @Override + public void setBiome(int x, int y, int z, Biome bio) { + // TODO Auto-generated method stub + } + + @Override + public void setChunkForceLoaded(int arg0, int arg1, boolean arg2) { + // TODO Auto-generated method stub + } + + @Override + public void setDifficulty(Difficulty diff) { + // FIXME BROKEN + // nms.getLevelProperties().setDifficulty(net.minecraft.world.Difficulty.byOrdinal(diff.ordinal())); + } + + @Override + public void setFullTime(long time) { + TimeSkipEvent event = new TimeSkipEvent(this, TimeSkipEvent.SkipReason.CUSTOM, time - nms.getTimeOfDay()); + CraftServer.INSTANCE.getPluginManager().callEvent(event); + if(event.isCancelled()) + return; + + nms.setTimeOfDay(nms.getTimeOfDay() + event.getSkipAmount()); + + for(Player p : getPlayers()) { + PlayerImpl cp = (PlayerImpl) p; + if(cp.getHandle().networkHandler == null) continue; + + cp.getHandle().networkHandler.sendPacket(new WorldTimeUpdateS2CPacket(cp.getHandle() + .getWorld() + .getTime(), cp.getHandle().getWorld().getTime(), cp.getHandle() + .getWorld() + .getGameRules() + .getBoolean(GameRules.DO_DAYLIGHT_CYCLE))); + } + } + + @Override + public boolean setGameRule(GameRule arg0, T arg1) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean setGameRuleValue(String arg0, String arg1) { + // TODO Auto-generated method stub + return false; + } + + @Override + public void setHardcore(boolean arg0) { + // FIXME BROKEN!! + // nms.getLevelProperties().setHardcore(arg0); + } + + @Override + public void setKeepSpawnInMemory(boolean arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setMonsterSpawnLimit(int arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setPVP(boolean arg0) { + nms.getServer().setPvpEnabled(arg0); + } + + @Override + public void setSpawnFlags(boolean arg0, boolean arg1) { + // TODO Auto-generated method stub + } + + @Override + public boolean setSpawnLocation(Location location) { + return equals(location.getWorld()) ? setSpawnLocation(location.getBlockX(), location.getBlockY(), location.getBlockZ()) : false; + } + + @Override + public boolean setSpawnLocation(int x, int y, int z) { + try { + Location previousLocation = getSpawnLocation(); + nms.setSpawnPos(new BlockPos(x, y, z), 0); + + // Notify anyone who's listening. + SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation); + Bukkit.getPluginManager().callEvent(event); + + return true; + } catch(Exception e) { + return false; + } + } + + @Override + public void setStorm(boolean arg0) { + nms.getLevelProperties().setRaining(arg0); + } + + @Override + public void setThunderDuration(int arg0) { + worldProperties().setThunderTime(arg0); + } + + @Override + public void setThundering(boolean arg0) { + worldProperties().setThundering(arg0); + } + + @Override + public void setTicksPerAmbientSpawns(int arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setTicksPerAnimalSpawns(int arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setTicksPerMonsterSpawns(int arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setTicksPerWaterSpawns(int arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setTime(long arg0) { + nms.setTimeOfDay(arg0); + } + + @Override + public void setWaterAnimalSpawnLimit(int arg0) { + // TODO Auto-generated method stub + } + + @Override + public void setWeatherDuration(int arg0) { + worldProperties().setRainTime(arg0); + } + + private ServerWorldProperties worldProperties() { + return ((IServerWorld) nms).cardboard_worldProperties(); + } + + @Override + public T spawn(Location location, Class clazz) throws IllegalArgumentException { + return spawn(location, clazz, null, SpawnReason.CUSTOM); + } + + @Override + public T spawn(Location location, Class clazz, Consumer function) throws IllegalArgumentException { + return spawn(location, clazz, function, SpawnReason.CUSTOM); + } + + public T spawn(Location location, Class clazz, Consumer function, SpawnReason reason) throws IllegalArgumentException { + net.minecraft.entity.Entity entity = createEntity(location, clazz); + + return addEntity(entity, reason, function); + } + + public net.minecraft.entity.Entity createEntity(Location location, Class clazz) throws IllegalArgumentException { + if(location == null || clazz == null) + throw new IllegalArgumentException("Location or entity class cannot be null"); + + net.minecraft.entity.Entity entity = null; + + double x = location.getX(); + double y = location.getY(); + double z = location.getZ(); + float pitch = location.getPitch(); + float yaw = location.getYaw(); + + if(Boat.class.isAssignableFrom(clazz)) { + entity = new BoatEntity(nms, x, y, z); + entity.refreshPositionAndAngles(x, y, z, yaw, pitch); + } else if(FallingBlock.class.isAssignableFrom(clazz)) { + // TODO 1.18.2 + // entity = new FallingBlockEntity(nms, x, y, z, nms.getBlockState(new BlockPos(x, y, z))); + } else if(Projectile.class.isAssignableFrom(clazz)) { + if(Snowball.class.isAssignableFrom(clazz)) { + entity = new SnowballEntity(nms, x, y, z); + } else if(Egg.class.isAssignableFrom(clazz)) { + entity = new EggEntity(nms, x, y, z); + } else if(AbstractArrow.class.isAssignableFrom(clazz)) { + if(TippedArrow.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.ARROW.create(nms); + // TODO set type + } else if(SpectralArrow.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.SPECTRAL_ARROW.create(nms); + } else if(Trident.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.TRIDENT.create(nms); + } else { + entity = net.minecraft.entity.EntityType.ARROW.create(nms); + } + entity.refreshPositionAndAngles(x, y, z, 0, 0); + } else if(ThrownExpBottle.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.EXPERIENCE_BOTTLE.create(nms); + entity.refreshPositionAndAngles(x, y, z, 0, 0); + } else if(EnderPearl.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.ENDER_PEARL.create(nms); + entity.refreshPositionAndAngles(x, y, z, 0, 0); + } else if(ThrownPotion.class.isAssignableFrom(clazz)) { + if(LingeringPotion.class.isAssignableFrom(clazz)) { + entity = new PotionEntity(nms, x, y, z); + ((PotionEntity) entity).setItem(CraftItemStack.asNMSCopy(new ItemStack(org.bukkit.Material.LINGERING_POTION, 1))); + } else { + entity = new PotionEntity(nms, x, y, z); + ((PotionEntity) entity).setItem(CraftItemStack.asNMSCopy(new ItemStack(org.bukkit.Material.SPLASH_POTION, 1))); + } + } else if(Fireball.class.isAssignableFrom(clazz)) { + // TODO Fireball + } else if(ShulkerBullet.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.SHULKER_BULLET.create(nms); + entity.refreshPositionAndAngles(x, y, z, yaw, pitch); + } else if(LlamaSpit.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.LLAMA_SPIT.create(nms); + entity.refreshPositionAndAngles(x, y, z, yaw, pitch); + } else if(Firework.class.isAssignableFrom(clazz)) { + entity = new FireworkRocketEntity(nms, x, y, z, net.minecraft.item.ItemStack.EMPTY); + } + } else if(Minecart.class.isAssignableFrom(clazz)) { + if(PoweredMinecart.class.isAssignableFrom(clazz)) { + entity = new FurnaceMinecartEntity(nms, x, y, z); + } else if(StorageMinecart.class.isAssignableFrom(clazz)) { + entity = new ChestMinecartEntity(nms, x, y, z); + } else if(ExplosiveMinecart.class.isAssignableFrom(clazz)) { + entity = new TntMinecartEntity(nms, x, y, z); + } else if(HopperMinecart.class.isAssignableFrom(clazz)) { + entity = new HopperMinecartEntity(nms, x, y, z); + } else if(SpawnerMinecart.class.isAssignableFrom(clazz)) { + entity = new SpawnerMinecartEntity(nms, x, y, z); + } else if(CommandMinecart.class.isAssignableFrom(clazz)) { + entity = new CommandBlockMinecartEntity(nms, x, y, z); + } else entity = new MinecartEntity(nms, x, y, z); + } else if(EnderSignal.class.isAssignableFrom(clazz)) { + // TODO EnderSignal + } else if(EnderCrystal.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.END_CRYSTAL.create(nms); + entity.refreshPositionAndAngles(x, y, z, 0, 0); + } else if(LivingEntity.class.isAssignableFrom(clazz)) { + if(Chicken.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.CHICKEN.create(nms); + } else if(Cow.class.isAssignableFrom(clazz)) { + if(MushroomCow.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.MOOSHROOM.create(nms); + } else { + entity = net.minecraft.entity.EntityType.COW.create(nms); + } + } else if(Golem.class.isAssignableFrom(clazz)) { + if(Snowman.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.SNOW_GOLEM.create(nms); + } else if(IronGolem.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.IRON_GOLEM.create(nms); + } else if(Shulker.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.SHULKER.create(nms); + } + } else if(Creeper.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.CREEPER.create(nms); + } else if(Ghast.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.GHAST.create(nms); + } else if(Pig.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.PIG.create(nms); + } else if(Player.class.isAssignableFrom(clazz)) { + // need a net server handler for this one + } else if(Sheep.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.SHEEP.create(nms); + } else if(AbstractHorse.class.isAssignableFrom(clazz)) { + if(ChestedHorse.class.isAssignableFrom(clazz)) { + if(Donkey.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.DONKEY.create(nms); + } else if(Mule.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.MULE.create(nms); + } else if(Llama.class.isAssignableFrom(clazz)) { + entity = TraderLlama.class.isAssignableFrom(clazz) ? + net.minecraft.entity.EntityType.TRADER_LLAMA.create(nms) : net.minecraft.entity.EntityType.LLAMA.create(nms); + } + } else if(SkeletonHorse.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.SKELETON_HORSE.create(nms); + } else if(ZombieHorse.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.ZOMBIE_HORSE.create(nms); + } else entity = net.minecraft.entity.EntityType.HORSE.create(nms); + } else if(Skeleton.class.isAssignableFrom(clazz)) { + if(Stray.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.STRAY.create(nms); + } else if(WitherSkeleton.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.WITHER_SKELETON.create(nms); + } else { + entity = net.minecraft.entity.EntityType.SKELETON.create(nms); + } + } else if(Slime.class.isAssignableFrom(clazz)) { + if(MagmaCube.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.MAGMA_CUBE.create(nms); + } else { + entity = net.minecraft.entity.EntityType.SLIME.create(nms); + } + } else if(Spider.class.isAssignableFrom(clazz)) { + if(CaveSpider.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.CAVE_SPIDER.create(nms); + } else { + entity = net.minecraft.entity.EntityType.SPIDER.create(nms); + } + } else if(Squid.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.SQUID.create(nms); + } else if(Tameable.class.isAssignableFrom(clazz)) { + if(Wolf.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.WOLF.create(nms); + } else if(Parrot.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.PARROT.create(nms); + } else if(Cat.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.CAT.create(nms); + } + } else if(PigZombie.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.ZOMBIFIED_PIGLIN.create(nms); + } else if(Zombie.class.isAssignableFrom(clazz)) { + if(Husk.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.HUSK.create(nms); + } else if(ZombieVillager.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.ZOMBIE_VILLAGER.create(nms); + } else if(Drowned.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.DROWNED.create(nms); + } else { + entity = new ZombieEntity(nms); + } + } else if(Giant.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.GIANT.create(nms); + } else if(Silverfish.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.SILVERFISH.create(nms); + } else if(Enderman.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.ENDERMAN.create(nms); + } else if(Blaze.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.BLAZE.create(nms); + } else if(AbstractVillager.class.isAssignableFrom(clazz)) { + if(Villager.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.VILLAGER.create(nms); + } else if(WanderingTrader.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.WANDERING_TRADER.create(nms); + } + } else if(Witch.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.WITCH.create(nms); + } else if(Wither.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.WITHER.create(nms); + } else if(ComplexLivingEntity.class.isAssignableFrom(clazz)) { + if(EnderDragon.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.ENDER_DRAGON.create(nms); + } + } else if(Ambient.class.isAssignableFrom(clazz)) { + if(Bat.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.BAT.create(nms); + } + } else if(Rabbit.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.RABBIT.create(nms); + } else if(Endermite.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.ENDERMITE.create(nms); + } else if(Guardian.class.isAssignableFrom(clazz)) { + if(ElderGuardian.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.ELDER_GUARDIAN.create(nms); + } else { + entity = net.minecraft.entity.EntityType.GUARDIAN.create(nms); + } + } else if(ArmorStand.class.isAssignableFrom(clazz)) { + entity = new ArmorStandEntity(nms, x, y, z); + } else if(PolarBear.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.POLAR_BEAR.create(nms); + } else if(Vex.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.VEX.create(nms); + } else if(Illager.class.isAssignableFrom(clazz)) { + if(Spellcaster.class.isAssignableFrom(clazz)) { + if(Evoker.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.EVOKER.create(nms); + } else if(Illusioner.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.ILLUSIONER.create(nms); + } + } else if(Vindicator.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.VINDICATOR.create(nms); + } else if(Pillager.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.PILLAGER.create(nms); + } + } else if(Turtle.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.TURTLE.create(nms); + } else if(Phantom.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.PHANTOM.create(nms); + } else if(Fish.class.isAssignableFrom(clazz)) { + if(Cod.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.COD.create(nms); + } else if(PufferFish.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.PUFFERFISH.create(nms); + } else if(Salmon.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.SALMON.create(nms); + } else if(TropicalFish.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.TROPICAL_FISH.create(nms); + } + } else if(Dolphin.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.DOLPHIN.create(nms); + } else if(Ocelot.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.OCELOT.create(nms); + } else if(Ravager.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.RAVAGER.create(nms); + } else if(Panda.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.PANDA.create(nms); + } else if(Fox.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.FOX.create(nms); + } else if(Bee.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.BEE.create(nms); + } else if(Hoglin.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.HOGLIN.create(nms); + } else if(Piglin.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.PIGLIN.create(nms); + } else if(PiglinBrute.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.PIGLIN_BRUTE.create(nms); + } else if(Strider.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.STRIDER.create(nms); + } else if(Zoglin.class.isAssignableFrom(clazz)) + entity = net.minecraft.entity.EntityType.ZOGLIN.create(nms); + + if(entity != null) { + entity.updatePositionAndAngles(x, y, z, yaw, pitch); + entity.setHeadYaw(yaw); // SPIGOT-3587 + } + } else if(Hanging.class.isAssignableFrom(clazz)) { + BlockFace face = BlockFace.SELF; + + int width = 16; // 1 full block, also painting smallest size. + int height = 16; // 1 full block, also painting smallest size. + + if(ItemFrame.class.isAssignableFrom(clazz)) { + width = 12; + height = 12; + } else if(LeashHitch.class.isAssignableFrom(clazz)) { + width = 9; + height = 9; + } + + BlockFace[] faces = new BlockFace[] {BlockFace.EAST, BlockFace.NORTH, BlockFace.WEST, BlockFace.SOUTH, BlockFace.UP, BlockFace.DOWN}; + final BlockPos pos = BlockPos.ofFloored(x, y, z); + for(BlockFace dir : faces) { + net.minecraft.block.BlockState nmsBlock = nms.getBlockState(pos.offset(CraftBlock.blockFaceToNotch(dir))); + if(nmsBlock.isSolid() || AbstractRedstoneGateBlock.isRedstoneGate(nmsBlock)) { + // TODO + } + } + + if(LeashHitch.class.isAssignableFrom(clazz)) { + entity = new LeashKnotEntity(nms, BlockPos.ofFloored(x, y, z)); + // TODO 1.17ify entity.teleporting = true; + } else { + // No valid face found + Preconditions.checkArgument(face != BlockFace.SELF, "Cannot spawn hanging entity for %s at %s (no free face)", clazz.getName(), location); + + Direction dir = CraftBlock.blockFaceToNotch(face).getOpposite(); + if(Painting.class.isAssignableFrom(clazz)) { + // TODO: 1.19 + // entity = new PaintingEntity(nms, new BlockPos(x, y, z), dir); + } else if(ItemFrame.class.isAssignableFrom(clazz)) { + entity = new ItemFrameEntity(nms, BlockPos.ofFloored(x, y, z), dir); + } + } + + if(entity != null && !((AbstractDecorationEntity) entity).canStayAttached()) + throw new IllegalArgumentException("Cannot spawn hanging entity for " + clazz.getName() + " at " + location); + } else if(TNTPrimed.class.isAssignableFrom(clazz)) { + entity = new TntEntity(nms, x, y, z, null); + } else if(ExperienceOrb.class.isAssignableFrom(clazz)) { + entity = new ExperienceOrbEntity(nms, x, y, z, 0); + } else if(LightningStrike.class.isAssignableFrom(clazz)) { + entity = net.minecraft.entity.EntityType.LIGHTNING_BOLT.create(nms); + } else if(AreaEffectCloud.class.isAssignableFrom(clazz)) { + entity = new AreaEffectCloudEntity(nms, x, y, z); + } else if(EvokerFangs.class.isAssignableFrom(clazz)) + entity = new EvokerFangsEntity(nms, x, y, z, (float) Math.toRadians(yaw), 0, null); + + if(entity != null) + return entity; + throw new IllegalArgumentException("Cannot spawn an entity for " + clazz.getName()); + } + + public T addEntity(net.minecraft.entity.Entity entity, SpawnReason reason) throws IllegalArgumentException { + return addEntity(entity, reason, null); + } + + @SuppressWarnings("unchecked") + public T addEntity(net.minecraft.entity.Entity entity, SpawnReason reason, Consumer function) throws IllegalArgumentException { + Preconditions.checkArgument(entity != null, "Cannot spawn null entity"); + + // if (entity instanceof MobEntity) + // ((MobEntity) entity).initialize(nms, getHandle().getLocalDifficulty(entity.getBlockPos()), net.minecraft.entity.SpawnReason.COMMAND, (EntityData) null, null); + + if(function != null) + function.accept((T) ((IMixinEntity) entity).getBukkitEntity()); + + nms.addEntity(entity); // TODO spawn reason + return (T) ((IMixinEntity) entity).getBukkitEntity(); + } + + @Override + public Arrow spawnArrow(Location loc, Vector velocity, float speed, float spread) { + return spawnArrow(loc, velocity, speed, spread, Arrow.class); + } + + @SuppressWarnings("unchecked") + @Override + public T spawnArrow(Location loc, Vector velocity, float speed, float spread, Class clazz) { + Validate.notNull(loc, "Cant spawn arrow with a null location"); + Validate.notNull(velocity, "Cant spawn arrow with a null velocity"); + Validate.notNull(clazz, "Cant spawn an arrow with no class"); + + PersistentProjectileEntity arrow; + if(TippedArrow.class.isAssignableFrom(clazz)) { + arrow = net.minecraft.entity.EntityType.ARROW.create(nms); + ((IMixinArrowEntity) arrow).setType(CardboardPotionUtil.fromBukkit(new PotionData(PotionType.WATER, false, false))); + } else if(SpectralArrow.class.isAssignableFrom(clazz)) { + arrow = net.minecraft.entity.EntityType.SPECTRAL_ARROW.create(nms); + } else if(Trident.class.isAssignableFrom(clazz)) { + arrow = net.minecraft.entity.EntityType.TRIDENT.create(nms); + } else arrow = net.minecraft.entity.EntityType.ARROW.create(nms); + + arrow.refreshPositionAndAngles(loc.getX(), loc.getY(), loc.getZ(), loc.getYaw(), loc.getPitch()); + arrow.setVelocity(velocity.getX(), velocity.getY(), velocity.getZ(), speed, spread); + nms.spawnEntity(arrow); + return (T) ((IMixinEntity) arrow).getBukkitEntity(); + } + + @Override + public Entity spawnEntity(Location loc, EntityType entityType) { + return spawn(loc, entityType.getEntityClass()); + } + + @Override + public FallingBlock spawnFallingBlock(Location location, MaterialData data) throws IllegalArgumentException { + Validate.notNull(data, "MaterialData cannot be null"); + return spawnFallingBlock(location, data.getItemType(), data.getData()); + } + + @Override + public FallingBlock spawnFallingBlock(Location location, BlockData data) throws IllegalArgumentException { + Validate.notNull(location, "Location cannot be null"); + Validate.notNull(data, "Material cannot be null"); + + // FallingBlockEntity entity = new FallingBlockEntity(nms, location.getX(), location.getY(), location.getZ(), ((CraftBlockData) data).getState()); + FallingBlockEntity entity = FallingBlockEntity.spawnFromBlock(nms, BlockPos.ofFloored(location.getX(), location.getY(), location.getZ()), ((CraftBlockData) data).getState()); + entity.timeFalling = 1; + + nms.addEntity(entity/*, SpawnReason.CUSTOM*/); + return (FallingBlock) ((IMixinEntity) entity).getBukkitEntity(); + } + + @Override + public FallingBlock spawnFallingBlock(Location location, org.bukkit.Material material, byte data) throws IllegalArgumentException { + Validate.notNull(location, "Location cannot be null"); + Validate.notNull(material, "Material cannot be null"); + Validate.isTrue(material.isBlock(), "Material must be a block"); + + // TODO 1.18.1 / 1.18.2 + FallingBlockEntity entity = FallingBlockEntity.spawnFromBlock(nms, BlockPos.ofFloored(location.getX(), location.getY(), location.getZ()), CraftMagicNumbers.getBlock(material) + .getDefaultState()); + // FallingBlockEntity entity = new FallingBlockEntity(nms, location.getX(), location.getY(), location.getZ(), CraftMagicNumbers.getBlock(material).getDefaultState()); + entity.timeFalling = 1; + + nms.addEntity(entity/*, SpawnReason.CUSTOM*/); + return (FallingBlock) ((IMixinEntity) entity).getBukkitEntity(); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count) { + spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count) { + spawnParticle(particle, x, y, z, count, null); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, T data) { + spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, data); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, T data) { + spawnParticle(particle, x, y, z, count, 0, 0, 0, data); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ) { + spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ) { + spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, null); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, T data) { + spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, data); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, T data) { + spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, 1, data); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra) { + spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra) { + spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, extra, null); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { + spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra, data); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data) { + spawnParticle(particle, x, y, z, count, offsetX, offsetY, offsetZ, extra, data, false); + } + + @Override + public void spawnParticle(Particle particle, Location location, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { + spawnParticle(particle, location.getX(), location.getY(), location.getZ(), count, offsetX, offsetY, offsetZ, extra, data, force); + } + + @Override + public void spawnParticle(Particle particle, double x, double y, double z, int count, double offsetX, double offsetY, double offsetZ, double extra, T data, boolean force) { + if(data != null && !particle.getDataType().isInstance(data)) + throw new IllegalArgumentException("data should be " + particle.getDataType() + " got " + data.getClass()); + // TODO Bukkit4Fabric: method + getHandle().addParticle( + // null, // Sender + CraftParticle.toNMS(particle, data), // Particle + x, y, z, // Position + (double) count, // Count + offsetX, offsetY//, offsetZ // Random offset + // extra // Speed? + // force + ); + } + + @Override + public LightningStrike strikeLightning(Location loc) { + LightningEntity lightning = net.minecraft.entity.EntityType.LIGHTNING_BOLT.create(nms); + lightning.refreshPositionAfterTeleport(loc.getX(), loc.getY(), loc.getZ()); + // nms.strikeLightning(lightning); + return (LightningStrike) ((IMixinEntity) lightning).getBukkitEntity(); + } + + @Override + public LightningStrike strikeLightningEffect(Location arg0) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean unloadChunk(Chunk chunk) { + return unloadChunk(chunk.getX(), chunk.getZ()); + } + + @Override + public boolean unloadChunk(int x, int z) { + return unloadChunk(x, z, true); + } + + @Override + public boolean unloadChunk(int x, int z, boolean save) { + return unloadChunk0(x, z, save); + } + + private boolean unloadChunk0(int x, int z, boolean save) { + net.minecraft.world.chunk.WorldChunk chunk = nms.getChunk(x, z); + + // chunk.mustNotSave = !save; + unloadChunkRequest(x, z); + + nms.getChunkManager().executeQueuedTasks(); + return !isChunkLoaded(x, z); + } + + + @Override + public boolean unloadChunkRequest(int arg0, int arg1) { + // TODO Auto-generated method stub + return false; + } + + public ServerWorld getHandle() { + return nms; + } + + @Override + public int getViewDistance() { + // TODO Auto-generated method stub + return 8; + } + + public void setWaterAmbientSpawnLimit(int i) { + // TODO Auto-generated method stub + } + + @Override + public Spigot spigot() { + return new Spigot() { + // TODO Auto-generated method stub + }; + } + + public MetadataStoreBase getBlockMetadata() { + return blockMetadata; + } + + @Override + public long getTicksPerWaterAmbientSpawns() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getWaterAmbientSpawnLimit() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void setTicksPerWaterAmbientSpawns(int arg0) { + // TODO Auto-generated method stub + } + + @Override + public boolean setSpawnLocation(int x, int y, int z, float angle) { + try { + Location previousLocation = getSpawnLocation(); + nms.setSpawnPos(new BlockPos(x, y, z), angle); + + SpawnChangeEvent event = new SpawnChangeEvent(this, previousLocation); + CraftServer.INSTANCE.getPluginManager().callEvent(event); + + return true; + } catch(Exception e) { + return false; + } + } + + @Override + public boolean createExplosion(Entity arg0, Location arg1, float arg2, boolean arg3, boolean arg4) { + // TODO Auto-generated method stub + return false; + } + + @Override + public CompletableFuture getChunkAtAsync(int arg0, int arg1, boolean arg2, boolean arg3) { + Chunk c = this.getChunkAt(arg0, arg1); + return CompletableFuture.completedFuture(c); + } + + @Override + public int getChunkCount() { + return nms.getChunkManager().getTotalChunksLoadedCount(); + } + + @Override + public int getClearWeatherDuration() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public Entity getEntity(UUID arg0) { + return ((IMixinEntity) nms.getEntity(arg0)).getBukkitEntity(); + } + + @Override + public int getEntityCount() { + return (int) nms.iterateEntities().spliterator().getExactSizeIfKnown();//.entitiesByUuid.size(); + } + + @Override + public int getHighestBlockYAt(int arg0, int arg1, HeightmapType arg2) throws UnsupportedOperationException { + return this.getHighestBlockYAt(arg0, arg1); + } + + @Override + public MoonPhase getMoonPhase() { + return MoonPhase.getPhase(nms.getLunarTime()); + } + + @Override + public int getNoTickViewDistance() { + return 0; + } + + @Override + public int getPlayerCount() { + return nms.getPlayers().size(); + } + + @Override + public int getTickableTileEntityCount() { + return 0; // TODO: 1.17ify return nms.tickingBlockEntities.size(); + } + + @Override + public int getTileEntityCount() { + return 0; // TODO: 1.17ify return nms.blockEntities.size(); + } + + @Override + public boolean isClearWeather() { + return !nms.isRaining(); + } + + @Override + public boolean isDayTime() { + return nms.isDay(); + } + + @Override + public void setClearWeatherDuration(int arg0) { + nms.setWeather(arg0, 0, false, false); + } + + @Override + public void setNoTickViewDistance(int arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void setViewDistance(int arg0) { + // TODO Auto-generated method stub + } + + @Override + public void spawnParticle(Particle arg0, List arg1, Player arg2, double arg3, double arg4, double arg5, + int arg6, double arg7, double arg8, double arg9, double arg10, T arg11, boolean arg12) { + // TODO Auto-generated method stub + } + + @Override + public boolean doesBedWork() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean doesRespawnAnchorWork() { + // TODO Auto-generated method stub + return false; + } + + @Override + public @NotNull Item dropItem(@NotNull Location arg0, @NotNull ItemStack arg1, @Nullable Consumer arg2) { + // TODO Auto-generated method stub + return null; + } + + @Override + public @NotNull Item dropItemNaturally(@NotNull Location arg0, @NotNull ItemStack arg1, + @Nullable Consumer arg2) { + // TODO Auto-generated method stub + return null; + } + + @Override + public double getCoordinateScale() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public long getGameTime() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public @NotNull Collection getInfiniburn() { + // TODO Auto-generated method stub + return null; + } + + @Override + public @NotNull NamespacedKey getKey() { + // TODO Auto-generated method stub + return NamespacedKey.minecraft(this.getName()); + } + + @Override + public int getMinHeight() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public boolean hasBedrockCeiling() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean hasRaids() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean hasSkylight() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isFixedTime() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isNatural() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isPiglinSafe() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isUltrawarm() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean lineOfSightExists(@NotNull Location arg0, @NotNull Location arg1) { + // TODO Auto-generated method stub + return false; + } + + @Override + public @Nullable Location locateNearestBiome(@NotNull Location arg0, @NotNull Biome arg1, int arg2) { + // TODO Auto-generated method stub + return null; + } + + @Override + public @Nullable Location locateNearestBiome(@NotNull Location arg0, @NotNull Biome arg1, int arg2, int arg3) { + // TODO Auto-generated method stub + return null; + } + + @Override + public boolean generateTree(@NotNull Location arg0, @NotNull Random arg1, @NotNull TreeType arg2) { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean generateTree(@NotNull Location arg0, @NotNull Random arg1, @NotNull TreeType arg2, + @Nullable Consumer arg3) { + // TODO Auto-generated method stub + return false; + } + + @Override + public @NotNull Biome getBiome(@NotNull Location arg0) { + // TODO Auto-generated method stub + return null; + } + + @Override + public @NotNull BlockData getBlockData(@NotNull Location arg0) { + // TODO Auto-generated method stub + return null; + } + + @Override + public @NotNull BlockData getBlockData(int arg0, int arg1, int arg2) { + // TODO Auto-generated method stub + return null; + } + + @Override + public @NotNull BlockState getBlockState(@NotNull Location arg0) { + // TODO Auto-generated method stub + return null; + } + + @Override + public @NotNull BlockState getBlockState(int arg0, int arg1, int arg2) { + // TODO Auto-generated method stub + return null; + } + + @Override + public @NotNull Material getType(@NotNull Location arg0) { + // TODO Auto-generated method stub + return null; + } + + @Override + public @NotNull Material getType(int arg0, int arg1, int arg2) { + // TODO Auto-generated method stub + return null; + } + + @Override + public void setBiome(@NotNull Location arg0, @NotNull Biome arg1) { + // TODO Auto-generated method stub + + } + + @Override + public void setBlockData(@NotNull Location arg0, @NotNull BlockData arg1) { + // TODO Auto-generated method stub + + } + + @Override + public void setBlockData(int arg0, int arg1, int arg2, @NotNull BlockData arg3) { + // TODO Auto-generated method stub + + } + + @Override + public void setType(@NotNull Location arg0, @NotNull Material arg1) { + // TODO Auto-generated method stub + + } + + @Override + public void setType(int arg0, int arg1, int arg2, @NotNull Material arg3) { + // TODO Auto-generated method stub + + } + + @Override + public @NotNull T spawn(@NotNull Location arg0, @NotNull Class arg1, boolean arg2, + @Nullable Consumer arg3) throws IllegalArgumentException { + // TODO Auto-generated method stub + return null; + } + + @Override + public @NotNull Entity spawnEntity(@NotNull Location arg0, @NotNull EntityType arg1, boolean arg2) { + // TODO Auto-generated method stub + return null; + } + + @Override + public @Nullable Location findLightningRod(@NotNull Location arg0) { + // TODO Auto-generated method stub + return null; + } + + @Override + public @Nullable Location findLightningTarget(@NotNull Location arg0) { + // TODO Auto-generated method stub + return null; + } + + @Override + public @Nullable BiomeProvider getBiomeProvider() { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getLogicalHeight() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getSendViewDistance() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public long getTicksPerWaterUndergroundCreatureSpawns() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getWaterUndergroundCreatureSpawnLimit() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public boolean hasCeiling() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean hasSkyLight() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isBedWorks() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isRespawnAnchorWorks() { + // TODO Auto-generated method stub + return false; + } + + @Override + public boolean isUltraWarm() { + // TODO Auto-generated method stub + return false; + } + + @Override + public void sendGameEvent(@Nullable Entity arg0, @NotNull GameEvent arg1, @NotNull Vector arg2) { + // TODO Auto-generated method stub + } + + @Override + public void setSendViewDistance(int i) { + // TODO Auto-generated method stub + + } + + @Override + public void setTicksPerWaterUndergroundCreatureSpawns(int i) { + // TODO Auto-generated method stub + + } + + @Override + public void setWaterUndergroundCreatureSpawnLimit(int i) { + // TODO Auto-generated method stub + + } + + // 1.18.2 API: + + @Override + public boolean generateTree(@NotNull Location arg0, @NotNull Random arg1, @NotNull TreeType arg2, + @Nullable Predicate arg3) { + // TODO Auto-generated method stub + return false; + } + + @Override + public @NotNull Biome getComputedBiome(int arg0, int arg1, int arg2) { + // TODO Auto-generated method stub + return null; + } + + @Override + public @NotNull BiomeProvider vanillaBiomeProvider() { + // TODO Auto-generated method stub + return null; + } + + @Override + public @NotNull PersistentDataContainer getPersistentDataContainer() { + // TODO Auto-generated method stub + return null; + } + + @Override + public int getSimulationDistance() { + // TODO Auto-generated method stub + return 0; + } + + @Override + public int getSpawnLimit(@NotNull SpawnCategory arg0) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public long getTicksPerSpawns(@NotNull SpawnCategory arg0) { + // TODO Auto-generated method stub + return 0; + } + + @Override + public void playSound(@NotNull Entity arg0, @NotNull Sound arg1, float arg2, float arg3) { + // TODO Auto-generated method stub + + } + + @Override + public void playSound(@NotNull Entity arg0, @NotNull Sound arg1, @NotNull SoundCategory arg2, float arg3, + float arg4) { + // TODO Auto-generated method stub + + } + + @Override + public void setSimulationDistance(int arg0) { + // TODO Auto-generated method stub + + } + + @Override + public void setSpawnLimit(@NotNull SpawnCategory arg0, int arg1) { + // TODO Auto-generated method stub + + } + + @Override + public void setTicksPerSpawns(@NotNull SpawnCategory arg0, int arg1) { + // TODO Auto-generated method stub + } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/interfaces/IHandshakeC2SPacket.java b/src/main/java/org/cardboardpowered/interfaces/IHandshakeC2SPacket.java deleted file mode 100644 index 3fb250df..00000000 --- a/src/main/java/org/cardboardpowered/interfaces/IHandshakeC2SPacket.java +++ /dev/null @@ -1,7 +0,0 @@ -package org.cardboardpowered.interfaces; - -public interface IHandshakeC2SPacket { - - int getPortBF(); - -} \ No newline at end of file diff --git a/src/main/java/org/cardboardpowered/interfaces/INetworkConfiguration.java b/src/main/java/org/cardboardpowered/interfaces/INetworkConfiguration.java new file mode 100644 index 00000000..3c1bb98a --- /dev/null +++ b/src/main/java/org/cardboardpowered/interfaces/INetworkConfiguration.java @@ -0,0 +1,7 @@ +package org.cardboardpowered.interfaces; + +import net.minecraft.server.network.ServerPlayerEntity; + +public interface INetworkConfiguration { + void cardboard_setPlayer(ServerPlayerEntity entity); +} diff --git a/src/main/java/org/cardboardpowered/mixin/CardboardMixinPlugin.java b/src/main/java/org/cardboardpowered/mixin/CardboardMixinPlugin.java index 988ee1ed..037b7bd9 100644 --- a/src/main/java/org/cardboardpowered/mixin/CardboardMixinPlugin.java +++ b/src/main/java/org/cardboardpowered/mixin/CardboardMixinPlugin.java @@ -116,7 +116,7 @@ public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { return false; } - /*if (mixin.equals("network.MixinPlayerManager_ChatEvent")) { + if (mixin.equals("network.MixinPlayerManager_ChatEvent")) { if (should_force_alternate_chat()) { logger.info("Architectury Mod detected! Using alternative async chat from PlayerManager"); return true; @@ -125,8 +125,7 @@ public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { if (CardboardConfig.ALT_CHAT && (mixin.contains("_ChatEvent"))) { logger.info("Alternative ChatEvent Mixin enabled in config. Changing status on: " + mixin); if (mixin.equals("network.MixinServerPlayNetworkHandler_ChatEvent")) return false; - if (mixin.equals("network.MixinPlayerManager_ChatEvent")) return true; - }*/ + } String mcver = GameVersion.create().getReleaseTarget(); if (mcver.contains("1.18") && mixin.endsWith("_1_19")) { diff --git a/src/main/java/org/cardboardpowered/mixin/MixinAdvancement.java b/src/main/java/org/cardboardpowered/mixin/MixinAdvancementEntry.java similarity index 79% rename from src/main/java/org/cardboardpowered/mixin/MixinAdvancement.java rename to src/main/java/org/cardboardpowered/mixin/MixinAdvancementEntry.java index 319bf93e..d18ca655 100644 --- a/src/main/java/org/cardboardpowered/mixin/MixinAdvancement.java +++ b/src/main/java/org/cardboardpowered/mixin/MixinAdvancementEntry.java @@ -18,17 +18,16 @@ */ package org.cardboardpowered.mixin; +import com.javazilla.bukkitfabric.interfaces.IMixinAdvancement; +import net.minecraft.advancement.AdvancementEntry; import org.cardboardpowered.impl.AdvancementImpl; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; -import com.javazilla.bukkitfabric.interfaces.IMixinAdvancement; - -import net.minecraft.advancement.Advancement; - -@Mixin(Advancement.class) -public class MixinAdvancement implements IMixinAdvancement { - - public AdvancementImpl bukkit = new AdvancementImpl((Advancement)(Object)this); +@Mixin(AdvancementEntry.class) +public class MixinAdvancementEntry implements IMixinAdvancement { + @Unique + private final AdvancementImpl bukkit = new AdvancementImpl((AdvancementEntry)(Object)this); @Override public AdvancementImpl getBukkitAdvancement() { diff --git a/src/main/java/org/cardboardpowered/mixin/MixinCommandManager.java b/src/main/java/org/cardboardpowered/mixin/MixinCommandManager.java index 3ad38bad..bd845ca9 100644 --- a/src/main/java/org/cardboardpowered/mixin/MixinCommandManager.java +++ b/src/main/java/org/cardboardpowered/mixin/MixinCommandManager.java @@ -18,28 +18,26 @@ */ package org.cardboardpowered.mixin; -import java.util.Collection; -import java.util.LinkedHashSet; -import java.util.Map; - -import org.bukkit.entity.Player; -import org.bukkit.event.player.PlayerCommandSendEvent; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - import com.google.common.collect.Maps; import com.javazilla.bukkitfabric.impl.BukkitEventFactory; import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; import com.mojang.brigadier.tree.CommandNode; import com.mojang.brigadier.tree.RootCommandNode; - -import net.minecraft.server.command.CommandManager; import net.minecraft.command.CommandSource; +import net.minecraft.server.command.CommandManager; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.network.ServerPlayerEntity; +import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerCommandSendEvent; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.Map; @Mixin(CommandManager.class) public class MixinCommandManager { @@ -80,4 +78,4 @@ public void bukkitize(ServerPlayerEntity entityplayer, CallbackInfo ci) { // if (!event.getCommands().contains(orig)) rootcommandnode.removeCommand(orig); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/MixinDedicatedServer.java b/src/main/java/org/cardboardpowered/mixin/MixinDedicatedServer.java index 3193f311..0db5f980 100644 --- a/src/main/java/org/cardboardpowered/mixin/MixinDedicatedServer.java +++ b/src/main/java/org/cardboardpowered/mixin/MixinDedicatedServer.java @@ -1,33 +1,38 @@ /** * CardboardPowered - Bukkit/Spigot for Fabric * Copyright (C) CardboardPowered.org and contributors - * + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public - * License as published by the Free Software Foundation; either + * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ package org.cardboardpowered.mixin; -import java.io.File; -import java.util.List; - +import com.javazilla.bukkitfabric.BukkitLogger; +import net.minecraft.enchantment.Enchantment; +import net.minecraft.registry.Registries; +import net.minecraft.server.dedicated.DedicatedPlayerManager; +import net.minecraft.server.dedicated.MinecraftDedicatedServer; +import net.minecraft.server.dedicated.PendingServerCommand; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.event.server.ServerCommandEvent; import org.bukkit.plugin.PluginLoadOrder; import org.bukkit.plugin.java.JavaPluginLoader; +import org.cardboardpowered.CardboardConfig; import org.cardboardpowered.impl.CardboardEnchantment; +import org.cardboardpowered.interfaces.IDedicatedServer; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; @@ -37,85 +42,84 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import com.javazilla.bukkitfabric.BukkitLogger; -import org.cardboardpowered.interfaces.IDedicatedServer; - -import net.minecraft.enchantment.Enchantment; -import net.minecraft.server.dedicated.DedicatedPlayerManager; -import net.minecraft.server.dedicated.MinecraftDedicatedServer; -import net.minecraft.server.dedicated.PendingServerCommand; -import net.minecraft.registry.Registries; +import java.io.File; +import java.util.List; @Mixin(MinecraftDedicatedServer.class) public abstract class MixinDedicatedServer extends MixinMCServer implements IDedicatedServer { - @Shadow - @Final - private List commandQueue; - - @Inject(at = @At(value = "HEAD"), method = "setupServer()Z") - private void initVar(CallbackInfoReturnable callbackInfo) { - CraftServer.server = (MinecraftDedicatedServer) (Object) this; - } - - @Inject(at = @At(value = "JUMP", ordinal = 8), method = "setupServer()Z") // TODO keep ordinal updated - private void init(CallbackInfoReturnable ci) { - // Register Bukkit Enchantments - for (Enchantment enchantment : Registries.ENCHANTMENT) - org.bukkit.enchantments.Enchantment.registerEnchantment(new CardboardEnchantment(enchantment)); - - CraftMagicNumbers.test(); - CraftMagicNumbers.setupUnknownModdedMaterials(); - - MinecraftDedicatedServer thiss = (MinecraftDedicatedServer) (Object) this; - - ((MinecraftDedicatedServer) (Object) this).setPlayerManager(new DedicatedPlayerManager(thiss, thiss.getCombinedDynamicRegistries(), saveHandler)); - Bukkit.setServer(new CraftServer((MinecraftDedicatedServer) (Object) this)); - org.spigotmc.SpigotConfig.init(new File("spigot.yml")); - - Bukkit.getLogger().info("Loading Bukkit plugins..."); - File pluginsDir = new File("plugins"); - pluginsDir.mkdir(); - - Bukkit.getPluginManager().registerInterface(JavaPluginLoader.class); - - CraftServer s = ((CraftServer)Bukkit.getServer()); - if (CraftServer.server == null) CraftServer.server = (MinecraftDedicatedServer) (Object) this; - - s.loadPlugins(); - s.enablePlugins(PluginLoadOrder.STARTUP); - - Bukkit.getLogger().info(""); - } - - @Inject(at = @At("TAIL"), method = "exit") - public void killProcess(CallbackInfo ci) { - BukkitLogger.getLogger().info("Goodbye!"); - Runtime.getRuntime().halt(0); - } - - /** - * @author BukkitFabric - * @reason ServerCommandEvent - */ - @Overwrite - public void executeQueuedCommands() { - while (!this.commandQueue.isEmpty()) { - PendingServerCommand servercommand = (PendingServerCommand) this.commandQueue.remove(0); - - ServerCommandEvent event = new ServerCommandEvent(CraftServer.INSTANCE.getConsoleSender(), servercommand.command); - CraftServer.INSTANCE.getPluginManager().callEvent(event); - if (event.isCancelled()) continue; - servercommand = new PendingServerCommand(event.getCommand(), servercommand.source); - - CraftServer.INSTANCE.dispatchServerCommand(CraftServer.INSTANCE.getConsoleSender(), servercommand); - } - - } - - @Override - public boolean isDebugging() { - return false; - } - -} \ No newline at end of file + @Shadow + @Final + private List commandQueue; + + @Inject(at = @At(value = "HEAD"), method = "setupServer()Z") + private void initVar(CallbackInfoReturnable callbackInfo) { + CraftServer.server = (MinecraftDedicatedServer) (Object) this; + } + + @Inject(at = @At(value = "JUMP", ordinal = 8), method = "setupServer()Z") // TODO keep ordinal updated + private void init(CallbackInfoReturnable ci) { + // Register Bukkit Enchantments + for(Enchantment enchantment : Registries.ENCHANTMENT) + org.bukkit.enchantments.Enchantment.registerEnchantment(new CardboardEnchantment(enchantment)); + + CraftMagicNumbers.test(); + CraftMagicNumbers.setupUnknownModdedMaterials(); + + MinecraftDedicatedServer thiss = (MinecraftDedicatedServer) (Object) this; + + ((MinecraftDedicatedServer) (Object) this).setPlayerManager(new DedicatedPlayerManager(thiss, thiss.getCombinedDynamicRegistries(), saveHandler)); + Bukkit.setServer(new CraftServer((MinecraftDedicatedServer) (Object) this)); + org.spigotmc.SpigotConfig.init(new File("spigot.yml")); + + Bukkit.getLogger().info("Loading Bukkit plugins..."); + File pluginsDir = new File("plugins"); + pluginsDir.mkdir(); + + Bukkit.getPluginManager().registerInterface(JavaPluginLoader.class); + + CraftServer s = ((CraftServer) Bukkit.getServer()); + if(CraftServer.server == null) CraftServer.server = (MinecraftDedicatedServer) (Object) this; + + s.loadPlugins(); + s.enablePlugins(PluginLoadOrder.STARTUP); + + Bukkit.getLogger().info(""); + } + + @Inject(at = @At("TAIL"), method = "exit") + public void killProcess(CallbackInfo ci) { + BukkitLogger.getLogger().info("Goodbye!"); + Runtime.getRuntime().halt(0); + } + + /** + * @author BukkitFabric + * @reason ServerCommandEvent + */ + @Overwrite + public void executeQueuedCommands() { + while(!this.commandQueue.isEmpty()) { + PendingServerCommand servercommand = (PendingServerCommand) this.commandQueue.remove(0); + + ServerCommandEvent event = new ServerCommandEvent(CraftServer.INSTANCE.getConsoleSender(), servercommand.command); + CraftServer.INSTANCE.getPluginManager().callEvent(event); + if(event.isCancelled()) continue; + servercommand = new PendingServerCommand(event.getCommand(), servercommand.source); + + CraftServer.INSTANCE.dispatchServerCommand(CraftServer.INSTANCE.getConsoleSender(), servercommand); + } + } + + @Inject(method = "shouldEnforceSecureProfile", at = @At("HEAD"), cancellable = true) + public void dontEnforceWithFix(CallbackInfoReturnable cir) { + if(CardboardConfig.REGISTRY_COMMAND_FIX) + cir.setReturnValue(false); + } + + @Override + public boolean isDebugging() { + return false; + } + +} diff --git a/src/main/java/org/cardboardpowered/mixin/MixinPlayerAdvancementTracker.java b/src/main/java/org/cardboardpowered/mixin/MixinPlayerAdvancementTracker.java index 80b12540..093e5c35 100644 --- a/src/main/java/org/cardboardpowered/mixin/MixinPlayerAdvancementTracker.java +++ b/src/main/java/org/cardboardpowered/mixin/MixinPlayerAdvancementTracker.java @@ -18,7 +18,11 @@ */ package org.cardboardpowered.mixin; -import net.minecraft.util.Identifier; +import com.javazilla.bukkitfabric.interfaces.IMixinAdvancement; +import com.javazilla.bukkitfabric.interfaces.IMixinEntity; +import net.minecraft.advancement.AdvancementEntry; +import net.minecraft.advancement.PlayerAdvancementTracker; +import net.minecraft.server.network.ServerPlayerEntity; import org.bukkit.Bukkit; import org.bukkit.entity.Player; import org.cardboardpowered.util.MixinInfo; @@ -28,18 +32,8 @@ import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import com.javazilla.bukkitfabric.interfaces.IMixinAdvancement; -import com.javazilla.bukkitfabric.interfaces.IMixinEntity; - -import net.minecraft.advancement.Advancement; -import net.minecraft.advancement.PlayerAdvancementTracker; -import net.minecraft.server.network.ServerPlayerEntity; - -import java.util.Map; - @MixinInfo(events = {"PlayerAdvancementDoneEvent"}) @Mixin(PlayerAdvancementTracker.class) public class MixinPlayerAdvancementTracker { @@ -60,8 +54,8 @@ public void ifModdedThing(Logger logger, String message, Object p0, Object p1) { @SuppressWarnings("rawtypes") @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/advancement/AdvancementRewards;apply(Lnet/minecraft/server/network/ServerPlayerEntity;)V"), method = "grantCriterion") - public void fireBukkitEvent(Advancement advancement, String s, CallbackInfoReturnable ci) { - Bukkit.getServer().getPluginManager().callEvent(new org.bukkit.event.player.PlayerAdvancementDoneEvent((Player) ((IMixinEntity)this.owner).getBukkitEntity(), ((IMixinAdvancement)advancement).getBukkitAdvancement())); // Bukkit + public void fireBukkitEvent(AdvancementEntry advancement, String criterionName, CallbackInfoReturnable cir) { + Bukkit.getServer().getPluginManager().callEvent(new org.bukkit.event.player.PlayerAdvancementDoneEvent((Player) ((IMixinEntity)this.owner).getBukkitEntity(), ((IMixinAdvancement)(Object) advancement).getBukkitAdvancement())); // Bukkit } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/MixinPlayerManager.java b/src/main/java/org/cardboardpowered/mixin/MixinPlayerManager.java index b9631c07..94f84935 100644 --- a/src/main/java/org/cardboardpowered/mixin/MixinPlayerManager.java +++ b/src/main/java/org/cardboardpowered/mixin/MixinPlayerManager.java @@ -18,29 +18,6 @@ */ package org.cardboardpowered.mixin; -import java.net.SocketAddress; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.UUID; -import org.bukkit.Location; -import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.craftbukkit.util.CraftChatMessage; -import org.bukkit.entity.Player; -import org.bukkit.event.player.PlayerChangedWorldEvent; -import org.bukkit.event.player.PlayerJoinEvent; -import org.bukkit.event.player.PlayerLoginEvent; -import org.bukkit.event.player.PlayerQuitEvent; -import org.bukkit.event.player.PlayerRespawnEvent; -import org.cardboardpowered.impl.entity.PlayerImpl; -import org.cardboardpowered.impl.world.WorldImpl; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - import com.google.common.collect.Lists; import com.javazilla.bukkitfabric.impl.BukkitEventFactory; import com.javazilla.bukkitfabric.interfaces.IMixinPlayNetworkHandler; @@ -49,28 +26,53 @@ import com.javazilla.bukkitfabric.interfaces.IMixinServerLoginNetworkHandler; import com.javazilla.bukkitfabric.interfaces.IMixinWorld; import com.mojang.authlib.GameProfile; - import me.isaiah.common.ICommonMod; import net.minecraft.block.BlockState; import net.minecraft.block.Blocks; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.network.ClientConnection; import net.minecraft.network.encryption.PlayerPublicKey; +import net.minecraft.network.packet.c2s.common.SyncedClientOptions; import net.minecraft.network.packet.s2c.play.GameStateChangeS2CPacket; +import net.minecraft.registry.tag.BlockTags; import net.minecraft.scoreboard.ServerScoreboard; import net.minecraft.server.BannedIpEntry; import net.minecraft.server.PlayerManager; +import net.minecraft.server.network.ConnectedClientData; import net.minecraft.server.network.ServerLoginNetworkHandler; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; -import net.minecraft.registry.tag.BlockTags; import net.minecraft.text.MutableText; import net.minecraft.text.Text; +import net.minecraft.util.Formatting; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; import net.minecraft.util.math.Vec3i; import net.minecraft.world.World; +import org.bukkit.Location; +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.craftbukkit.util.CraftChatMessage; +import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerChangedWorldEvent; +import org.bukkit.event.player.PlayerJoinEvent; +import org.bukkit.event.player.PlayerLoginEvent; +import org.bukkit.event.player.PlayerQuitEvent; +import org.bukkit.event.player.PlayerRespawnEvent; +import org.cardboardpowered.impl.entity.PlayerImpl; +import org.cardboardpowered.impl.world.WorldImpl; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.net.SocketAddress; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.UUID; @Mixin(PlayerManager.class) public class MixinPlayerManager implements IMixinPlayerManager { @@ -148,7 +150,7 @@ public ServerPlayerEntity moveToWorld(ServerPlayerEntity player, ServerWorld wor World fromWorld = player.getWorld(); player.teleport(worldserver1, location.getX(), location.getY(), location.getZ(), 0, 0); - if (fromWorld != location.getWorld()) { + if (fromWorld != ((WorldImpl) location.getWorld()).getHandle()) { PlayerChangedWorldEvent event = new PlayerChangedWorldEvent((Player) ((IMixinServerEntityPlayer)player).getBukkitEntity(), ((IMixinWorld)fromWorld).getWorldImpl()); CraftServer.INSTANCE.getPluginManager().callEvent(event); } @@ -156,8 +158,9 @@ public ServerPlayerEntity moveToWorld(ServerPlayerEntity player, ServerWorld wor } @Inject(at = @At("TAIL"), method = "onPlayerConnect") - public void firePlayerJoinEvent(ClientConnection con, ServerPlayerEntity player, CallbackInfo ci) { - String joinMessage = Text.translatable("multiplayer.player.joined", new Object[]{player.getDisplayName()}).getString(); + public void firePlayerJoinEvent(ClientConnection connection, ServerPlayerEntity player, ConnectedClientData clientData, CallbackInfo ci) { + String joinMessage = Formatting.YELLOW + + Text.translatable("multiplayer.player.joined", player.getDisplayName()).getString(); PlayerImpl plr = (PlayerImpl) CraftServer.INSTANCE.getPlayer(player); PlayerJoinEvent playerJoinEvent = new PlayerJoinEvent(plr, joinMessage); @@ -168,8 +171,8 @@ public void firePlayerJoinEvent(ClientConnection con, ServerPlayerEntity player, joinMessage = playerJoinEvent.getJoinMessage(); - if (joinMessage != null && joinMessage.length() > 0) { - for (Text line : org.bukkit.craftbukkit.util.CraftChatMessage.fromString(joinMessage)) { + if (joinMessage != null && !joinMessage.isEmpty()) { + for (Text line : CraftChatMessage.fromString(joinMessage)) { // 1.18: CraftServer.server.getPlayerManager().sendToAll(new GameMessageS2CPacket(line, MessageType.SYSTEM, Util.NIL_UUID)); // TODO: 1.19 CraftServer.server.getPlayerManager().broadcast(line, entityplayer -> line, false); @@ -218,8 +221,7 @@ public ServerPlayerEntity attemptLogin(ServerLoginNetworkHandler nethand, GamePr me.isaiah.common.cmixin.IMixinPlayerManager imixin = (me.isaiah.common.cmixin.IMixinPlayerManager) (Object)this; // ServerPlayerEntity entity = imixin.InewPlayer(CraftServer.server, CraftServer.server.getWorld(World.OVERWORLD), profile); - ServerPlayerEntity entity = new ServerPlayerEntity(CraftServer.server, CraftServer.server.getWorld(World.OVERWORLD), profile); - + ServerPlayerEntity entity = new ServerPlayerEntity(CraftServer.server, CraftServer.server.getWorld(World.OVERWORLD), profile, SyncedClientOptions.createDefault()); Player player = (Player) ((IMixinServerEntityPlayer)entity).getBukkitEntity(); PlayerLoginEvent event = new PlayerLoginEvent(player, hostname, ((java.net.InetSocketAddress) address).getAddress(), ((java.net.InetSocketAddress) ims.cb_get_connection().channel.remoteAddress()).getAddress()); @@ -261,4 +263,4 @@ public void sendScoreboardBF(ServerScoreboard newboard, ServerPlayerEntity handl sendScoreboard(newboard, handle); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/MixinPluginLogger.java b/src/main/java/org/cardboardpowered/mixin/MixinPluginLogger.java index ac9bfc33..267d79c2 100644 --- a/src/main/java/org/cardboardpowered/mixin/MixinPluginLogger.java +++ b/src/main/java/org/cardboardpowered/mixin/MixinPluginLogger.java @@ -18,27 +18,27 @@ */ package org.cardboardpowered.mixin; -import java.util.logging.LogRecord; -import java.util.logging.Logger; - +import com.destroystokyo.paper.utils.PaperPluginLogger; +import com.javazilla.bukkitfabric.BukkitLogger; import org.bukkit.plugin.PluginDescriptionFile; +import org.jetbrains.annotations.NotNull; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Overwrite; -import com.destroystokyo.paper.utils.PaperPluginLogger; -import com.javazilla.bukkitfabric.BukkitLogger; +import java.util.logging.LogRecord; +import java.util.logging.Logger; @Mixin(value = PaperPluginLogger.class, remap = false) public class MixinPluginLogger { @Overwrite + @NotNull public static Logger getLogger(PluginDescriptionFile des) { - Logger logger = BukkitLogger.getPluginLogger(des.getName()); - return logger; + return BukkitLogger.getPluginLogger(des.getName()); } public void log(LogRecord logRecord) { BukkitLogger.getLogger().log(logRecord); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/MixinServerNetworkConfiguration.java b/src/main/java/org/cardboardpowered/mixin/MixinServerNetworkConfiguration.java new file mode 100644 index 00000000..375a0099 --- /dev/null +++ b/src/main/java/org/cardboardpowered/mixin/MixinServerNetworkConfiguration.java @@ -0,0 +1,33 @@ +package org.cardboardpowered.mixin; + + +import com.mojang.authlib.GameProfile; +import net.minecraft.network.packet.c2s.common.SyncedClientOptions; +import net.minecraft.server.PlayerManager; +import net.minecraft.server.network.ServerConfigurationNetworkHandler; +import net.minecraft.server.network.ServerPlayerEntity; +import org.cardboardpowered.interfaces.INetworkConfiguration; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +@Mixin(ServerConfigurationNetworkHandler.class) +public class MixinServerNetworkConfiguration implements INetworkConfiguration { + @Unique private ServerPlayerEntity replacementPlayer; + + @Override + public void cardboard_setPlayer(ServerPlayerEntity entity) { + this.replacementPlayer = entity; + } + + @Redirect(method = "onReady", at = @At(value = "INVOKE", target = "Lnet/minecraft/server/PlayerManager;createPlayer(Lcom/mojang/authlib/GameProfile;Lnet/minecraft/network/packet/c2s/common/SyncedClientOptions;)Lnet/minecraft/server/network/ServerPlayerEntity;")) + private ServerPlayerEntity replacePlayer(PlayerManager manager, GameProfile profile, SyncedClientOptions syncedOptions) { + if(replacementPlayer != null) { + replacementPlayer.setClientOptions(syncedOptions); + return replacementPlayer; + } + + return manager.createPlayer(profile, syncedOptions); + } +} diff --git a/src/main/java/org/cardboardpowered/mixin/MixinServerPlayerInteractionManager.java b/src/main/java/org/cardboardpowered/mixin/MixinServerPlayerInteractionManager.java index c2bd84d9..869398fa 100644 --- a/src/main/java/org/cardboardpowered/mixin/MixinServerPlayerInteractionManager.java +++ b/src/main/java/org/cardboardpowered/mixin/MixinServerPlayerInteractionManager.java @@ -14,35 +14,13 @@ */ package org.cardboardpowered.mixin; -import java.util.Objects; - -import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.craftbukkit.block.CraftBlock; -import org.bukkit.entity.Player; -import org.bukkit.event.Event; -import org.bukkit.event.block.Action; -import org.bukkit.event.block.BlockBreakEvent; -import org.bukkit.event.block.BlockDamageEvent; -import org.bukkit.event.player.PlayerInteractEvent; -import org.cardboardpowered.impl.entity.PlayerImpl; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import org.spongepowered.asm.mixin.injection.callback.LocalCapture; - import com.javazilla.bukkitfabric.impl.BukkitEventFactory; import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; import com.javazilla.bukkitfabric.interfaces.IMixinServerPlayerInteractionManager; - import net.minecraft.advancement.criterion.Criteria; import net.minecraft.block.BlockState; import net.minecraft.block.CakeBlock; import net.minecraft.block.DoorBlock; -import net.minecraft.block.TrapdoorBlock; import net.minecraft.block.entity.BlockEntity; import net.minecraft.block.enums.DoubleBlockHalf; import net.minecraft.entity.player.PlayerEntity; @@ -62,6 +40,23 @@ import net.minecraft.world.BlockView; import net.minecraft.world.GameMode; import net.minecraft.world.World; +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.craftbukkit.block.CraftBlock; +import org.bukkit.entity.Player; +import org.bukkit.event.Event; +import org.bukkit.event.block.Action; +import org.bukkit.event.block.BlockBreakEvent; +import org.bukkit.event.block.BlockDamageEvent; +import org.bukkit.event.player.PlayerInteractEvent; +import org.cardboardpowered.impl.entity.PlayerImpl; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; @Mixin(value = ServerPlayerInteractionManager.class, priority = 999) public class MixinServerPlayerInteractionManager implements IMixinServerPlayerInteractionManager { @@ -113,8 +108,8 @@ public float cb_2(BlockState instance, PlayerEntity playerEntity, BlockView bloc return f2; } - @Inject(method = "processBlockBreakingAction", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;isAir()Z"), locals = LocalCapture.CAPTURE_FAILSOFT) - private void cb_3(BlockPos pos, PlayerActionC2SPacket.Action action, Direction direction, int worldHeight, int sequence, CallbackInfo ci, float i) { + @Inject(method = "processBlockBreakingAction", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockState;isAir()Z"), locals = LocalCapture.CAPTURE_FAILSOFT, cancellable = true) + private void cb_3(BlockPos pos, PlayerActionC2SPacket.Action action, Direction direction, int worldHeight, int sequence, CallbackInfo ci) { // System.out.println("A = " + i); if (cb_stat == 1) { @@ -133,8 +128,7 @@ private void cb_3(BlockPos pos, PlayerActionC2SPacket.Action action, Direction d // System.out.println("INSTA CHECK"); if (blockEvent.getInstaBreak()) { cb_f2 = 2.0f; - i = cb_f2; - } + } } } @@ -294,4 +288,4 @@ public void interactBlock(ServerPlayerEntity entityplayer, World world, ItemStac ci.setReturnValue(enuminteractionresult); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/MixinServerScoreboard.java b/src/main/java/org/cardboardpowered/mixin/MixinServerScoreboard.java index 146a2eff..605f415a 100644 --- a/src/main/java/org/cardboardpowered/mixin/MixinServerScoreboard.java +++ b/src/main/java/org/cardboardpowered/mixin/MixinServerScoreboard.java @@ -1,21 +1,20 @@ package org.cardboardpowered.mixin; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -import org.bukkit.craftbukkit.CraftServer; -import org.cardboardpowered.impl.entity.PlayerImpl; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; - import net.minecraft.network.packet.Packet; import net.minecraft.scoreboard.Scoreboard; import net.minecraft.scoreboard.ScoreboardObjective; import net.minecraft.scoreboard.ServerScoreboard; import net.minecraft.server.network.ServerPlayerEntity; +import org.bukkit.craftbukkit.CraftServer; +import org.cardboardpowered.impl.entity.PlayerImpl; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + +import java.util.Iterator; +import java.util.List; +import java.util.Set; @Mixin(value = ServerScoreboard.class, priority = 900) public class MixinServerScoreboard extends Scoreboard { @@ -75,4 +74,4 @@ private void sendAll(Packet packet) { entityplayer.networkHandler.sendPacket(packet); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/MixinUserCache.java b/src/main/java/org/cardboardpowered/mixin/MixinUserCache.java index 3e20f68d..7e5c574e 100644 --- a/src/main/java/org/cardboardpowered/mixin/MixinUserCache.java +++ b/src/main/java/org/cardboardpowered/mixin/MixinUserCache.java @@ -1,6 +1,14 @@ package org.cardboardpowered.mixin; -import static org.bukkit.craftbukkit.CraftServer.server; +import com.javazilla.bukkitfabric.interfaces.IUserCache; +import com.mojang.authlib.GameProfile; +import com.mojang.authlib.GameProfileRepository; +import com.mojang.authlib.ProfileLookupCallback; +import me.isaiah.common.ICommonMod; +import net.minecraft.util.UserCache; +import net.minecraft.util.UserCache.Entry; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; import java.util.Date; import java.util.Locale; @@ -9,19 +17,7 @@ import java.util.UUID; import java.util.concurrent.atomic.AtomicReference; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -import com.javazilla.bukkitfabric.interfaces.IUserCache; -import com.mojang.authlib.Agent; -import com.mojang.authlib.GameProfile; -import com.mojang.authlib.GameProfileRepository; -import com.mojang.authlib.ProfileLookupCallback; - -import me.isaiah.common.ICommonMod; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.util.UserCache; -import net.minecraft.util.UserCache.Entry; +import static org.bukkit.craftbukkit.CraftServer.server; @Mixin(UserCache.class) public class MixinUserCache implements IUserCache { @@ -67,18 +63,17 @@ public Optional card_findByName(String name) { } private static Optional card_findProfileByName(GameProfileRepository repository, String name) { - final AtomicReference atomicReference = new AtomicReference(); + final AtomicReference atomicReference = new AtomicReference(); ProfileLookupCallback profileLookupCallback = new ProfileLookupCallback(){ - public void onProfileLookupSucceeded(GameProfile profile) { atomicReference.set(profile); } - - public void onProfileLookupFailed(GameProfile profile, Exception exception) { + @Override + public void onProfileLookupFailed(String profileName, Exception exception) { atomicReference.set(null); } }; - repository.findProfilesByNames(new String[]{name}, Agent.MINECRAFT, profileLookupCallback); + repository.findProfilesByNames(new String[]{name}, profileLookupCallback); GameProfile gameProfile = (GameProfile)atomicReference.get(); if (!shouldUseRemote() && gameProfile == null) { @@ -103,4 +98,4 @@ private long incrementAndGetAccessCount() { return 0; } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/block/MixinDispenserBlock.java b/src/main/java/org/cardboardpowered/mixin/block/MixinDispenserBlock.java index f1406306..a87b56da 100644 --- a/src/main/java/org/cardboardpowered/mixin/block/MixinDispenserBlock.java +++ b/src/main/java/org/cardboardpowered/mixin/block/MixinDispenserBlock.java @@ -1,15 +1,13 @@ package org.cardboardpowered.mixin.block; +import com.javazilla.bukkitfabric.interfaces.IMixinDispenserBlock; +import net.minecraft.block.DispenserBlock; import org.cardboardpowered.impl.block.DispenserBlockHelper; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import com.javazilla.bukkitfabric.interfaces.IMixinDispenserBlock; - -import net.minecraft.block.DispenserBlock; - @Mixin(DispenserBlock.class) public class MixinDispenserBlock implements IMixinDispenserBlock { @@ -17,7 +15,7 @@ public class MixinDispenserBlock implements IMixinDispenserBlock { * @author Cardboard * @reason Set event fired to false */ - @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/block/DispenserBlock;getBehaviorForItem(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/block/dispenser/DispenserBehavior;"), method = "Lnet/minecraft/block/DispenserBlock;dispense(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;)V") + @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/block/DispenserBlock;getBehaviorForItem(Lnet/minecraft/item/ItemStack;)Lnet/minecraft/block/dispenser/DispenserBehavior;"), method = "dispense") public void doBukkit_setEventFired(CallbackInfo ci) { DispenserBlockHelper.eventFired = false; } diff --git a/src/main/java/org/cardboardpowered/mixin/block/MixinPistonBlock.java b/src/main/java/org/cardboardpowered/mixin/block/MixinPistonBlock.java index ccf11b86..3c53bc3b 100644 --- a/src/main/java/org/cardboardpowered/mixin/block/MixinPistonBlock.java +++ b/src/main/java/org/cardboardpowered/mixin/block/MixinPistonBlock.java @@ -1,29 +1,25 @@ package org.cardboardpowered.mixin.block; -import java.util.AbstractList; -import java.util.List; - +import com.javazilla.bukkitfabric.interfaces.IMixinWorld; +import net.minecraft.block.Blocks; +import net.minecraft.block.PistonBlock; +import net.minecraft.block.piston.PistonHandler; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Direction; +import net.minecraft.world.World; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.block.CraftBlock; import org.bukkit.event.block.BlockPistonEvent; import org.bukkit.event.block.BlockPistonExtendEvent; import org.bukkit.event.block.BlockPistonRetractEvent; import org.cardboardpowered.extras.DualBlockList; -import org.cardboardpowered.util.MixinInfo; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import com.javazilla.bukkitfabric.interfaces.IMixinWorld; - -import net.minecraft.block.Blocks; -import net.minecraft.block.PistonBlock; -import net.minecraft.block.piston.PistonHandler; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Direction; -import net.minecraft.world.World; +import java.util.List; //@MixinInfo(events = {"BlockPistonExtendEvent","BlockPistonRetractEvent","BlockPistonEvent"}) @Mixin(PistonBlock.class) @@ -31,7 +27,7 @@ public class MixinPistonBlock { private PistonHandler cardboard_ph; - @Redirect(at = @At(value = "NEW", target = "Lnet/minecraft/block/piston/PistonHandler;"), method = "move") + @Redirect(at = @At(value = "NEW", target = "(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/util/math/Direction;Z)Lnet/minecraft/block/piston/PistonHandler;"), method = "tryMove") public PistonHandler cardboard_storePH(World world, BlockPos pos, Direction dir, boolean retract) { return (cardboard_ph = new PistonHandler(world,pos,dir,retract)); } @@ -79,4 +75,4 @@ public org.bukkit.block.Block get(int index) { } } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/block/MixinShearsDispenserBehavior.java b/src/main/java/org/cardboardpowered/mixin/block/MixinShearsDispenserBehavior.java index e1e6239e..b5385b7f 100644 --- a/src/main/java/org/cardboardpowered/mixin/block/MixinShearsDispenserBehavior.java +++ b/src/main/java/org/cardboardpowered/mixin/block/MixinShearsDispenserBehavior.java @@ -1,20 +1,7 @@ package org.cardboardpowered.mixin.block; -import org.bukkit.Bukkit; -import org.bukkit.block.Block; -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.event.block.BlockDispenseEvent; -import org.bukkit.event.block.BlockShearEntityEvent; -import org.cardboardpowered.impl.block.DispenserBlockHelper; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - import com.javazilla.bukkitfabric.interfaces.IMixinEntity; import com.javazilla.bukkitfabric.interfaces.IMixinWorld; - import net.minecraft.block.DispenserBlock; import net.minecraft.block.dispenser.DispenserBehavior; import net.minecraft.block.dispenser.ShearsDispenserBehavior; @@ -24,6 +11,17 @@ import net.minecraft.item.ItemStack; import net.minecraft.sound.SoundCategory; import net.minecraft.util.math.BlockPointer; +import org.bukkit.Bukkit; +import org.bukkit.block.Block; +import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.event.block.BlockDispenseEvent; +import org.bukkit.event.block.BlockShearEntityEvent; +import org.cardboardpowered.impl.block.DispenserBlockHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(ShearsDispenserBehavior.class) public class MixinShearsDispenserBehavior { @@ -34,7 +32,7 @@ public class MixinShearsDispenserBehavior { @Inject(at = @At("HEAD"), method = "dispenseSilently") protected void cardboard_dispenseSilently(BlockPointer pointer, ItemStack stack, CallbackInfoReturnable ci) { - cardboard_block = ((IMixinWorld)pointer.getWorld()).getWorldImpl().getBlockAt(pointer.getPos().getX(), pointer.getPos().getY(), pointer.getPos().getZ()); + cardboard_block = ((IMixinWorld)pointer.world()).getWorldImpl().getBlockAt(pointer.pos().getX(), pointer.pos().getY(), pointer.pos().getZ()); cardboard_saved = CraftItemStack.asCraftMirror(stack); BlockDispenseEvent event = new BlockDispenseEvent(cardboard_block, cardboard_saved.clone(), new org.bukkit.util.Vector(0, 0, 0)); @@ -70,4 +68,4 @@ private static BlockShearEntityEvent callBlockShearEntityEvent(Entity animal, or return bse; } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/entity/MixinLeashKnotEntity.java b/src/main/java/org/cardboardpowered/mixin/entity/MixinLeashKnotEntity.java index 1bc52e71..5cb532d9 100644 --- a/src/main/java/org/cardboardpowered/mixin/entity/MixinLeashKnotEntity.java +++ b/src/main/java/org/cardboardpowered/mixin/entity/MixinLeashKnotEntity.java @@ -1,14 +1,6 @@ package org.cardboardpowered.mixin.entity; -import java.util.Iterator; -import java.util.List; - -import org.cardboardpowered.util.MixinInfo; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; - import com.javazilla.bukkitfabric.impl.BukkitEventFactory; - import net.minecraft.entity.Entity.RemovalReason; import net.minecraft.entity.decoration.LeashKnotEntity; import net.minecraft.entity.mob.MobEntity; @@ -18,6 +10,12 @@ import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.util.math.Box; +import org.cardboardpowered.util.MixinInfo; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; + +import java.util.Iterator; +import java.util.List; @MixinInfo(events = {"PlayerLeashEntityEvent", "PlayerUnleashEntityEvent"}) @Mixin(value = LeashKnotEntity.class, priority = 900) @@ -63,4 +61,4 @@ public ActionResult interact(PlayerEntity entityhuman, Hand enumhand) { return ActionResult.CONSUME; } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/entity/MixinLivingEntity.java b/src/main/java/org/cardboardpowered/mixin/entity/MixinLivingEntity.java index 9dd22d18..be33141a 100644 --- a/src/main/java/org/cardboardpowered/mixin/entity/MixinLivingEntity.java +++ b/src/main/java/org/cardboardpowered/mixin/entity/MixinLivingEntity.java @@ -1,7 +1,20 @@ package org.cardboardpowered.mixin.entity; -import java.util.ArrayList; - +import com.javazilla.bukkitfabric.impl.BukkitEventFactory; +import com.javazilla.bukkitfabric.interfaces.IMixinEntity; +import com.javazilla.bukkitfabric.interfaces.IMixinLivingEntity; +import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; +import net.minecraft.enchantment.EnchantmentHelper; +import net.minecraft.entity.Entity; +import net.minecraft.entity.LivingEntity; +import net.minecraft.entity.attribute.AttributeContainer; +import net.minecraft.entity.damage.DamageSource; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.ItemStack; +import net.minecraft.server.network.ServerPlayerEntity; +import net.minecraft.util.Arm; +import net.minecraft.world.GameRules; +import net.minecraft.world.World; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.entity.Player; @@ -17,24 +30,10 @@ import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import com.javazilla.bukkitfabric.impl.BukkitEventFactory; -import com.javazilla.bukkitfabric.interfaces.IMixinEntity; -import com.javazilla.bukkitfabric.interfaces.IMixinLivingEntity; -import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; - -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.Entity; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.attribute.AttributeContainer; -import net.minecraft.entity.damage.DamageSource; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.ItemStack; -import net.minecraft.server.network.ServerPlayerEntity; -import net.minecraft.world.GameRules; -import net.minecraft.world.World; +import java.util.ArrayList; @Mixin(LivingEntity.class) -public class MixinLivingEntity extends MixinEntity implements IMixinLivingEntity { +public abstract class MixinLivingEntity extends MixinEntity implements IMixinLivingEntity { private transient EntityPotionEffectEvent.Cause bukkitCause; private LivingEntity get() { @@ -128,7 +127,8 @@ public void dropLoot(DamageSource damagesource, boolean flag) { public void dropEquipment(DamageSource damagesource, int i, boolean flag) { } - /** + @Shadow public abstract Arm getMainArm(); + /** * @reason Bukkit RegainHealthEvent */ @Inject(at = @At("HEAD"), method = "heal", cancellable = true) @@ -148,4 +148,4 @@ public void heal(float f, EntityRegainHealthEvent.RegainReason regainReason) { } } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/entity/MixinPlayer.java b/src/main/java/org/cardboardpowered/mixin/entity/MixinPlayer.java index ecf2cc49..10fd2b45 100644 --- a/src/main/java/org/cardboardpowered/mixin/entity/MixinPlayer.java +++ b/src/main/java/org/cardboardpowered/mixin/entity/MixinPlayer.java @@ -18,53 +18,21 @@ */ package org.cardboardpowered.mixin.entity; -import java.util.OptionalInt; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.command.CommandSender; -import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.craftbukkit.entity.CraftEntity; -import org.bukkit.craftbukkit.entity.CraftHumanEntity; -import org.cardboardpowered.impl.entity.PlayerImpl; -import org.cardboardpowered.impl.inventory.CardboardInventoryView; -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.util.CraftChatMessage; -import org.bukkit.entity.Player; -import org.bukkit.event.inventory.InventoryCloseEvent; -import org.bukkit.event.player.PlayerChangedMainHandEvent; -import org.bukkit.event.player.PlayerTeleportEvent; -import org.bukkit.inventory.MainHand; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.Unique; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.javazilla.bukkitfabric.impl.BukkitEventFactory; import com.javazilla.bukkitfabric.interfaces.IMixinCommandOutput; -import com.javazilla.bukkitfabric.interfaces.IMixinEntity; import com.javazilla.bukkitfabric.interfaces.IMixinScreenHandler; import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; import com.javazilla.bukkitfabric.interfaces.IMixinWorld; import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerFactory; import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType; -//import net.fabricmc.fabric.impl.screenhandler.ExtendedScreenHandlerType; import net.fabricmc.fabric.impl.screenhandler.Networking; -import net.minecraft.enchantment.EnchantmentHelper; -import net.minecraft.entity.LivingEntity; -import net.minecraft.entity.damage.DamageSource; import net.minecraft.inventory.DoubleInventory; import net.minecraft.inventory.Inventory; -import net.minecraft.item.ItemStack; import net.minecraft.network.ClientConnection; import net.minecraft.network.packet.Packet; -import net.minecraft.network.packet.c2s.play.ClientSettingsC2SPacket; -import net.minecraft.network.packet.s2c.play.DeathMessageS2CPacket; +import net.minecraft.network.packet.c2s.common.SyncedClientOptions; import net.minecraft.network.packet.s2c.play.OpenScreenS2CPacket; -import net.minecraft.scoreboard.AbstractTeam; +import net.minecraft.registry.Registries; import net.minecraft.screen.NamedScreenHandlerFactory; import net.minecraft.screen.ScreenHandler; import net.minecraft.screen.ScreenHandlerListener; @@ -72,21 +40,35 @@ import net.minecraft.server.network.ServerPlayNetworkHandler; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; -import net.minecraft.text.HoverEvent; -import net.minecraft.text.MutableText; -import net.minecraft.text.Text; import net.minecraft.util.Arm; -import net.minecraft.util.Formatting; import net.minecraft.util.Identifier; -import net.minecraft.util.Util; -import net.minecraft.util.collection.DefaultedList; import net.minecraft.util.math.BlockPos; -import net.minecraft.registry.Registries; import net.minecraft.world.GameRules; import net.minecraft.world.World; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.command.CommandSender; +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.event.inventory.InventoryCloseEvent; +import org.bukkit.event.player.PlayerChangedMainHandEvent; +import org.bukkit.event.player.PlayerLocaleChangeEvent; +import org.bukkit.event.player.PlayerTeleportEvent; +import org.bukkit.inventory.MainHand; +import org.cardboardpowered.impl.entity.PlayerImpl; +import org.cardboardpowered.impl.inventory.CardboardInventoryView; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import java.util.OptionalInt; @Mixin(value = ServerPlayerEntity.class, priority = 999) -public class MixinPlayer extends MixinLivingEntity implements IMixinCommandOutput, IMixinServerEntityPlayer { +public abstract class MixinPlayer extends MixinLivingEntity implements IMixinCommandOutput, IMixinServerEntityPlayer { private PlayerImpl bukkit; @@ -111,7 +93,7 @@ public CommandSender getBukkitSender(ServerCommandSource serverCommandSource) { } @Override - public CraftEntity getBukkitEntity() { + public PlayerImpl getBukkitEntity() { return bukkit; } @@ -132,21 +114,27 @@ public void onDisconnect(CallbackInfo ci) { @Inject(at = @At("HEAD"), method = "Lnet/minecraft/server/network/ServerPlayerEntity;teleport(Lnet/minecraft/server/world/ServerWorld;DDDFF)V", cancellable = true) public void teleport1(ServerWorld worldserver, double x, double y, double z, float f, float f1, CallbackInfo ci) { - PlayerTeleportEvent event = new PlayerTeleportEvent((Player) this.getBukkitEntity(), this.getBukkitEntity().getLocation(), new Location(((IMixinWorld)worldserver).getWorldImpl(), x,y,z,f,f1), PlayerTeleportEvent.TeleportCause.UNKNOWN); + PlayerTeleportEvent event = new PlayerTeleportEvent(this.getBukkitEntity(), this.getBukkitEntity().getLocation(), new Location(((IMixinWorld)worldserver).getWorldImpl(), x,y,z,f,f1), PlayerTeleportEvent.TeleportCause.UNKNOWN); Bukkit.getPluginManager().callEvent(event); if (event.isCancelled()) { ci.cancel(); - return; } } public String locale_BF = "en_us"; - @Inject(at = @At("HEAD"), method = "setClientSettings") - public void setClientSettings(ClientSettingsC2SPacket packet, CallbackInfo ci) { - PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent((Player) getBukkitEntity(), ((ServerPlayerEntity) (Object) this).getMainArm() == Arm.LEFT ? MainHand.LEFT : MainHand.RIGHT); - CraftServer.INSTANCE.getPluginManager().callEvent(event); + @Inject(at = @At("HEAD"), method = "setClientOptions") + public void onUpdateOptions(SyncedClientOptions options, CallbackInfo ci) { + if(getMainArm() != options.mainArm()) { + PlayerChangedMainHandEvent event = new PlayerChangedMainHandEvent(getBukkitEntity(), ((ServerPlayerEntity) (Object) this).getMainArm() == Arm.LEFT ? MainHand.LEFT : MainHand.RIGHT); + CraftServer.INSTANCE.getPluginManager().callEvent(event); + } + + if(!this.language.equals(options.language())) { + PlayerLocaleChangeEvent event = new PlayerLocaleChangeEvent(getBukkitEntity(), options.language()); + CraftServer.INSTANCE.getPluginManager().callEvent(event); + } } @Shadow @@ -230,7 +218,7 @@ public void openHandledScreen_c(NamedScreenHandlerFactory factory, CallbackInfoR if ( CraftServer.INSTANCE.getMinecraftVersion().contains("1.16") ) { // 1.16.5 - container.addListener((ScreenHandlerListener) ((ServerPlayerEntity)(Object)this)); + container.addListener((ScreenHandlerListener) this); } else { // 1.17 ((ServerPlayerEntity)(Object)this).onScreenHandlerOpened(container); @@ -333,6 +321,8 @@ public void bukkitizeDeath(DamageSource damagesource, CallbackInfo ci) { @Shadow public void forgiveMobAnger() {} + @Shadow public abstract OptionalInt openHandledScreen(@Nullable NamedScreenHandlerFactory factory); + @Shadow private String language; @Override public void setConnectionBF(ClientConnection connection) { this.connectionBF = connection; @@ -374,7 +364,7 @@ public void doBukkitEvent_PlayerLevelChangeEvent(CallbackInfo ci) { try { if (this.oldLevel == -1) this.oldLevel = ((ServerPlayerEntity)(Object)this).experienceLevel; if (this.oldLevel != ((ServerPlayerEntity)(Object)this).experienceLevel) { - BukkitEventFactory.callPlayerLevelChangeEvent((Player)getBukkitEntity(), this.oldLevel, ((ServerPlayerEntity)(Object)this).experienceLevel); + BukkitEventFactory.callPlayerLevelChangeEvent(getBukkitEntity(), this.oldLevel, ((ServerPlayerEntity)(Object)this).experienceLevel); this.oldLevel = ((ServerPlayerEntity)(Object)this).experienceLevel; } } catch (Throwable throwable) {} @@ -418,7 +408,7 @@ public void cardboard_doInventoryCloseEvent(CallbackInfo ci) { view.setPlayerIfNotSet(getBukkit()); InventoryCloseEvent event = new InventoryCloseEvent(view); Bukkit.getPluginManager().callEvent(event); - handler.transferTo(((ServerPlayerEntity)(Object)this).playerScreenHandler, (CraftHumanEntity) getBukkitEntity()); + handler.transferTo(((ServerPlayerEntity)(Object)this).playerScreenHandler, getBukkitEntity()); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/entity/ai/MixinUpdateAttackTargetTask.java b/src/main/java/org/cardboardpowered/mixin/entity/ai/MixinUpdateAttackTargetTask.java index 5d600d88..75f2b20a 100644 --- a/src/main/java/org/cardboardpowered/mixin/entity/ai/MixinUpdateAttackTargetTask.java +++ b/src/main/java/org/cardboardpowered/mixin/entity/ai/MixinUpdateAttackTargetTask.java @@ -1,22 +1,19 @@ package org.cardboardpowered.mixin.entity.ai; -import org.cardboardpowered.impl.entity.LivingEntityImpl; -import org.bukkit.event.entity.EntityTargetEvent; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import org.spongepowered.asm.mixin.injection.callback.LocalCapture; - import com.javazilla.bukkitfabric.impl.BukkitEventFactory; - import net.minecraft.entity.LivingEntity; import net.minecraft.entity.ai.brain.MemoryQueryResult; import net.minecraft.entity.ai.brain.task.UpdateAttackTargetTask; import net.minecraft.entity.mob.MobEntity; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; +import org.bukkit.event.entity.EntityTargetEvent; +import org.cardboardpowered.impl.entity.LivingEntityImpl; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; import java.util.Optional; import java.util.function.Function; @@ -26,7 +23,7 @@ public class MixinUpdateAttackTargetTask { @Inject(method = "method_47123", at = @At(value = "INVOKE", - target = "Lnet/minecraft/world/entity/ai/behavior/declarative/MemoryAccessor;set(Ljava/lang/Object;)V"), + target = "Lnet/minecraft/entity/ai/brain/MemoryQueryResult;remember(Ljava/lang/Object;)V"), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true) private static void banner$targetEvent(Predicate predicate, Function> function, MemoryQueryResult memoryAccessor, MemoryQueryResult memoryAccessor2, @@ -45,4 +42,4 @@ public class MixinUpdateAttackTargetTask { // CraftBukkit end } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/entity/block/MixinBoatDispenserBehavior.java b/src/main/java/org/cardboardpowered/mixin/entity/block/MixinBoatDispenserBehavior.java index 856a36f6..2b1c7cd9 100644 --- a/src/main/java/org/cardboardpowered/mixin/entity/block/MixinBoatDispenserBehavior.java +++ b/src/main/java/org/cardboardpowered/mixin/entity/block/MixinBoatDispenserBehavior.java @@ -18,26 +18,22 @@ */ package org.cardboardpowered.mixin.entity.block; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - import com.javazilla.bukkitfabric.interfaces.IMixinWorld; - +import net.minecraft.block.DispenserBlock; import net.minecraft.block.dispenser.BoatDispenserBehavior; import net.minecraft.block.dispenser.DispenserBehavior; import net.minecraft.block.dispenser.ItemDispenserBehavior; -import net.minecraft.block.DispenserBlock; import net.minecraft.entity.vehicle.BoatEntity; -import net.minecraft.fluid.Fluid; import net.minecraft.item.ItemStack; import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPointer; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; - import org.bukkit.craftbukkit.CraftServer; import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.event.block.BlockDispenseEvent; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; @Mixin(BoatDispenserBehavior.class) public class MixinBoatDispenserBehavior { @@ -49,12 +45,12 @@ public class MixinBoatDispenserBehavior { public BoatEntity.Type boatType; public ItemStack dispenseSilently(BlockPointer isourceblock, ItemStack itemstack) { - Direction enumdirection = (Direction) isourceblock.getBlockState().get(DispenserBlock.FACING); - ServerWorld worldserver = isourceblock.getWorld(); - double d0 = isourceblock.getX() + (double) ((float) enumdirection.getOffsetX() * 1.125F); - double d1 = isourceblock.getY() + (double) ((float) enumdirection.getOffsetY() * 1.125F); - double d2 = isourceblock.getZ() + (double) ((float) enumdirection.getOffsetZ() * 1.125F); - BlockPos blockposition = isourceblock.getPos().offset(enumdirection); + Direction enumdirection = (Direction) isourceblock.state().get(DispenserBlock.FACING); + ServerWorld worldserver = isourceblock.world(); + double d0 = isourceblock.pos().getX() + (double) ((float) enumdirection.getOffsetX() * 1.125F); + double d1 = isourceblock.pos().getY() + (double) ((float) enumdirection.getOffsetY() * 1.125F); + double d2 = isourceblock.pos().getZ() + (double) ((float) enumdirection.getOffsetZ() * 1.125F); + BlockPos blockposition = isourceblock.pos().offset(enumdirection); double d3; // FIXME: 1.18.2 @@ -67,7 +63,7 @@ public ItemStack dispenseSilently(BlockPointer isourceblock, ItemStack itemstack // } ItemStack itemstack1 = itemstack.split(1); - org.bukkit.block.Block block = ((IMixinWorld)worldserver).getWorldImpl().getBlockAt(isourceblock.getPos().getX(), isourceblock.getPos().getY(), isourceblock.getPos().getZ()); + org.bukkit.block.Block block = ((IMixinWorld)worldserver).getWorldImpl().getBlockAt(isourceblock.pos().getX(), isourceblock.pos().getY(), isourceblock.pos().getZ()); CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); BlockDispenseEvent event = new BlockDispenseEvent(block, craftItem.clone(), new org.bukkit.util.Vector(d0, d1 + d3, d2)); diff --git a/src/main/java/org/cardboardpowered/mixin/entity/block/MixinEndGatewayBlockEntity.java b/src/main/java/org/cardboardpowered/mixin/entity/block/MixinEndGatewayBlockEntity.java index 962ac4b2..a26f69ae 100644 --- a/src/main/java/org/cardboardpowered/mixin/entity/block/MixinEndGatewayBlockEntity.java +++ b/src/main/java/org/cardboardpowered/mixin/entity/block/MixinEndGatewayBlockEntity.java @@ -1,83 +1,79 @@ package org.cardboardpowered.mixin.entity.block; -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.event.player.PlayerTeleportEvent; -import org.cardboardpowered.impl.entity.PlayerImpl; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - import com.javazilla.bukkitfabric.interfaces.IMixinEntity; import com.javazilla.bukkitfabric.interfaces.IMixinPlayNetworkHandler; import com.javazilla.bukkitfabric.interfaces.IMixinWorld; - -import net.minecraft.advancement.criterion.Criteria; import net.minecraft.block.BlockState; import net.minecraft.block.entity.EndGatewayBlockEntity; -import net.minecraft.block.entity.EndPortalBlockEntity; import net.minecraft.entity.Entity; -import net.minecraft.entity.Entity.RemovalReason; -import net.minecraft.entity.projectile.thrown.EnderPearlEntity; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import org.bukkit.Location; +import org.bukkit.event.player.PlayerTeleportEvent; +import org.cardboardpowered.impl.entity.PlayerImpl; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; @Mixin(EndGatewayBlockEntity.class) -public class MixinEndGatewayBlockEntity extends EndPortalBlockEntity { +public class MixinEndGatewayBlockEntity { + + // I tried using LocalCapture but it kept making up + // that i was using ServerWorld which crashed the game + // So this messy solution will have to do + + @Shadow + private static void startTeleportCooldown(World world, BlockPos pos, BlockState state, EndGatewayBlockEntity be) { + } - public MixinEndGatewayBlockEntity(BlockPos pos, BlockState state) { - super(pos, state); - } - @Shadow public BlockPos exitPortalPos; - @Shadow public boolean exactTeleport; + @Redirect(method = "tryTeleportingEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;resetPortalCooldown()V")) + private static void onResetPortalCooldown(Entity instance) { + // ignore, called somewhere else here + } - @Shadow - private static BlockPos findBestPortalExitPos(World world, BlockPos pos) { - return null; - } + @Unique private static boolean wasCancelled; - @Shadow - private static void startTeleportCooldown(World world, BlockPos pos, BlockState state, EndGatewayBlockEntity be) { - } + @Redirect(method = "tryTeleportingEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/entity/EndGatewayBlockEntity;startTeleportCooldown(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;Lnet/minecraft/block/entity/EndGatewayBlockEntity;)V")) + private static void onStartTeleportCooldown(World world, BlockPos pos, BlockState state, EndGatewayBlockEntity blockEntity) { + if(wasCancelled) { + wasCancelled = false; + } else { + startTeleportCooldown(world, pos, state, blockEntity); + } + } - @Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;teleport(DDD)V"), method = "tryTeleportingEntity", cancellable = true) - private static void bukkitize(World world, BlockPos pos, BlockState state, Entity entity, EndGatewayBlockEntity be, CallbackInfo ci) { - BlockPos blockposition = be.exactTeleport ? be.exitPortalPos : findBestPortalExitPos(world, pos); - Entity entity1; + @Redirect(method = "tryTeleportingEntity", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;teleport(DDD)V")) + private static void bukkitize(Entity target, double x, double y, double z) { + if(!(target instanceof ServerPlayerEntity player)) { + target.resetPortalCooldown(); + target.teleport(x, y, z); + return; + } - if (entity instanceof EnderPearlEntity) { - Entity entity2 = ((EnderPearlEntity) entity).getOwner(); - if (entity2 instanceof ServerPlayerEntity) Criteria.ENTER_BLOCK.trigger((ServerPlayerEntity) entity2, state); + Location loc = callEvent((IMixinWorld) player.getWorld(), (IMixinEntity) player, x, y, z); - if (entity2 != null) { - entity1 = entity2; - entity.remove(RemovalReason.DISCARDED); - } else entity1 = entity; - } else entity1 = entity.getRootVehicle(); + if(loc == null) { + wasCancelled = true; + return; + } - if (entity1 instanceof ServerPlayerEntity) { - PlayerImpl player = (PlayerImpl) ((IMixinEntity)entity1).getBukkitEntity(); - org.bukkit.Location location = new Location(((IMixinWorld)world).getWorldImpl(), (double) blockposition.getX() + 0.5D, (double) blockposition.getY() + 0.5D, (double) blockposition.getZ() + 0.5D); - location.setPitch(player.getLocation().getPitch()); - location.setYaw(player.getLocation().getYaw()); + target.resetPortalCooldown(); + ((IMixinPlayNetworkHandler) player.networkHandler).teleport(loc); + } - PlayerTeleportEvent teleEvent = new PlayerTeleportEvent(player, player.getLocation(), location, PlayerTeleportEvent.TeleportCause.END_GATEWAY); - Bukkit.getPluginManager().callEvent(teleEvent); - if (teleEvent.isCancelled()) { - ci.cancel(); - return; - } + @Unique + private static Location callEvent(IMixinWorld world, IMixinEntity teleported, double x, double y, double z) { + PlayerImpl player = (PlayerImpl) teleported.getBukkitEntity(); + Location location = new Location(world.getWorldImpl(), x, y, z); + location.setPitch(player.getLocation().getPitch()); + location.setYaw(player.getLocation().getYaw()); - entity1.resetPortalCooldown(); - ((IMixinPlayNetworkHandler) ((ServerPlayerEntity) entity1).networkHandler).teleport(teleEvent.getTo()); - startTeleportCooldown(world, blockposition, state, be); - ci.cancel(); - return; - } - } + PlayerTeleportEvent teleEvent = new PlayerTeleportEvent(player, player.getLocation(), location, PlayerTeleportEvent.TeleportCause.END_GATEWAY); + return teleEvent.isCancelled() ? null : teleEvent.getTo(); + } } diff --git a/src/main/java/org/cardboardpowered/mixin/item/MixinArmorItem.java b/src/main/java/org/cardboardpowered/mixin/item/MixinArmorItem.java index be2e34b7..9c472374 100644 --- a/src/main/java/org/cardboardpowered/mixin/item/MixinArmorItem.java +++ b/src/main/java/org/cardboardpowered/mixin/item/MixinArmorItem.java @@ -1,19 +1,7 @@ package org.cardboardpowered.mixin.item; -import java.util.List; - -import org.bukkit.Bukkit; -import org.cardboardpowered.impl.block.DispenserBlockHelper; -import org.cardboardpowered.impl.entity.LivingEntityImpl; -import org.cardboardpowered.util.MixinInfo; -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.event.block.BlockDispenseArmorEvent; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; - import com.javazilla.bukkitfabric.interfaces.IMixinEntity; import com.javazilla.bukkitfabric.interfaces.IMixinWorld; - import net.minecraft.block.DispenserBlock; import net.minecraft.block.dispenser.DispenserBehavior; import net.minecraft.entity.EquipmentSlot; @@ -27,6 +15,16 @@ import net.minecraft.util.math.Box; import net.minecraft.util.math.Direction; import net.minecraft.world.World; +import org.bukkit.Bukkit; +import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.event.block.BlockDispenseArmorEvent; +import org.cardboardpowered.impl.block.DispenserBlockHelper; +import org.cardboardpowered.impl.entity.LivingEntityImpl; +import org.cardboardpowered.util.MixinInfo; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; + +import java.util.List; @MixinInfo(events = {"BlockDispenseArmorEvent"}) @Mixin(value = ArmorItem.class, priority = 900) @@ -38,8 +36,8 @@ public class MixinArmorItem { */ @Overwrite public static boolean dispenseArmor(BlockPointer isourceblock, ItemStack itemstack) { - BlockPos blockposition = isourceblock.getPos().offset((Direction) isourceblock.getBlockState().get(DispenserBlock.FACING)); - List list = isourceblock.getWorld().getEntitiesByClass(LivingEntity.class, new Box(blockposition), EntityPredicates.EXCEPT_SPECTATOR.and(new EntityPredicates.Equipable(itemstack))); + BlockPos blockposition = isourceblock.pos().offset((Direction) isourceblock.state().get(DispenserBlock.FACING)); + List list = isourceblock.world().getEntitiesByClass(LivingEntity.class, new Box(blockposition), EntityPredicates.EXCEPT_SPECTATOR.and(new EntityPredicates.Equipable(itemstack))); if (list.isEmpty()) { return false; @@ -48,8 +46,8 @@ public static boolean dispenseArmor(BlockPointer isourceblock, ItemStack itemsta EquipmentSlot enumitemslot = MobEntity.getPreferredEquipmentSlot(itemstack); ItemStack itemstack1 = itemstack.split(1); - World world = isourceblock.getWorld(); - org.bukkit.block.Block block = ((IMixinWorld)world).getWorldImpl().getBlockAt(isourceblock.getPos().getX(), isourceblock.getPos().getY(), isourceblock.getPos().getZ()); + World world = isourceblock.world(); + org.bukkit.block.Block block = ((IMixinWorld)world).getWorldImpl().getBlockAt(isourceblock.pos().getX(), isourceblock.pos().getY(), isourceblock.pos().getZ()); CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack1); BlockDispenseArmorEvent event = new BlockDispenseArmorEvent(block, craftItem.clone(), (LivingEntityImpl) ((IMixinEntity)entityliving).getBukkitEntity()); @@ -82,4 +80,4 @@ public static boolean dispenseArmor(BlockPointer isourceblock, ItemStack itemsta } } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/item/MixinBlockItem.java b/src/main/java/org/cardboardpowered/mixin/item/MixinBlockItem.java index b8897088..93729a0c 100644 --- a/src/main/java/org/cardboardpowered/mixin/item/MixinBlockItem.java +++ b/src/main/java/org/cardboardpowered/mixin/item/MixinBlockItem.java @@ -63,10 +63,10 @@ public class MixinBlockItem { */ @Inject(at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/item/BlockItem;getPlacementState(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/block/BlockState;"), - method = "place", cancellable = true) + method = "place(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/util/ActionResult;") public void bukkitWaterlilyPlacementFix(ItemPlacementContext context, CallbackInfoReturnable ci) { bukkit_state = null; - if (((BlockItem)(Object)this) instanceof PlaceableOnWaterItem ) + if (((BlockItem)(Object)this) instanceof PlaceableOnWaterItem) bukkit_state = org.bukkit.craftbukkit.block.CraftBlockState.getBlockState(context.getWorld(), context.getBlockPos()); } @@ -75,7 +75,7 @@ public void bukkitWaterlilyPlacementFix(ItemPlacementContext context, CallbackIn */ @Inject(at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/item/BlockItem;postPlacement(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/world/World;Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;Lnet/minecraft/block/BlockState;)Z"), - method = "place", cancellable = true) + method = "place(Lnet/minecraft/item/ItemPlacementContext;)Lnet/minecraft/util/ActionResult;", cancellable = true) public void doBukkitEvent_DoBlockPlaceEventForWaterlilies(ItemPlacementContext context, CallbackInfoReturnable ci) { if (bukkit_state != null) { BlockPos pos = context.getBlockPos(); @@ -83,10 +83,9 @@ public void doBukkitEvent_DoBlockPlaceEventForWaterlilies(ItemPlacementContext c PlayerEntity entityhuman = context.getPlayer(); BlockPlaceEvent placeEvent = BukkitEventFactory.callBlockPlaceEvent((ServerWorld) world, entityhuman, context.getHand(), bukkit_state, pos.getX(), pos.getY(), pos.getZ()); - if (placeEvent != null && (placeEvent.isCancelled() || !placeEvent.canBuild())) { + if (placeEvent.isCancelled() || !placeEvent.canBuild()) { bukkit_state.update(true, false); ci.setReturnValue(ActionResult.FAIL); - return; } } } @@ -107,4 +106,4 @@ public void doBukkitEvent_BlockCanBuildEvent(ItemPlacementContext blockactioncon ci.setReturnValue(event.isBuildable()); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/item/MixinBucketItem.java b/src/main/java/org/cardboardpowered/mixin/item/MixinBucketItem.java index c37d6c96..0a85e12a 100644 --- a/src/main/java/org/cardboardpowered/mixin/item/MixinBucketItem.java +++ b/src/main/java/org/cardboardpowered/mixin/item/MixinBucketItem.java @@ -1,19 +1,8 @@ package org.cardboardpowered.mixin.item; -import org.bukkit.entity.Player; -import org.bukkit.event.player.PlayerBucketEmptyEvent; -import org.bukkit.event.player.PlayerBucketFillEvent; -import org.cardboardpowered.impl.world.FakeWorldAccess; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; - import com.javazilla.bukkitfabric.impl.BukkitEventFactory; import com.javazilla.bukkitfabric.interfaces.IMixinEntity; import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; - import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.block.FluidDrainable; @@ -35,6 +24,15 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.world.RaycastContext; import net.minecraft.world.World; +import org.bukkit.entity.Player; +import org.bukkit.event.player.PlayerBucketEmptyEvent; +import org.bukkit.event.player.PlayerBucketFillEvent; +import org.cardboardpowered.impl.world.FakeWorldAccess; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(BucketItem.class) public class MixinBucketItem extends Item { @@ -47,40 +45,40 @@ public MixinBucketItem(Settings settings) { public Fluid fluid; @SuppressWarnings({ "unchecked", "rawtypes" }) - @Inject(method = "use", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/FluidDrainable;tryDrainFluid(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/item/ItemStack;")) - public void use_BF(World world, PlayerEntity entityhuman, Hand enumhand, CallbackInfoReturnable ci) { - BlockHitResult movingobjectpositionblock = raycast(world, entityhuman, this.fluid == Fluids.EMPTY ? RaycastContext.FluidHandling.NONE : RaycastContext.FluidHandling.ANY); + @Inject(method = "use", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/FluidDrainable;tryDrainFluid(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/item/ItemStack;")) + public void use_BF(World world, PlayerEntity player, Hand enumhand, CallbackInfoReturnable ci) { + BlockHitResult movingobjectpositionblock = raycast(world, player, this.fluid == Fluids.EMPTY ? RaycastContext.FluidHandling.NONE : RaycastContext.FluidHandling.ANY); BlockHitResult movingobjectpositionblock1 = (BlockHitResult) movingobjectpositionblock; BlockPos blockposition = movingobjectpositionblock1.getBlockPos(); BlockState iblockdata = world.getBlockState(blockposition); if (iblockdata.getBlock() instanceof FluidDrainable) { - ItemStack dummyFluid = ((FluidDrainable) iblockdata.getBlock()).tryDrainFluid(FakeWorldAccess.INSTANCE, blockposition, iblockdata); - PlayerBucketFillEvent event = BukkitEventFactory.callPlayerBucketFillEvent((ServerWorld) world, entityhuman, blockposition, blockposition, movingobjectpositionblock.getSide(), entityhuman.getStackInHand(enumhand), dummyFluid.getItem(), enumhand); // Paper - add enumhand + ItemStack dummyFluid = ((FluidDrainable) iblockdata.getBlock()).tryDrainFluid(player, FakeWorldAccess.INSTANCE, blockposition, iblockdata); + PlayerBucketFillEvent event = BukkitEventFactory.callPlayerBucketFillEvent((ServerWorld) world, player, blockposition, blockposition, movingobjectpositionblock.getSide(), player.getStackInHand(enumhand), dummyFluid.getItem(), enumhand); // Paper - add enumhand if (event.isCancelled()) { - ((ServerPlayerEntity) entityhuman).networkHandler.sendPacket(new BlockUpdateS2CPacket(world, blockposition)); // SPIGOT-5163 (see PlayerInteractManager) - ((Player)((IMixinServerEntityPlayer) entityhuman).getBukkitEntity()).updateInventory(); // SPIGOT-4541 - ci.setReturnValue(new TypedActionResult(ActionResult.FAIL, entityhuman.getStackInHand(enumhand))); + ((ServerPlayerEntity) player).networkHandler.sendPacket(new BlockUpdateS2CPacket(world, blockposition)); // SPIGOT-5163 (see PlayerInteractManager) + ((Player)((IMixinServerEntityPlayer) player).getBukkitEntity()).updateInventory(); // SPIGOT-4541 + ci.setReturnValue(new TypedActionResult(ActionResult.FAIL, player.getStackInHand(enumhand))); return; } } } @Inject(method = "placeFluid", at = @At("HEAD"), cancellable = true) - public void placeFluid_BF(PlayerEntity entityhuman, World world, BlockPos blockposition, BlockHitResult movingobjectpositionblock, CallbackInfoReturnable ci) { + public void placeFluid_BF(PlayerEntity player, World world, BlockPos blockposition, BlockHitResult movingobjectpositionblock, CallbackInfoReturnable ci) { if (this.fluid instanceof FlowableFluid) { BlockState iblockdata = world.getBlockState(blockposition); Block block = iblockdata.getBlock(); boolean flag = iblockdata.canBucketPlace(this.fluid); - boolean flag1 = iblockdata.isAir() || flag || block instanceof FluidFillable && ((FluidFillable) block).canFillWithFluid(world, blockposition, iblockdata, this.fluid); + boolean flag1 = iblockdata.isAir() || flag || block instanceof FluidFillable && ((FluidFillable) block).canFillWithFluid(player, world, blockposition, iblockdata, this.fluid); // CraftBukkit start - if (flag1 && entityhuman != null) { - PlayerBucketEmptyEvent event = BukkitEventFactory.callPlayerBucketEmptyEvent((ServerWorld) world, entityhuman, blockposition, movingobjectpositionblock.getBlockPos(), movingobjectpositionblock.getSide(), entityhuman.getStackInHand(entityhuman.getActiveHand()), entityhuman.getActiveHand()); + if (flag1 && player != null) { + PlayerBucketEmptyEvent event = BukkitEventFactory.callPlayerBucketEmptyEvent(world, player, blockposition, movingobjectpositionblock.getBlockPos(), movingobjectpositionblock.getSide(), player.getStackInHand(player.getActiveHand()), player.getActiveHand()); if (event.isCancelled()) { - ((ServerPlayerEntity) entityhuman).networkHandler.sendPacket(new BlockUpdateS2CPacket(world, blockposition)); - ((Player)((IMixinEntity)((ServerPlayerEntity) entityhuman)).getBukkitEntity()).updateInventory(); + ((ServerPlayerEntity) player).networkHandler.sendPacket(new BlockUpdateS2CPacket(world, blockposition)); + ((Player)((IMixinEntity) player).getBukkitEntity()).updateInventory(); ci.setReturnValue(false); return; } diff --git a/src/main/java/org/cardboardpowered/mixin/item/MixinItemStack.java b/src/main/java/org/cardboardpowered/mixin/item/MixinItemStack.java index 945b88c0..48136c30 100644 --- a/src/main/java/org/cardboardpowered/mixin/item/MixinItemStack.java +++ b/src/main/java/org/cardboardpowered/mixin/item/MixinItemStack.java @@ -1,19 +1,6 @@ package org.cardboardpowered.mixin.item; // import java.util.Random; -import java.util.function.Consumer; - -import org.bukkit.craftbukkit.block.CraftBlockState; -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.entity.Player; -import org.bukkit.event.player.PlayerItemDamageEvent; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.javazilla.bukkitfabric.impl.BukkitEventFactory; import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; @@ -35,11 +22,23 @@ import net.minecraft.util.ActionResult; import net.minecraft.util.Hand; import net.minecraft.util.math.BlockPos; -import java.util.List; - +import net.minecraft.util.math.random.Random; import org.bukkit.block.BlockState; +import org.bukkit.craftbukkit.block.CraftBlockState; +import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.entity.Player; import org.bukkit.event.block.BlockPlaceEvent; -import net.minecraft.util.math.random.Random; +import org.bukkit.event.player.PlayerItemDamageEvent; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import java.util.List; +import java.util.function.Consumer; @Mixin(value = ItemStack.class, priority = 999) public class MixinItemStack { @@ -47,8 +46,8 @@ public class MixinItemStack { @Shadow private Item item; - @Inject(at = @At("HEAD"), method = "damage", cancellable = true) - public void callPlayerItemDamageEvent(int i, Random random, ServerPlayerEntity entityplayer, CallbackInfoReturnable ci) { + @Inject(at = @At("HEAD"), method = "damage(ILnet/minecraft/util/math/random/Random;Lnet/minecraft/server/network/ServerPlayerEntity;)Z", cancellable = true) + public void callPlayerItemDamageEvent(int i, Random random, ServerPlayerEntity player, CallbackInfoReturnable ci) { if (!((ItemStack)(Object)this).isDamageable()) { ci.setReturnValue(false); return; @@ -59,8 +58,8 @@ public void callPlayerItemDamageEvent(int i, Random random, ServerPlayerEntity e j = EnchantmentHelper.getLevel(Enchantments.UNBREAKING, ((ItemStack)(Object)this)); for (int l = 0; j > 0 && l < i; ++l) if (UnbreakingEnchantment.shouldPreventDamage(((ItemStack)(Object)this), j, random)) i--; - if (entityplayer != null) { - PlayerItemDamageEvent event = new PlayerItemDamageEvent((Player) ((IMixinServerEntityPlayer)entityplayer).getBukkitEntity(), CraftItemStack.asCraftMirror((ItemStack)(Object)this), i); + if (player != null) { + PlayerItemDamageEvent event = new PlayerItemDamageEvent((Player) ((IMixinServerEntityPlayer)player).getBukkitEntity(), CraftItemStack.asCraftMirror((ItemStack)(Object)this), i); event.getPlayer().getServer().getPluginManager().callEvent(event); if (i != event.getDamage() || event.isCancelled()) event.getPlayer().updateInventory(); @@ -75,11 +74,10 @@ public void callPlayerItemDamageEvent(int i, Random random, ServerPlayerEntity e return; } } - if (entityplayer != null && i != 0) Criteria.ITEM_DURABILITY_CHANGED.trigger(entityplayer, ((ItemStack)(Object)this), ((ItemStack)(Object)this).getDamage() + i); + if (player != null && i != 0) Criteria.ITEM_DURABILITY_CHANGED.trigger(player, ((ItemStack)(Object)this), ((ItemStack)(Object)this).getDamage() + i); ((ItemStack)(Object)this).setDamage((j = ((ItemStack)(Object)this).getDamage() + i)); ci.setReturnValue(j >= ((ItemStack)(Object)this).getMaxDamage()); - return; } @Overwrite @@ -146,4 +144,4 @@ public void damage(int i, T t0, Consumer consumer, C return; } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/item/MixinSkullItem.java b/src/main/java/org/cardboardpowered/mixin/item/MixinSkullItem.java deleted file mode 100644 index 9ad92e68..00000000 --- a/src/main/java/org/cardboardpowered/mixin/item/MixinSkullItem.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.cardboardpowered.mixin.item; - -import java.util.UUID; - -import org.apache.commons.lang3.StringUtils; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; - -import com.mojang.authlib.GameProfile; - -import net.minecraft.block.Block; -import net.minecraft.block.entity.SkullBlockEntity; -import net.minecraft.item.Item; -import net.minecraft.item.SkullItem; -//import net.minecraft.item.WallStandingBlockItem; -import net.minecraft.nbt.NbtCompound; -import net.minecraft.nbt.NbtHelper; -import net.minecraft.nbt.NbtList; - -@Mixin(value = SkullItem.class, priority = 900) -public class MixinSkullItem extends Item { - - public MixinSkullItem(Settings properties) { - super(properties); - } - - /** - * @reason Bukkit - * @author . - */ - @Overwrite - public void postProcessNbt(NbtCompound compoundTag) { - super.postProcessNbt(compoundTag); - if (compoundTag.contains("SkullOwner", 8) && !StringUtils.isBlank(compoundTag.getString("SkullOwner"))) { - GameProfile gameProfile = new GameProfile((UUID)null, compoundTag.getString("SkullOwner")); - SkullBlockEntity.loadProperties(gameProfile, (gameProfilex) -> { - compoundTag.put("SkullOwner", NbtHelper.writeGameProfile(new NbtCompound(), gameProfilex)); - }); - // CraftBukkit start - } else { - net.minecraft.nbt.NbtList textures = compoundTag.getCompound("SkullOwner").getCompound("Properties").getList("textures", 10); // Safe due to method contracts - for (net.minecraft.nbt.NbtElement texture : textures) { - if (texture instanceof NbtCompound && !((NbtCompound) texture).contains("Signature", 8) && ((NbtCompound) texture).getString("Value").trim().isEmpty()) { - compoundTag.remove("SkullOwner"); - break; - } - } - // CraftBukkit end - } - - } - -} \ No newline at end of file diff --git a/src/main/java/org/cardboardpowered/mixin/loot/MixinLootManager.java b/src/main/java/org/cardboardpowered/mixin/loot/MixinLootManager.java index 4a116b31..a22db7ab 100644 --- a/src/main/java/org/cardboardpowered/mixin/loot/MixinLootManager.java +++ b/src/main/java/org/cardboardpowered/mixin/loot/MixinLootManager.java @@ -1,24 +1,18 @@ package org.cardboardpowered.mixin.loot; -import java.util.Map; - -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - import com.google.common.collect.ImmutableMap; -import com.google.gson.JsonElement; import com.javazilla.bukkitfabric.interfaces.IMixinLootManager; - import net.minecraft.loot.LootDataKey; import net.minecraft.loot.LootDataType; import net.minecraft.loot.LootManager; -import net.minecraft.loot.LootTable; -import net.minecraft.resource.ResourceManager; import net.minecraft.util.Identifier; -import net.minecraft.util.profiler.Profiler; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.Map; @Mixin(LootManager.class) public class MixinLootManager implements IMixinLootManager { @@ -38,14 +32,14 @@ public Map getLootTableToKeyMapBF() { return lootTableToKey; } - @Inject(at = @At("TAIL"), method = "validate") + @Inject(at = @At("TAIL"), method = "validate(Ljava/util/Map;)V") private void cardboard$buildRev(Map, Map> map, CallbackInfo ci) { // public void fillLootTableToKeyMap(Map map, ResourceManager iresourcemanager, Profiler gameprofilerfiller, CallbackInfo ci) { ImmutableMap.Builder lootTableToKeyBuilder = ImmutableMap.builder(); // this.keyToValue.forEach((lootTable, key) -> lootTableToKeyBuilder.put(key, lootTable)); - this.keyToValue.forEach((key, lootTable) -> lootTableToKeyBuilder.put((Object) lootTable, key.id())); + this.keyToValue.forEach((key, lootTable) -> lootTableToKeyBuilder.put(lootTable, key.id())); this.lootTableToKey = lootTableToKeyBuilder.build(); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/loot/MixinRandomChanceWithLootingLootCondition.java b/src/main/java/org/cardboardpowered/mixin/loot/MixinRandomChanceWithLootingLootCondition.java index 766b5c18..bdee14df 100644 --- a/src/main/java/org/cardboardpowered/mixin/loot/MixinRandomChanceWithLootingLootCondition.java +++ b/src/main/java/org/cardboardpowered/mixin/loot/MixinRandomChanceWithLootingLootCondition.java @@ -1,23 +1,21 @@ package org.cardboardpowered.mixin.loot; +import com.javazilla.bukkitfabric.interfaces.IMixinLootContextParameters; +import net.minecraft.loot.condition.RandomChanceWithLootingLootCondition; +import net.minecraft.loot.context.LootContext; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import com.javazilla.bukkitfabric.interfaces.IMixinLootContextParameters; - -import net.minecraft.loot.condition.RandomChanceWithLootingLootCondition; -import net.minecraft.loot.context.LootContext; - @Mixin(RandomChanceWithLootingLootCondition.class) public class MixinRandomChanceWithLootingLootCondition { + @Final @Shadow private float chance; + @Final @Shadow private float lootingMultiplier; - @Shadow private float chance; - @Shadow private float lootingMultiplier; - - @Inject(at = @At("RETURN"), method = "test", cancellable = true) + @Inject(at = @At("RETURN"), method = "test(Lnet/minecraft/loot/context/LootContext;)Z", cancellable = true) public void cardboard_test(LootContext loottableinfo, CallbackInfoReturnable ci) { if (loottableinfo.hasParameter(IMixinLootContextParameters.LOOTING_MOD)) { int i = loottableinfo.get(IMixinLootContextParameters.LOOTING_MOD); @@ -26,4 +24,4 @@ public void cardboard_test(LootContext loottableinfo, CallbackInfoReturnable ci) { - Float ofloat = (Float) loottableinfo.get(LootContextParameters.EXPLOSION_RADIUS); - if (null == ofloat) { + Float ofloat = loottableinfo.get(LootContextParameters.EXPLOSION_RADIUS); + if (ofloat == null) { ci.setReturnValue(true); return; } @@ -23,4 +22,4 @@ public void cardboard_test(LootContext loottableinfo, CallbackInfoReturnable ver.getProtocolVersion()) { - } else if (packethandshakinginsetprotocol.getProtocolVersion() < ver.getProtocolVersion()) { + if (packethandshakinginsetprotocol.protocolVersion() > ver.getProtocolVersion()) { + } else if (packethandshakinginsetprotocol.protocolVersion() < ver.getProtocolVersion()) { } else { if (org.spigotmc.SpigotConfig.bungee) { String[] split = packethandshakinginsetprotocol.address.split("\00"); if ( split.length == 3 || split.length == 4 ) { // TODO 1.17ify packethandshakinginsetprotocol.address = split[0]; connection.address = new java.net.InetSocketAddress(split[1], ((java.net.InetSocketAddress) connection.getAddress()).getPort()); - ((IMixinClientConnection)connection).setSpoofedUUID(com.mojang.util.UUIDTypeAdapter.fromString( split[2] )); + ((IMixinClientConnection)connection).setSpoofedUUID(fromString( split[2] )); } else { return; } if ( split.length == 4 ) ((IMixinClientConnection)connection).setSpoofedProfile(gson.fromJson(split[3], com.mojang.authlib.properties.Property[].class)); } - ((IMixinServerLoginNetworkHandler)((ServerLoginNetworkHandler) this.connection.getPacketListener())).setHostname(packethandshakinginsetprotocol.address + ":" + ((IHandshakeC2SPacket)packethandshakinginsetprotocol).getPortBF()); // Bukkit - set hostname + ((IMixinServerLoginNetworkHandler)((ServerLoginNetworkHandler) this.connection.getPacketListener())).setHostname(packethandshakinginsetprotocol.address + ":" + packethandshakinginsetprotocol.port()); // Bukkit - set hostname } } } -} \ No newline at end of file + private UUID fromString(final String input) { + return UUID.fromString(input.replaceFirst("(\\w{8})(\\w{4})(\\w{4})(\\w{4})(\\w{12})", "$1-$2-$3-$4-$5")); + } + +} diff --git a/src/main/java/org/cardboardpowered/mixin/network/MixinServerLoginNetworkHandler.java b/src/main/java/org/cardboardpowered/mixin/network/MixinServerLoginNetworkHandler.java index 442938b4..950a5a38 100644 --- a/src/main/java/org/cardboardpowered/mixin/network/MixinServerLoginNetworkHandler.java +++ b/src/main/java/org/cardboardpowered/mixin/network/MixinServerLoginNetworkHandler.java @@ -1,33 +1,5 @@ package org.cardboardpowered.mixin.network; -import java.math.BigInteger; -import java.net.InetAddress; -import java.net.InetSocketAddress; -import java.net.SocketAddress; -import java.security.PrivateKey; -import java.time.Duration; -import java.util.UUID; - -import javax.crypto.Cipher; -import javax.crypto.SecretKey; - -import org.apache.commons.lang3.Validate; -import org.apache.logging.log4j.Level; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.craftbukkit.util.Waitable; -import org.bukkit.event.player.AsyncPlayerPreLoginEvent; -import org.bukkit.event.player.PlayerPreLoginEvent; -import org.jetbrains.annotations.Nullable; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.Redirect; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - import com.javazilla.bukkitfabric.BukkitFabricMod; import com.javazilla.bukkitfabric.interfaces.IMixinClientConnection; import com.javazilla.bukkitfabric.interfaces.IMixinMinecraftServer; @@ -35,179 +7,214 @@ import com.javazilla.bukkitfabric.interfaces.IMixinServerLoginNetworkHandler; import com.mojang.authlib.GameProfile; import com.mojang.authlib.exceptions.AuthenticationUnavailableException; - import io.netty.channel.local.LocalAddress; import net.minecraft.network.ClientConnection; import net.minecraft.network.encryption.NetworkEncryptionException; import net.minecraft.network.encryption.NetworkEncryptionUtils; -import net.minecraft.network.encryption.PlayerPublicKey; -import net.minecraft.network.encryption.SignatureVerifier; +import net.minecraft.network.packet.c2s.login.EnterConfigurationC2SPacket; import net.minecraft.network.packet.c2s.login.LoginHelloC2SPacket; import net.minecraft.network.packet.c2s.login.LoginKeyC2SPacket; import net.minecraft.network.packet.s2c.login.LoginDisconnectS2CPacket; import net.minecraft.server.MinecraftServer; import net.minecraft.server.PlayerManager; +import net.minecraft.server.network.ConnectedClientData; +import net.minecraft.server.network.ServerConfigurationNetworkHandler; import net.minecraft.server.network.ServerLoginNetworkHandler; -import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.network.ServerLoginNetworkHandler.State; +import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.text.Text; import net.minecraft.util.Uuids; +import org.apache.commons.lang3.Validate; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.craftbukkit.util.Waitable; +import org.bukkit.event.player.AsyncPlayerPreLoginEvent; +import org.bukkit.event.player.PlayerPreLoginEvent; +import org.cardboardpowered.interfaces.INetworkConfiguration; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; + +import javax.crypto.Cipher; +import javax.crypto.SecretKey; +import java.math.BigInteger; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.security.PrivateKey; +import java.util.Objects; +import java.util.UUID; @SuppressWarnings("deprecation") @Mixin(value = ServerLoginNetworkHandler.class, priority = 999) -public class MixinServerLoginNetworkHandler implements IMixinServerLoginNetworkHandler { - - @Shadow private byte[] nonce = new byte[4]; - @Shadow private MinecraftServer server; - @Shadow public ClientConnection connection; - @Shadow private ServerLoginNetworkHandler.State state; - @Shadow private GameProfile profile; - @Shadow public ServerPlayerEntity delayedPlayer; - - @Override +public abstract class MixinServerLoginNetworkHandler implements IMixinServerLoginNetworkHandler { + + @Shadow @Nullable private String profileName; + @Shadow + abstract void startVerify(GameProfile profile); + @Shadow + protected static GameProfile createOfflineProfile(String name) {return null;} + @Shadow private byte[] nonce = new byte[4]; + @Shadow private MinecraftServer server; + @Shadow public ClientConnection connection; + @Shadow private ServerLoginNetworkHandler.State state; + @Shadow private GameProfile profile; + public ServerPlayerEntity delayedPlayer; + + @Override public ClientConnection cb_get_connection() { return connection; } - - private Logger LOGGER_BF = LogManager.getLogger("Bukkit|ServerLoginNetworkHandler"); - public String hostname = ""; // Bukkit - add field - private long theid = 0; - - //@Shadow - //private PlayerPublicKey.PublicKeyData publicKeyData; - - @Inject(at = @At("TAIL"), method = "*") - public void setBF(MinecraftServer minecraftserver, ClientConnection networkmanager, CallbackInfo ci) { - BukkitFabricMod.NETWORK_CACHE.add((ServerLoginNetworkHandler)(Object)this); - } - - @Override - public String getHostname() { - return hostname; - } - - @Override - public void setHostname(String s) { - this.hostname = s; - } - - @Overwrite - public void onKey(LoginKeyC2SPacket packetIn) { - Validate.validState(this.state == ServerLoginNetworkHandler.State.KEY, "Unexpected key packet"); - - final String s; - try { - PrivateKey privatekey = this.server.getKeyPair().getPrivate(); - if (!packetIn.verifySignedNonce(this.nonce, privatekey)) { - throw new IllegalStateException("Protocol error"); - } - SecretKey secretKey = packetIn.decryptSecretKey(privatekey); - Cipher cipher = NetworkEncryptionUtils.cipherFromKey(2, secretKey); - Cipher cipher1 = NetworkEncryptionUtils.cipherFromKey(1, secretKey); - s = (new BigInteger(NetworkEncryptionUtils.computeServerId("", this.server.getKeyPair().getPublic(), secretKey))).toString(16); - this.state = ServerLoginNetworkHandler.State.AUTHENTICATING; - this.connection.setupEncryption(cipher, cipher1); - } catch (NetworkEncryptionException cryptexception) { - throw new IllegalStateException("Protocol error", cryptexception); - } + private Logger LOGGER_BF = LogManager.getLogger("Bukkit|ServerLoginNetworkHandler"); + public String hostname = ""; // Bukkit - add field + private long theid = 0; - Thread thread = new Thread("User Authenticator #" + theid++) { - @Override - public void run() { - GameProfile gameprofile = profile; - - try { - profile = server.getSessionService().hasJoinedServer(new GameProfile((UUID)null, gameprofile.getName()), s, this.a()); - if (profile != null) { - // Fire PlayerPreLoginEvent - if (!connection.isOpen()) return; - fireEvents(); - } else if (server.isSingleplayer()) { - LOGGER_BF.warn("Failed to verify username but will let them in anyway!"); - profile = toOfflineProfile(gameprofile); - state = ServerLoginNetworkHandler.State.READY_TO_ACCEPT; - } else { - disconnect("multiplayer.disconnect.unverified_username"); - LOGGER_BF.error("Username '{}' tried to join with an invalid session", gameprofile.getName()); - } - } catch (AuthenticationUnavailableException authenticationunavailableexception) { - if (server.isSingleplayer()) { - LOGGER_BF.warn("Authentication servers are down but will let them in anyway!"); - profile = toOfflineProfile(gameprofile); - state = ServerLoginNetworkHandler.State.READY_TO_ACCEPT; - } else { - disconnect("multiplayer.disconnect.authservers_down"); - LOGGER_BF.error("Couldn't verify username because servers are unavailable"); - } - } catch (Exception exception) { - disconnect("Failed to verify username!"); - LOGGER_BF.log(Level.WARN, "Exception verifying " + gameprofile.getName(), exception); - } - } + //@Shadow + // private PlayerPublicKey.PublicKeyData publicKeyData; - @Nullable - private InetAddress a() { - SocketAddress socketaddress = connection.getAddress(); - return server.shouldPreventProxyConnections() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null; - } - }; - // TODO: thread.setUncaughtExceptionHandler(new UncaughtExceptionLogger(LogManager.getLogger("BukkitServerLoginManager"))); - thread.start(); - } - - public void fireEvents() throws Exception { - String playerName = profile.getName(); - java.net.InetAddress address; - if (connection.getAddress() instanceof LocalAddress) { - address = InetAddress.getLocalHost(); - } else address = ((java.net.InetSocketAddress) connection.getAddress()).getAddress(); - UUID uniqueId = profile.getId(); - final org.bukkit.craftbukkit.CraftServer server = CraftServer.INSTANCE; - - AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId); - server.getPluginManager().callEvent(asyncEvent); - - if (PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) { - final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId); - if (asyncEvent.getResult() != PlayerPreLoginEvent.Result.ALLOWED) - event.disallow(asyncEvent.getResult(), asyncEvent.getKickMessage()); - - Waitable waitable = new Waitable() { - @Override - protected PlayerPreLoginEvent.Result evaluate() { - server.getPluginManager().callEvent(event); - return event.getResult(); - } - }; - - ((IMixinMinecraftServer)CraftServer.server).getProcessQueue().add(waitable); - if (waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) { - disconnect(event.getKickMessage()); - return; - } - } else { - if (asyncEvent.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) { - disconnect(asyncEvent.getKickMessage()); - return; - } - } - LOGGER_BF.info("UUID of player {} is {}", profile.getName(), profile.getId()); - state = ServerLoginNetworkHandler.State.READY_TO_ACCEPT; - } - - public void disconnect(String s) { - try { - Text text = Text.of(s); - LOGGER_BF.info("Disconnecting BUKKITFABRIC_TODO: " + s); - this.connection.send(new LoginDisconnectS2CPacket(text)); - this.connection.disconnect(text); - } catch (Exception exception) { - LOGGER_BF.error("Error whilst disconnecting player", exception); - } - } + @Inject(at = @At("TAIL"), method = "*") + public void setBF(MinecraftServer minecraftserver, ClientConnection networkmanager, CallbackInfo ci) { + BukkitFabricMod.NETWORK_CACHE.add((ServerLoginNetworkHandler) (Object) this); + } - private ServerPlayerEntity cardboard_player; + @Override + public String getHostname() { + return hostname; + } + + @Override + public void setHostname(String s) { + this.hostname = s; + } + + @Overwrite + public void onKey(LoginKeyC2SPacket packetIn) { + Validate.validState(this.state == ServerLoginNetworkHandler.State.KEY, "Unexpected key packet"); + + final String s; + try { + PrivateKey privatekey = this.server.getKeyPair().getPrivate(); + if(!packetIn.verifySignedNonce(this.nonce, privatekey)) { + throw new IllegalStateException("Protocol error"); + } + + SecretKey secretKey = packetIn.decryptSecretKey(privatekey); + Cipher cipher = NetworkEncryptionUtils.cipherFromKey(2, secretKey); + Cipher cipher1 = NetworkEncryptionUtils.cipherFromKey(1, secretKey); + s = (new BigInteger(NetworkEncryptionUtils.computeServerId("", this.server.getKeyPair() + .getPublic(), secretKey))).toString(16); + this.state = ServerLoginNetworkHandler.State.AUTHENTICATING; + this.connection.setupEncryption(cipher, cipher1); + } catch(NetworkEncryptionException cryptexception) { + throw new IllegalStateException("Protocol error", cryptexception); + } + + Thread thread = new Thread("User Authenticator #" + theid++) { + @Override + public void run() { + GameProfile gameprofile = profile; + String name = Objects.requireNonNull(profileName, "Player name not initialized"); + + try { + profile = server.getSessionService().hasJoinedServer(name, s, this.a()).profile(); + if(profile != null) { + // Fire PlayerPreLoginEvent + if(!connection.isOpen()) return; + fireEvents(); + } else if(server.isSingleplayer()) { + LOGGER_BF.warn("Failed to verify username but will let them in anyway!"); + profile = createOfflineProfile(name); + startVerify(profile); + } else { + disconnect("multiplayer.disconnect.unverified_username"); + LOGGER_BF.error("Username '{}' tried to join with an invalid session", gameprofile.getName()); + } + } catch(AuthenticationUnavailableException authenticationunavailableexception) { + if(server.isSingleplayer()) { + LOGGER_BF.warn("Authentication servers are down but will let them in anyway!"); + profile = createOfflineProfile(name); + startVerify(profile); + } else { + disconnect("multiplayer.disconnect.authservers_down"); + LOGGER_BF.error("Couldn't verify username because servers are unavailable"); + } + } catch(Exception exception) { + disconnect("Failed to verify username!"); + LOGGER_BF.log(Level.WARN, "Exception verifying " + name, exception); + } + } + + @Nullable + private InetAddress a() { + SocketAddress socketaddress = connection.getAddress(); + return server.shouldPreventProxyConnections() && socketaddress instanceof InetSocketAddress ? ((InetSocketAddress) socketaddress).getAddress() : null; + } + }; + // TODO: thread.setUncaughtExceptionHandler(new UncaughtExceptionLogger(LogManager.getLogger("BukkitServerLoginManager"))); + thread.start(); + } + + public void fireEvents() throws Exception { + String playerName = profile.getName(); + java.net.InetAddress address; + if(connection.getAddress() instanceof LocalAddress) { + address = InetAddress.getLocalHost(); + } else address = ((java.net.InetSocketAddress) connection.getAddress()).getAddress(); + UUID uniqueId = profile.getId(); + final org.bukkit.craftbukkit.CraftServer server = CraftServer.INSTANCE; + + AsyncPlayerPreLoginEvent asyncEvent = new AsyncPlayerPreLoginEvent(playerName, address, uniqueId); + server.getPluginManager().callEvent(asyncEvent); + + if(PlayerPreLoginEvent.getHandlerList().getRegisteredListeners().length != 0) { + final PlayerPreLoginEvent event = new PlayerPreLoginEvent(playerName, address, uniqueId); + if(asyncEvent.getResult() != PlayerPreLoginEvent.Result.ALLOWED) + event.disallow(asyncEvent.getResult(), asyncEvent.getKickMessage()); + + Waitable waitable = new Waitable() { + @Override + protected PlayerPreLoginEvent.Result evaluate() { + server.getPluginManager().callEvent(event); + return event.getResult(); + } + }; + + ((IMixinMinecraftServer) CraftServer.server).getProcessQueue().add(waitable); + if(waitable.get() != PlayerPreLoginEvent.Result.ALLOWED) { + disconnect(event.getKickMessage()); + return; + } + } else { + if(asyncEvent.getLoginResult() != AsyncPlayerPreLoginEvent.Result.ALLOWED) { + disconnect(asyncEvent.getKickMessage()); + return; + } + } + LOGGER_BF.info("UUID of player {} is {}", profile.getName(), profile.getId()); + startVerify(profile); + } + + public void disconnect(String s) { + try { + Text text = Text.of(s); + LOGGER_BF.info("Disconnecting BUKKITFABRIC_TODO: " + s); + this.connection.send(new LoginDisconnectS2CPacket(text)); + this.connection.disconnect(text); + } catch(Exception exception) { + LOGGER_BF.error("Error whilst disconnecting player", exception); + } + } + + private ServerPlayerEntity cardboard_player; /*@Overwrite private static PlayerPublicKey getVerifiedPublicKey(@Nullable PlayerPublicKey.PublicKeyData publicKeyData, UUID playerUuid, SignatureVerifier servicesSignatureVerifier, boolean shouldThrowOnMissingKey) throws PlayerPublicKey.PublicKeyException { @@ -220,12 +227,12 @@ private static PlayerPublicKey getVerifiedPublicKey(@Nullable PlayerPublicKey.Pu } return PlayerPublicKey.verifyAndDecode(servicesSignatureVerifier, playerUuid, publicKeyData, Duration.ZERO); }*/ - - @Redirect(at = @At(value = "INVOKE", - target = "Lnet/minecraft/server/PlayerManager;checkCanJoin(Ljava/net/SocketAddress;Lcom/mojang/authlib/GameProfile;)Lnet/minecraft/text/Text;"), - method = "acceptPlayer") - public Text acceptPlayer_checkCanJoin(PlayerManager man, SocketAddress a, GameProfile b) { - IMixinPlayerManager pm = ((IMixinPlayerManager)this.server.getPlayerManager()); + + @Redirect(at = @At(value = "INVOKE", + target = "Lnet/minecraft/server/PlayerManager;checkCanJoin(Ljava/net/SocketAddress;Lcom/mojang/authlib/GameProfile;)Lnet/minecraft/text/Text;"), + method = "tickVerify") + public Text acceptPlayer_checkCanJoin(PlayerManager man, SocketAddress a, GameProfile b) { + IMixinPlayerManager pm = ((IMixinPlayerManager) this.server.getPlayerManager()); /*PlayerPublicKey playerPublicKey; try { @@ -236,74 +243,82 @@ public Text acceptPlayer_checkCanJoin(PlayerManager man, SocketAddress a, GamePr this.disconnect(publicKeyException.getMessageText()); return null; }*/ - - ServerPlayerEntity s = pm.attemptLogin((ServerLoginNetworkHandler)(Object)this, this.profile, null, hostname); - - cardboard_player = s; - - return null; - } - - // 1.19.2: target = "Lnet/minecraft/server/PlayerManager;createPlayer(Lcom/mojang/authlib/GameProfile;Lnet/minecraft/network/encryption/PlayerPublicKey;)Lnet/minecraft/server/network/ServerPlayerEntity;"), - // 1.19.4: target = "Lnet/minecraft/server/PlayerManager;createPlayer(Lcom/mojang/authlib/GameProfile;)Lnet/minecraft/server/network/ServerPlayerEntity;"), - @Redirect(at = @At(value = "INVOKE", - target = "Lnet/minecraft/server/PlayerManager;createPlayer(Lcom/mojang/authlib/GameProfile;)Lnet/minecraft/server/network/ServerPlayerEntity;"), - method = "acceptPlayer") - public ServerPlayerEntity acceptPlayer_createPlayer(PlayerManager man, GameProfile a/*, PlayerPublicKey key*/) { - return cardboard_player; - } - - @Inject(at = @At("HEAD"), method="onHello", cancellable = true) - public void spigotHello1(LoginHelloC2SPacket p, CallbackInfo ci) { - //if (null == this.publicKeyData) { - // this.publicKeyData = p.publicKey().orElse(null); - //} - if (state != State.HELLO) { - LOGGER_BF.info("Cancel onHello because state is " + state); - ((ServerLoginNetworkHandler)(Object)this).acceptPlayer(); - ci.cancel(); - } - } - - @Inject(at = @At("TAIL"), method="onHello") - public void spigotHello(LoginHelloC2SPacket packetlogininstart, CallbackInfo ci) { - if (!(this.server.isOnlineMode() && !this.connection.isLocal())) { - // Spigot start - new Thread("User Authenticator #" + theid++) { - @Override - public void run() { - try { - initUUID(); - fireEvents(); - } catch (Exception ex) { - disconnect("Failed to verify username!"); - CraftServer.INSTANCE.getLogger().log(java.util.logging.Level.WARNING, "Exception verifying " + profile.getName(), ex); - } - } - }.start(); - // Spigot end - } - } - - // Spigot start - public void initUUID() { - UUID uuid; - if ( ((IMixinClientConnection)connection).getSpoofedUUID() != null ) - uuid = ((IMixinClientConnection)connection).getSpoofedUUID(); - else { - // Note: PlayerEntity (1.18) -> DynamicSerializableUuid (1.19) -> Uuids (1.19.4) - uuid = Uuids.getOfflinePlayerUuid( this.profile.getName() ); - } - this.profile = new GameProfile( uuid, this.profile.getName() ); + ServerPlayerEntity s = pm.attemptLogin((ServerLoginNetworkHandler) (Object) this, this.profile, null, hostname); + + cardboard_player = s; + + return null; + } + + // 1.19.2: target = "Lnet/minecraft/server/PlayerManager;createPlayer(Lcom/mojang/authlib/GameProfile;Lnet/minecraft/network/encryption/PlayerPublicKey;)Lnet/minecraft/server/network/ServerPlayerEntity;"), + // 1.19.4: target = "Lnet/minecraft/server/PlayerManager;createPlayer(Lcom/mojang/authlib/GameProfile;)Lnet/minecraft/server/network/ServerPlayerEntity;"), + // @Redirect(at = @At(value = "INVOKE", + // target = "Lnet/minecraft/server/PlayerManager;createPlayer(Lcom/mojang/authlib/GameProfile;)Lnet/minecraft/server/network/ServerPlayerEntity;"), + // method = "acceptPlayer") + // public ServerPlayerEntity acceptPlayer_createPlayer(PlayerManager man, GameProfile a/*, PlayerPublicKey key*/) { + // return cardboard_player; + // } + + @Inject(at = @At("HEAD"), method = "onHello", cancellable = true) + public void spigotHello1(LoginHelloC2SPacket p, CallbackInfo ci) { + // if (null == this.publicKeyData) { + // this.publicKeyData = p.publicKey().orElse(null); + //} + if(state != State.HELLO) { + LOGGER_BF.info("Cancel onHello because state is " + state); + startVerify(profile); + ci.cancel(); + } + } - if (((IMixinClientConnection)connection).getSpoofedProfile() != null) - for ( com.mojang.authlib.properties.Property property : ((IMixinClientConnection)connection).getSpoofedProfile() ) - this.profile.getProperties().put( property.getName(), property ); - } - // Spigot end + @Inject(at = @At("TAIL"), method = "onHello") + public void spigotHello(LoginHelloC2SPacket packetlogininstart, CallbackInfo ci) { + if(!(this.server.isOnlineMode() && !this.connection.isLocal())) { + // Spigot start + new Thread("User Authenticator #" + theid++) { + @Override + public void run() { + try { + initUUID(); + fireEvents(); + } catch(Exception ex) { + disconnect("Failed to verify username!"); + CraftServer.INSTANCE.getLogger() + .log(java.util.logging.Level.WARNING, "Exception verifying " + profile.getName(), ex); + } + } + }.start(); + // Spigot end + } + } + + // Spigot start + public void initUUID() { + UUID uuid; + if(((IMixinClientConnection) connection).getSpoofedUUID() != null) + uuid = ((IMixinClientConnection) connection).getSpoofedUUID(); + else { + // Note: PlayerEntity (1.18) -> DynamicSerializableUuid (1.19) -> Uuids (1.19.4) + uuid = Uuids.getOfflinePlayerUuid(this.profile.getName()); + } + + this.profile = new GameProfile(uuid, this.profile.getName()); + + if(((IMixinClientConnection) connection).getSpoofedProfile() != null) + for(com.mojang.authlib.properties.Property property : ((IMixinClientConnection) connection).getSpoofedProfile()) + this.profile.getProperties().put(property.name(), property); + } + // Spigot end + + @Inject(method = "onEnterConfiguration", locals = LocalCapture.CAPTURE_FAILHARD, at = @At(value = "INVOKE", target = "Lnet/minecraft/network/ClientConnection;setPacketListener(Lnet/minecraft/network/listener/PacketListener;)V")) + private void onCreateNetworkConfig(EnterConfigurationC2SPacket packet, CallbackInfo ci, ConnectedClientData connectedClientData, ServerConfigurationNetworkHandler networkConfig) { + if(cardboard_player != null) { + ((INetworkConfiguration) networkConfig).cardboard_setPlayer(cardboard_player); + } + } - @Shadow protected GameProfile toOfflineProfile(GameProfile gameprofile) {return null;} - @Shadow public void disconnect(Text t) {} + @Shadow + public void disconnect(Text t) {} -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/network/MixinServerPlayNetworkHandler.java b/src/main/java/org/cardboardpowered/mixin/network/MixinServerPlayNetworkHandler.java index f462fd8c..c85e8c85 100644 --- a/src/main/java/org/cardboardpowered/mixin/network/MixinServerPlayNetworkHandler.java +++ b/src/main/java/org/cardboardpowered/mixin/network/MixinServerPlayNetworkHandler.java @@ -1,34 +1,5 @@ package org.cardboardpowered.mixin.network; -import java.util.Collections; -import java.util.Set; -import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; - -import org.bukkit.Bukkit; -import org.bukkit.Location; -import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.entity.Player; -import org.bukkit.event.block.Action; -import org.bukkit.event.inventory.InventoryCloseEvent; -import org.bukkit.event.player.PlayerAnimationEvent; -import org.bukkit.event.player.PlayerItemHeldEvent; -import org.bukkit.event.player.PlayerKickEvent; -import org.bukkit.event.player.PlayerMoveEvent; -import org.bukkit.event.player.PlayerResourcePackStatusEvent; -import org.bukkit.event.player.PlayerTeleportEvent; -import org.bukkit.event.player.PlayerToggleFlightEvent; -import org.bukkit.event.player.PlayerToggleSneakEvent; -import org.bukkit.event.player.PlayerToggleSprintEvent; -import org.cardboardpowered.impl.entity.PlayerImpl; -import org.cardboardpowered.impl.inventory.CardboardInventoryView; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -import com.javazilla.bukkitfabric.BukkitFabricMod; import com.javazilla.bukkitfabric.impl.BukkitEventFactory; import com.javazilla.bukkitfabric.interfaces.IMixinPlayNetworkHandler; import com.javazilla.bukkitfabric.interfaces.IMixinResourcePackStatusC2SPacket; @@ -43,19 +14,21 @@ import net.minecraft.item.ItemStack; import net.minecraft.network.ClientConnection; import net.minecraft.network.NetworkThreadUtils; -import net.minecraft.network.packet.Packet; import net.minecraft.network.PacketCallbacks; +import net.minecraft.network.packet.c2s.common.ResourcePackStatusC2SPacket; import net.minecraft.network.packet.c2s.play.ClientCommandC2SPacket; import net.minecraft.network.packet.c2s.play.HandSwingC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerInteractItemC2SPacket; import net.minecraft.network.packet.c2s.play.PlayerMoveC2SPacket; -import net.minecraft.network.packet.c2s.play.ResourcePackStatusC2SPacket; import net.minecraft.network.packet.c2s.play.UpdatePlayerAbilitiesC2SPacket; import net.minecraft.network.packet.c2s.play.UpdateSelectedSlotC2SPacket; -import net.minecraft.network.packet.s2c.play.DisconnectS2CPacket; +import net.minecraft.network.packet.s2c.common.DisconnectS2CPacket; import net.minecraft.network.packet.s2c.play.PlayerPositionLookS2CPacket; import net.minecraft.network.packet.s2c.play.PositionFlag; import net.minecraft.network.packet.s2c.play.UpdateSelectedSlotS2CPacket; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.network.ConnectedClientData; +import net.minecraft.server.network.ServerCommonNetworkHandler; import net.minecraft.server.network.ServerPlayNetworkHandler; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.server.world.ServerWorld; @@ -64,7 +37,6 @@ import net.minecraft.util.Hand; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.HitResult; -import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.Vec3d; @@ -72,15 +44,44 @@ import net.minecraft.world.GameRules; import net.minecraft.world.RaycastContext; import net.minecraft.world.WorldView; +import org.bukkit.Bukkit; +import org.bukkit.Location; +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.entity.Player; +import org.bukkit.event.block.Action; +import org.bukkit.event.inventory.InventoryCloseEvent; +import org.bukkit.event.player.PlayerAnimationEvent; +import org.bukkit.event.player.PlayerItemHeldEvent; +import org.bukkit.event.player.PlayerKickEvent; +import org.bukkit.event.player.PlayerMoveEvent; +import org.bukkit.event.player.PlayerResourcePackStatusEvent; +import org.bukkit.event.player.PlayerTeleportEvent; +import org.bukkit.event.player.PlayerToggleFlightEvent; +import org.bukkit.event.player.PlayerToggleSneakEvent; +import org.bukkit.event.player.PlayerToggleSprintEvent; +import org.cardboardpowered.impl.entity.PlayerImpl; +import org.cardboardpowered.impl.inventory.CardboardInventoryView; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.Collections; +import java.util.Set; +import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; @SuppressWarnings("deprecation") @Mixin(value = ServerPlayNetworkHandler.class, priority = 800) -public abstract class MixinServerPlayNetworkHandler implements IMixinPlayNetworkHandler { +public abstract class MixinServerPlayNetworkHandler extends ServerCommonNetworkHandler implements IMixinPlayNetworkHandler { + + public MixinServerPlayNetworkHandler(MinecraftServer server, ClientConnection connection, ConnectedClientData clientData) { + super(server, connection, clientData); + throw new AssertionError("nuh uh"); + } - @Shadow - private ClientConnection connection; - - @Override + @Override public ClientConnection cb_get_connection() { return connection; } @@ -88,9 +89,6 @@ public ClientConnection cb_get_connection() { @Shadow public ServerPlayerEntity player; - @Shadow - public abstract void sendPacket(Packet packet); - private volatile int messageCooldownBukkit; private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(ServerPlayNetworkHandler.class, "messageCooldownBukkit"); @@ -127,14 +125,14 @@ public ClientConnection cb_get_connection() { @Override public boolean isDisconnected() { - return false; // TODO + return !connection.isOpen(); } /** * @author BukkitFabric * @reason PlayerKickEvent */ - @Overwrite + @Override public void disconnect(Text reason) { String leaveMessage = Formatting.YELLOW + this.player.getEntityName() + " left the game."; @@ -660,10 +658,12 @@ public void doBukkitEvent_PlayerToggleFlightEvent(UpdatePlayerAbilitiesC2SPacket } } - @Inject(at = @At("HEAD"), method = "onResourcePackStatus") - public void doBukkitEvent_PlayerResourcePackStatusEvent(ResourcePackStatusC2SPacket packet, CallbackInfo ci) { - NetworkThreadUtils.forceMainThread(packet, get(), this.player.getServerWorld()); - Bukkit.getPluginManager().callEvent(new PlayerResourcePackStatusEvent(getPlayer(), PlayerResourcePackStatusEvent.Status.values()[((IMixinResourcePackStatusC2SPacket)packet).getStatus_Bukkit().ordinal()])); + @Override + public void onResourcePackStatus(ResourcePackStatusC2SPacket packet) { + super.onResourcePackStatus(packet); + int statusOrdinal = ((IMixinResourcePackStatusC2SPacket)packet).getStatus_Bukkit().ordinal(); + PlayerResourcePackStatusEvent event = new PlayerResourcePackStatusEvent(getPlayer(), PlayerResourcePackStatusEvent.Status.values()[statusOrdinal]); + Bukkit.getPluginManager().callEvent(event); } // 1.19.2 = closeScreenHandler @@ -678,4 +678,4 @@ public void doBukkit_InventoryCloseEvent(CallbackInfo ci) { handler.transferTo(player.playerScreenHandler, ((IMixinServerEntityPlayer)player).getBukkit()); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/network/MixinServerPlayNetworkHandler_ChatEvent.java b/src/main/java/org/cardboardpowered/mixin/network/MixinServerPlayNetworkHandler_ChatEvent.java index 3ddddfdf..201612b3 100644 --- a/src/main/java/org/cardboardpowered/mixin/network/MixinServerPlayNetworkHandler_ChatEvent.java +++ b/src/main/java/org/cardboardpowered/mixin/network/MixinServerPlayNetworkHandler_ChatEvent.java @@ -1,25 +1,25 @@ package org.cardboardpowered.mixin.network; -import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; -import org.cardboardpowered.impl.entity.PlayerImpl; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; - -import net.minecraft.network.packet.Packet; +import net.minecraft.network.ClientConnection; +import net.minecraft.server.MinecraftServer; +import net.minecraft.server.network.ConnectedClientData; +import net.minecraft.server.network.ServerCommonNetworkHandler; import net.minecraft.server.network.ServerPlayNetworkHandler; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.util.math.Vec3d; +import org.cardboardpowered.impl.entity.PlayerImpl; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; + +import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; @Mixin(value = ServerPlayNetworkHandler.class, priority = 999) -public abstract class MixinServerPlayNetworkHandler_ChatEvent { +public abstract class MixinServerPlayNetworkHandler_ChatEvent extends ServerCommonNetworkHandler { @Shadow public ServerPlayerEntity player; - @Shadow - public abstract void sendPacket(Packet packet); - private static final AtomicIntegerFieldUpdater chatSpamField = AtomicIntegerFieldUpdater.newUpdater(ServerPlayNetworkHandler.class, "messageCooldownBukkit"); @Shadow @@ -44,6 +44,10 @@ public abstract class MixinServerPlayNetworkHandler_ChatEvent { @Shadow private int movePacketsCount; @Shadow private int lastTickMovePacketsCount; + public MixinServerPlayNetworkHandler_ChatEvent(MinecraftServer server, ClientConnection connection, ConnectedClientData clientData) { + super(server, connection, clientData); + throw new AssertionError("i disagree"); + } private ServerPlayNetworkHandler get() { return (ServerPlayNetworkHandler) (Object) this; diff --git a/src/main/java/org/cardboardpowered/mixin/network/handler/MixinSPNH_InventoryClickEvent.java b/src/main/java/org/cardboardpowered/mixin/network/handler/MixinSPNH_InventoryClickEvent.java index 1b47e249..6cc39b28 100644 --- a/src/main/java/org/cardboardpowered/mixin/network/handler/MixinSPNH_InventoryClickEvent.java +++ b/src/main/java/org/cardboardpowered/mixin/network/handler/MixinSPNH_InventoryClickEvent.java @@ -1,5 +1,17 @@ package org.cardboardpowered.mixin.network.handler; +import com.javazilla.bukkitfabric.interfaces.IMixinScreenHandler; +import net.minecraft.block.Blocks; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.network.packet.c2s.play.ClickSlotC2SPacket; +import net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket; +import net.minecraft.screen.ScreenHandler; +import net.minecraft.screen.slot.Slot; +import net.minecraft.screen.slot.SlotActionType; +import net.minecraft.server.network.ServerPlayNetworkHandler; +import net.minecraft.server.network.ServerPlayerEntity; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.util.CraftMagicNumbers; import org.bukkit.entity.HumanEntity; @@ -18,19 +30,6 @@ import org.spongepowered.asm.mixin.injection.Redirect; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import com.javazilla.bukkitfabric.interfaces.IMixinScreenHandler; -import net.minecraft.block.Blocks; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.network.packet.c2s.play.ClickSlotC2SPacket; -import net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket; -import net.minecraft.screen.ScreenHandler; -import net.minecraft.screen.slot.Slot; -import net.minecraft.screen.slot.SlotActionType; -import net.minecraft.server.network.ServerPlayNetworkHandler; -import net.minecraft.server.network.ServerPlayerEntity; - @MixinInfo(events = {"InventoryClickEvent", "CraftItemEvent"}) @Mixin(value = ServerPlayNetworkHandler.class, priority = 800) public class MixinSPNH_InventoryClickEvent { @@ -295,4 +294,4 @@ public void doBukkitEvent_InventoryClickedEvent(ClickSlotC2SPacket packet, Callb } } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/network/handler/MixinSPNH_PlayerCommandPreprocessEvent_1_18.java b/src/main/java/org/cardboardpowered/mixin/network/handler/MixinSPNH_PlayerCommandPreprocessEvent_1_18.java index c58c821a..1e1eaf95 100644 --- a/src/main/java/org/cardboardpowered/mixin/network/handler/MixinSPNH_PlayerCommandPreprocessEvent_1_18.java +++ b/src/main/java/org/cardboardpowered/mixin/network/handler/MixinSPNH_PlayerCommandPreprocessEvent_1_18.java @@ -1,5 +1,12 @@ package org.cardboardpowered.mixin.network.handler; +import com.javazilla.bukkitfabric.BukkitLogger; +import com.javazilla.bukkitfabric.interfaces.IMixinPlayNetworkHandler; +import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; +import net.minecraft.network.message.LastSeenMessageList; +import net.minecraft.network.packet.c2s.play.CommandExecutionC2SPacket; +import net.minecraft.server.network.ServerPlayNetworkHandler; +import net.minecraft.server.network.ServerPlayerEntity; import org.bukkit.Bukkit; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.event.player.PlayerCommandPreprocessEvent; @@ -11,12 +18,6 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; -import com.javazilla.bukkitfabric.BukkitLogger; -import com.javazilla.bukkitfabric.interfaces.IMixinPlayNetworkHandler; -import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; -import net.minecraft.server.network.ServerPlayNetworkHandler; -import net.minecraft.server.network.ServerPlayerEntity; - @Mixin(value = ServerPlayNetworkHandler.class, priority = 800) public abstract class MixinSPNH_PlayerCommandPreprocessEvent_1_18 implements IMixinPlayNetworkHandler { @@ -28,10 +29,11 @@ public abstract class MixinSPNH_PlayerCommandPreprocessEvent_1_18 implements IMi * @author Cardboard 1.18.2 */ // TODO: 1.19 - @Inject(at = @At("HEAD"), method = "executeCommand", cancellable = true) - public void executeCommand_1_18_2(String string, CallbackInfo ci) { - BukkitLogger.getLogger().info(this.player.getName().getString() + " issued server command: " + string); - PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(getPlayer(), string, new LazyPlayerSet(CraftServer.server)); + @Inject(at = @At("HEAD"), method = "handleCommandExecution", cancellable = true) + public void executeCommand_1_18_2(CommandExecutionC2SPacket packet, LastSeenMessageList messages, CallbackInfo ci) { + String command = packet.command(); + BukkitLogger.getLogger().info(this.player.getName().getString() + " issued server command: " + command); + PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(getPlayer(), command, new LazyPlayerSet(CraftServer.server)); Bukkit.getPluginManager().callEvent(event); if (event.isCancelled()) return; @@ -51,4 +53,4 @@ public PlayerImpl getPlayer() { return (PlayerImpl) ((IMixinServerEntityPlayer)(Object)this.player).getBukkitEntity(); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/network/handler/MixinSPNH_PlayerCommandPreprocessEvent_1_19.java b/src/main/java/org/cardboardpowered/mixin/network/handler/MixinSPNH_PlayerCommandPreprocessEvent_1_19.java index f76885ed..8630120a 100644 --- a/src/main/java/org/cardboardpowered/mixin/network/handler/MixinSPNH_PlayerCommandPreprocessEvent_1_19.java +++ b/src/main/java/org/cardboardpowered/mixin/network/handler/MixinSPNH_PlayerCommandPreprocessEvent_1_19.java @@ -1,27 +1,14 @@ package org.cardboardpowered.mixin.network.handler; -import java.util.Collections; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; - -import org.bukkit.craftbukkit.CraftServer; -import org.bukkit.event.player.PlayerCommandPreprocessEvent; -import org.cardboardpowered.impl.entity.PlayerImpl; -import org.cardboardpowered.impl.util.LazyPlayerSet; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; - import com.javazilla.bukkitfabric.BukkitFabricMod; import com.javazilla.bukkitfabric.interfaces.IMixinPlayNetworkHandler; import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; import com.mojang.brigadier.ParseResults; - import net.minecraft.command.argument.SignedArgumentList; import net.minecraft.network.message.LastSeenMessageList; import net.minecraft.network.message.MessageChain; import net.minecraft.network.message.MessageChain.MessageChainException; +import net.minecraft.network.message.MessageChainTaskQueue; import net.minecraft.network.message.SignedCommandArguments; import net.minecraft.network.message.SignedMessage; import net.minecraft.network.packet.c2s.play.CommandExecutionC2SPacket; @@ -29,63 +16,84 @@ import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.network.ServerPlayNetworkHandler; import net.minecraft.server.network.ServerPlayerEntity; +import org.bukkit.Bukkit; +import org.bukkit.craftbukkit.CraftServer; +import org.bukkit.event.player.PlayerCommandPreprocessEvent; +import org.cardboardpowered.CardboardConfig; +import org.cardboardpowered.impl.entity.PlayerImpl; +import org.cardboardpowered.impl.util.LazyPlayerSet; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + +import java.util.Collections; +import java.util.Map; @Mixin(value = ServerPlayNetworkHandler.class, priority = 800) public abstract class MixinSPNH_PlayerCommandPreprocessEvent_1_19 implements IMixinPlayNetworkHandler { - @Shadow - public ServerPlayerEntity player; + @Shadow + public ServerPlayerEntity player; - /** - * @reason PlayerCommandPreprocessEvent - * @author Cardboard 1.19.4 - */ - @SuppressWarnings("unused") + /** + * @reason PlayerCommandPreprocessEvent + * @author Cardboard 1.19.4 + */ + @SuppressWarnings("unused") @Overwrite - private void handleCommandExecution(CommandExecutionC2SPacket packet, LastSeenMessageList lastseenmessages) { - SignedMessage playerchatmessage; - String command = "/" + packet.command(); - BukkitFabricMod.LOGGER.info(this.player.getEntityName() + " issued server command: " + command); - PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(this.getPlayer(), command, new LazyPlayerSet(CraftServer.server)); - CraftServer.INSTANCE.getPluginManager().callEvent(event); - - if (event.isCancelled()) { - return; - } - - command = event.getMessage().substring(1); - ParseResults parseresults = this.parse(packet.command()); - Map map; - try { - map = (packet.command().equals(command)) ? this.collectArgumentMessages(packet, SignedArgumentList.of(parseresults), lastseenmessages) : Collections.emptyMap(); // CraftBukkit - } catch (MessageChain.MessageChainException e) { - this.handleMessageChainException(e); - return; - } - - SignedCommandArguments.Impl arguments = new SignedCommandArguments.Impl(map); - - parseresults = CommandManager.withCommandSource(parseresults, (stack) -> stack.withSignedArguments(arguments)); - CraftServer.server.getCommandManager().execute(parseresults, command); - } - - @Shadow - public void handleMessageChainException(MessageChain.MessageChainException e) { - } - - // private Map collectArgumentMessages(CommandExecutionC2SPacket packet, DecoratableArgumentList arguments) { - @Shadow - private Map collectArgumentMessages(CommandExecutionC2SPacket packet, SignedArgumentList a, LastSeenMessageList b) throws MessageChainException { - return null; // Shadow method - } - - @Shadow - private ParseResults parse(String command) { - return null; // Shadow method - } - - public PlayerImpl getPlayer() { - return (PlayerImpl) ((IMixinServerEntityPlayer)(Object)this.player).getBukkitEntity(); - } - -} \ No newline at end of file + private void handleCommandExecution(CommandExecutionC2SPacket packet, LastSeenMessageList lastseenmessages) { + SignedMessage playerchatmessage; + String command = "/" + packet.command(); + BukkitFabricMod.LOGGER.info(this.player.getEntityName() + " issued server command: " + command); + PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(this.getPlayer(), command, new LazyPlayerSet(CraftServer.server)); + CraftServer.INSTANCE.getPluginManager().callEvent(event); + + if(event.isCancelled()) { + return; + } + + command = event.getMessage().substring(1); + + if(CardboardConfig.REGISTRY_COMMAND_FIX) { + Bukkit.dispatchCommand(getPlayer(), command); + return; + } + + ParseResults parseresults = this.parse(packet.command()); + Map map; + try { + map = (packet.command().equals(command)) ? this.collectArgumentMessages(packet, SignedArgumentList.of(parseresults), lastseenmessages) : Collections.emptyMap(); // CraftBukkit + } catch(MessageChain.MessageChainException e) { + this.handleMessageChainException(e); + return; + } + + SignedCommandArguments.Impl arguments = new SignedCommandArguments.Impl(map); + + parseresults = CommandManager.withCommandSource(parseresults, (stack) -> + stack.withSignedArguments(arguments, messageChainTaskQueue)); + CraftServer.server.getCommandManager().execute(parseresults, command); + } + + @Shadow + public void handleMessageChainException(MessageChain.MessageChainException e) { + } + + // private Map collectArgumentMessages(CommandExecutionC2SPacket packet, DecoratableArgumentList arguments) { + @Shadow + private Map collectArgumentMessages(CommandExecutionC2SPacket packet, SignedArgumentList a, LastSeenMessageList b) throws MessageChainException { + return null; // Shadow method + } + + @Shadow + private ParseResults parse(String command) { + return null; // Shadow method + } + + @Shadow @Final private MessageChainTaskQueue messageChainTaskQueue; + public PlayerImpl getPlayer() { + return (PlayerImpl) ((IMixinServerEntityPlayer) (Object) this.player).getBukkitEntity(); + } + +} diff --git a/src/main/java/org/cardboardpowered/mixin/recipe/MixinBlastingRecipe.java b/src/main/java/org/cardboardpowered/mixin/recipe/MixinBlastingRecipe.java deleted file mode 100644 index b8749245..00000000 --- a/src/main/java/org/cardboardpowered/mixin/recipe/MixinBlastingRecipe.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.cardboardpowered.mixin.recipe; - -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.util.CraftNamespacedKey; -import org.bukkit.inventory.Recipe; -import org.cardboardpowered.impl.inventory.recipe.CardboardBlastingRecipe; -import org.spongepowered.asm.mixin.Mixin; - -import org.cardboardpowered.impl.inventory.recipe.RecipeInterface; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipe; - -import net.minecraft.recipe.AbstractCookingRecipe; -import net.minecraft.recipe.BlastingRecipe; - -@Mixin(BlastingRecipe.class) -public class MixinBlastingRecipe implements IMixinRecipe { - - @Override - public Recipe toBukkitRecipe() { - AbstractCookingRecipe nms = (AbstractCookingRecipe)(Object)this; - CraftItemStack result = CraftItemStack.asCraftMirror(nms.output); - - CardboardBlastingRecipe recipe = new CardboardBlastingRecipe(CraftNamespacedKey.fromMinecraft(nms.id), result, RecipeInterface.toBukkit(nms.input), nms.experience, nms.cookTime); - recipe.setGroup(nms.group); - - return recipe; - } - -} \ No newline at end of file diff --git a/src/main/java/org/cardboardpowered/mixin/recipe/MixinCampfireCookingRecipe.java b/src/main/java/org/cardboardpowered/mixin/recipe/MixinCampfireCookingRecipe.java deleted file mode 100644 index 697d94f7..00000000 --- a/src/main/java/org/cardboardpowered/mixin/recipe/MixinCampfireCookingRecipe.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.cardboardpowered.mixin.recipe; - -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.util.CraftNamespacedKey; -import org.bukkit.inventory.Recipe; -import org.spongepowered.asm.mixin.Mixin; - -import org.cardboardpowered.impl.inventory.recipe.CardboardCampfireRecipe; -import org.cardboardpowered.impl.inventory.recipe.RecipeInterface; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipe; - -import net.minecraft.recipe.AbstractCookingRecipe; -import net.minecraft.recipe.CampfireCookingRecipe; - -@Mixin(CampfireCookingRecipe.class) -public class MixinCampfireCookingRecipe implements IMixinRecipe { - - @Override - public Recipe toBukkitRecipe() { - AbstractCookingRecipe nms = (AbstractCookingRecipe)(Object)this; - CraftItemStack result = CraftItemStack.asCraftMirror(nms.output); - - CardboardCampfireRecipe recipe = new CardboardCampfireRecipe(CraftNamespacedKey.fromMinecraft(nms.id), result, RecipeInterface.toBukkit(nms.input), nms.experience, nms.cookTime); - recipe.setGroup(nms.group); - - return recipe; - } - -} \ No newline at end of file diff --git a/src/main/java/org/cardboardpowered/mixin/recipe/MixinRecipeEntry.java b/src/main/java/org/cardboardpowered/mixin/recipe/MixinRecipeEntry.java new file mode 100644 index 00000000..9c6de4be --- /dev/null +++ b/src/main/java/org/cardboardpowered/mixin/recipe/MixinRecipeEntry.java @@ -0,0 +1,161 @@ +package org.cardboardpowered.mixin.recipe; + +import com.javazilla.bukkitfabric.interfaces.IMixinRecipe; +import net.minecraft.recipe.BlastingRecipe; +import net.minecraft.recipe.CampfireCookingRecipe; +import net.minecraft.recipe.Ingredient; +import net.minecraft.recipe.Recipe; +import net.minecraft.recipe.RecipeEntry; +import net.minecraft.recipe.ShapedRecipe; +import net.minecraft.recipe.ShapelessRecipe; +import net.minecraft.recipe.SmeltingRecipe; +import net.minecraft.recipe.SmokingRecipe; +import net.minecraft.recipe.SpecialCraftingRecipe; +import net.minecraft.recipe.StonecuttingRecipe; +import net.minecraft.util.Identifier; +import net.minecraft.village.TradeOffer; +import org.bukkit.craftbukkit.inventory.CraftItemStack; +import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe; +import org.bukkit.craftbukkit.util.CraftNamespacedKey; +import org.bukkit.inventory.RecipeChoice; +import org.cardboardpowered.impl.inventory.recipe.CardboardBlastingRecipe; +import org.cardboardpowered.impl.inventory.recipe.CardboardCampfireRecipe; +import org.cardboardpowered.impl.inventory.recipe.CardboardComplexRecipe; +import org.cardboardpowered.impl.inventory.recipe.CardboardFurnaceRecipe; +import org.cardboardpowered.impl.inventory.recipe.CardboardShapedRecipe; +import org.cardboardpowered.impl.inventory.recipe.CardboardShapelessRecipe; +import org.cardboardpowered.impl.inventory.recipe.CardboardSmokingRecipe; +import org.cardboardpowered.impl.inventory.recipe.CardboardStonecuttingRecipe; +import org.cardboardpowered.impl.inventory.recipe.RecipeInterface; +import org.spongepowered.asm.mixin.Mixin; + +@Mixin(RecipeEntry.class) +public class MixinRecipeEntry implements IMixinRecipe { + + @Override + public org.bukkit.inventory.Recipe toBukkitRecipe() { + RecipeEntry recipeEntry = (RecipeEntry) (Object) this; + Recipe nmsRecipe = recipeEntry.value(); + Identifier id = recipeEntry.id(); + + if(nmsRecipe instanceof BlastingRecipe nms) { + CraftItemStack result = CraftItemStack.asCraftMirror(nms.getResult(null)); + + CardboardBlastingRecipe recipe = new CardboardBlastingRecipe(CraftNamespacedKey.fromMinecraft(id), + result, + RecipeInterface.toBukkit(nms.getIngredients().get(0)), + nms.experience, nms.getCookingTime()); + recipe.setGroup(nms.group); + + return recipe; + } else if(nmsRecipe instanceof CampfireCookingRecipe nms) { + CraftItemStack result = CraftItemStack.asCraftMirror(nms.getResult(null)); + + CardboardCampfireRecipe recipe = new CardboardCampfireRecipe(CraftNamespacedKey.fromMinecraft(id), + result, + RecipeInterface.toBukkit(nms.getIngredients().get(0)), + nms.experience, nms.getCookingTime()); + recipe.setGroup(nms.group); + + return recipe; + } else if(nmsRecipe instanceof ShapedRecipe nms) { + CraftItemStack result = CraftItemStack.asCraftMirror(nms.getResult(null)); + CardboardShapedRecipe recipe = new CardboardShapedRecipe(id, result, nms); + recipe.setGroup(nms.group); + + switch(nms.height) { + case 1: + switch(nms.width) { + case 1: + recipe.shape("a"); + break; + case 2: + recipe.shape("ab"); + break; + case 3: + recipe.shape("abc"); + break; + } + break; + case 2: + switch(nms.width) { + case 1: + recipe.shape("a", "b"); + break; + case 2: + recipe.shape("ab", "cd"); + break; + case 3: + recipe.shape("abc", "def"); + break; + } + break; + case 3: + switch(nms.width) { + case 1: + recipe.shape("a", "b", "c"); + break; + case 2: + recipe.shape("ab", "cd", "ef"); + break; + case 3: + recipe.shape("abc", "def", "ghi"); + break; + } + break; + } + char c = 'a'; + for(Ingredient list : nms.getIngredients()) { + RecipeChoice choice = RecipeInterface.toBukkit(list); + if(choice != null) recipe.setIngredient(c, choice); + c++; + } + return recipe; + } else if(nmsRecipe instanceof ShapelessRecipe nms) { + CraftItemStack result = CraftItemStack.asCraftMirror(nms.getResult(null)); + CardboardShapelessRecipe recipe = new CardboardShapelessRecipe(id, result, nms); + recipe.setGroup(nms.group); + for(Ingredient list : nms.getIngredients()) + recipe.addIngredient(RecipeInterface.toBukkit(list)); + return recipe; + } else if(nmsRecipe instanceof SmeltingRecipe nms) { + CraftItemStack result = CraftItemStack.asCraftMirror(nms.getResult(null)); + + CardboardFurnaceRecipe recipe = new CardboardFurnaceRecipe(CraftNamespacedKey.fromMinecraft(id), + result, + RecipeInterface.toBukkit(nms.getIngredients().get(0)), + nms.experience, nms.getCookingTime()); + recipe.setGroup(nms.group); + + return recipe; + } else if(nmsRecipe instanceof SmokingRecipe nms) { + CraftItemStack result = CraftItemStack.asCraftMirror(nms.getResult(null)); + + CardboardSmokingRecipe recipe = new CardboardSmokingRecipe(CraftNamespacedKey.fromMinecraft(id), + result, + RecipeInterface.toBukkit(nms.getIngredients().get(0)), + nms.experience, nms.getCookingTime()); + recipe.setGroup(nms.group); + + return recipe; + } else if(nmsRecipe instanceof StonecuttingRecipe nms) { + CraftItemStack result = CraftItemStack.asCraftMirror(nms.getResult(null)); + + CardboardStonecuttingRecipe recipe = new CardboardStonecuttingRecipe( + CraftNamespacedKey.fromMinecraft(id), + result, + RecipeInterface.toBukkit(nms.getIngredients().get(0))); + recipe.setGroup(nms.group); + + return recipe; + } else if(nmsRecipe instanceof TradeOffer nms) { + return new CraftMerchantRecipe(nms); + } else if(nmsRecipe instanceof SpecialCraftingRecipe) { + return new CardboardComplexRecipe((RecipeEntry) recipeEntry); + } else { + throw new IllegalArgumentException("Invalid recipe type: " + nmsRecipe.getClass()); + } + + } + +} diff --git a/src/main/java/org/cardboardpowered/mixin/recipe/MixinRecipeManager.java b/src/main/java/org/cardboardpowered/mixin/recipe/MixinRecipeManager.java index 6807cff3..68917461 100644 --- a/src/main/java/org/cardboardpowered/mixin/recipe/MixinRecipeManager.java +++ b/src/main/java/org/cardboardpowered/mixin/recipe/MixinRecipeManager.java @@ -1,86 +1,83 @@ package org.cardboardpowered.mixin.recipe; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Optional; - -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; -import com.javazilla.bukkitfabric.interfaces.IMixinInventory; import com.javazilla.bukkitfabric.interfaces.IMixinRecipeManager; - import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap; import net.minecraft.inventory.Inventory; import net.minecraft.recipe.Recipe; +import net.minecraft.recipe.RecipeEntry; import net.minecraft.recipe.RecipeManager; import net.minecraft.recipe.RecipeType; +import net.minecraft.registry.Registries; import net.minecraft.resource.ResourceManager; import net.minecraft.util.Identifier; import net.minecraft.util.JsonHelper; -import net.minecraft.util.Util; import net.minecraft.util.profiler.Profiler; -import net.minecraft.registry.Registries; -import net.minecraft.world.World; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.gen.Invoker; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.HashMap; +import java.util.Map; +import java.util.Map.Entry; @Mixin(RecipeManager.class) public class MixinRecipeManager implements IMixinRecipeManager { + @Invoker("deserialize") + protected static RecipeEntry method_17720(Identifier minecraftkey, JsonObject jsonobject) { + return null; + } + @Shadow public boolean errored; - @Shadow public static Recipe deserialize(Identifier minecraftkey, JsonObject jsonobject) {return null;} - @Shadow public Map, Map>> recipes = ImmutableMap.of(); + @Shadow public Map, Map>> recipes = ImmutableMap.of(); @Shadow public > Map> getAllOfType(RecipeType recipes) {return null;} - private static final Logger LOGGER_BF = LogManager.getLogger("Bukkit|RecipeManager"); + @Unique private static final Logger LOGGER_BF = LogManager.getLogger("Bukkit|RecipeManager"); /** * @author BukkitFabric * @reason Properly fill recipe map */ - @SuppressWarnings({ "unchecked", "rawtypes" }) - @Inject(at = @At("TAIL"), method = "apply") + @Inject(at = @At("TAIL"), method = "apply(Ljava/util/Map;Lnet/minecraft/resource/ResourceManager;Lnet/minecraft/util/profiler/Profiler;)V") public void apply(Map map, ResourceManager iresourcemanager, Profiler gameprofilerfiller, CallbackInfo ci) { this.errored = false; - Map, Map>> map1 = Maps.newHashMap(); + Map, Map>> map1 = Maps.newHashMap(); for (RecipeType recipeType : Registries.RECIPE_TYPE) map1.put(recipeType, new HashMap<>()); - Iterator> iterator = map.entrySet().iterator(); - while (iterator.hasNext()) { - Entry entry = (Entry) iterator.next(); - Identifier minecraftkey = (Identifier) entry.getKey(); + for(Entry entry : map.entrySet()) { + Identifier minecraftkey = entry.getKey(); - try { - Recipe irecipe = deserialize(minecraftkey, JsonHelper.asObject((JsonElement) entry.getValue(), "top element")); - (map1.computeIfAbsent(irecipe.getType(), (recipes) -> new Object2ObjectLinkedOpenHashMap<>())).put(minecraftkey, irecipe); - } catch (IllegalArgumentException | JsonParseException jsonparseexception) { - LOGGER_BF.error("Parsing error loading recipe {}", minecraftkey, jsonparseexception); - } - } + try { + RecipeEntry irecipe = method_17720(minecraftkey, JsonHelper.asObject(entry.getValue(), "top element")); + (map1.computeIfAbsent(irecipe.value().getType(), (recipes) -> new Object2ObjectLinkedOpenHashMap<>())).put(minecraftkey, irecipe); + } catch(IllegalArgumentException | JsonParseException jsonparseexception) { + LOGGER_BF.error("Parsing error loading recipe {}", minecraftkey, jsonparseexception); + } + } - this.recipes = (Map) map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, (entry1) -> entry1.getValue())); + this.recipes = map1.entrySet().stream().collect(ImmutableMap.toImmutableMap(Entry::getKey, Entry::getValue)); LOGGER_BF.info("Loaded " + map1.size() + " recipes"); } @Override - public void addRecipe(Recipe irecipe) { - Map> map = this.recipes.get(irecipe.getType()); - if (map.containsKey(irecipe.getId())) - throw new IllegalStateException("Duplicate recipe ignored with ID " + irecipe.getId()); - else map.put(irecipe.getId(), irecipe); + public void addRecipe(RecipeEntry entry) { + Map> map = this.recipes.get(entry.value().getType()); + if (map.containsKey(entry.id())) + throw new IllegalStateException("Duplicate recipe ignored with ID " + entry.toString()); + else + map.put(entry.id(), entry); } /** @@ -103,8 +100,8 @@ public void clearRecipes() { } @Override - public Map, Map>> getRecipes() { + public Map, Map>> getRecipes() { return recipes; } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/recipe/MixinShapedRecipe.java b/src/main/java/org/cardboardpowered/mixin/recipe/MixinShapedRecipe.java deleted file mode 100644 index b7cfbcad..00000000 --- a/src/main/java/org/cardboardpowered/mixin/recipe/MixinShapedRecipe.java +++ /dev/null @@ -1,81 +0,0 @@ -package org.cardboardpowered.mixin.recipe; - -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.inventory.RecipeChoice; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -import org.cardboardpowered.impl.inventory.recipe.CardboardShapedRecipe; -import org.cardboardpowered.impl.inventory.recipe.RecipeInterface; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipe; - -import net.minecraft.item.ItemStack; -import net.minecraft.recipe.Ingredient; -import net.minecraft.recipe.ShapedRecipe; -import net.minecraft.util.collection.DefaultedList; - -@Mixin(ShapedRecipe.class) -public class MixinShapedRecipe implements IMixinRecipe { - - @Shadow public String group; - @Shadow public ItemStack output; - @Shadow public DefaultedList input; - @Shadow public int width; - @Shadow public int height; - - public org.bukkit.inventory.ShapedRecipe toBukkitRecipe() { - CraftItemStack result = CraftItemStack.asCraftMirror(this.output); - CardboardShapedRecipe recipe = new CardboardShapedRecipe(result, (ShapedRecipe)(Object)this); - recipe.setGroup(this.group); - - switch (this.height) { - case 1: - switch (this.width) { - case 1: - recipe.shape("a"); - break; - case 2: - recipe.shape("ab"); - break; - case 3: - recipe.shape("abc"); - break; - } - break; - case 2: - switch (this.width) { - case 1: - recipe.shape("a","b"); - break; - case 2: - recipe.shape("ab","cd"); - break; - case 3: - recipe.shape("abc","def"); - break; - } - break; - case 3: - switch (this.width) { - case 1: - recipe.shape("a","b","c"); - break; - case 2: - recipe.shape("ab","cd","ef"); - break; - case 3: - recipe.shape("abc","def","ghi"); - break; - } - break; - } - char c = 'a'; - for (Ingredient list : this.input) { - RecipeChoice choice = RecipeInterface.toBukkit(list); - if (choice != null) recipe.setIngredient(c, choice); - c++; - } - return recipe; - } - -} \ No newline at end of file diff --git a/src/main/java/org/cardboardpowered/mixin/recipe/MixinShapelessRecipe.java b/src/main/java/org/cardboardpowered/mixin/recipe/MixinShapelessRecipe.java deleted file mode 100644 index 0b2da29a..00000000 --- a/src/main/java/org/cardboardpowered/mixin/recipe/MixinShapelessRecipe.java +++ /dev/null @@ -1,33 +0,0 @@ -package org.cardboardpowered.mixin.recipe; - -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -import org.cardboardpowered.impl.inventory.recipe.CardboardShapelessRecipe; -import org.cardboardpowered.impl.inventory.recipe.RecipeInterface; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipe; - -import net.minecraft.item.ItemStack; -import net.minecraft.recipe.Ingredient; -import net.minecraft.recipe.ShapelessRecipe; -import net.minecraft.util.collection.DefaultedList; - -@Mixin(ShapelessRecipe.class) -public class MixinShapelessRecipe implements IMixinRecipe { - - @Shadow public String group; - @Shadow public ItemStack output; - @Shadow public DefaultedList input; - - @Override - public org.bukkit.inventory.ShapelessRecipe toBukkitRecipe() { - CraftItemStack result = CraftItemStack.asCraftMirror(this.output); - CardboardShapelessRecipe recipe = new CardboardShapelessRecipe(result, (ShapelessRecipe)(Object)this); - recipe.setGroup(this.group); - - for (Ingredient list : this.input) recipe.addIngredient(RecipeInterface.toBukkit(list)); - return recipe; - } - -} \ No newline at end of file diff --git a/src/main/java/org/cardboardpowered/mixin/recipe/MixinSmeltingRecipe.java b/src/main/java/org/cardboardpowered/mixin/recipe/MixinSmeltingRecipe.java deleted file mode 100644 index 56a95f26..00000000 --- a/src/main/java/org/cardboardpowered/mixin/recipe/MixinSmeltingRecipe.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.cardboardpowered.mixin.recipe; - -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.util.CraftNamespacedKey; -import org.bukkit.inventory.Recipe; -import org.spongepowered.asm.mixin.Mixin; - -import org.cardboardpowered.impl.inventory.recipe.CardboardFurnaceRecipe; -import org.cardboardpowered.impl.inventory.recipe.RecipeInterface; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipe; - -import net.minecraft.recipe.AbstractCookingRecipe; -import net.minecraft.recipe.SmeltingRecipe; - -@Mixin(SmeltingRecipe.class) -public class MixinSmeltingRecipe implements IMixinRecipe { - - @Override - public Recipe toBukkitRecipe() { - AbstractCookingRecipe nms = (AbstractCookingRecipe)(Object)this; - CraftItemStack result = CraftItemStack.asCraftMirror(nms.output); - - CardboardFurnaceRecipe recipe = new CardboardFurnaceRecipe(CraftNamespacedKey.fromMinecraft(nms.id), result, RecipeInterface.toBukkit(nms.input), nms.experience, nms.cookTime); - recipe.setGroup(nms.group); - - return recipe; - } - -} \ No newline at end of file diff --git a/src/main/java/org/cardboardpowered/mixin/recipe/MixinSmithingRecipe.java b/src/main/java/org/cardboardpowered/mixin/recipe/MixinSmithingRecipe.java index d718f0b2..74e4c291 100644 --- a/src/main/java/org/cardboardpowered/mixin/recipe/MixinSmithingRecipe.java +++ b/src/main/java/org/cardboardpowered/mixin/recipe/MixinSmithingRecipe.java @@ -1,26 +1,14 @@ package org.cardboardpowered.mixin.recipe; -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.util.CraftNamespacedKey; +import net.minecraft.recipe.Ingredient; import org.bukkit.inventory.Recipe; import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Shadow; - -import org.cardboardpowered.impl.inventory.recipe.CardboardSmithingRecipe; -import org.cardboardpowered.impl.inventory.recipe.RecipeInterface; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipe; - -import net.minecraft.item.ItemStack; -import net.minecraft.recipe.Ingredient; -//import net.minecraft.recipe.LegacySmithingRecipe; -import net.minecraft.recipe.SmithingRecipe; -import net.minecraft.util.Identifier; //@Mixin(LegacySmithingRecipe.class) @Mixin(Ingredient.class) -public class MixinSmithingRecipe implements IMixinRecipe { +public class MixinSmithingRecipe /*implements IMixinRecipe*/ { - @Override + // @Override public Recipe toBukkitRecipe() { // TODO Auto-generated method stub return null; @@ -39,4 +27,4 @@ public Recipe toBukkitRecipe() { return recipe; }*/ -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/recipe/MixinSmokingRecipe.java b/src/main/java/org/cardboardpowered/mixin/recipe/MixinSmokingRecipe.java deleted file mode 100644 index 09c82ea2..00000000 --- a/src/main/java/org/cardboardpowered/mixin/recipe/MixinSmokingRecipe.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.cardboardpowered.mixin.recipe; - -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.util.CraftNamespacedKey; -import org.bukkit.inventory.Recipe; -import org.spongepowered.asm.mixin.Mixin; - -import org.cardboardpowered.impl.inventory.recipe.CardboardSmokingRecipe; -import org.cardboardpowered.impl.inventory.recipe.RecipeInterface; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipe; - -import net.minecraft.recipe.SmokingRecipe; - -@Mixin(SmokingRecipe.class) -public class MixinSmokingRecipe implements IMixinRecipe { - - @Override - public Recipe toBukkitRecipe() { - SmokingRecipe rrr = (SmokingRecipe)(Object)this; - CraftItemStack result = CraftItemStack.asCraftMirror(rrr.output); - - CardboardSmokingRecipe recipe = new CardboardSmokingRecipe(CraftNamespacedKey.fromMinecraft(rrr.id), result, RecipeInterface.toBukkit(rrr.input), rrr.experience, rrr.cookTime); - recipe.setGroup(rrr.group); - - return recipe; - } - -} \ No newline at end of file diff --git a/src/main/java/org/cardboardpowered/mixin/recipe/MixinSpecialCraftingRecipe.java b/src/main/java/org/cardboardpowered/mixin/recipe/MixinSpecialCraftingRecipe.java deleted file mode 100644 index ecc85e6e..00000000 --- a/src/main/java/org/cardboardpowered/mixin/recipe/MixinSpecialCraftingRecipe.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.cardboardpowered.mixin.recipe; - -import org.spongepowered.asm.mixin.Mixin; - -import org.cardboardpowered.impl.inventory.recipe.CardboardComplexRecipe; - -import com.javazilla.bukkitfabric.interfaces.IMixinRecipe; - -import net.minecraft.recipe.SpecialCraftingRecipe; - -@Mixin(SpecialCraftingRecipe.class) -public class MixinSpecialCraftingRecipe implements IMixinRecipe { - - @Override - public org.bukkit.inventory.Recipe toBukkitRecipe() { - return new CardboardComplexRecipe((SpecialCraftingRecipe)(Object)this); - } - -} \ No newline at end of file diff --git a/src/main/java/org/cardboardpowered/mixin/recipe/MixinStonecuttingRecipe.java b/src/main/java/org/cardboardpowered/mixin/recipe/MixinStonecuttingRecipe.java deleted file mode 100644 index e0b8819f..00000000 --- a/src/main/java/org/cardboardpowered/mixin/recipe/MixinStonecuttingRecipe.java +++ /dev/null @@ -1,28 +0,0 @@ -package org.cardboardpowered.mixin.recipe; - -import org.bukkit.craftbukkit.inventory.CraftItemStack; -import org.bukkit.craftbukkit.util.CraftNamespacedKey; -import org.bukkit.inventory.Recipe; -import org.spongepowered.asm.mixin.Mixin; - -import org.cardboardpowered.impl.inventory.recipe.CardboardStonecuttingRecipe; -import org.cardboardpowered.impl.inventory.recipe.RecipeInterface; -import com.javazilla.bukkitfabric.interfaces.IMixinRecipe; - -import net.minecraft.recipe.StonecuttingRecipe; - -@Mixin(StonecuttingRecipe.class) -public class MixinStonecuttingRecipe implements IMixinRecipe { - - @Override - public Recipe toBukkitRecipe() { - CraftItemStack result = CraftItemStack.asCraftMirror(((StonecuttingRecipe)(Object)this).output); - - CardboardStonecuttingRecipe recipe = new CardboardStonecuttingRecipe(CraftNamespacedKey.fromMinecraft(((StonecuttingRecipe)(Object)this).id), - result, RecipeInterface.toBukkit(((StonecuttingRecipe)(Object)this).input)); - recipe.setGroup(((StonecuttingRecipe)(Object)this).group); - - return recipe; - } - -} \ No newline at end of file diff --git a/src/main/java/org/cardboardpowered/mixin/recipe/MixinTradeOffer.java b/src/main/java/org/cardboardpowered/mixin/recipe/MixinTradeOffer.java deleted file mode 100644 index d53c131f..00000000 --- a/src/main/java/org/cardboardpowered/mixin/recipe/MixinTradeOffer.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.cardboardpowered.mixin.recipe; - -import org.bukkit.craftbukkit.inventory.CraftMerchantRecipe; -import org.bukkit.inventory.Recipe; -import org.spongepowered.asm.mixin.Mixin; - -import com.javazilla.bukkitfabric.interfaces.IMixinRecipe; - -import net.minecraft.village.TradeOffer; - -@Mixin(TradeOffer.class) -public class MixinTradeOffer implements IMixinRecipe { - - private CraftMerchantRecipe bukkitHandle; - - @Override - public Recipe toBukkitRecipe() { - return (bukkitHandle == null) ? bukkitHandle = new CraftMerchantRecipe((TradeOffer)(Object)this) : bukkitHandle; - } - - -} \ No newline at end of file diff --git a/src/main/java/org/cardboardpowered/mixin/screen/MixinCraftingScreenHandler.java b/src/main/java/org/cardboardpowered/mixin/screen/MixinCraftingScreenHandler.java index 037a8a4f..98f96c1f 100644 --- a/src/main/java/org/cardboardpowered/mixin/screen/MixinCraftingScreenHandler.java +++ b/src/main/java/org/cardboardpowered/mixin/screen/MixinCraftingScreenHandler.java @@ -1,30 +1,17 @@ package org.cardboardpowered.mixin.screen; -import java.util.Optional; - -import org.bukkit.craftbukkit.inventory.CraftInventoryCrafting; -import org.cardboardpowered.impl.inventory.CardboardInventoryView; -import org.bukkit.entity.Player; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - import com.javazilla.bukkitfabric.impl.BukkitEventFactory; import com.javazilla.bukkitfabric.interfaces.IMixinEntity; import com.javazilla.bukkitfabric.interfaces.IMixinScreenHandler; - import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; -import net.minecraft.inventory.CraftingInventory; import net.minecraft.inventory.CraftingResultInventory; import net.minecraft.inventory.Inventory; import net.minecraft.inventory.RecipeInputInventory; import net.minecraft.item.ItemStack; import net.minecraft.network.packet.s2c.play.ScreenHandlerSlotUpdateS2CPacket; import net.minecraft.recipe.CraftingRecipe; +import net.minecraft.recipe.RecipeEntry; import net.minecraft.recipe.RecipeType; import net.minecraft.registry.DynamicRegistryManager; import net.minecraft.screen.CraftingScreenHandler; @@ -32,6 +19,17 @@ import net.minecraft.screen.ScreenHandlerContext; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.world.World; +import org.bukkit.craftbukkit.inventory.CraftInventoryCrafting; +import org.bukkit.entity.Player; +import org.cardboardpowered.impl.inventory.CardboardInventoryView; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import java.util.Optional; @Mixin(CraftingScreenHandler.class) public class MixinCraftingScreenHandler extends MixinScreenHandler { @@ -65,12 +63,13 @@ private static void aBF(int i, World world, PlayerEntity entityhuman, RecipeInpu if (!world.isClient) { ServerPlayerEntity entityplayer = (ServerPlayerEntity) entityhuman; ItemStack itemstack = ItemStack.EMPTY; - Optional optional = world.getServer().getRecipeManager().getFirstMatch(RecipeType.CRAFTING, inventorycrafting, world); + Optional> optional = world.getServer().getRecipeManager().getFirstMatch( + RecipeType.CRAFTING, inventorycrafting, world); if (optional.isPresent()) { - CraftingRecipe recipecrafting = (CraftingRecipe) optional.get(); + RecipeEntry recipecrafting = optional.get(); if (inventorycraftresult.shouldCraftRecipe(world, entityplayer, recipecrafting)) - itemstack = recipecrafting.craft(inventorycrafting, DynamicRegistryManager.EMPTY); + itemstack = recipecrafting.value().craft(inventorycrafting, DynamicRegistryManager.EMPTY); } itemstack = BukkitEventFactory.callPreCraftEvent(inventorycrafting, inventorycraftresult, itemstack, ((IMixinScreenHandler)container).getBukkitView(), false); inventorycraftresult.setStack(0, itemstack); @@ -89,4 +88,4 @@ public void onContentChanged(Inventory iinventory) { }); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/world/MixinServerEntityHandler.java b/src/main/java/org/cardboardpowered/mixin/world/MixinServerEntityHandler.java index b041b92a..e2ccd101 100644 --- a/src/main/java/org/cardboardpowered/mixin/world/MixinServerEntityHandler.java +++ b/src/main/java/org/cardboardpowered/mixin/world/MixinServerEntityHandler.java @@ -18,37 +18,35 @@ */ package org.cardboardpowered.mixin.world; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - import com.destroystokyo.paper.event.entity.EntityAddToWorldEvent; import com.destroystokyo.paper.event.entity.EntityRemoveFromWorldEvent; import com.javazilla.bukkitfabric.impl.BukkitEventFactory; import com.javazilla.bukkitfabric.interfaces.IMixinEntity; - import net.minecraft.entity.Entity; import net.minecraft.server.world.ServerWorld.ServerEntityHandler; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(ServerEntityHandler.class) public class MixinServerEntityHandler { - @Inject(at = @At("TAIL"), method = "stopTracking") + @Inject(at = @At("TAIL"), method = "stopTracking(Lnet/minecraft/entity/Entity;)V") public void unvalidateEntityBF(Entity entity, CallbackInfo ci) { IMixinEntity bf = (IMixinEntity) entity; bf.setValid(false); BukkitEventFactory.callEvent( new EntityRemoveFromWorldEvent(bf.getBukkitEntity()) ); } - @Inject(at = @At("TAIL"), method = "startTracking") + @Inject(at = @At("TAIL"), method = "startTicking(Lnet/minecraft/entity/Entity;)V") public void validateEntityBF(Entity entity, CallbackInfo ci) { IMixinEntity bf = (IMixinEntity) entity; bf.setValid(true); - if (null == bf.getOriginBF() && null != bf.getBukkitEntity()) + if (null == bf.getOriginBF() && bf.getBukkitEntity() != null) bf.setOriginBF(bf.getBukkitEntity().getLocation()); // Paper Entity Origin API BukkitEventFactory.callEvent( new EntityAddToWorldEvent(bf.getBukkitEntity()) ); } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/world/MixinWorld.java b/src/main/java/org/cardboardpowered/mixin/world/MixinWorld.java index bb1030ca..77a299b9 100644 --- a/src/main/java/org/cardboardpowered/mixin/world/MixinWorld.java +++ b/src/main/java/org/cardboardpowered/mixin/world/MixinWorld.java @@ -1,25 +1,25 @@ package org.cardboardpowered.mixin.world; -import java.util.HashMap; -import java.util.Map; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import org.cardboardpowered.impl.block.CapturedBlockState; -import org.cardboardpowered.impl.world.WorldImpl; - import com.javazilla.bukkitfabric.interfaces.IMixinWorld; - import net.minecraft.block.BlockState; -import net.minecraft.server.world.ServerWorld; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; import net.minecraft.world.chunk.WorldChunk; +import org.cardboardpowered.impl.block.CapturedBlockState; +import org.cardboardpowered.impl.world.WorldImpl; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import java.util.HashMap; +import java.util.Map; @Mixin(World.class) -public class MixinWorld implements IMixinWorld { +public abstract class MixinWorld implements IMixinWorld { + @Shadow public WorldChunk getWorldChunk(BlockPos pos) {return null;} private WorldImpl bukkit; public boolean captureBlockStates = false; @@ -56,14 +56,14 @@ public void set_bukkit_world(WorldImpl world) { this.bukkit = world; } - @Inject(at = @At("HEAD"), method = "setBlockState", cancellable = true) - public void setBlockState1(BlockPos blockposition, BlockState iblockdata, int i, CallbackInfoReturnable ci) { + @Inject(at = @At("HEAD"), method = "setBlockState(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;II)Z") + public void setBlockState1(BlockPos pos, BlockState state, int flags, int maxUpdateDepth, CallbackInfoReturnable cir) { // TODO 1.17ify: if (!ServerWorld.isOutOfBuildLimitVertically(blockposition)) { - WorldChunk chunk = ((ServerWorld)(Object)this).getWorldChunk(blockposition); + WorldChunk chunk = getWorldChunk(pos); boolean captured = false; - if (this.captureBlockStates && !this.capturedBlockStates.containsKey(blockposition)) { - CapturedBlockState blockstate = CapturedBlockState.getBlockState((World)(Object)this, blockposition, i); - this.capturedBlockStates.put(blockposition.toImmutable(), blockstate); + if (this.captureBlockStates && !this.capturedBlockStates.containsKey(pos)) { + CapturedBlockState blockstate = CapturedBlockState.getBlockState((World)(Object)this, pos, flags); + this.capturedBlockStates.put(pos.toImmutable(), blockstate); captured = true; } //} @@ -74,4 +74,4 @@ public void setCaptureBlockStates_BF(boolean b) { this.captureBlockStates = b; } -} \ No newline at end of file +} diff --git a/src/main/java/org/cardboardpowered/mixin/world/MixinWorldSaveHandler.java b/src/main/java/org/cardboardpowered/mixin/world/MixinWorldSaveHandler.java index 2e2661b5..07bf3aed 100644 --- a/src/main/java/org/cardboardpowered/mixin/world/MixinWorldSaveHandler.java +++ b/src/main/java/org/cardboardpowered/mixin/world/MixinWorldSaveHandler.java @@ -1,21 +1,9 @@ package org.cardboardpowered.mixin.world; -import java.io.File; -import java.io.FileInputStream; -import java.io.InputStream; -import java.nio.charset.StandardCharsets; - -import org.cardboardpowered.impl.entity.PlayerImpl; -import org.spongepowered.asm.mixin.Final; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Overwrite; -import org.spongepowered.asm.mixin.Shadow; - import com.javazilla.bukkitfabric.BukkitFabricMod; import com.javazilla.bukkitfabric.interfaces.IMixinServerEntityPlayer; import com.javazilla.bukkitfabric.interfaces.IMixinWorldSaveHandler; import com.mojang.datafixers.DataFixer; - import net.minecraft.datafixer.DataFixTypes; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.nbt.NbtCompound; @@ -23,6 +11,16 @@ import net.minecraft.nbt.NbtIo; import net.minecraft.server.network.ServerPlayerEntity; import net.minecraft.world.WorldSaveHandler; +import org.cardboardpowered.impl.entity.PlayerImpl; +import org.jetbrains.annotations.Nullable; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Overwrite; +import org.spongepowered.asm.mixin.Shadow; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; @Mixin(value = WorldSaveHandler.class, priority = 999) public class MixinWorldSaveHandler implements IMixinWorldSaveHandler { @@ -40,6 +38,7 @@ public class MixinWorldSaveHandler implements IMixinWorldSaveHandler { * @author Cardboard */ @Overwrite + @Nullable public NbtCompound loadPlayerData(PlayerEntity player) { NbtCompound lv = null; try { diff --git a/src/main/resources/bukkitfabric.accesswidener b/src/main/resources/bukkitfabric.accesswidener index be3a45ca..075f5e67 100644 --- a/src/main/resources/bukkitfabric.accesswidener +++ b/src/main/resources/bukkitfabric.accesswidener @@ -4,11 +4,8 @@ accessible method net/minecraft/recipe/Ingredient (Ljava/util/stream/Stre accessible field net/minecraft/network/packet/c2s/handshake/HandshakeC2SPacket address Ljava/lang/String; accessible method net/minecraft/server/ServerConfigEntry getKey ()Ljava/lang/Object; accessible field net/minecraft/entity/boss/BossBar color Lnet/minecraft/entity/boss/BossBar$Color; -accessible field net/minecraft/block/entity/AbstractFurnaceBlockEntity cookTime I accessible method net/minecraft/entity/decoration/AbstractDecorationEntity setFacing (Lnet/minecraft/util/math/Direction;)V -accessible field net/minecraft/block/entity/AbstractFurnaceBlockEntity cookTimeTotal I accessible field net/minecraft/block/entity/AbstractFurnaceBlockEntity burnTime I -accessible method net/minecraft/block/DispenserBlock dispense (Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;)V accessible field net/minecraft/network/ClientConnection address Ljava/net/SocketAddress; accessible field net/minecraft/entity/boss/dragon/EnderDragonEntity parts [Lnet/minecraft/entity/boss/dragon/EnderDragonPart; accessible field net/minecraft/network/packet/s2c/play/PlayerSpawnPositionS2CPacket pos Lnet/minecraft/util/math/BlockPos; @@ -183,20 +180,10 @@ mutable field net/minecraft/potion/Potion effects Lcom/google/common/collect/Imm accessible method net/minecraft/potion/Potions register (Ljava/lang/String;Lnet/minecraft/potion/Potion;)Lnet/minecraft/potion/Potion; accessible field net/minecraft/recipe/AbstractCookingRecipe type Lnet/minecraft/recipe/RecipeType; mutable field net/minecraft/recipe/AbstractCookingRecipe type Lnet/minecraft/recipe/RecipeType; -accessible field net/minecraft/recipe/AbstractCookingRecipe id Lnet/minecraft/util/Identifier; -mutable field net/minecraft/recipe/AbstractCookingRecipe id Lnet/minecraft/util/Identifier; accessible field net/minecraft/recipe/AbstractCookingRecipe group Ljava/lang/String; mutable field net/minecraft/recipe/AbstractCookingRecipe group Ljava/lang/String; -accessible field net/minecraft/recipe/AbstractCookingRecipe input Lnet/minecraft/recipe/Ingredient; -mutable field net/minecraft/recipe/AbstractCookingRecipe input Lnet/minecraft/recipe/Ingredient; -accessible field net/minecraft/recipe/AbstractCookingRecipe output Lnet/minecraft/item/ItemStack; -mutable field net/minecraft/recipe/AbstractCookingRecipe output Lnet/minecraft/item/ItemStack; accessible field net/minecraft/recipe/AbstractCookingRecipe experience F mutable field net/minecraft/recipe/AbstractCookingRecipe experience F -accessible field net/minecraft/recipe/AbstractCookingRecipe cookTime I -mutable field net/minecraft/recipe/AbstractCookingRecipe cookTime I -accessible field net/minecraft/recipe/SpecialCraftingRecipe id Lnet/minecraft/util/Identifier; -mutable field net/minecraft/recipe/SpecialCraftingRecipe id Lnet/minecraft/util/Identifier; accessible class net/minecraft/recipe/Ingredient$StackEntry accessible method net/minecraft/recipe/Ingredient$StackEntry (Lnet/minecraft/item/ItemStack;)V accessible class net/minecraft/recipe/Ingredient$TagEntry @@ -215,28 +202,11 @@ accessible method net/minecraft/recipe/RecipeManager getAllOfType (Lnet/minecraf extendable class net/minecraft/recipe/RecipeType$1 accessible field net/minecraft/recipe/ShapedRecipe width I accessible field net/minecraft/recipe/ShapedRecipe height I -accessible field net/minecraft/recipe/ShapedRecipe output Lnet/minecraft/item/ItemStack; -accessible field net/minecraft/recipe/ShapedRecipe id Lnet/minecraft/util/Identifier; accessible field net/minecraft/recipe/ShapedRecipe group Ljava/lang/String; -accessible method net/minecraft/recipe/ShapedRecipe getPattern (Lcom/google/gson/JsonArray;)[Ljava/lang/String; -accessible field net/minecraft/recipe/ShapelessRecipe id Lnet/minecraft/util/Identifier; -mutable field net/minecraft/recipe/ShapelessRecipe id Lnet/minecraft/util/Identifier; accessible field net/minecraft/recipe/ShapelessRecipe group Ljava/lang/String; mutable field net/minecraft/recipe/ShapelessRecipe group Ljava/lang/String; -accessible field net/minecraft/recipe/ShapelessRecipe output Lnet/minecraft/item/ItemStack; -mutable field net/minecraft/recipe/ShapelessRecipe output Lnet/minecraft/item/ItemStack; accessible class net/minecraft/recipe/CookingRecipeSerializer$RecipeFactory -accessible field net/minecraft/recipe/CookingRecipeSerializer cookingTime I -mutable field net/minecraft/recipe/CookingRecipeSerializer cookingTime I accessible class net/minecraft/recipe/CuttingRecipe$Serializer$RecipeFactory -accessible field net/minecraft/recipe/CuttingRecipe input Lnet/minecraft/recipe/Ingredient; -mutable field net/minecraft/recipe/CuttingRecipe input Lnet/minecraft/recipe/Ingredient; -accessible field net/minecraft/recipe/CuttingRecipe output Lnet/minecraft/item/ItemStack; -mutable field net/minecraft/recipe/CuttingRecipe output Lnet/minecraft/item/ItemStack; -accessible field net/minecraft/recipe/CuttingRecipe type Lnet/minecraft/recipe/RecipeType; -mutable field net/minecraft/recipe/CuttingRecipe type Lnet/minecraft/recipe/RecipeType; -accessible field net/minecraft/recipe/CuttingRecipe id Lnet/minecraft/util/Identifier; -mutable field net/minecraft/recipe/CuttingRecipe id Lnet/minecraft/util/Identifier; accessible field net/minecraft/recipe/CuttingRecipe group Ljava/lang/String; mutable field net/minecraft/recipe/CuttingRecipe group Ljava/lang/String; extendable class net/minecraft/enchantment/EnchantmentTarget$1 @@ -564,7 +534,6 @@ accessible field net/minecraft/block/entity/StructureBlockBlockEntity mirror Lne accessible field net/minecraft/block/entity/StructureBlockBlockEntity integrity F accessible field net/minecraft/inventory/ContainerLock key Ljava/lang/String; accessible field net/minecraft/village/TradeOffer secondBuyItem Lnet/minecraft/item/ItemStack; -accessible method net/minecraft/block/DropperBlock dispense (Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;)V mutable field net/minecraft/village/TradeOffer secondBuyItem Lnet/minecraft/item/ItemStack; accessible field net/minecraft/village/TradeOffer sellItem Lnet/minecraft/item/ItemStack; accessible field net/minecraft/village/TradeOffer merchantExperience I @@ -595,4 +564,9 @@ accessible field net/minecraft/server/MinecraftServer resourceManagerHolder Lnet accessible field net/minecraft/entity/projectile/FireworkRocketEntity ITEM Lnet/minecraft/entity/data/TrackedData; accessible field net/minecraft/entity/projectile/FireworkRocketEntity SHOT_AT_ANGLE Lnet/minecraft/entity/data/TrackedData; accessible field net/minecraft/entity/projectile/FireworkRocketEntity lifeTime I -accessible class net/minecraft/server/MinecraftServer$ResourceManagerHolder \ No newline at end of file +accessible class net/minecraft/server/MinecraftServer$ResourceManagerHolder +accessible method net/minecraft/block/entity/SkullBlockEntity fetchProfileWithTextures (Lcom/mojang/authlib/GameProfile;)Ljava/util/concurrent/CompletableFuture; +accessible method net/minecraft/block/DispenserBlock dispense (Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;)V +accessible method net/minecraft/block/DropperBlock dispense (Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/block/BlockState;Lnet/minecraft/util/math/BlockPos;)V +accessible field net/minecraft/block/entity/AbstractFurnaceBlockEntity cookTime I +accessible field net/minecraft/block/entity/AbstractFurnaceBlockEntity cookTimeTotal I diff --git a/src/main/resources/bukkitfabric.mixins.json b/src/main/resources/bukkitfabric.mixins.json index 56be00f7..73200a2e 100644 --- a/src/main/resources/bukkitfabric.mixins.json +++ b/src/main/resources/bukkitfabric.mixins.json @@ -5,7 +5,7 @@ "package": "org.cardboardpowered.mixin", "compatibilityLevel": "JAVA_16", "mixins": [ - "MixinAdvancement", + "MixinAdvancementEntry", "MixinCommandManager", "MixinCommandOutput", "MixinDedicatedServer", @@ -19,6 +19,7 @@ "MixinPluginLogger", "MixinServerBossBar", "MixinServerCommandSource", + "MixinServerNetworkConfiguration", "MixinServerPlayerInteractionManager", "MixinServerScoreboard", "MixinStatHandler", @@ -127,7 +128,6 @@ "item.MixinLeadItem", "item.MixinMinecraftItem", "item.MixinPotionItem", - "item.MixinSkullItem", "item.MixinSnowballItem", "item.MixinTridentItem", "loot.MixinLootContextParameters", @@ -139,7 +139,6 @@ "network.MixinClientConnection", "network.MixinDataTracker", "network.MixinGameMessageS2CPacket", - "network.MixinHandshakeC2SPacket", "network.MixinLegacyQueryHandler", "network.MixinPacketByteBuf", "network.MixinPlayerManager_ChatEvent", @@ -154,19 +153,9 @@ "network.handler.MixinSPNH_PlayerCommandPreprocessEvent_1_18", "network.handler.MixinSPNH_PlayerCommandPreprocessEvent_1_19", "network.handler.MixinSPNH_SignUpdateEvent", - "recipe.MixinBlastingRecipe", - "recipe.MixinCampfireCookingRecipe", "recipe.MixinIngredient", + "recipe.MixinRecipeEntry", "recipe.MixinRecipeManager", - "recipe.MixinServerRecipeBook", - "recipe.MixinShapedRecipe", - "recipe.MixinShapelessRecipe", - "recipe.MixinSmeltingRecipe", - "recipe.MixinSmithingRecipe", - "recipe.MixinSmokingRecipe", - "recipe.MixinSpecialCraftingRecipe", - "recipe.MixinStonecuttingRecipe", - "recipe.MixinTradeOffer", "screen.MixinAbstractFurnaceScreenHandler", "screen.MixinAnvilScreenHandler", "screen.MixinBeaconScreenHandler", @@ -209,4 +198,4 @@ "defaultRequire": 1 } -} \ No newline at end of file +} diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 9ec8a678..018f5724 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,12 +1,13 @@ { "schemaVersion": 1, "id": "cardboard", - "version": "${version}", + "version": "1.20.1", "name": "Cardboard", "description": "An implementation of the popular Spigot/Paper API for Fabric", "authors": [ - "Isaiah" + "Isaiah", + "The Cardboard Community" ], "contact": { "homepage": "https://cardboardpowered.org/", @@ -29,7 +30,7 @@ "depends": { "fabricloader": ">=0.11.0", - "fabric": "*", + "fabric-api": "*", "java": ">=16", "icommon": "*" }, @@ -37,4 +38,4 @@ "flamingo": "*" } -} \ No newline at end of file +} diff --git a/src/main/resources/mappings/spigot2srg-1.20.2.srg b/src/main/resources/mappings/spigot2srg-1.20.2.srg new file mode 100644 index 00000000..b094de9c --- /dev/null +++ b/src/main/resources/mappings/spigot2srg-1.20.2.srg @@ -0,0 +1,3520 @@ +# (c) 2023 SpigotMC Pty. Ltd. +aa net/minecraft/SharedConstants +aaa net/minecraft/network/protocol/game/PacketPlayOutEntityEquipment +aab net/minecraft/network/protocol/game/PacketPlayOutExperience +aac net/minecraft/network/protocol/game/PacketPlayOutUpdateHealth +aad net/minecraft/network/protocol/game/PacketPlayOutScoreboardObjective +aae net/minecraft/network/protocol/game/PacketPlayOutMount +aaf net/minecraft/network/protocol/game/PacketPlayOutScoreboardTeam +aag net/minecraft/network/protocol/game/PacketPlayOutScoreboardScore +aah net/minecraft/network/protocol/game/ClientboundSetSimulationDistancePacket +aai net/minecraft/network/protocol/game/ClientboundSetSubtitleTextPacket +aaj net/minecraft/network/protocol/game/PacketPlayOutUpdateTime +aak net/minecraft/network/protocol/game/ClientboundSetTitleTextPacket +aal net/minecraft/network/protocol/game/ClientboundSetTitlesAnimationPacket +aam net/minecraft/network/protocol/game/PacketPlayOutEntitySound +aan net/minecraft/network/protocol/game/PacketPlayOutNamedSoundEffect +aao net/minecraft/network/protocol/game/ClientboundStartConfigurationPacket +aap net/minecraft/network/protocol/game/PacketPlayOutStopSound +aaq net/minecraft/network/protocol/game/ClientboundSystemChatPacket +aar net/minecraft/network/protocol/game/PacketPlayOutPlayerListHeaderFooter +aas net/minecraft/network/protocol/game/PacketPlayOutNBTQuery +aat net/minecraft/network/protocol/game/PacketPlayOutCollect +aau net/minecraft/network/protocol/game/PacketPlayOutEntityTeleport +aav net/minecraft/network/protocol/game/PacketPlayOutAdvancements +aaw net/minecraft/network/protocol/game/PacketPlayOutUpdateAttributes +aaw$a net/minecraft/network/protocol/game/PacketPlayOutUpdateAttributes$AttributeSnapshot +aax net/minecraft/network/protocol/game/PacketPlayOutEntityEffect +aay net/minecraft/network/protocol/game/PacketPlayOutRecipeUpdate +aaz net/minecraft/network/protocol/game/CommonPlayerSpawnInfo +ab net/minecraft/SystemReport +aba net/minecraft/network/protocol/game/DebugEntityNameGenerator +abb net/minecraft/network/protocol/game/PacketDebug +abc net/minecraft/network/protocol/game/PacketListenerPlayIn +abd net/minecraft/network/protocol/game/ServerPacketListener +abe net/minecraft/network/protocol/game/ServerPingPacketListener +abf net/minecraft/network/protocol/game/PacketPlayInTeleportAccept +abg net/minecraft/network/protocol/game/PacketPlayInTileNBTQuery +abh net/minecraft/network/protocol/game/PacketPlayInDifficultyChange +abi net/minecraft/network/protocol/game/ServerboundChatAckPacket +abj net/minecraft/network/protocol/game/ServerboundChatCommandPacket +abk net/minecraft/network/protocol/game/PacketPlayInChat +abl net/minecraft/network/protocol/game/ServerboundChatSessionUpdatePacket +abm net/minecraft/network/protocol/game/ServerboundChunkBatchReceivedPacket +abn net/minecraft/network/protocol/game/PacketPlayInClientCommand +abn$a net/minecraft/network/protocol/game/PacketPlayInClientCommand$EnumClientCommand +abo net/minecraft/network/protocol/game/PacketPlayInTabComplete +abp net/minecraft/network/protocol/game/ServerboundConfigurationAcknowledgedPacket +abq net/minecraft/network/protocol/game/PacketPlayInEnchantItem +abr net/minecraft/network/protocol/game/PacketPlayInWindowClick +abs net/minecraft/network/protocol/game/PacketPlayInCloseWindow +abt net/minecraft/network/protocol/game/PacketPlayInBEdit +abu net/minecraft/network/protocol/game/PacketPlayInEntityNBTQuery +abv net/minecraft/network/protocol/game/PacketPlayInUseEntity +abv$a net/minecraft/network/protocol/game/PacketPlayInUseEntity$EnumEntityUseAction +abw net/minecraft/network/protocol/game/PacketPlayInJigsawGenerate +abx net/minecraft/network/protocol/game/PacketPlayInDifficultyLock +aby net/minecraft/network/protocol/game/PacketPlayInFlying +aby$a net/minecraft/network/protocol/game/PacketPlayInFlying$PacketPlayInPosition +aby$b net/minecraft/network/protocol/game/PacketPlayInFlying$PacketPlayInPositionLook +aby$c net/minecraft/network/protocol/game/PacketPlayInFlying$PacketPlayInLook +abz net/minecraft/network/protocol/game/PacketPlayInVehicleMove +ac net/minecraft/SystemUtils +ac$a net/minecraft/SystemUtils$IdentityHashingStrategy +ac$b net/minecraft/SystemUtils$OS +aca net/minecraft/network/protocol/game/PacketPlayInBoatMove +acb net/minecraft/network/protocol/game/PacketPlayInPickItem +acc net/minecraft/network/protocol/game/PacketPlayInAutoRecipe +acd net/minecraft/network/protocol/game/PacketPlayInAbilities +ace net/minecraft/network/protocol/game/PacketPlayInBlockDig +ace$a net/minecraft/network/protocol/game/PacketPlayInBlockDig$EnumPlayerDigType +acf net/minecraft/network/protocol/game/PacketPlayInEntityAction +acf$a net/minecraft/network/protocol/game/PacketPlayInEntityAction$EnumPlayerAction +acg net/minecraft/network/protocol/game/PacketPlayInSteerVehicle +ach net/minecraft/network/protocol/game/PacketPlayInRecipeSettings +aci net/minecraft/network/protocol/game/PacketPlayInRecipeDisplayed +acj net/minecraft/network/protocol/game/PacketPlayInItemName +ack net/minecraft/network/protocol/game/PacketPlayInAdvancements +ack$a net/minecraft/network/protocol/game/PacketPlayInAdvancements$Status +acl net/minecraft/network/protocol/game/PacketPlayInTrSel +acm net/minecraft/network/protocol/game/PacketPlayInBeacon +acn net/minecraft/network/protocol/game/PacketPlayInHeldItemSlot +aco net/minecraft/network/protocol/game/PacketPlayInSetCommandBlock +acp net/minecraft/network/protocol/game/PacketPlayInSetCommandMinecart +acq net/minecraft/network/protocol/game/PacketPlayInSetCreativeSlot +acr net/minecraft/network/protocol/game/PacketPlayInSetJigsaw +acs net/minecraft/network/protocol/game/PacketPlayInStruct +act net/minecraft/network/protocol/game/PacketPlayInUpdateSign +acu net/minecraft/network/protocol/game/PacketPlayInArmAnimation +acv net/minecraft/network/protocol/game/PacketPlayInSpectate +acw net/minecraft/network/protocol/game/PacketPlayInUseItem +acx net/minecraft/network/protocol/game/PacketPlayInBlockPlace +acy net/minecraft/network/protocol/game/VecDeltaCodec +ad net/minecraft/WorldVersion +ada net/minecraft/network/protocol/handshake/ClientIntent +adb net/minecraft/network/protocol/handshake/PacketHandshakingInSetProtocol +adc net/minecraft/network/protocol/handshake/PacketHandshakingInListener +ade net/minecraft/network/protocol/login/PacketLoginOutListener +adf net/minecraft/network/protocol/login/PacketLoginOutCustomPayload +adg net/minecraft/network/protocol/login/PacketLoginOutSuccess +adh net/minecraft/network/protocol/login/PacketLoginOutEncryptionBegin +adi net/minecraft/network/protocol/login/PacketLoginOutSetCompression +adj net/minecraft/network/protocol/login/PacketLoginOutDisconnect +adk net/minecraft/network/protocol/login/PacketLoginInListener +adl net/minecraft/network/protocol/login/ServerboundCustomQueryAnswerPacket +adm net/minecraft/network/protocol/login/PacketLoginInStart +adn net/minecraft/network/protocol/login/PacketLoginInEncryptionBegin +ado net/minecraft/network/protocol/login/ServerboundLoginAcknowledgedPacket +adp net/minecraft/network/protocol/login/custom/CustomQueryAnswerPayload +adq net/minecraft/network/protocol/login/custom/CustomQueryPayload +adr net/minecraft/network/protocol/login/custom/DiscardedQueryAnswerPayload +ads net/minecraft/network/protocol/login/custom/DiscardedQueryPayload +adw net/minecraft/network/protocol/status/PacketStatusOutListener +adx net/minecraft/network/protocol/status/PacketStatusOutPong +ady net/minecraft/network/protocol/status/PacketStatusOutServerInfo +adz net/minecraft/network/protocol/status/ServerPing +adz$b net/minecraft/network/protocol/status/ServerPing$ServerPingPlayerSample +adz$c net/minecraft/network/protocol/status/ServerPing$ServerData +ae net/minecraft/advancements/Advancement +ae$a net/minecraft/advancements/Advancement$SerializedAdvancement +aea net/minecraft/network/protocol/status/PacketStatusInListener +aeb net/minecraft/network/protocol/status/PacketStatusInPing +aec net/minecraft/network/protocol/status/PacketStatusInStart +aee net/minecraft/network/syncher/DataWatcherObject +aef net/minecraft/network/syncher/DataWatcherSerializer +aeg net/minecraft/network/syncher/DataWatcherRegistry +aeh net/minecraft/network/syncher/DataWatcher +aeh$a net/minecraft/network/syncher/DataWatcher$Item +ael net/minecraft/recipebook/AutoRecipeAbstract +aem net/minecraft/recipebook/AutoRecipe +aeo net/minecraft/resources/DynamicOpsWrapper +aep net/minecraft/resources/FileToIdConverter +aeq net/minecraft/resources/HolderSetCodec +aer net/minecraft/resources/RegistryDataLoader +aes net/minecraft/resources/RegistryFileCodec +aet net/minecraft/resources/RegistryFixedCodec +aeu net/minecraft/resources/RegistryOps +aev net/minecraft/resources/ResourceKey +aew net/minecraft/resources/MinecraftKey +aey net/minecraft/server/DispenserRegistry +af net/minecraft/advancements/AdvancementHolder +afa net/minecraft/server/ServerCommand +afb net/minecraft/server/DebugOutputStream +afc net/minecraft/server/EULA +afd net/minecraft/server/RedirectStream +afe net/minecraft/server/AdvancementDataPlayer +aff net/minecraft/server/RegistryLayer +afg net/minecraft/server/DataPackResources +afh net/minecraft/server/CancelledPacketHandleException +afi net/minecraft/server/AdvancementDataWorld +afj net/minecraft/server/CustomFunctionManager +afk net/minecraft/server/CustomFunctionData +afk$a net/minecraft/server/CustomFunctionData$ExecutionContext +afk$a$a net/minecraft/server/CustomFunctionData$ExecutionContext$AbortingReturnValueConsumer +afk$b net/minecraft/server/CustomFunctionData$QueuedCommand +afk$c net/minecraft/server/CustomFunctionData$TraceCallbacks +afl net/minecraft/server/ServerInfo +afm net/minecraft/server/IMinecraftServer +afn net/minecraft/server/ScoreboardServer +afn$a net/minecraft/server/ScoreboardServer$Action +afo net/minecraft/server/Services +afp net/minecraft/server/TickTask +afq net/minecraft/server/WorldLoader +afr net/minecraft/server/WorldStem +afs net/minecraft/server/advancements/AdvancementVisibilityEvaluator +afu net/minecraft/server/bossevents/BossBattleCustom +afv net/minecraft/server/bossevents/BossBattleCustomData +ag net/minecraft/advancements/AdvancementNode +aga net/minecraft/server/commands/CommandAdvancement +aga$a net/minecraft/server/commands/CommandAdvancement$Action +aga$b net/minecraft/server/commands/CommandAdvancement$Filter +agb net/minecraft/server/commands/CommandAttribute +agc net/minecraft/server/commands/CommandBanIp +agd net/minecraft/server/commands/CommandBanList +age net/minecraft/server/commands/CommandBan +agf net/minecraft/server/commands/CommandBossBar +agh net/minecraft/server/commands/CommandClear +agi net/minecraft/server/commands/CommandClone +agi$a net/minecraft/server/commands/CommandClone$CommandCloneStoredTileEntity +agi$d net/minecraft/server/commands/CommandClone$Mode +agj net/minecraft/server/commands/DamageCommand +agk net/minecraft/server/commands/CommandDatapack +agl net/minecraft/server/commands/CommandDeop +agm net/minecraft/server/commands/CommandDebug +agn net/minecraft/server/commands/DebugConfigCommand +agq net/minecraft/server/commands/CommandGamemodeDefault +agr net/minecraft/server/commands/CommandDifficulty +ags net/minecraft/server/commands/CommandEffect +agt net/minecraft/server/commands/CommandMe +agu net/minecraft/server/commands/CommandEnchant +agv net/minecraft/server/commands/CommandExecute +agw net/minecraft/server/commands/CommandXp +agw$a net/minecraft/server/commands/CommandXp$Unit +agx net/minecraft/server/commands/FillBiomeCommand +agy net/minecraft/server/commands/CommandFill +agy$a net/minecraft/server/commands/CommandFill$Mode +agz net/minecraft/server/commands/CommandForceload +ah net/minecraft/advancements/AdvancementProgress +aha net/minecraft/server/commands/CommandFunction +ahb net/minecraft/server/commands/CommandGamemode +ahc net/minecraft/server/commands/CommandGamerule +ahd net/minecraft/server/commands/CommandGive +ahe net/minecraft/server/commands/CommandHelp +ahf net/minecraft/server/commands/ItemCommands +ahg net/minecraft/server/commands/JfrCommand +ahh net/minecraft/server/commands/CommandKick +ahi net/minecraft/server/commands/CommandKill +ahj net/minecraft/server/commands/CommandList +ahk net/minecraft/server/commands/CommandLocate +ahl net/minecraft/server/commands/CommandLoot +ahm net/minecraft/server/commands/CommandTell +ahn net/minecraft/server/commands/CommandOp +aho net/minecraft/server/commands/CommandPardon +ahp net/minecraft/server/commands/CommandPardonIP +ahq net/minecraft/server/commands/CommandParticle +ahr net/minecraft/server/commands/PerfCommand +ahs net/minecraft/server/commands/PlaceCommand +aht net/minecraft/server/commands/CommandPlaySound +ahu net/minecraft/server/commands/CommandPublish +ahw net/minecraft/server/commands/RandomCommand +ahx net/minecraft/server/commands/CommandRecipe +ahy net/minecraft/server/commands/CommandReload +ai net/minecraft/advancements/AdvancementRequirements +aia net/minecraft/server/commands/ReturnCommand +aib net/minecraft/server/commands/RideCommand +aic net/minecraft/server/commands/CommandSaveAll +aid net/minecraft/server/commands/CommandSaveOff +aie net/minecraft/server/commands/CommandSaveOn +aif net/minecraft/server/commands/CommandSay +aig net/minecraft/server/commands/CommandSchedule +aih net/minecraft/server/commands/CommandScoreboard +aii net/minecraft/server/commands/CommandSeed +aij net/minecraft/server/commands/CommandSetBlock +aij$a net/minecraft/server/commands/CommandSetBlock$Filter +aij$b net/minecraft/server/commands/CommandSetBlock$Mode +aik net/minecraft/server/commands/CommandIdleTimeout +ail net/minecraft/server/commands/CommandSpawnpoint +aim net/minecraft/server/commands/CommandSetWorldSpawn +ain net/minecraft/server/commands/SpawnArmorTrimsCommand +aio net/minecraft/server/commands/CommandSpectate +aip net/minecraft/server/commands/CommandSpreadPlayers +aiq net/minecraft/server/commands/CommandStop +air net/minecraft/server/commands/CommandStopSound +ais net/minecraft/server/commands/CommandSummon +ait net/minecraft/server/commands/CommandTag +aiu net/minecraft/server/commands/CommandTeam +aiv net/minecraft/server/commands/CommandTeamMsg +aiw net/minecraft/server/commands/CommandTeleport +aix net/minecraft/server/commands/CommandTellRaw +aiy net/minecraft/server/commands/CommandTime +aiz net/minecraft/server/commands/CommandTitle +aj net/minecraft/advancements/AdvancementRewards +aja net/minecraft/server/commands/CommandTrigger +ajc net/minecraft/server/commands/CommandWeather +ajd net/minecraft/server/commands/CommandWhitelist +aje net/minecraft/server/commands/CommandWorldBorder +ajf net/minecraft/server/commands/data/CommandDataAccessorTile +ajg net/minecraft/server/commands/data/CommandDataAccessor +ajh net/minecraft/server/commands/data/CommandData +aji net/minecraft/server/commands/data/CommandDataAccessorEntity +ajj net/minecraft/server/commands/data/CommandDataStorage +ajm net/minecraft/server/dedicated/DedicatedPlayerList +ajn net/minecraft/server/dedicated/DedicatedServer +ajo net/minecraft/server/dedicated/DedicatedServerProperties +ajo$a net/minecraft/server/dedicated/DedicatedServerProperties$WorldDimensionData +ajp net/minecraft/server/dedicated/DedicatedServerSettings +ajq net/minecraft/server/dedicated/ThreadWatchdog +ajr net/minecraft/server/dedicated/PropertyManager +ajr$a net/minecraft/server/dedicated/PropertyManager$EditableProperty +ajt net/minecraft/server/gui/ServerGUI +aju net/minecraft/server/gui/PlayerListBox +ajv net/minecraft/server/gui/GuiStatsComponent +ajy net/minecraft/server/level/PlayerChunk +ajy$a net/minecraft/server/level/PlayerChunk$Failure +ajz net/minecraft/server/level/ChunkLevel +ak net/minecraft/advancements/AdvancementTree +aka net/minecraft/server/level/PlayerChunkMap +aka$b net/minecraft/server/level/PlayerChunkMap$EntityTracker +akb net/minecraft/server/level/ChunkTaskQueue +akc net/minecraft/server/level/ChunkTaskQueueSorter +akd net/minecraft/server/level/ChunkMap +ake net/minecraft/server/level/ChunkTrackingView +akf net/minecraft/server/level/ClientInformation +akg net/minecraft/server/level/BlockPosition2D +akh net/minecraft/server/level/DemoPlayerInteractManager +aki net/minecraft/server/level/ChunkMapDistance +akj net/minecraft/server/level/FullChunkStatus +akk net/minecraft/server/level/PlayerMap +akl net/minecraft/server/level/WorldProviderNormal +akm net/minecraft/server/level/LightEngineGraphSection +akn net/minecraft/server/level/BossBattleServer +ako net/minecraft/server/level/ChunkProviderServer +akp net/minecraft/server/level/EntityTrackerEntry +akq net/minecraft/server/level/WorldServer +akr net/minecraft/server/level/EntityPlayer +aks net/minecraft/server/level/PlayerInteractManager +akt net/minecraft/server/level/LightEngineThreaded +akt$a net/minecraft/server/level/LightEngineThreaded$Update +aku net/minecraft/server/level/Ticket +akv net/minecraft/server/level/TicketType +akw net/minecraft/server/level/TickingTracker +akx net/minecraft/server/level/RegionLimitedWorldAccess +akz net/minecraft/server/level/progress/WorldLoadListener +al net/minecraft/advancements/CriterionTriggers +ala net/minecraft/server/level/progress/WorldLoadListenerFactory +alb net/minecraft/server/level/progress/WorldLoadListenerLogger +alf net/minecraft/server/network/CommonListenerCookie +alg net/minecraft/server/network/ConfigurationTask +alh net/minecraft/server/network/FilteredText +ali net/minecraft/server/network/LegacyProtocolUtils +alj net/minecraft/server/network/LegacyPingHandler +alk net/minecraft/server/network/MemoryServerHandshakePacketListenerImpl +all net/minecraft/server/network/PlayerChunkSender +alm net/minecraft/server/network/ServerCommonPacketListenerImpl +aln net/minecraft/server/network/ServerConfigurationPacketListenerImpl +alo net/minecraft/server/network/ServerConnection +alo$a net/minecraft/server/network/ServerConnection$LatencySimulator +alo$a$a net/minecraft/server/network/ServerConnection$LatencySimulator$DelayedMessage +alp net/minecraft/server/network/PlayerConnection +alq net/minecraft/server/network/HandshakeListener +alr net/minecraft/server/network/LoginListener +alr$a net/minecraft/server/network/LoginListener$EnumProtocolState +als net/minecraft/server/network/ServerPlayerConnection +alt net/minecraft/server/network/PacketStatusListener +alu net/minecraft/server/network/ITextFilter +alv net/minecraft/server/network/TextFilter +alw net/minecraft/server/network/config/JoinWorldTask +alx net/minecraft/server/network/config/ServerResourcePackConfigurationTask +am net/minecraft/advancements/Criterion +amb net/minecraft/server/packs/ResourcePackAbstract +amc net/minecraft/server/packs/BuiltInMetadata +amd net/minecraft/server/packs/CompositePackResources +ame net/minecraft/server/packs/FeatureFlagsMetadataSection +amf net/minecraft/server/packs/ResourcePackFile +amg net/minecraft/server/packs/OverlayMetadataSection +amh net/minecraft/server/packs/IResourcePack +ami net/minecraft/server/packs/EnumResourcePackType +amj net/minecraft/server/packs/PathPackResources +amk net/minecraft/server/packs/ResourcePackVanilla +aml net/minecraft/server/packs/VanillaPackResourcesBuilder +amm net/minecraft/server/packs/linkfs/DummyFileAttributes +amn net/minecraft/server/packs/linkfs/LinkFSFileStore +amo net/minecraft/server/packs/linkfs/LinkFSPath +amp net/minecraft/server/packs/linkfs/LinkFSProvider +amq net/minecraft/server/packs/linkfs/LinkFileSystem +amr net/minecraft/server/packs/linkfs/PathContents +amt net/minecraft/server/packs/metadata/ResourcePackMetaParser +amu net/minecraft/server/packs/metadata/MetadataSectionType +amv net/minecraft/server/packs/metadata/pack/ResourcePackInfo +amz net/minecraft/server/packs/repository/BuiltInPackSource +an net/minecraft/advancements/CriterionProgress +ana net/minecraft/server/packs/repository/ResourcePackSourceFolder +anb net/minecraft/server/packs/repository/ResourcePackLoader +anb$b net/minecraft/server/packs/repository/ResourcePackLoader$Position +anc net/minecraft/server/packs/repository/EnumResourcePackVersion +and net/minecraft/server/packs/repository/PackDetector +ane net/minecraft/server/packs/repository/ResourcePackRepository +anf net/minecraft/server/packs/repository/PackSource +ang net/minecraft/server/packs/repository/ResourcePackSource +anh net/minecraft/server/packs/repository/ResourcePackSourceVanilla +anj net/minecraft/server/packs/resources/IReloadableResourceManager +ank net/minecraft/server/packs/resources/ResourceManagerFallback +anl net/minecraft/server/packs/resources/IoSupplier +anm net/minecraft/server/packs/resources/ResourceManager +ann net/minecraft/server/packs/resources/IReloadListener +ano net/minecraft/server/packs/resources/ReloadableProfiled +anp net/minecraft/server/packs/resources/IReloadable +anr net/minecraft/server/packs/resources/IResource +ans net/minecraft/server/packs/resources/ResourceFilterSection +ant net/minecraft/server/packs/resources/IResourceManager +ant$a net/minecraft/server/packs/resources/IResourceManager$Empty +anv net/minecraft/server/packs/resources/ResourceMetadata +anw net/minecraft/server/packs/resources/ResourceProvider +anx net/minecraft/server/packs/resources/ResourceDataJson +any net/minecraft/server/packs/resources/ResourceDataAbstract +anz net/minecraft/server/packs/resources/Reloadable +ao net/minecraft/advancements/CriterionTrigger +aob net/minecraft/server/players/ExpirableListEntry +aoc net/minecraft/server/players/UserCache +aoc$a net/minecraft/server/players/UserCache$UserCacheEntry +aod net/minecraft/server/players/IpBanList +aoe net/minecraft/server/players/IpBanEntry +aof net/minecraft/server/players/NameReferencingFileConverter +aof$a net/minecraft/server/players/NameReferencingFileConverter$FileConversionException +aog net/minecraft/server/players/PlayerList +aoh net/minecraft/server/players/OpList +aoi net/minecraft/server/players/OpListEntry +aoj net/minecraft/server/players/SleepStatus +aok net/minecraft/server/players/JsonListEntry +aol net/minecraft/server/players/JsonList +aom net/minecraft/server/players/GameProfileBanList +aon net/minecraft/server/players/GameProfileBanEntry +aoo net/minecraft/server/players/WhiteList +aop net/minecraft/server/players/WhiteListEntry +aor net/minecraft/server/rcon/RemoteStatusReply +aos net/minecraft/server/rcon/StatusChallengeUtils +aot net/minecraft/server/rcon/RemoteControlCommandListener +aov net/minecraft/server/rcon/thread/RemoteConnectionThread +aow net/minecraft/server/rcon/thread/RemoteStatusListener +aow$a net/minecraft/server/rcon/thread/RemoteStatusListener$RemoteStatusChallenge +aox net/minecraft/server/rcon/thread/RemoteControlSession +aoy net/minecraft/server/rcon/thread/RemoteControlListener +ap net/minecraft/advancements/CriterionInstance +apa net/minecraft/sounds/Music +apb net/minecraft/sounds/Musics +apc net/minecraft/sounds/SoundEffect +apd net/minecraft/sounds/SoundEffects +ape net/minecraft/sounds/SoundCategory +apg net/minecraft/stats/RecipeBook +aph net/minecraft/stats/RecipeBookSettings +api net/minecraft/stats/RecipeBookServer +apj net/minecraft/stats/ServerStatisticManager +apk net/minecraft/stats/Statistic +apl net/minecraft/stats/Counter +apm net/minecraft/stats/StatisticWrapper +apn net/minecraft/stats/StatisticList +apo net/minecraft/stats/StatisticManager +apq net/minecraft/tags/BannerPatternTags +apr net/minecraft/tags/BiomeTags +aps net/minecraft/tags/TagsBlock +apt net/minecraft/tags/CatVariantTags +apu net/minecraft/tags/DamageTypeTags +apv net/minecraft/tags/TagsEntity +apx net/minecraft/tags/TagsFluid +apy net/minecraft/tags/GameEventTags +apz net/minecraft/tags/InstrumentTags +aq net/minecraft/advancements/AdvancementDisplay +aqa net/minecraft/tags/TagsItem +aqb net/minecraft/tags/PaintingVariantTags +aqc net/minecraft/tags/PoiTypeTags +aqd net/minecraft/tags/StructureTags +aqf net/minecraft/tags/TagEntry +aqg net/minecraft/tags/TagFile +aqh net/minecraft/tags/TagKey +aqi net/minecraft/tags/TagDataPack +aqj net/minecraft/tags/TagRegistry +aqk net/minecraft/tags/TagNetworkSerialization +aqn net/minecraft/util/AbortableIterationConsumer +aqp net/minecraft/util/DataBits +aqq net/minecraft/util/Brightness +aqr net/minecraft/util/ByIdMap +aqs net/minecraft/util/EntitySlice +aqv net/minecraft/util/RegistryID +aqw net/minecraft/util/MinecraftEncryption +aqx net/minecraft/util/CryptographyException +aqy net/minecraft/util/CSVWriter +ar net/minecraft/advancements/AdvancementFrameType +ara net/minecraft/util/CubicSpline +arb net/minecraft/util/DebugBuffer +arc net/minecraft/util/DependencySorter +ard net/minecraft/util/SessionLock +ard$a net/minecraft/util/SessionLock$ExceptionWorldConflict +are net/minecraft/util/ExceptionSuppressor +arf net/minecraft/util/ExtraCodecs +arg net/minecraft/util/FastBufferedInputStream +arh net/minecraft/util/ColorUtil +ari net/minecraft/util/FileZipper +arj net/minecraft/util/FormattedString +ark net/minecraft/util/FormattedStringEmpty +arl net/minecraft/util/FutureChain +arm net/minecraft/util/Graph +arn net/minecraft/util/ChatDeserializer +aro net/minecraft/util/HttpUtilities +arp net/minecraft/util/InclusiveRange +arq net/minecraft/util/KeyDispatchDataCodec +arr net/minecraft/util/LazyInitVar +ars net/minecraft/util/LinearCongruentialGenerator +art net/minecraft/util/ChatTypeAdapterFactory +aru net/minecraft/util/MemoryReserve +arv net/minecraft/util/ModCheck +arw net/minecraft/util/MathHelper +arx net/minecraft/util/NativeModuleLister +ary net/minecraft/util/OptionEnum +arz net/minecraft/util/ParticleUtils +as net/minecraft/advancements/TreeNodePosition +asb net/minecraft/util/IProgressUpdate +asc net/minecraft/util/RandomSource +asd net/minecraft/util/ResourceLocationPattern +ase net/minecraft/util/SampleLogger +asf net/minecraft/util/SegmentedAnglePrecision +asg net/minecraft/util/SignatureUpdater +ash net/minecraft/util/SignatureValidator +asi net/minecraft/util/Signer +asj net/minecraft/util/SimpleBitStorage +ask net/minecraft/util/SingleKeyCache +asm net/minecraft/util/ArraySetSorted +asn net/minecraft/util/SpawnUtil +aso net/minecraft/util/StringDecomposer +asp net/minecraft/util/INamable +asq net/minecraft/util/UtilColor +asr net/minecraft/util/TaskChainer +ass net/minecraft/util/ThreadingDetector +ast net/minecraft/util/TimeSource +asu net/minecraft/util/TimeRange +asv net/minecraft/util/ToFloatFunction +asw net/minecraft/util/Tuple +asx net/minecraft/util/Unit +asy net/minecraft/util/VisibleForDebug +asz net/minecraft/util/ZeroBitStorage +at net/minecraft/advancements/critereon/CriterionInstanceAbstract +ata net/minecraft/util/datafix/DataFixTypes +atb net/minecraft/util/datafix/DataConverterRegistry +atc net/minecraft/util/datafix/DataBitsPacked +atd net/minecraft/util/datafix/fixes/AbstractArrowPickupFix +ate net/minecraft/util/datafix/fixes/AbstractPoiSectionFix +atf net/minecraft/util/datafix/fixes/DataConverterUUIDBase +atg net/minecraft/util/datafix/fixes/AddFlagIfNotPresentFix +ath net/minecraft/util/datafix/fixes/DataConverterAddChoices +ati net/minecraft/util/datafix/fixes/DataConverterAdvancement +atj net/minecraft/util/datafix/fixes/DataConverterAdvancementBase +atk net/minecraft/util/datafix/fixes/DataConverterAttributes +atl net/minecraft/util/datafix/fixes/DataConverterBedItem +atm net/minecraft/util/datafix/fixes/DataConverterBiome +atn net/minecraft/util/datafix/fixes/DataConverterBitStorageAlign +ato net/minecraft/util/datafix/fixes/BlendingDataFix +atp net/minecraft/util/datafix/fixes/BlendingDataRemoveFromNetherEndFix +atq net/minecraft/util/datafix/fixes/DataConverterBannerColour +atr net/minecraft/util/datafix/fixes/DataConverterPiston +ats net/minecraft/util/datafix/fixes/DataConverterCustomNameTile +att net/minecraft/util/datafix/fixes/DataConverterTileEntity +atu net/minecraft/util/datafix/fixes/DataConverterJukeBox +atv net/minecraft/util/datafix/fixes/DataConverterBlockEntityKeepPacked +atw net/minecraft/util/datafix/fixes/BlockEntityRenameFix +atx net/minecraft/util/datafix/fixes/DataConverterShulkerBoxBlock +aty net/minecraft/util/datafix/fixes/BlockEntitySignDoubleSidedEditableTextFix +atz net/minecraft/util/datafix/fixes/DataConverterSignText +au net/minecraft/advancements/critereon/CriterionTriggerBeeNestDestroyed +aua net/minecraft/util/datafix/fixes/DataConverterBlockEntityUUID +aub net/minecraft/util/datafix/fixes/DataConverterBlockName +auc net/minecraft/util/datafix/fixes/DataConverterBlockRename +aud net/minecraft/util/datafix/fixes/BlockRenameFixWithJigsaw +aue net/minecraft/util/datafix/fixes/DataConverterFlattenData +auf net/minecraft/util/datafix/fixes/DataConverterFlattenState +aug net/minecraft/util/datafix/fixes/DataConverterCatType +auh net/minecraft/util/datafix/fixes/CauldronRenameFix +aui net/minecraft/util/datafix/fixes/CavesAndCliffsRenames +auj net/minecraft/util/datafix/fixes/DataConverterBedBlock +auk net/minecraft/util/datafix/fixes/DataConverterLeavesBiome +aul net/minecraft/util/datafix/fixes/ChunkDeleteIgnoredLightDataFix +aum net/minecraft/util/datafix/fixes/ChunkDeleteLightFix +aun net/minecraft/util/datafix/fixes/ChunkHeightAndBiomeFix +auo net/minecraft/util/datafix/fixes/DataConverterChunkLightRemove +aup net/minecraft/util/datafix/fixes/ChunkConverterPalette +aup$b net/minecraft/util/datafix/fixes/ChunkConverterPalette$Direction +aup$b$a net/minecraft/util/datafix/fixes/ChunkConverterPalette$Direction$Axis +aup$b$b net/minecraft/util/datafix/fixes/ChunkConverterPalette$Direction$AxisDirection +auq net/minecraft/util/datafix/fixes/ChunkProtoTickListFix +aur net/minecraft/util/datafix/fixes/ChunkRenamesFix +aus net/minecraft/util/datafix/fixes/DataConverterChunkStatus +aut net/minecraft/util/datafix/fixes/DataConverterChunkStatus2 +auu net/minecraft/util/datafix/fixes/DataConverterChunkStructuresTemplateRename +auv net/minecraft/util/datafix/fixes/DataConverterProtoChunk +auw net/minecraft/util/datafix/fixes/DataConverterColorlessShulkerEntity +auy net/minecraft/util/datafix/fixes/CriteriaRenameFix +auz net/minecraft/util/datafix/fixes/DecoratedPotFieldRenameFix +av net/minecraft/advancements/critereon/CriterionConditionBlock +ava net/minecraft/util/datafix/fixes/DropInvalidSignDataFix +avb net/minecraft/util/datafix/fixes/DataConverterDye +avc net/minecraft/util/datafix/fixes/EffectDurationFix +avd net/minecraft/util/datafix/fixes/DataConverterArmorStand +ave net/minecraft/util/datafix/fixes/DataConverterEntityBlockState +avf net/minecraft/util/datafix/fixes/EntityBrushableBlockFieldsRenameFix +avg net/minecraft/util/datafix/fixes/DataConverterEntityCatSplit +avh net/minecraft/util/datafix/fixes/DataConverterEntityCodSalmon +avi net/minecraft/util/datafix/fixes/DataConverterCustomNameEntity +avj net/minecraft/util/datafix/fixes/DataConverterGuardian +avk net/minecraft/util/datafix/fixes/DataConverterEquipment +avl net/minecraft/util/datafix/fixes/EntityGoatMissingStateFix +avm net/minecraft/util/datafix/fixes/DataConverterHealth +avn net/minecraft/util/datafix/fixes/DataConverterSaddle +avo net/minecraft/util/datafix/fixes/DataConverterHorse +avp net/minecraft/util/datafix/fixes/DataConverterEntity +avq net/minecraft/util/datafix/fixes/DataConverterItemFrame +avr net/minecraft/util/datafix/fixes/DataConverterMinecart +avs net/minecraft/util/datafix/fixes/EntityPaintingFieldsRenameFix +avt net/minecraft/util/datafix/fixes/DataConverterHanging +avu net/minecraft/util/datafix/fixes/DataConverterPainting +avv net/minecraft/util/datafix/fixes/DataConverterEntityProjectileOwner +avw net/minecraft/util/datafix/fixes/DataConverterEntityPufferfish +avx net/minecraft/util/datafix/fixes/DataConverterEntityRavagerRename +avy net/minecraft/util/datafix/fixes/DataConverterDropChances +avz net/minecraft/util/datafix/fixes/DataConverterEntityName +aw net/minecraft/advancements/critereon/CriterionTriggerBredAnimals +awa net/minecraft/util/datafix/fixes/DataConverterRiding +awb net/minecraft/util/datafix/fixes/DataConverterShulker +awc net/minecraft/util/datafix/fixes/DataConverterEntityShulkerRotation +awd net/minecraft/util/datafix/fixes/DataConverterSkeleton +awe net/minecraft/util/datafix/fixes/DataConverterUUID +awf net/minecraft/util/datafix/fixes/DataConverterEntityRename +awg net/minecraft/util/datafix/fixes/DataConverterEntityTippedArrow +awh net/minecraft/util/datafix/fixes/DataConverterEntityUUID +awi net/minecraft/util/datafix/fixes/EntityVariantFix +awj net/minecraft/util/datafix/fixes/DataConverterWolf +awk net/minecraft/util/datafix/fixes/DataConverterZombieType +awl net/minecraft/util/datafix/fixes/DataConverterZombie +awm net/minecraft/util/datafix/fixes/DataConverterEntityZombifiedPiglinRename +awn net/minecraft/util/datafix/fixes/FeatureFlagRemoveFix +awo net/minecraft/util/datafix/fixes/FilteredBooksFix +awp net/minecraft/util/datafix/fixes/FilteredSignsFix +awq net/minecraft/util/datafix/fixes/DataConverterPOIRebuild +awr net/minecraft/util/datafix/fixes/DataConverterFurnaceRecipesUsed +aws net/minecraft/util/datafix/fixes/GoatHornIdFix +awt net/minecraft/util/datafix/fixes/DataConverterGossip +awu net/minecraft/util/datafix/fixes/DataConverterHeightmapRenaming +awv net/minecraft/util/datafix/fixes/DataConverterIglooMetadataRemoval +aww net/minecraft/util/datafix/fixes/DataConverterBanner +awx net/minecraft/util/datafix/fixes/DataConverterCustomNameItem +awy net/minecraft/util/datafix/fixes/DataConverterMaterialId +awz net/minecraft/util/datafix/fixes/DataConverterItemLoreComponentize +ax net/minecraft/advancements/critereon/CriterionTriggerBrewedPotion +axa net/minecraft/util/datafix/fixes/DataConverterPotionId +axb net/minecraft/util/datafix/fixes/ItemRemoveBlockEntityTagFix +axc net/minecraft/util/datafix/fixes/DataConverterItemName +axd net/minecraft/util/datafix/fixes/DataConverterShulkerBoxItem +axe net/minecraft/util/datafix/fixes/DataConverterSpawnEgg +axf net/minecraft/util/datafix/fixes/DataConverterItemStackEnchantment +axg net/minecraft/util/datafix/fixes/DataConverterMap +axh net/minecraft/util/datafix/fixes/DataConverterFlattenSpawnEgg +axi net/minecraft/util/datafix/fixes/ItemStackTagFix +axj net/minecraft/util/datafix/fixes/DataConverterFlatten +axk net/minecraft/util/datafix/fixes/DataConverterItemStackUUID +axl net/minecraft/util/datafix/fixes/DataConverterPotionWater +axm net/minecraft/util/datafix/fixes/DataConverterBook +axn net/minecraft/util/datafix/fixes/DataConverterJigsawProperties +axo net/minecraft/util/datafix/fixes/DataConverterJigsawRotation +axp net/minecraft/util/datafix/fixes/DataConverterLeaves +axq net/minecraft/util/datafix/fixes/LegacyDragonFightFix +axr net/minecraft/util/datafix/fixes/DataConverterLevelDataGeneratorOptions +axs net/minecraft/util/datafix/fixes/DataConverterWorldGenSettings +axt net/minecraft/util/datafix/fixes/DataConverterMiscUUID +axu net/minecraft/util/datafix/fixes/DataConverterMapId +axv net/minecraft/util/datafix/fixes/DataConverterMemoryExpiry +axw net/minecraft/util/datafix/fixes/DataConverterMissingDimension +axx net/minecraft/util/datafix/fixes/MobEffectIdFix +axy net/minecraft/util/datafix/fixes/DataConverterMobSpawner +axz net/minecraft/util/datafix/fixes/DataConverterNamedEntity +ay net/minecraft/advancements/critereon/CriterionTriggerChangedDimension +aya net/minecraft/util/datafix/fixes/NamespacedTypeRenameFix +ayb net/minecraft/util/datafix/fixes/DataConverterNewVillage +ayc net/minecraft/util/datafix/fixes/DataConverterObjectiveDisplayName +ayd net/minecraft/util/datafix/fixes/DataConverterObjectiveRenderType +aye net/minecraft/util/datafix/fixes/DataConverterOminousBannerBlockEntityRename +ayf net/minecraft/util/datafix/fixes/DataConverterOminousBannerRename +ayg net/minecraft/util/datafix/fixes/OptionsAccessibilityOnboardFix +ayh net/minecraft/util/datafix/fixes/DataConverterOptionsAddTextBackground +ayi net/minecraft/util/datafix/fixes/OptionsAmbientOcclusionFix +ayj net/minecraft/util/datafix/fixes/DataConverterVBO +ayk net/minecraft/util/datafix/fixes/DataConverterKeybind +ayl net/minecraft/util/datafix/fixes/DataConverterKeybind2 +aym net/minecraft/util/datafix/fixes/DataConverterLang +ayn net/minecraft/util/datafix/fixes/OptionsProgrammerArtFix +ayo net/minecraft/util/datafix/fixes/DataConverterSettingRename +ayp net/minecraft/util/datafix/fixes/OverreachingTickFix +ayq net/minecraft/util/datafix/fixes/DataConverterPlayerUUID +ayr net/minecraft/util/datafix/fixes/PoiTypeRemoveFix +ays net/minecraft/util/datafix/fixes/PoiTypeRenameFix +ayt net/minecraft/util/datafix/fixes/RandomSequenceSettingsFix +ayu net/minecraft/util/datafix/fixes/DataConverterRecipes +ayv net/minecraft/util/datafix/fixes/DataConverterRecipeRename +ayw net/minecraft/util/datafix/fixes/DataConverterRedstoneConnections +ayx net/minecraft/util/datafix/fixes/DataConverterTypes +ayy net/minecraft/util/datafix/fixes/RemapChunkStatusFix +ayz net/minecraft/util/datafix/fixes/DataConverterRemoveGolemGossip +az net/minecraft/advancements/critereon/CriterionTriggerChanneledLightning +aza net/minecraft/util/datafix/fixes/DataConverterCoralFan +azb net/minecraft/util/datafix/fixes/DataConverterCoral +azc net/minecraft/util/datafix/fixes/DataConverterPOI +azd net/minecraft/util/datafix/fixes/SavedDataFeaturePoolElementFix +aze net/minecraft/util/datafix/fixes/DataConverterSavedDataUUID +azf net/minecraft/util/datafix/fixes/ScoreboardDisplaySlotFix +azg net/minecraft/util/datafix/fixes/DataConverterEntityNameAbstract +azh net/minecraft/util/datafix/fixes/DataConverterEntityRenameAbstract +azi net/minecraft/util/datafix/fixes/SpawnerDataFix +azj net/minecraft/util/datafix/fixes/DataConverterStatistic +azk net/minecraft/util/datafix/fixes/StatsRenameFix +azl net/minecraft/util/datafix/fixes/DataConverterStriderGravity +azm net/minecraft/util/datafix/fixes/DataConverterStructureReference +azn net/minecraft/util/datafix/fixes/StructureSettingsFlattenFix +azo net/minecraft/util/datafix/fixes/StructuresBecomeConfiguredFix +azp net/minecraft/util/datafix/fixes/DataConverterTeamDisplayName +azq net/minecraft/util/datafix/fixes/DataConverterTrappedChest +azr net/minecraft/util/datafix/fixes/VariantRenameFix +azs net/minecraft/util/datafix/fixes/DataConverterVillagerProfession +azt net/minecraft/util/datafix/fixes/DataConverterVillagerFollowRange +azu net/minecraft/util/datafix/fixes/DataConverterVillagerLevelXp +azv net/minecraft/util/datafix/fixes/DataConverterVillagerTrade +azw net/minecraft/util/datafix/fixes/DataConverterWallProperty +azx net/minecraft/util/datafix/fixes/WeaponSmithChestLootTableFix +azy net/minecraft/util/datafix/fixes/WorldGenSettingsDisallowOldCustomWorldsFix +azz net/minecraft/util/datafix/fixes/DataConverterWorldGenSettingsBuilding +ba net/minecraft/advancements/critereon/CriterionTriggerConstructBeacon +baa net/minecraft/util/datafix/fixes/WorldGenSettingsHeightAndBiomeFix +bab net/minecraft/util/datafix/fixes/DataConverterShoulderEntity +bac net/minecraft/util/datafix/fixes/DataConverterZombieVillagerLevelXp +baf net/minecraft/util/datafix/schemas/DataConverterSchemaNamed +bag net/minecraft/util/datafix/schemas/DataConverterSchemaV100 +bah net/minecraft/util/datafix/schemas/DataConverterSchemaV102 +bai net/minecraft/util/datafix/schemas/DataConverterSchemaV1022 +baj net/minecraft/util/datafix/schemas/DataConverterSchemaV106 +bak net/minecraft/util/datafix/schemas/DataConverterSchemaV107 +bal net/minecraft/util/datafix/schemas/DataConverterSchemaV1125 +bam net/minecraft/util/datafix/schemas/DataConverterSchemaV135 +ban net/minecraft/util/datafix/schemas/DataConverterSchemaV143 +bao net/minecraft/util/datafix/schemas/DataConverterSchemaV1451 +bap net/minecraft/util/datafix/schemas/DataConverterSchemaV1451_1 +baq net/minecraft/util/datafix/schemas/DataConverterSchemaV1451_2 +bar net/minecraft/util/datafix/schemas/DataConverterSchemaV1451_3 +bas net/minecraft/util/datafix/schemas/DataConverterSchemaV1451_4 +bat net/minecraft/util/datafix/schemas/DataConverterSchemaV1451_5 +bau net/minecraft/util/datafix/schemas/DataConverterSchemaV1451_6 +bav net/minecraft/util/datafix/schemas/DataConverterSchemaV1460 +baw net/minecraft/util/datafix/schemas/DataConverterSchemaV1466 +bax net/minecraft/util/datafix/schemas/DataConverterSchemaV1470 +bay net/minecraft/util/datafix/schemas/DataConverterSchemaV1481 +baz net/minecraft/util/datafix/schemas/DataConverterSchemaV1483 +bb net/minecraft/advancements/critereon/CriterionTriggerConsumeItem +bba net/minecraft/util/datafix/schemas/DataConverterSchemaV1486 +bbb net/minecraft/util/datafix/schemas/DataConverterSchemaV1510 +bbc net/minecraft/util/datafix/schemas/DataConverterSchemaV1800 +bbd net/minecraft/util/datafix/schemas/DataConverterSchemaV1801 +bbe net/minecraft/util/datafix/schemas/DataConverterSchemaV1904 +bbf net/minecraft/util/datafix/schemas/DataConverterSchemaV1906 +bbg net/minecraft/util/datafix/schemas/DataConverterSchemaV1909 +bbh net/minecraft/util/datafix/schemas/DataConverterSchemaV1920 +bbi net/minecraft/util/datafix/schemas/DataConverterSchemaV1928 +bbj net/minecraft/util/datafix/schemas/DataConverterSchemaV1929 +bbk net/minecraft/util/datafix/schemas/DataConverterSchemaV1931 +bbl net/minecraft/util/datafix/schemas/DataConverterSchemaV2100 +bbm net/minecraft/util/datafix/schemas/DataConverterSchemaV2501 +bbn net/minecraft/util/datafix/schemas/DataConverterSchemaV2502 +bbo net/minecraft/util/datafix/schemas/DataConverterSchemaV2505 +bbp net/minecraft/util/datafix/schemas/DataConverterSchemaV2509 +bbq net/minecraft/util/datafix/schemas/DataConverterSchemaV2519 +bbr net/minecraft/util/datafix/schemas/DataConverterSchemaV2522 +bbs net/minecraft/util/datafix/schemas/DataConverterSchemaV2551 +bbt net/minecraft/util/datafix/schemas/DataConverterSchemaV2568 +bbu net/minecraft/util/datafix/schemas/V2571 +bbv net/minecraft/util/datafix/schemas/V2684 +bbw net/minecraft/util/datafix/schemas/V2686 +bbx net/minecraft/util/datafix/schemas/V2688 +bby net/minecraft/util/datafix/schemas/V2704 +bbz net/minecraft/util/datafix/schemas/V2707 +bc net/minecraft/advancements/critereon/ContextAwarePredicate +bca net/minecraft/util/datafix/schemas/V2831 +bcb net/minecraft/util/datafix/schemas/V2832 +bcc net/minecraft/util/datafix/schemas/V2842 +bcd net/minecraft/util/datafix/schemas/V3076 +bce net/minecraft/util/datafix/schemas/V3078 +bcf net/minecraft/util/datafix/schemas/V3081 +bcg net/minecraft/util/datafix/schemas/V3082 +bch net/minecraft/util/datafix/schemas/V3083 +bci net/minecraft/util/datafix/schemas/V3202 +bcj net/minecraft/util/datafix/schemas/V3203 +bck net/minecraft/util/datafix/schemas/V3204 +bcl net/minecraft/util/datafix/schemas/V3325 +bcm net/minecraft/util/datafix/schemas/V3326 +bcn net/minecraft/util/datafix/schemas/V3327 +bco net/minecraft/util/datafix/schemas/V3328 +bcp net/minecraft/util/datafix/schemas/V3438 +bcq net/minecraft/util/datafix/schemas/V3448 +bcr net/minecraft/util/datafix/schemas/DataConverterSchemaV501 +bcs net/minecraft/util/datafix/schemas/DataConverterSchemaV700 +bct net/minecraft/util/datafix/schemas/DataConverterSchemaV701 +bcu net/minecraft/util/datafix/schemas/DataConverterSchemaV702 +bcv net/minecraft/util/datafix/schemas/DataConverterSchemaV703 +bcw net/minecraft/util/datafix/schemas/DataConverterSchemaV704 +bcx net/minecraft/util/datafix/schemas/DataConverterSchemaV705 +bcy net/minecraft/util/datafix/schemas/DataConverterSchemaV808 +bcz net/minecraft/util/datafix/schemas/DataConverterSchemaV99 +bd net/minecraft/advancements/critereon/CriterionTriggerCuredZombieVillager +bdf net/minecraft/util/monitoring/jmx/MinecraftServerBeans +bdi net/minecraft/util/profiling/MethodProfiler +bdj net/minecraft/util/profiling/GameProfilerSwitcher +bdk net/minecraft/util/profiling/MethodProfilerResultsEmpty +bdl net/minecraft/util/profiling/MethodProfilerResultsFilled +bdm net/minecraft/util/profiling/GameProfilerDisabled +bdn net/minecraft/util/profiling/GameProfilerFillerActive +bdo net/minecraft/util/profiling/MethodProfilerResults +bdp net/minecraft/util/profiling/GameProfilerFiller +bdq net/minecraft/util/profiling/MethodProfilerResult +bdr net/minecraft/util/profiling/MethodProfilerResultsField +bds net/minecraft/util/profiling/GameProfilerTick +bdt net/minecraft/util/profiling/jfr/Environment +bdu net/minecraft/util/profiling/jfr/JfrProfiler +bdv net/minecraft/util/profiling/jfr/JvmProfiler +bdw net/minecraft/util/profiling/jfr/Percentiles +bdx net/minecraft/util/profiling/jfr/SummaryReporter +bdy net/minecraft/util/profiling/jfr/callback/ProfiledDuration +be net/minecraft/advancements/critereon/CriterionConditionDamage +bea net/minecraft/util/profiling/jfr/event/PacketEvent +bed net/minecraft/util/profiling/jfr/parse/JfrStatsParser +bee net/minecraft/util/profiling/jfr/parse/JfrStatsResult +beg net/minecraft/util/profiling/jfr/serialize/JfrResultJsonSerializer +bei net/minecraft/util/profiling/jfr/stats/ChunkGenStat +bej net/minecraft/util/profiling/jfr/stats/CpuLoadStat +bek net/minecraft/util/profiling/jfr/stats/FileIOStat +bel net/minecraft/util/profiling/jfr/stats/GcHeapStat +bem net/minecraft/util/profiling/jfr/stats/NetworkPacketSummary +ben net/minecraft/util/profiling/jfr/stats/ThreadAllocationStat +beo net/minecraft/util/profiling/jfr/stats/TickTimeStat +bep net/minecraft/util/profiling/jfr/stats/TimedStat +beq net/minecraft/util/profiling/jfr/stats/TimedStatSummary +bes net/minecraft/util/profiling/metrics/MetricCategory +bet net/minecraft/util/profiling/metrics/MetricSampler +beu net/minecraft/util/profiling/metrics/MetricsRegistry +bev net/minecraft/util/profiling/metrics/MetricsSamplerProvider +bew net/minecraft/util/profiling/metrics/ProfilerMeasured +bey net/minecraft/util/profiling/metrics/profiling/ActiveMetricsRecorder +bez net/minecraft/util/profiling/metrics/profiling/InactiveMetricsRecorder +bf net/minecraft/advancements/critereon/CriterionConditionDamageSource +bfa net/minecraft/util/profiling/metrics/profiling/MetricsRecorder +bfb net/minecraft/util/profiling/metrics/profiling/ProfilerSamplerAdapter +bfc net/minecraft/util/profiling/metrics/profiling/ServerMetricsSamplersProvider +bfe net/minecraft/util/profiling/metrics/storage/MetricsPersister +bff net/minecraft/util/profiling/metrics/storage/RecordedDeviation +bfi net/minecraft/util/random/SimpleWeightedRandomList +bfj net/minecraft/util/random/Weight +bfk net/minecraft/util/random/WeightedEntry +bfl net/minecraft/util/random/WeightedRandom2 +bfm net/minecraft/util/random/WeightedRandomList +bfo net/minecraft/util/thread/IAsyncTaskHandler +bfq net/minecraft/util/thread/Mailbox +bfr net/minecraft/util/thread/ThreadedMailbox +bfs net/minecraft/util/thread/IAsyncTaskHandlerReentrant +bft net/minecraft/util/thread/PairedQueue +bfv net/minecraft/util/valueproviders/BiasedToBottomInt +bfw net/minecraft/util/valueproviders/ClampedInt +bfx net/minecraft/util/valueproviders/ClampedNormalFloat +bfy net/minecraft/util/valueproviders/ClampedNormalInt +bfz net/minecraft/util/valueproviders/ConstantFloat +bg net/minecraft/advancements/critereon/LootDeserializationContext +bga net/minecraft/util/valueproviders/ConstantInt +bgb net/minecraft/util/valueproviders/FloatProvider +bgc net/minecraft/util/valueproviders/FloatProviderType +bgd net/minecraft/util/valueproviders/IntProvider +bge net/minecraft/util/valueproviders/IntProviderType +bgg net/minecraft/util/valueproviders/SampledFloat +bgh net/minecraft/util/valueproviders/TrapezoidFloat +bgi net/minecraft/util/valueproviders/UniformFloat +bgj net/minecraft/util/valueproviders/UniformInt +bgk net/minecraft/util/valueproviders/WeightedListInt +bgm net/minecraft/util/worldupdate/WorldUpgrader +bgo net/minecraft/world/BossBattle +bgo$a net/minecraft/world/BossBattle$BarColor +bgo$b net/minecraft/world/BossBattle$BarStyle +bgp net/minecraft/world/Clearable +bgq net/minecraft/world/InventoryLargeChest +bgr net/minecraft/world/IInventory +bgs net/minecraft/world/ContainerUtil +bgt net/minecraft/world/IInventoryListener +bgu net/minecraft/world/InventoryUtils +bgv net/minecraft/world/EnumDifficulty +bgw net/minecraft/world/DifficultyDamageScaler +bgx net/minecraft/world/EnumHand +bgy net/minecraft/world/EnumInteractionResult +bgz net/minecraft/world/InteractionResultWrapper +bh net/minecraft/advancements/critereon/CriterionConditionDistance +bha net/minecraft/world/ChestLock +bhb net/minecraft/world/ITileInventory +bhc net/minecraft/world/INamableTileEntity +bhd net/minecraft/world/RandomSequence +bhe net/minecraft/world/RandomSequences +bhf net/minecraft/world/InventorySubcontainer +bhg net/minecraft/world/TileInventory +bhh net/minecraft/world/IWorldInventory +bhi net/minecraft/world/IInventoryHolder +bhj net/minecraft/world/damagesource/CombatEntry +bhk net/minecraft/world/damagesource/CombatMath +bhl net/minecraft/world/damagesource/CombatTracker +bhm net/minecraft/world/damagesource/DamageEffects +bhn net/minecraft/world/damagesource/DamageScaling +bho net/minecraft/world/damagesource/DamageSource +bhp net/minecraft/world/damagesource/DamageSources +bhq net/minecraft/world/damagesource/DamageType +bhr net/minecraft/world/damagesource/DamageTypes +bhs net/minecraft/world/damagesource/DeathMessageType +bht net/minecraft/world/damagesource/FallLocation +bhv net/minecraft/world/effect/AbsorptionMobEffect +bhw net/minecraft/world/effect/AttributeModifierTemplate +bhx net/minecraft/world/effect/BadOmenMobEffect +bhy net/minecraft/world/effect/HealOrHarmMobEffect +bhz net/minecraft/world/effect/HungerMobEffect +bi net/minecraft/advancements/critereon/DistanceTrigger +bia net/minecraft/world/effect/InstantMobEffect +bib net/minecraft/world/effect/MobEffectList +bic net/minecraft/world/effect/MobEffectInfo +bid net/minecraft/world/effect/MobEffect +bie net/minecraft/world/effect/MobEffectUtil +bif net/minecraft/world/effect/MobEffects +big net/minecraft/world/effect/PoisonMobEffect +bih net/minecraft/world/effect/RegenerationMobEffect +bii net/minecraft/world/effect/SaturationMobEffect +bij net/minecraft/world/effect/WitherMobEffect +bil net/minecraft/world/entity/EntityAgeable +bim net/minecraft/world/entity/AnimationState +bin net/minecraft/world/entity/EntityAreaEffectCloud +bio net/minecraft/world/entity/Attackable +bip net/minecraft/world/entity/Display +bip$a net/minecraft/world/entity/Display$BillboardConstraints +bip$b net/minecraft/world/entity/Display$BlockDisplay +bip$c net/minecraft/world/entity/Display$ColorInterpolator +bip$d net/minecraft/world/entity/Display$FloatInterpolator +bip$e net/minecraft/world/entity/Display$GenericInterpolator +bip$f net/minecraft/world/entity/Display$IntInterpolator +bip$g net/minecraft/world/entity/Display$ItemDisplay +bip$l net/minecraft/world/entity/Display$TextDisplay +bip$l$a net/minecraft/world/entity/Display$TextDisplay$Align +bip$l$b net/minecraft/world/entity/Display$TextDisplay$CachedInfo +bip$l$c net/minecraft/world/entity/Display$TextDisplay$CachedLine +bip$l$d net/minecraft/world/entity/Display$TextDisplay$LineSplitter +biq net/minecraft/world/entity/Entity +biq$a net/minecraft/world/entity/Entity$MoveFunction +biq$b net/minecraft/world/entity/Entity$MovementEmission +biq$c net/minecraft/world/entity/Entity$RemovalReason +bir net/minecraft/world/entity/EntitySize +bit net/minecraft/world/entity/IEntitySelector +bit$a net/minecraft/world/entity/IEntitySelector$EntitySelectorEquipable +biu net/minecraft/world/entity/EntityTypes +biu$a net/minecraft/world/entity/EntityTypes$Builder +biv net/minecraft/world/entity/EnumItemSlot +biv$a net/minecraft/world/entity/EnumItemSlot$Function +biw net/minecraft/world/entity/EntityExperienceOrb +bix net/minecraft/world/entity/EntityFlying +biy net/minecraft/world/entity/GlowSquid +biz net/minecraft/world/entity/HasCustomInventoryScreen +bj net/minecraft/advancements/critereon/CriterionTriggerEffectsChanged +bja net/minecraft/world/entity/EnumMainHand +bjb net/minecraft/world/entity/Interaction +bjb$a net/minecraft/world/entity/Interaction$PlayerAction +bjc net/minecraft/world/entity/SaddleStorage +bjd net/minecraft/world/entity/ISteerable +bje net/minecraft/world/entity/LerpingModel +bjf net/minecraft/world/entity/EntityLightning +bjg net/minecraft/world/entity/EntityLiving +bjh net/minecraft/world/entity/Marker +bji net/minecraft/world/entity/EntityInsentient +bjj net/minecraft/world/entity/EnumCreatureType +bjk net/minecraft/world/entity/EnumMobSpawn +bjl net/minecraft/world/entity/EnumMonsterType +bjm net/minecraft/world/entity/EnumMoveType +bjn net/minecraft/world/entity/IEntityAngerable +bjo net/minecraft/world/entity/OwnableEntity +bjp net/minecraft/world/entity/EntityCreature +bjq net/minecraft/world/entity/PlayerRideable +bjr net/minecraft/world/entity/IJumpable +bjs net/minecraft/world/entity/EntityPose +bjt net/minecraft/world/entity/PowerableMob +bju net/minecraft/world/entity/RelativeMovement +bjv net/minecraft/world/entity/ReputationHandler +bjw net/minecraft/world/entity/ISaddleable +bjx net/minecraft/world/entity/IShearable +bjy net/minecraft/world/entity/SlotAccess +bjz net/minecraft/world/entity/GroupDataEntity +bk net/minecraft/advancements/critereon/CriterionTriggerEnchantedItem +bka net/minecraft/world/entity/EntityPositionTypes +bka$c net/minecraft/world/entity/EntityPositionTypes$Surface +bkb net/minecraft/world/entity/EntityTameableAnimal +bkc net/minecraft/world/entity/Targeting +bkd net/minecraft/world/entity/TraceableEntity +bke net/minecraft/world/entity/VariantHolder +bkf net/minecraft/world/entity/WalkAnimationState +bkg net/minecraft/world/entity/ai/BehaviorController +bkh net/minecraft/world/entity/ai/attributes/AttributeBase +bki net/minecraft/world/entity/ai/attributes/AttributeModifiable +bkj net/minecraft/world/entity/ai/attributes/AttributeMapBase +bkk net/minecraft/world/entity/ai/attributes/AttributeModifier +bkk$a net/minecraft/world/entity/ai/attributes/AttributeModifier$Operation +bkl net/minecraft/world/entity/ai/attributes/AttributeProvider +bkl$a net/minecraft/world/entity/ai/attributes/AttributeProvider$Builder +bkm net/minecraft/world/entity/ai/attributes/GenericAttributes +bkn net/minecraft/world/entity/ai/attributes/AttributeDefaults +bko net/minecraft/world/entity/ai/attributes/AttributeRanged +bkq net/minecraft/world/entity/ai/behavior/BehaviorFindPosition +bkr net/minecraft/world/entity/ai/behavior/BehaviorMakeLoveAnimal +bks net/minecraft/world/entity/ai/behavior/AnimalPanic +bkt net/minecraft/world/entity/ai/behavior/BehaviorCareer +bku net/minecraft/world/entity/ai/behavior/BehaviorFollowAdult +bkv net/minecraft/world/entity/ai/behavior/BehaviorRetreat +bkw net/minecraft/world/entity/ai/behavior/BehaviorPacify +bkx net/minecraft/world/entity/ai/behavior/Behavior +bkx$a net/minecraft/world/entity/ai/behavior/Behavior$Status +bky net/minecraft/world/entity/ai/behavior/BehaviorControl +bkz net/minecraft/world/entity/ai/behavior/BehaviorUtil +bl net/minecraft/advancements/critereon/CriterionConditionEnchantments +bla net/minecraft/world/entity/ai/behavior/BehaviorTarget +blb net/minecraft/world/entity/ai/behavior/BehaviorCelebrate +blc net/minecraft/world/entity/ai/behavior/BehaviorExpirableMemory +bld net/minecraft/world/entity/ai/behavior/CountDownCooldownTicks +ble net/minecraft/world/entity/ai/behavior/Croak +blf net/minecraft/world/entity/ai/behavior/BehaviorCrossbowAttack +blf$a net/minecraft/world/entity/ai/behavior/BehaviorCrossbowAttack$BowState +blg net/minecraft/world/entity/ai/behavior/BehaviorStopRiding +blh net/minecraft/world/entity/ai/behavior/BehaviorNop +bli net/minecraft/world/entity/ai/behavior/BehaviorPositionEntity +blj net/minecraft/world/entity/ai/behavior/BehaviorRemoveMemory +blk net/minecraft/world/entity/ai/behavior/FollowTemptation +bll net/minecraft/world/entity/ai/behavior/BehaviorGate +bll$a net/minecraft/world/entity/ai/behavior/BehaviorGate$Order +bll$b net/minecraft/world/entity/ai/behavior/BehaviorGate$Execution +blm net/minecraft/world/entity/ai/behavior/BehaviorVillageHeroGift +bln net/minecraft/world/entity/ai/behavior/GoAndGiveItemsToTarget +blo net/minecraft/world/entity/ai/behavior/BehaviorNearestVillage +blp net/minecraft/world/entity/ai/behavior/BehaviorPotentialJobSite +blq net/minecraft/world/entity/ai/behavior/GoToTargetLocation +blr net/minecraft/world/entity/ai/behavior/BehaviorFindAdmirableItem +bls net/minecraft/world/entity/ai/behavior/BehaviorFarm +blt net/minecraft/world/entity/ai/behavior/BehaviorStrollInside +blu net/minecraft/world/entity/ai/behavior/BehaviorInteract +blv net/minecraft/world/entity/ai/behavior/BehaviorInteractDoor +blw net/minecraft/world/entity/ai/behavior/BehaviorBedJump +blx net/minecraft/world/entity/ai/behavior/BehaviorHome +bly net/minecraft/world/entity/ai/behavior/LongJumpMidJump +blz net/minecraft/world/entity/ai/behavior/LongJumpToPreferredBlock +bm net/minecraft/advancements/critereon/CriterionTriggerEnterBlock +bma net/minecraft/world/entity/ai/behavior/LongJumpToRandomPos +bmb net/minecraft/world/entity/ai/behavior/BehaviorInteractPlayer +bmc net/minecraft/world/entity/ai/behavior/BehaviorLook +bmd net/minecraft/world/entity/ai/behavior/BehaviorAttack +bme net/minecraft/world/entity/ai/behavior/BehaviorStartRiding +bmf net/minecraft/world/entity/ai/behavior/BehaviorOutside +bmg net/minecraft/world/entity/ai/behavior/BehavorMove +bmh net/minecraft/world/entity/ai/behavior/OneShot +bmi net/minecraft/world/entity/ai/behavior/BehaviorPlay +bmj net/minecraft/world/entity/ai/behavior/BehaviorBetterJob +bmk net/minecraft/world/entity/ai/behavior/BehaviorPosition +bml net/minecraft/world/entity/ai/behavior/PrepareRamNearestTarget +bmm net/minecraft/world/entity/ai/behavior/RamTarget +bmn net/minecraft/world/entity/ai/behavior/RandomLookAround +bmo net/minecraft/world/entity/ai/behavior/BehaviorStrollRandomUnconstrained +bmp net/minecraft/world/entity/ai/behavior/BehaviorBellAlert +bmq net/minecraft/world/entity/ai/behavior/BehaviorProfession +bmr net/minecraft/world/entity/ai/behavior/BehaviorRaidReset +bms net/minecraft/world/entity/ai/behavior/BehaviorBellRing +bmt net/minecraft/world/entity/ai/behavior/BehaviorGateSingle +bmu net/minecraft/world/entity/ai/behavior/BehaviorWalkHome +bmv net/minecraft/world/entity/ai/behavior/BehaviorLookTarget +bmw net/minecraft/world/entity/ai/behavior/SetEntityLookTargetSometimes +bmx net/minecraft/world/entity/ai/behavior/BehaviorHide +bmy net/minecraft/world/entity/ai/behavior/BehaviorLookInteract +bmz net/minecraft/world/entity/ai/behavior/BehaviorRaid +bn net/minecraft/advancements/critereon/CriterionConditionEntityEquipment +bna net/minecraft/world/entity/ai/behavior/BehaviorWalkAway +bnb net/minecraft/world/entity/ai/behavior/BehaviorWalkAwayOutOfRange +bnc net/minecraft/world/entity/ai/behavior/BehaviorWalkAwayBlock +bnd net/minecraft/world/entity/ai/behavior/BehaviorLookWalk +bne net/minecraft/world/entity/ai/behavior/BehaviorTradePlayer +bnf net/minecraft/world/entity/ai/behavior/ShufflingList +bng net/minecraft/world/entity/ai/behavior/BehaviorSleep +bnh net/minecraft/world/entity/ai/behavior/BehaviorBell +bni net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetSet +bnj net/minecraft/world/entity/ai/behavior/BehaviorCelebrateDeath +bnk net/minecraft/world/entity/ai/behavior/StayCloseToTarget +bnl net/minecraft/world/entity/ai/behavior/BehaviorAttackTargetForget +bnm net/minecraft/world/entity/ai/behavior/BehaviorForgetAnger +bnn net/minecraft/world/entity/ai/behavior/BehaviorStrollPosition +bno net/minecraft/world/entity/ai/behavior/BehaviorStrollPlace +bnp net/minecraft/world/entity/ai/behavior/BehaviorStrollPlaceList +bnq net/minecraft/world/entity/ai/behavior/BehaviorSwim +bnr net/minecraft/world/entity/ai/behavior/BehaviorTradeVillager +bns net/minecraft/world/entity/ai/behavior/TriggerGate +bnt net/minecraft/world/entity/ai/behavior/TryFindLand +bnu net/minecraft/world/entity/ai/behavior/TryFindLandNearWater +bnv net/minecraft/world/entity/ai/behavior/TryFindWater +bnw net/minecraft/world/entity/ai/behavior/TryLaySpawnOnWaterNearLand +bnx net/minecraft/world/entity/ai/behavior/BehaviorSchedule +bny net/minecraft/world/entity/ai/behavior/BehaviorBonemeal +bnz net/minecraft/world/entity/ai/behavior/BehaviorPositionValidate +bo net/minecraft/advancements/critereon/CriterionConditionEntityFlags +boa net/minecraft/world/entity/ai/behavior/BehaviorStrollRandom +bob net/minecraft/world/entity/ai/behavior/BehaviorCooldown +boc net/minecraft/world/entity/ai/behavior/Behaviors +bod net/minecraft/world/entity/ai/behavior/BehaviorMakeLove +boe net/minecraft/world/entity/ai/behavior/BehaviorPanic +bof net/minecraft/world/entity/ai/behavior/BehaviorWake +bog net/minecraft/world/entity/ai/behavior/BehaviorWorkComposter +boh net/minecraft/world/entity/ai/behavior/BehaviorWork +boi net/minecraft/world/entity/ai/behavior/BehaviorLeaveJob +boj net/minecraft/world/entity/ai/behavior/declarative/BehaviorBuilder +bok net/minecraft/world/entity/ai/behavior/declarative/MemoryAccessor +bol net/minecraft/world/entity/ai/behavior/declarative/MemoryCondition +bom net/minecraft/world/entity/ai/behavior/declarative/Trigger +bop net/minecraft/world/entity/ai/behavior/warden/Digging +boq net/minecraft/world/entity/ai/behavior/warden/Emerging +bor net/minecraft/world/entity/ai/behavior/warden/ForceUnmount +bos net/minecraft/world/entity/ai/behavior/warden/Roar +bot net/minecraft/world/entity/ai/behavior/warden/SetRoarTarget +bou net/minecraft/world/entity/ai/behavior/warden/SetWardenLookTarget +bov net/minecraft/world/entity/ai/behavior/warden/Sniffing +bow net/minecraft/world/entity/ai/behavior/warden/SonicBoom +box net/minecraft/world/entity/ai/behavior/warden/TryToSniff +boz net/minecraft/world/entity/ai/control/EntityAIBodyControl +bp net/minecraft/advancements/critereon/CriterionTriggerEntityHurtPlayer +bpa net/minecraft/world/entity/ai/control/Control +bpb net/minecraft/world/entity/ai/control/ControllerMoveFlying +bpc net/minecraft/world/entity/ai/control/ControllerJump +bpd net/minecraft/world/entity/ai/control/ControllerLook +bpe net/minecraft/world/entity/ai/control/ControllerMove +bpe$a net/minecraft/world/entity/ai/control/ControllerMove$Operation +bpf net/minecraft/world/entity/ai/control/SmoothSwimmingLookControl +bpg net/minecraft/world/entity/ai/control/SmoothSwimmingMoveControl +bpi net/minecraft/world/entity/ai/goal/PathfinderGoalAvoidTarget +bpj net/minecraft/world/entity/ai/goal/PathfinderGoalBeg +bpk net/minecraft/world/entity/ai/goal/PathfinderGoalBoat +bpl net/minecraft/world/entity/ai/goal/PathfinderGoalBreakDoor +bpm net/minecraft/world/entity/ai/goal/PathfinderGoalBreath +bpn net/minecraft/world/entity/ai/goal/PathfinderGoalBreed +bpo net/minecraft/world/entity/ai/goal/PathfinderGoalCatSitOnBed +bpp net/minecraft/world/entity/ai/goal/PathfinderGoalJumpOnBlock +bpq net/minecraft/world/entity/ai/goal/ClimbOnTopOfPowderSnowGoal +bpr net/minecraft/world/entity/ai/goal/PathfinderGoalWaterJump +bps net/minecraft/world/entity/ai/goal/PathfinderGoalDoorInteract +bpt net/minecraft/world/entity/ai/goal/PathfinderGoalEatTile +bpu net/minecraft/world/entity/ai/goal/PathfinderGoalFleeSun +bpv net/minecraft/world/entity/ai/goal/PathfinderGoalFloat +bpw net/minecraft/world/entity/ai/goal/PathfinderGoalFollowBoat +bpx net/minecraft/world/entity/ai/goal/PathfinderGoalFishSchool +bpy net/minecraft/world/entity/ai/goal/PathfinderGoalFollowEntity +bpz net/minecraft/world/entity/ai/goal/PathfinderGoalFollowOwner +bq net/minecraft/advancements/critereon/CriterionConditionEntity +bqa net/minecraft/world/entity/ai/goal/PathfinderGoalFollowParent +bqb net/minecraft/world/entity/ai/goal/PathfinderGoal +bqb$a net/minecraft/world/entity/ai/goal/PathfinderGoal$Type +bqc net/minecraft/world/entity/ai/goal/PathfinderGoalSelector +bqd net/minecraft/world/entity/ai/goal/PathfinderGoalStrollVillageGolem +bqe net/minecraft/world/entity/ai/goal/PathfinderGoalInteract +bqf net/minecraft/world/entity/ai/goal/PathfinderGoalWaterJumpAbstract +bqg net/minecraft/world/entity/ai/goal/PathfinderGoalPerch +bqh net/minecraft/world/entity/ai/goal/PathfinderGoalLeapAtTarget +bqi net/minecraft/world/entity/ai/goal/PathfinderGoalLlamaFollow +bqj net/minecraft/world/entity/ai/goal/PathfinderGoalLookAtPlayer +bqk net/minecraft/world/entity/ai/goal/PathfinderGoalLookAtTradingPlayer +bql net/minecraft/world/entity/ai/goal/PathfinderGoalMeleeAttack +bqm net/minecraft/world/entity/ai/goal/PathfinderGoalStrollVillage +bqn net/minecraft/world/entity/ai/goal/PathfinderGoalMoveThroughVillage +bqo net/minecraft/world/entity/ai/goal/PathfinderGoalGotoTarget +bqp net/minecraft/world/entity/ai/goal/PathfinderGoalMoveTowardsRestriction +bqq net/minecraft/world/entity/ai/goal/PathfinderGoalMoveTowardsTarget +bqr net/minecraft/world/entity/ai/goal/PathfinderGoalOcelotAttack +bqs net/minecraft/world/entity/ai/goal/PathfinderGoalOfferFlower +bqt net/minecraft/world/entity/ai/goal/PathfinderGoalDoorOpen +bqu net/minecraft/world/entity/ai/goal/PathfinderGoalPanic +bqv net/minecraft/world/entity/ai/goal/PathfinderGoalRaid +bqw net/minecraft/world/entity/ai/goal/PathfinderGoalRandomLookaround +bqx net/minecraft/world/entity/ai/goal/RandomStandGoal +bqy net/minecraft/world/entity/ai/goal/PathfinderGoalRandomStroll +bqz net/minecraft/world/entity/ai/goal/PathfinderGoalRandomSwim +br net/minecraft/advancements/critereon/EntitySubPredicate +bra net/minecraft/world/entity/ai/goal/PathfinderGoalArrowAttack +brb net/minecraft/world/entity/ai/goal/PathfinderGoalBowShoot +brc net/minecraft/world/entity/ai/goal/PathfinderGoalCrossbowAttack +brc$a net/minecraft/world/entity/ai/goal/PathfinderGoalCrossbowAttack$State +brd net/minecraft/world/entity/ai/goal/PathfinderGoalRemoveBlock +bre net/minecraft/world/entity/ai/goal/PathfinderGoalRestrictSun +brf net/minecraft/world/entity/ai/goal/PathfinderGoalTame +brg net/minecraft/world/entity/ai/goal/PathfinderGoalSit +brh net/minecraft/world/entity/ai/goal/PathfinderGoalNearestVillage +bri net/minecraft/world/entity/ai/goal/PathfinderGoalSwell +brj net/minecraft/world/entity/ai/goal/PathfinderGoalTempt +brk net/minecraft/world/entity/ai/goal/PathfinderGoalTradeWithPlayer +brl net/minecraft/world/entity/ai/goal/PathfinderGoalWater +brm net/minecraft/world/entity/ai/goal/PathfinderGoalUseItem +brn net/minecraft/world/entity/ai/goal/PathfinderGoalRandomFly +bro net/minecraft/world/entity/ai/goal/PathfinderGoalRandomStrollLand +brp net/minecraft/world/entity/ai/goal/PathfinderGoalWrapped +brq net/minecraft/world/entity/ai/goal/PathfinderGoalZombieAttack +brs net/minecraft/world/entity/ai/goal/target/PathfinderGoalDefendVillage +brt net/minecraft/world/entity/ai/goal/target/PathfinderGoalHurtByTarget +bru net/minecraft/world/entity/ai/goal/target/PathfinderGoalNearestAttackableTarget +brv net/minecraft/world/entity/ai/goal/target/PathfinderGoalNearestAttackableTargetWitch +brw net/minecraft/world/entity/ai/goal/target/PathfinderGoalNearestHealableRaider +brx net/minecraft/world/entity/ai/goal/target/PathfinderGoalRandomTargetNonTamed +bry net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtByTarget +brz net/minecraft/world/entity/ai/goal/target/PathfinderGoalOwnerHurtTarget +bs net/minecraft/advancements/critereon/CriterionConditionEntityType +bsa net/minecraft/world/entity/ai/goal/target/PathfinderGoalUniversalAngerReset +bsb net/minecraft/world/entity/ai/goal/target/PathfinderGoalTarget +bsd net/minecraft/world/entity/ai/gossip/Reputation +bse net/minecraft/world/entity/ai/gossip/ReputationType +bsg net/minecraft/world/entity/ai/memory/ExpirableMemory +bsh net/minecraft/world/entity/ai/memory/MemoryModuleType +bsi net/minecraft/world/entity/ai/memory/MemoryStatus +bsj net/minecraft/world/entity/ai/memory/NearestVisibleLivingEntities +bsk net/minecraft/world/entity/ai/memory/MemoryTarget +bsm net/minecraft/world/entity/ai/navigation/AmphibiousPathNavigation +bsn net/minecraft/world/entity/ai/navigation/NavigationFlying +bso net/minecraft/world/entity/ai/navigation/Navigation +bsp net/minecraft/world/entity/ai/navigation/NavigationAbstract +bsq net/minecraft/world/entity/ai/navigation/NavigationSpider +bsr net/minecraft/world/entity/ai/navigation/NavigationGuardian +bsu net/minecraft/world/entity/ai/sensing/SensorAdult +bsv net/minecraft/world/entity/ai/sensing/AxolotlAttackablesSensor +bsw net/minecraft/world/entity/ai/sensing/SensorDummy +bsx net/minecraft/world/entity/ai/sensing/FrogAttackablesSensor +bsy net/minecraft/world/entity/ai/sensing/SensorGolemLastSeen +bsz net/minecraft/world/entity/ai/sensing/SensorHoglinSpecific +bt net/minecraft/advancements/critereon/EntityVariantPredicate +bta net/minecraft/world/entity/ai/sensing/SensorHurtBy +btb net/minecraft/world/entity/ai/sensing/IsInWaterSensor +btc net/minecraft/world/entity/ai/sensing/SensorNearestBed +btd net/minecraft/world/entity/ai/sensing/SensorNearestItems +bte net/minecraft/world/entity/ai/sensing/SensorNearestLivingEntities +btf net/minecraft/world/entity/ai/sensing/NearestVisibleLivingEntitySensor +btg net/minecraft/world/entity/ai/sensing/SensorPiglinBruteSpecific +bth net/minecraft/world/entity/ai/sensing/SensorPiglinSpecific +bti net/minecraft/world/entity/ai/sensing/SensorNearestPlayers +btj net/minecraft/world/entity/ai/sensing/SensorSecondaryPlaces +btk net/minecraft/world/entity/ai/sensing/EntitySenses +btl net/minecraft/world/entity/ai/sensing/Sensor +btm net/minecraft/world/entity/ai/sensing/SensorType +btn net/minecraft/world/entity/ai/sensing/TemptingSensor +bto net/minecraft/world/entity/ai/sensing/SensorVillagerBabies +btp net/minecraft/world/entity/ai/sensing/SensorVillagerHostiles +btq net/minecraft/world/entity/ai/sensing/WardenEntitySensor +bts net/minecraft/world/entity/ai/targeting/PathfinderTargetCondition +btu net/minecraft/world/entity/ai/util/AirAndWaterRandomPos +btv net/minecraft/world/entity/ai/util/AirRandomPos +btw net/minecraft/world/entity/ai/util/DefaultRandomPos +btx net/minecraft/world/entity/ai/util/PathfinderGoalUtil +bty net/minecraft/world/entity/ai/util/HoverRandomPos +btz net/minecraft/world/entity/ai/util/LandRandomPos +bu net/minecraft/advancements/critereon/CriterionTriggerFilledBucket +bua net/minecraft/world/entity/ai/util/RandomPositionGenerator +buc net/minecraft/world/entity/ai/village/ReputationEvent +bud net/minecraft/world/entity/ai/village/VillageSiege +bud$a net/minecraft/world/entity/ai/village/VillageSiege$State +buf net/minecraft/world/entity/ai/village/poi/VillagePlace +buf$b net/minecraft/world/entity/ai/village/poi/VillagePlace$Occupancy +bug net/minecraft/world/entity/ai/village/poi/VillagePlaceRecord +buh net/minecraft/world/entity/ai/village/poi/VillagePlaceSection +bui net/minecraft/world/entity/ai/village/poi/VillagePlaceType +buj net/minecraft/world/entity/ai/village/poi/PoiTypes +bul net/minecraft/world/entity/ambient/EntityAmbient +bum net/minecraft/world/entity/ambient/EntityBat +buo net/minecraft/world/entity/animal/EntityFish +bup net/minecraft/world/entity/animal/EntityGolem +buq net/minecraft/world/entity/animal/EntityFishSchool +bur net/minecraft/world/entity/animal/EntityAnimal +bus net/minecraft/world/entity/animal/EntityBee +but net/minecraft/world/entity/animal/Bucketable +buu net/minecraft/world/entity/animal/EntityCat +buu$c net/minecraft/world/entity/animal/EntityCat$PathfinderGoalTemptChance +buv net/minecraft/world/entity/animal/CatVariant +buw net/minecraft/world/entity/animal/EntityChicken +bux net/minecraft/world/entity/animal/EntityCod +buy net/minecraft/world/entity/animal/EntityCow +buz net/minecraft/world/entity/animal/EntityDolphin +bv net/minecraft/advancements/critereon/CriterionConditionInOpenWater +bva net/minecraft/world/entity/animal/EntityBird +bvb net/minecraft/world/entity/animal/EntityFox +bvb$v net/minecraft/world/entity/animal/EntityFox$Type +bvc net/minecraft/world/entity/animal/FrogVariant +bvd net/minecraft/world/entity/animal/EntityIronGolem +bvd$a net/minecraft/world/entity/animal/EntityIronGolem$CrackLevel +bve net/minecraft/world/entity/animal/EntityMushroomCow +bve$a net/minecraft/world/entity/animal/EntityMushroomCow$Type +bvf net/minecraft/world/entity/animal/EntityOcelot +bvg net/minecraft/world/entity/animal/EntityPanda +bvg$a net/minecraft/world/entity/animal/EntityPanda$Gene +bvh net/minecraft/world/entity/animal/EntityParrot +bvh$b net/minecraft/world/entity/animal/EntityParrot$Variant +bvi net/minecraft/world/entity/animal/EntityPig +bvj net/minecraft/world/entity/animal/EntityPolarBear +bvk net/minecraft/world/entity/animal/EntityPufferFish +bvl net/minecraft/world/entity/animal/EntityRabbit +bvl$a net/minecraft/world/entity/animal/EntityRabbit$PathfinderGoalRabbitAvoidTarget +bvl$b net/minecraft/world/entity/animal/EntityRabbit$GroupDataRabbit +bvl$c net/minecraft/world/entity/animal/EntityRabbit$ControllerJumpRabbit +bvl$d net/minecraft/world/entity/animal/EntityRabbit$ControllerMoveRabbit +bvl$e net/minecraft/world/entity/animal/EntityRabbit$PathfinderGoalRabbitPanic +bvl$f net/minecraft/world/entity/animal/EntityRabbit$PathfinderGoalEatCarrots +bvl$g net/minecraft/world/entity/animal/EntityRabbit$Variant +bvm net/minecraft/world/entity/animal/EntitySalmon +bvn net/minecraft/world/entity/animal/EntitySheep +bvo net/minecraft/world/entity/animal/EntityPerchable +bvp net/minecraft/world/entity/animal/EntitySnowman +bvq net/minecraft/world/entity/animal/EntitySquid +bvq$b net/minecraft/world/entity/animal/EntitySquid$PathfinderGoalSquid +bvr net/minecraft/world/entity/animal/EntityTropicalFish +bvr$a net/minecraft/world/entity/animal/EntityTropicalFish$Base +bvr$b net/minecraft/world/entity/animal/EntityTropicalFish$Variant +bvs net/minecraft/world/entity/animal/EntityTurtle +bvt net/minecraft/world/entity/animal/EntityWaterAnimal +bvu net/minecraft/world/entity/animal/EntityWolf +bvv net/minecraft/world/entity/animal/allay/Allay +bvw net/minecraft/world/entity/animal/allay/AllayAi +bvy net/minecraft/world/entity/animal/axolotl/Axolotl +bvy$d net/minecraft/world/entity/animal/axolotl/Axolotl$Variant +bvz net/minecraft/world/entity/animal/axolotl/AxolotlAi +bw net/minecraft/advancements/critereon/CriterionTriggerFishingRodHooked +bwa net/minecraft/world/entity/animal/axolotl/PlayDead +bwb net/minecraft/world/entity/animal/axolotl/ValidatePlayDead +bwd net/minecraft/world/entity/animal/camel/Camel +bwe net/minecraft/world/entity/animal/camel/CamelAi +bwg net/minecraft/world/entity/animal/frog/Frog +bwh net/minecraft/world/entity/animal/frog/FrogAi +bwi net/minecraft/world/entity/animal/frog/ShootTongue +bwj net/minecraft/world/entity/animal/frog/Tadpole +bwk net/minecraft/world/entity/animal/frog/TadpoleAi +bwm net/minecraft/world/entity/animal/goat/Goat +bwn net/minecraft/world/entity/animal/goat/GoatAi +bwp net/minecraft/world/entity/animal/horse/EntityHorseChestedAbstract +bwq net/minecraft/world/entity/animal/horse/EntityHorseAbstract +bwr net/minecraft/world/entity/animal/horse/EntityHorseDonkey +bws net/minecraft/world/entity/animal/horse/EntityHorse +bwt net/minecraft/world/entity/animal/horse/EntityLlama +bwt$d net/minecraft/world/entity/animal/horse/EntityLlama$Variant +bwu net/minecraft/world/entity/animal/horse/HorseStyle +bwv net/minecraft/world/entity/animal/horse/EntityHorseMule +bww net/minecraft/world/entity/animal/horse/EntityHorseSkeleton +bwx net/minecraft/world/entity/animal/horse/PathfinderGoalHorseTrap +bwy net/minecraft/world/entity/animal/horse/EntityLlamaTrader +bwz net/minecraft/world/entity/animal/horse/HorseColor +bx net/minecraft/advancements/critereon/CriterionConditionFluid +bxa net/minecraft/world/entity/animal/horse/EntityHorseZombie +bxd net/minecraft/world/entity/animal/sniffer/Sniffer +bxd$a net/minecraft/world/entity/animal/sniffer/Sniffer$State +bxe net/minecraft/world/entity/animal/sniffer/SnifferAi +bxf net/minecraft/world/entity/boss/EntityComplexPart +bxg net/minecraft/world/entity/boss/enderdragon/EntityEnderCrystal +bxh net/minecraft/world/entity/boss/enderdragon/EntityEnderDragon +bxj net/minecraft/world/entity/boss/enderdragon/phases/AbstractDragonController +bxk net/minecraft/world/entity/boss/enderdragon/phases/AbstractDragonControllerLanded +bxl net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerCharge +bxm net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerDying +bxn net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerHold +bxo net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerHover +bxp net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerLandingFly +bxq net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerLanding +bxr net/minecraft/world/entity/boss/enderdragon/phases/IDragonController +bxs net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerLandedAttack +bxt net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerLandedFlame +bxu net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerLandedSearch +bxv net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerStrafe +bxw net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerFly +bxx net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerPhase +bxy net/minecraft/world/entity/boss/enderdragon/phases/DragonControllerManager +by net/minecraft/advancements/critereon/CriterionTriggerImpossible +byb net/minecraft/world/entity/boss/wither/EntityWither +byd net/minecraft/world/entity/decoration/EntityArmorStand +bye net/minecraft/world/entity/decoration/GlowItemFrame +byf net/minecraft/world/entity/decoration/EntityHanging +byg net/minecraft/world/entity/decoration/EntityItemFrame +byh net/minecraft/world/entity/decoration/EntityLeash +byi net/minecraft/world/entity/decoration/EntityPainting +byj net/minecraft/world/entity/decoration/PaintingVariant +byk net/minecraft/world/entity/decoration/PaintingVariants +bym net/minecraft/world/entity/item/EntityFallingBlock +byn net/minecraft/world/entity/item/EntityItem +byo net/minecraft/world/entity/item/EntityTNTPrimed +byq net/minecraft/world/entity/monster/EntityIllagerAbstract +byr net/minecraft/world/entity/monster/EntitySkeletonAbstract +bys net/minecraft/world/entity/monster/EntityBlaze +bys$a net/minecraft/world/entity/monster/EntityBlaze$PathfinderGoalBlazeFireball +byt net/minecraft/world/entity/monster/EntityCaveSpider +byu net/minecraft/world/entity/monster/EntityCreeper +byv net/minecraft/world/entity/monster/ICrossbow +byw net/minecraft/world/entity/monster/EntityDrowned +byx net/minecraft/world/entity/monster/EntityGuardianElder +byy net/minecraft/world/entity/monster/EntityEnderman +byy$b net/minecraft/world/entity/monster/EntityEnderman$PathfinderGoalEndermanPlaceBlock +byy$c net/minecraft/world/entity/monster/EntityEnderman$PathfinderGoalPlayerWhoLookedAtTarget +byy$d net/minecraft/world/entity/monster/EntityEnderman$PathfinderGoalEndermanPickupBlock +byz net/minecraft/world/entity/monster/EntityEndermite +bz net/minecraft/advancements/critereon/CriterionTriggerInventoryChanged +bza net/minecraft/world/entity/monster/IMonster +bzb net/minecraft/world/entity/monster/EntityEvoker +bzc net/minecraft/world/entity/monster/EntityGhast +bzc$a net/minecraft/world/entity/monster/EntityGhast$PathfinderGoalGhastMoveTowardsTarget +bzc$b net/minecraft/world/entity/monster/EntityGhast$ControllerGhast +bzc$c net/minecraft/world/entity/monster/EntityGhast$PathfinderGoalGhastAttackTarget +bzc$d net/minecraft/world/entity/monster/EntityGhast$PathfinderGoalGhastIdleMove +bzd net/minecraft/world/entity/monster/EntityGiantZombie +bze net/minecraft/world/entity/monster/EntityGuardian +bze$a net/minecraft/world/entity/monster/EntityGuardian$PathfinderGoalGuardianAttack +bze$b net/minecraft/world/entity/monster/EntityGuardian$EntitySelectorGuardianTargetHumanSquid +bze$c net/minecraft/world/entity/monster/EntityGuardian$ControllerMoveGuardian +bzf net/minecraft/world/entity/monster/EntityZombieHusk +bzg net/minecraft/world/entity/monster/EntityIllagerIllusioner +bzh net/minecraft/world/entity/monster/EntityMagmaCube +bzi net/minecraft/world/entity/monster/EntityMonster +bzj net/minecraft/world/entity/monster/EntityMonsterPatrolling +bzk net/minecraft/world/entity/monster/EntityPhantom +bzk$a net/minecraft/world/entity/monster/EntityPhantom$AttackPhase +bzl net/minecraft/world/entity/monster/EntityPillager +bzm net/minecraft/world/entity/monster/IRangedEntity +bzn net/minecraft/world/entity/monster/EntityRavager +bzo net/minecraft/world/entity/monster/EntityShulker +bzp net/minecraft/world/entity/monster/EntitySilverfish +bzp$a net/minecraft/world/entity/monster/EntitySilverfish$PathfinderGoalSilverfishHideInBlock +bzp$b net/minecraft/world/entity/monster/EntitySilverfish$PathfinderGoalSilverfishWakeOthers +bzq net/minecraft/world/entity/monster/EntitySkeleton +bzr net/minecraft/world/entity/monster/EntitySlime +bzr$a net/minecraft/world/entity/monster/EntitySlime$PathfinderGoalSlimeNearestPlayer +bzr$b net/minecraft/world/entity/monster/EntitySlime$PathfinderGoalSlimeRandomJump +bzr$c net/minecraft/world/entity/monster/EntitySlime$PathfinderGoalSlimeIdle +bzr$d net/minecraft/world/entity/monster/EntitySlime$ControllerMoveSlime +bzr$e net/minecraft/world/entity/monster/EntitySlime$PathfinderGoalSlimeRandomDirection +bzs net/minecraft/world/entity/monster/EntityIllagerWizard +bzs$a net/minecraft/world/entity/monster/EntityIllagerWizard$Spell +bzs$c net/minecraft/world/entity/monster/EntityIllagerWizard$PathfinderGoalCastSpell +bzt net/minecraft/world/entity/monster/EntitySpider +bzt$a net/minecraft/world/entity/monster/EntitySpider$PathfinderGoalSpiderMeleeAttack +bzt$b net/minecraft/world/entity/monster/EntitySpider$GroupDataSpider +bzt$c net/minecraft/world/entity/monster/EntitySpider$PathfinderGoalSpiderNearestAttackableTarget +bzu net/minecraft/world/entity/monster/EntitySkeletonStray +bzv net/minecraft/world/entity/monster/EntityStrider +bzw net/minecraft/world/entity/monster/EntityVex +bzx net/minecraft/world/entity/monster/EntityVindicator +bzy net/minecraft/world/entity/monster/EntityWitch +bzz net/minecraft/world/entity/monster/EntitySkeletonWither +ca net/minecraft/advancements/critereon/CriterionTriggerItemDurabilityChanged +caa net/minecraft/world/entity/monster/EntityZoglin +cab net/minecraft/world/entity/monster/EntityZombie +cab$b net/minecraft/world/entity/monster/EntityZombie$GroupDataZombie +cac net/minecraft/world/entity/monster/EntityZombieVillager +cad net/minecraft/world/entity/monster/EntityPigZombie +cae net/minecraft/world/entity/monster/hoglin/EntityHoglin +caf net/minecraft/world/entity/monster/hoglin/HoglinAI +cag net/minecraft/world/entity/monster/hoglin/IOglin +caj net/minecraft/world/entity/monster/piglin/EntityPiglinAbstract +cak net/minecraft/world/entity/monster/piglin/EntityPiglin +cal net/minecraft/world/entity/monster/piglin/PiglinAI +cam net/minecraft/world/entity/monster/piglin/EntityPiglinArmPose +can net/minecraft/world/entity/monster/piglin/EntityPiglinBrute +cao net/minecraft/world/entity/monster/piglin/PiglinBruteAI +cap net/minecraft/world/entity/monster/piglin/BehaviorRememberHuntedHoglin +caq net/minecraft/world/entity/monster/piglin/BehaviorStartAdmiringItem +car net/minecraft/world/entity/monster/piglin/BehaviorHuntHoglin +cas net/minecraft/world/entity/monster/piglin/BehaviorStopAdmiringItem +cat net/minecraft/world/entity/monster/piglin/BehaviorAdmireTimeout +cau net/minecraft/world/entity/monster/piglin/BehaviorStopAdmiring +caw net/minecraft/world/entity/monster/warden/AngerLevel +cax net/minecraft/world/entity/monster/warden/AngerManagement +cay net/minecraft/world/entity/monster/warden/Warden +caz net/minecraft/world/entity/monster/warden/WardenAi +cb net/minecraft/advancements/critereon/CriterionConditionItem +cba net/minecraft/world/entity/monster/warden/WardenSpawnTracker +cbc net/minecraft/world/entity/npc/EntityVillagerAbstract +cbd net/minecraft/world/entity/npc/MobSpawnerCat +cbe net/minecraft/world/entity/npc/MerchantWrapper +cbf net/minecraft/world/entity/npc/InventoryCarrier +cbg net/minecraft/world/entity/npc/NPC +cbh net/minecraft/world/entity/npc/EntityVillager +cbi net/minecraft/world/entity/npc/VillagerData +cbj net/minecraft/world/entity/npc/VillagerDataHolder +cbk net/minecraft/world/entity/npc/VillagerProfession +cbl net/minecraft/world/entity/npc/VillagerTrades +cbl$g net/minecraft/world/entity/npc/VillagerTrades$IMerchantRecipeOption +cbm net/minecraft/world/entity/npc/VillagerType +cbn net/minecraft/world/entity/npc/EntityVillagerTrader +cbo net/minecraft/world/entity/npc/MobSpawnerTrader +cbr net/minecraft/world/entity/player/PlayerAbilities +cbs net/minecraft/world/entity/player/EnumChatVisibility +cbt net/minecraft/world/entity/player/PlayerInventory +cbu net/minecraft/world/entity/player/EntityHuman +cbu$a net/minecraft/world/entity/player/EntityHuman$EnumBedResult +cbv net/minecraft/world/entity/player/PlayerModelPart +cbx net/minecraft/world/entity/player/ProfilePublicKey +cby net/minecraft/world/entity/player/AutoRecipeStackManager +cc net/minecraft/advancements/critereon/ItemUsedOnLocationTrigger +cca net/minecraft/world/entity/projectile/EntityArrow +cca$a net/minecraft/world/entity/projectile/EntityArrow$PickupStatus +ccb net/minecraft/world/entity/projectile/EntityFireball +ccc net/minecraft/world/entity/projectile/EntityTippedArrow +ccd net/minecraft/world/entity/projectile/EntityDragonFireball +cce net/minecraft/world/entity/projectile/EntityEvokerFangs +ccf net/minecraft/world/entity/projectile/EntityEnderSignal +ccg net/minecraft/world/entity/projectile/EntityFireballFireball +cch net/minecraft/world/entity/projectile/EntityFireworks +cci net/minecraft/world/entity/projectile/EntityFishingHook +cci$a net/minecraft/world/entity/projectile/EntityFishingHook$HookState +cci$b net/minecraft/world/entity/projectile/EntityFishingHook$WaterPosition +ccj net/minecraft/world/entity/projectile/ItemSupplier +cck net/minecraft/world/entity/projectile/EntityLargeFireball +ccl net/minecraft/world/entity/projectile/EntityLlamaSpit +ccm net/minecraft/world/entity/projectile/IProjectile +ccn net/minecraft/world/entity/projectile/ProjectileHelper +cco net/minecraft/world/entity/projectile/EntityShulkerBullet +ccp net/minecraft/world/entity/projectile/EntitySmallFireball +ccq net/minecraft/world/entity/projectile/EntitySnowball +ccr net/minecraft/world/entity/projectile/EntitySpectralArrow +ccs net/minecraft/world/entity/projectile/EntityProjectileThrowable +cct net/minecraft/world/entity/projectile/EntityProjectile +ccu net/minecraft/world/entity/projectile/EntityEgg +ccv net/minecraft/world/entity/projectile/EntityEnderPearl +ccw net/minecraft/world/entity/projectile/EntityThrownExpBottle +ccx net/minecraft/world/entity/projectile/EntityPotion +ccy net/minecraft/world/entity/projectile/EntityThrownTrident +ccz net/minecraft/world/entity/projectile/EntityWitherSkull +cd net/minecraft/advancements/critereon/CriterionTriggerKilledByCrossbow +cdb net/minecraft/world/entity/raid/Raid +cdb$a net/minecraft/world/entity/raid/Raid$Status +cdb$b net/minecraft/world/entity/raid/Raid$Wave +cdc net/minecraft/world/entity/raid/EntityRaider +cdd net/minecraft/world/entity/raid/PersistentRaid +cdf net/minecraft/world/entity/schedule/Activity +cdg net/minecraft/world/entity/schedule/ActivityFrame +cdh net/minecraft/world/entity/schedule/Schedule +cdi net/minecraft/world/entity/schedule/ScheduleBuilder +cdj net/minecraft/world/entity/schedule/ScheduleActivity +cdl net/minecraft/world/entity/vehicle/EntityMinecartAbstract +cdl$a net/minecraft/world/entity/vehicle/EntityMinecartAbstract$EnumMinecartType +cdm net/minecraft/world/entity/vehicle/EntityMinecartContainer +cdn net/minecraft/world/entity/vehicle/EntityBoat +cdn$a net/minecraft/world/entity/vehicle/EntityBoat$EnumStatus +cdn$b net/minecraft/world/entity/vehicle/EntityBoat$EnumBoatType +cdo net/minecraft/world/entity/vehicle/ChestBoat +cdp net/minecraft/world/entity/vehicle/ContainerEntity +cdq net/minecraft/world/entity/vehicle/DismountUtil +cdr net/minecraft/world/entity/vehicle/EntityMinecartRideable +cds net/minecraft/world/entity/vehicle/EntityMinecartChest +cdt net/minecraft/world/entity/vehicle/EntityMinecartCommandBlock +cdu net/minecraft/world/entity/vehicle/EntityMinecartFurnace +cdv net/minecraft/world/entity/vehicle/EntityMinecartHopper +cdw net/minecraft/world/entity/vehicle/EntityMinecartMobSpawner +cdx net/minecraft/world/entity/vehicle/EntityMinecartTNT +cdz net/minecraft/world/flag/FeatureElement +ce net/minecraft/advancements/critereon/CriterionTriggerKilled +cea net/minecraft/world/flag/FeatureFlag +ceb net/minecraft/world/flag/FeatureFlagRegistry +cec net/minecraft/world/flag/FeatureFlagSet +ced net/minecraft/world/flag/FeatureFlagUniverse +cee net/minecraft/world/flag/FeatureFlags +ceh net/minecraft/world/food/FoodMetaData +cei net/minecraft/world/food/FoodInfo +cej net/minecraft/world/food/Foods +cel net/minecraft/world/inventory/Container +cem net/minecraft/world/inventory/ContainerFurnace +cen net/minecraft/world/inventory/ContainerAnvil +ceo net/minecraft/world/inventory/ContainerBeacon +ceo$a net/minecraft/world/inventory/ContainerBeacon$SlotBeacon +cep net/minecraft/world/inventory/ContainerBlastFurnace +ceq net/minecraft/world/inventory/ContainerBrewingStand +ceq$b net/minecraft/world/inventory/ContainerBrewingStand$SlotBrewing +ceq$c net/minecraft/world/inventory/ContainerBrewingStand$SlotPotionBottle +cer net/minecraft/world/inventory/ContainerCartography +ces net/minecraft/world/inventory/ContainerChest +cet net/minecraft/world/inventory/ClickAction +ceu net/minecraft/world/inventory/InventoryClickType +cev net/minecraft/world/inventory/IContainerProperties +cew net/minecraft/world/inventory/ContainerAccess +cex net/minecraft/world/inventory/ICrafting +cey net/minecraft/world/inventory/ContainerSynchronizer +cez net/minecraft/world/inventory/InventoryCrafting +cf net/minecraft/advancements/critereon/CriterionTriggerLevitation +cfa net/minecraft/world/inventory/ContainerWorkbench +cfb net/minecraft/world/inventory/ContainerProperty +cfc net/minecraft/world/inventory/ContainerDispenser +cfd net/minecraft/world/inventory/ContainerEnchantTable +cfe net/minecraft/world/inventory/SlotFurnaceFuel +cff net/minecraft/world/inventory/ContainerFurnaceFurnace +cfg net/minecraft/world/inventory/SlotFurnaceResult +cfh net/minecraft/world/inventory/ContainerGrindstone +cfi net/minecraft/world/inventory/ContainerHopper +cfj net/minecraft/world/inventory/ContainerHorse +cfk net/minecraft/world/inventory/ContainerPlayer +cfl net/minecraft/world/inventory/ContainerAnvilAbstract +cfm net/minecraft/world/inventory/ItemCombinerMenuSlotDefinition +cfn net/minecraft/world/inventory/ContainerLectern +cfo net/minecraft/world/inventory/ContainerLoom +cfp net/minecraft/world/inventory/ITileEntityContainer +cfq net/minecraft/world/inventory/Containers +cfq$a net/minecraft/world/inventory/Containers$Supplier +cfr net/minecraft/world/inventory/InventoryMerchant +cfs net/minecraft/world/inventory/ContainerMerchant +cft net/minecraft/world/inventory/SlotMerchantResult +cfu net/minecraft/world/inventory/InventoryEnderChest +cfv net/minecraft/world/inventory/ContainerRecipeBook +cfw net/minecraft/world/inventory/RecipeBookType +cfx net/minecraft/world/inventory/RecipeCraftingHolder +cfy net/minecraft/world/inventory/InventoryCraftResult +cfz net/minecraft/world/inventory/SlotResult +cg net/minecraft/advancements/critereon/CriterionConditionLight +cga net/minecraft/world/inventory/ContainerShulkerBox +cgb net/minecraft/world/inventory/SlotShulkerBox +cgc net/minecraft/world/inventory/ContainerProperties +cgd net/minecraft/world/inventory/Slot +cge net/minecraft/world/inventory/ContainerSmithing +cgf net/minecraft/world/inventory/ContainerSmoker +cgg net/minecraft/world/inventory/AutoRecipeOutput +cgh net/minecraft/world/inventory/ContainerStonecutter +cgi net/minecraft/world/inventory/TransientCraftingContainer +cgk net/minecraft/world/inventory/tooltip/BundleTooltip +cgl net/minecraft/world/inventory/tooltip/TooltipComponent +cgn net/minecraft/world/item/AdventureModeCheck +cgo net/minecraft/world/item/ItemAir +cgp net/minecraft/world/item/ItemArmor +cgq net/minecraft/world/item/ArmorMaterial +cgr net/minecraft/world/item/EnumArmorMaterial +cgs net/minecraft/world/item/ItemArmorStand +cgt net/minecraft/world/item/ItemArrow +cgu net/minecraft/world/item/ItemAxe +cgv net/minecraft/world/item/ItemBanner +cgw net/minecraft/world/item/ItemBannerPattern +cgx net/minecraft/world/item/ItemBed +cgy net/minecraft/world/item/ItemBlock +cgz net/minecraft/world/item/ItemBoat +ch net/minecraft/advancements/critereon/LightningBoltPredicate +cha net/minecraft/world/item/ItemBoneMeal +chb net/minecraft/world/item/ItemBook +chc net/minecraft/world/item/ItemGlassBottle +chd net/minecraft/world/item/ItemBow +che net/minecraft/world/item/ItemSoup +chf net/minecraft/world/item/BrushItem +chg net/minecraft/world/item/ItemBucket +chh net/minecraft/world/item/BundleItem +chi net/minecraft/world/item/ItemChorusFruit +chj net/minecraft/world/item/ItemCompass +chk net/minecraft/world/item/ItemWorldMapBase +chl net/minecraft/world/item/CreativeModeTab +chm net/minecraft/world/item/CreativeModeTabs +chn net/minecraft/world/item/ItemCrossbow +cho net/minecraft/world/item/ItemDebugStick +chp net/minecraft/world/item/ItemTool +chq net/minecraft/world/item/DiscFragmentItem +chr net/minecraft/world/item/DispensibleContainerItem +chs net/minecraft/world/item/ItemBisected +cht net/minecraft/world/item/EnumColor +chu net/minecraft/world/item/ItemDye +chv net/minecraft/world/item/ItemArmorColorable +chw net/minecraft/world/item/ItemHorseArmorDyeable +chx net/minecraft/world/item/IDyeable +chy net/minecraft/world/item/ItemEgg +chz net/minecraft/world/item/ItemElytra +ci net/minecraft/advancements/critereon/LightningStrikeTrigger +cia net/minecraft/world/item/ItemMapEmpty +cib net/minecraft/world/item/ItemEnchantedBook +cic net/minecraft/world/item/ItemGoldenAppleEnchanted +cid net/minecraft/world/item/ItemEndCrystal +cie net/minecraft/world/item/ItemEnderEye +cif net/minecraft/world/item/ItemEnderPearl +cig net/minecraft/world/item/Equipable +cih net/minecraft/world/item/ItemExpBottle +cii net/minecraft/world/item/ItemFireball +cij net/minecraft/world/item/ItemFireworks +cij$a net/minecraft/world/item/ItemFireworks$EffectType +cik net/minecraft/world/item/ItemFireworksCharge +cil net/minecraft/world/item/ItemFishingRod +cim net/minecraft/world/item/ItemFlintAndSteel +cin net/minecraft/world/item/ItemCarrotStick +cio net/minecraft/world/item/ItemRestricted +cip net/minecraft/world/item/GlowInkSacItem +ciq net/minecraft/world/item/ItemHanging +cir net/minecraft/world/item/HangingSignItem +cis net/minecraft/world/item/ItemHoe +cit net/minecraft/world/item/ItemHoneyBottle +ciu net/minecraft/world/item/HoneycombItem +civ net/minecraft/world/item/ItemHorseArmor +ciw net/minecraft/world/item/InkSacItem +cix net/minecraft/world/item/Instrument +ciy net/minecraft/world/item/InstrumentItem +ciz net/minecraft/world/item/Instruments +cj net/minecraft/advancements/critereon/CriterionConditionLocation +cja net/minecraft/world/item/Item +cja$a net/minecraft/world/item/Item$Info +cjb net/minecraft/world/item/ItemCooldown +cjb$a net/minecraft/world/item/ItemCooldown$Info +cjc net/minecraft/world/item/ItemDisplayContext +cjd net/minecraft/world/item/ItemItemFrame +cje net/minecraft/world/item/ItemNamedBlock +cjf net/minecraft/world/item/ItemStack +cjf$a net/minecraft/world/item/ItemStack$HideFlags +cjg net/minecraft/world/item/ItemStackLinkedSet +cjh net/minecraft/world/item/ItemLiquidUtil +cji net/minecraft/world/item/Items +cjj net/minecraft/world/item/ItemKnowledgeBook +cjk net/minecraft/world/item/ItemLeash +cjl net/minecraft/world/item/ItemLingeringPotion +cjm net/minecraft/world/item/ItemWorldMap +cjn net/minecraft/world/item/ItemMilkBucket +cjo net/minecraft/world/item/ItemMinecart +cjp net/minecraft/world/item/MobBucketItem +cjq net/minecraft/world/item/ItemNameTag +cjr net/minecraft/world/item/ItemPickaxe +cjs net/minecraft/world/item/PlaceOnWaterBlockItem +cjt net/minecraft/world/item/ItemSkullPlayer +cju net/minecraft/world/item/ItemPotion +cjv net/minecraft/world/item/ItemProjectileWeapon +cjw net/minecraft/world/item/EnumItemRarity +cjx net/minecraft/world/item/ItemRecord +cjy net/minecraft/world/item/ItemSaddle +cjz net/minecraft/world/item/ItemScaffolding +ck net/minecraft/advancements/critereon/CriterionTriggerPlayerGeneratesContainerLoot +cka net/minecraft/world/item/ItemCooldownPlayer +ckb net/minecraft/world/item/ItemShears +ckc net/minecraft/world/item/ItemShield +ckd net/minecraft/world/item/ItemSpade +cke net/minecraft/world/item/SignApplicator +ckf net/minecraft/world/item/ItemSign +ckg net/minecraft/world/item/ItemNetherStar +ckh net/minecraft/world/item/SmithingTemplateItem +cki net/minecraft/world/item/ItemSnowball +ckj net/minecraft/world/item/SolidBucketItem +ckk net/minecraft/world/item/ItemMonsterEgg +ckl net/minecraft/world/item/ItemSpectralArrow +ckm net/minecraft/world/item/ItemSplashPotion +ckn net/minecraft/world/item/SpyglassItem +cko net/minecraft/world/item/ItemBlockWallable +ckp net/minecraft/world/item/ItemSuspiciousStew +ckq net/minecraft/world/item/ItemSword +ckr net/minecraft/world/item/ItemPotionThrowable +cks net/minecraft/world/item/ToolMaterial +ckt net/minecraft/world/item/ItemToolMaterial +cku net/minecraft/world/item/EnumToolMaterial +ckv net/minecraft/world/item/ItemTippedArrow +ckw net/minecraft/world/item/TooltipFlag +ckx net/minecraft/world/item/ItemTrident +cky net/minecraft/world/item/EnumAnimation +ckz net/minecraft/world/item/ItemVanishable +cl net/minecraft/advancements/critereon/CriterionConditionValue +cl$c net/minecraft/advancements/critereon/CriterionConditionValue$DoubleRange +cl$d net/minecraft/advancements/critereon/CriterionConditionValue$IntegerRange +cla net/minecraft/world/item/ItemBookAndQuill +clb net/minecraft/world/item/ItemWrittenBook +clc net/minecraft/world/item/alchemy/PotionRegistry +cld net/minecraft/world/item/alchemy/PotionBrewer +cld$a net/minecraft/world/item/alchemy/PotionBrewer$PredicatedCombination +cle net/minecraft/world/item/alchemy/PotionUtil +clf net/minecraft/world/item/alchemy/Potions +clh net/minecraft/world/item/armortrim/ArmorTrim +cli net/minecraft/world/item/armortrim/TrimMaterial +clj net/minecraft/world/item/armortrim/TrimMaterials +clk net/minecraft/world/item/armortrim/TrimPattern +cll net/minecraft/world/item/armortrim/TrimPatterns +cln net/minecraft/world/item/context/BlockActionContext +clo net/minecraft/world/item/context/BlockActionContextDirectional +clp net/minecraft/world/item/context/ItemActionContext +clr net/minecraft/world/item/crafting/RecipeCooking +cls net/minecraft/world/item/crafting/RecipeArmorDye +clt net/minecraft/world/item/crafting/RecipeBannerDuplicate +clu net/minecraft/world/item/crafting/RecipeBlasting +clv net/minecraft/world/item/crafting/RecipeBookClone +clw net/minecraft/world/item/crafting/RecipeCampfire +clx net/minecraft/world/item/crafting/CookingBookCategory +cly net/minecraft/world/item/crafting/CraftingBookCategory +clz net/minecraft/world/item/crafting/RecipeCrafting +cm net/minecraft/advancements/critereon/CriterionConditionMobEffect +cma net/minecraft/world/item/crafting/CraftingRecipeCodecs +cmb net/minecraft/world/item/crafting/IRecipeComplex +cmc net/minecraft/world/item/crafting/DecoratedPotRecipe +cmd net/minecraft/world/item/crafting/RecipeFireworks +cme net/minecraft/world/item/crafting/RecipeFireworksFade +cmf net/minecraft/world/item/crafting/RecipeFireworksStar +cmg net/minecraft/world/item/crafting/RecipeItemStack +cmg$a net/minecraft/world/item/crafting/RecipeItemStack$StackProvider +cmg$c net/minecraft/world/item/crafting/RecipeItemStack$Provider +cmh net/minecraft/world/item/crafting/RecipeMapClone +cmi net/minecraft/world/item/crafting/RecipeMapExtend +cmj net/minecraft/world/item/crafting/IRecipe +cmk net/minecraft/world/item/crafting/RecipeHolder +cml net/minecraft/world/item/crafting/CraftingManager +cmm net/minecraft/world/item/crafting/RecipeSerializer +cmn net/minecraft/world/item/crafting/Recipes +cmo net/minecraft/world/item/crafting/RecipeRepair +cmp net/minecraft/world/item/crafting/ShapedRecipes +cmp$a net/minecraft/world/item/crafting/ShapedRecipes$Serializer +cmp$a$a net/minecraft/world/item/crafting/ShapedRecipes$Serializer$RawShapedRecipe +cmq net/minecraft/world/item/crafting/ShapelessRecipes +cmr net/minecraft/world/item/crafting/RecipiesShield +cms net/minecraft/world/item/crafting/RecipeShulkerBox +cmt net/minecraft/world/item/crafting/RecipeSerializerCooking +cmu net/minecraft/world/item/crafting/SimpleCraftingRecipeSerializer +cmv net/minecraft/world/item/crafting/RecipeSingleItem +cmw net/minecraft/world/item/crafting/FurnaceRecipe +cmx net/minecraft/world/item/crafting/SmithingRecipe +cmy net/minecraft/world/item/crafting/SmithingTransformRecipe +cmz net/minecraft/world/item/crafting/SmithingTrimRecipe +cn net/minecraft/advancements/critereon/CriterionConditionNBT +cna net/minecraft/world/item/crafting/RecipeSmoking +cnb net/minecraft/world/item/crafting/RecipeStonecutting +cnc net/minecraft/world/item/crafting/RecipeSuspiciousStew +cnd net/minecraft/world/item/crafting/RecipeTippedArrow +cnf net/minecraft/world/item/enchantment/EnchantmentArrowDamage +cng net/minecraft/world/item/enchantment/EnchantmentFlameArrows +cnh net/minecraft/world/item/enchantment/EnchantmentInfiniteArrows +cni net/minecraft/world/item/enchantment/EnchantmentArrowKnockback +cnj net/minecraft/world/item/enchantment/EnchantmentPiercing +cnk net/minecraft/world/item/enchantment/EnchantmentBinding +cnl net/minecraft/world/item/enchantment/EnchantmentWeaponDamage +cnm net/minecraft/world/item/enchantment/EnchantmentDurability +cnn net/minecraft/world/item/enchantment/EnchantmentDigging +cno net/minecraft/world/item/enchantment/Enchantment +cno$a net/minecraft/world/item/enchantment/Enchantment$Rarity +cnp net/minecraft/world/item/enchantment/EnchantmentSlotType +cnq net/minecraft/world/item/enchantment/EnchantmentManager +cnr net/minecraft/world/item/enchantment/WeightedRandomEnchant +cns net/minecraft/world/item/enchantment/Enchantments +cnt net/minecraft/world/item/enchantment/EnchantmentFire +cnu net/minecraft/world/item/enchantment/EnchantmentLure +cnv net/minecraft/world/item/enchantment/EnchantmentFrostWalker +cnw net/minecraft/world/item/enchantment/EnchantmentKnockback +cnx net/minecraft/world/item/enchantment/EnchantmentLootBonus +cny net/minecraft/world/item/enchantment/EnchantmentMending +cnz net/minecraft/world/item/enchantment/EnchantmentMultishot +co net/minecraft/advancements/critereon/PickedUpItemTrigger +coa net/minecraft/world/item/enchantment/EnchantmentOxygen +cob net/minecraft/world/item/enchantment/EnchantmentProtection +cob$a net/minecraft/world/item/enchantment/EnchantmentProtection$DamageType +coc net/minecraft/world/item/enchantment/EnchantmentQuickCharge +cod net/minecraft/world/item/enchantment/EnchantmentSoulSpeed +coe net/minecraft/world/item/enchantment/EnchantmentSweeping +cof net/minecraft/world/item/enchantment/SwiftSneakEnchantment +cog net/minecraft/world/item/enchantment/EnchantmentThorns +coh net/minecraft/world/item/enchantment/EnchantmentTridentChanneling +coi net/minecraft/world/item/enchantment/EnchantmentTridentImpaling +coj net/minecraft/world/item/enchantment/EnchantmentTridentLoyalty +cok net/minecraft/world/item/enchantment/EnchantmentTridentRiptide +col net/minecraft/world/item/enchantment/EnchantmentSilkTouch +com net/minecraft/world/item/enchantment/EnchantmentVanishing +coo net/minecraft/world/item/enchantment/EnchantmentDepthStrider +cop net/minecraft/world/item/enchantment/EnchantmentWaterWorker +cos net/minecraft/world/item/trading/IMerchant +cot net/minecraft/world/item/trading/MerchantRecipe +cou net/minecraft/world/item/trading/MerchantRecipeList +cow net/minecraft/world/level/CommandBlockListenerAbstract +cox net/minecraft/world/level/MobSpawnerAbstract +coy net/minecraft/world/level/IBlockLightAccess +coz net/minecraft/world/level/VoxelShapeSpliterator +cp net/minecraft/advancements/critereon/CriterionTriggerPlayerHurtEntity +cpa net/minecraft/world/level/BlockActionData +cpb net/minecraft/world/level/IBlockAccess +cpc net/minecraft/world/level/ChunkCoordIntPair +cpd net/minecraft/world/level/ClipBlockStateContext +cpe net/minecraft/world/level/RayTrace +cpe$a net/minecraft/world/level/RayTrace$BlockCollisionOption +cpe$b net/minecraft/world/level/RayTrace$FluidCollisionOption +cpf net/minecraft/world/level/ICollisionAccess +cpg net/minecraft/world/level/ColorResolver +cph net/minecraft/world/level/ICombinedAccess +cpi net/minecraft/world/level/MobSpawner +cpj net/minecraft/world/level/DataPackConfiguration +cpk net/minecraft/world/level/BlockAccessAir +cpl net/minecraft/world/level/ExplosionDamageCalculatorEntity +cpm net/minecraft/world/level/IEntityAccess +cpn net/minecraft/world/level/Explosion +cpn$a net/minecraft/world/level/Explosion$Effect +cpo net/minecraft/world/level/ExplosionDamageCalculator +cpp net/minecraft/world/level/FoliageColor +cpq net/minecraft/world/level/ForcedChunk +cpr net/minecraft/world/level/GameRules +cpr$a net/minecraft/world/level/GameRules$GameRuleBoolean +cpr$b net/minecraft/world/level/GameRules$GameRuleCategory +cpr$c net/minecraft/world/level/GameRules$GameRuleVisitor +cpr$d net/minecraft/world/level/GameRules$GameRuleInt +cpr$e net/minecraft/world/level/GameRules$GameRuleKey +cpr$f net/minecraft/world/level/GameRules$GameRuleDefinition +cpr$g net/minecraft/world/level/GameRules$GameRuleValue +cps net/minecraft/world/level/EnumGamemode +cpt net/minecraft/world/level/GrassColor +cpu net/minecraft/world/level/IMaterial +cpv net/minecraft/world/level/World +cpw net/minecraft/world/level/GeneratorAccess +cpx net/minecraft/world/level/LevelHeightAccessor +cpy net/minecraft/world/level/IWorldReader +cpz net/minecraft/world/level/WorldSettings +cq net/minecraft/advancements/critereon/CriterionTriggerPlayerInteractedWithEntity +cqa net/minecraft/world/level/VirtualLevelWritable +cqb net/minecraft/world/level/VirtualLevelReadable +cqc net/minecraft/world/level/IWorldTime +cqd net/minecraft/world/level/IWorldWriter +cqe net/minecraft/world/level/EnumSkyBlock +cqf net/minecraft/world/level/LocalMobCapCalculator +cqg net/minecraft/world/level/SpawnerCreature +cqh net/minecraft/world/level/BlockColumn +cqi net/minecraft/world/level/ChunkCache +cqj net/minecraft/world/level/SpawnerCreatureProbabilities +cqk net/minecraft/world/level/WorldAccess +cql net/minecraft/world/level/SignalGetter +cqm net/minecraft/world/level/MobSpawnerData +cqn net/minecraft/world/level/StructureManager +cqo net/minecraft/world/level/WorldDataConfiguration +cqp net/minecraft/world/level/GeneratorAccessSeed +cqq net/minecraft/world/level/biome/CaveSound +cqr net/minecraft/world/level/biome/CaveSoundSettings +cqs net/minecraft/world/level/biome/BiomeParticles +cqt net/minecraft/world/level/biome/BiomeBase +cqt$b net/minecraft/world/level/biome/BiomeBase$ClimateSettings +cqt$c net/minecraft/world/level/biome/BiomeBase$Precipitation +cqt$d net/minecraft/world/level/biome/BiomeBase$TemperatureModifier +cqu net/minecraft/world/level/biome/BiomeSettingsGeneration +cqv net/minecraft/world/level/biome/BiomeManager +cqv$a net/minecraft/world/level/biome/BiomeManager$Provider +cqw net/minecraft/world/level/biome/BiomeResolver +cqx net/minecraft/world/level/biome/WorldChunkManager +cqy net/minecraft/world/level/biome/BiomeSources +cqz net/minecraft/world/level/biome/BiomeFog +cqz$b net/minecraft/world/level/biome/BiomeFog$GrassColor +cr net/minecraft/advancements/critereon/CriterionConditionPlayer +cra net/minecraft/world/level/biome/Biomes +crb net/minecraft/world/level/biome/WorldChunkManagerCheckerBoard +crc net/minecraft/world/level/biome/Climate +crc$f net/minecraft/world/level/biome/Climate$Sampler +crd net/minecraft/world/level/biome/FeatureSorter +cre net/minecraft/world/level/biome/WorldChunkManagerHell +crf net/minecraft/world/level/biome/BiomeSettingsMobs +crg net/minecraft/world/level/biome/WorldChunkManagerMultiNoise +crh net/minecraft/world/level/biome/MultiNoiseBiomeSourceParameterList +cri net/minecraft/world/level/biome/MultiNoiseBiomeSourceParameterLists +crj net/minecraft/world/level/biome/OverworldBiomeBuilder +crk net/minecraft/world/level/biome/WorldChunkManagerTheEnd +crm net/minecraft/world/level/block/BlockBannerAbstract +crn net/minecraft/world/level/block/AbstractCandleBlock +cro net/minecraft/world/level/block/AbstractCauldronBlock +crp net/minecraft/world/level/block/BlockChestAbstract +crq net/minecraft/world/level/block/BlockFurnace +crr net/minecraft/world/level/block/BlockGlassAbstract +crs net/minecraft/world/level/block/BlockSkullAbstract +crt net/minecraft/world/level/block/BlockAir +cru net/minecraft/world/level/block/AmethystBlock +crv net/minecraft/world/level/block/AmethystClusterBlock +crw net/minecraft/world/level/block/BlockAnvil +crx net/minecraft/world/level/block/BlockStemAttached +cry net/minecraft/world/level/block/AzaleaBlock +crz net/minecraft/world/level/block/BlockBambooSapling +cs net/minecraft/advancements/critereon/PlayerTrigger +csa net/minecraft/world/level/block/BlockBamboo +csb net/minecraft/world/level/block/BlockBanner +csc net/minecraft/world/level/block/BlockBarrel +csd net/minecraft/world/level/block/BlockBarrier +cse net/minecraft/world/level/block/BlockCoralFanAbstract +csf net/minecraft/world/level/block/BlockCoralDead +csg net/minecraft/world/level/block/BlockCoralBase +csh net/minecraft/world/level/block/BlockCoralFanWallAbstract +csi net/minecraft/world/level/block/BlockTileEntity +csj net/minecraft/world/level/block/BlockFireAbstract +csk net/minecraft/world/level/block/BlockPressurePlateAbstract +csl net/minecraft/world/level/block/BlockMinecartTrackAbstract +csm net/minecraft/world/level/block/IBeaconBeam +csn net/minecraft/world/level/block/BlockBeacon +cso net/minecraft/world/level/block/BlockBed +csp net/minecraft/world/level/block/BlockBeehive +csq net/minecraft/world/level/block/BlockBeetroot +csr net/minecraft/world/level/block/BlockBell +css net/minecraft/world/level/block/BigDripleafBlock +cst net/minecraft/world/level/block/BigDripleafStemBlock +csu net/minecraft/world/level/block/BlockBlastFurnace +csv net/minecraft/world/level/block/Block +csw net/minecraft/world/level/block/Blocks +csx net/minecraft/world/level/block/IBlockFragilePlantElement +csy net/minecraft/world/level/block/BlockBrewingStand +csz net/minecraft/world/level/block/BrushableBlock +ct net/minecraft/advancements/critereon/RecipeCraftedTrigger +cta net/minecraft/world/level/block/BlockBubbleColumn +ctb net/minecraft/world/level/block/IFluidSource +ctc net/minecraft/world/level/block/BuddingAmethystBlock +ctd net/minecraft/world/level/block/BlockPlant +cte net/minecraft/world/level/block/BlockButtonAbstract +ctf net/minecraft/world/level/block/BlockCactus +ctg net/minecraft/world/level/block/BlockCake +cth net/minecraft/world/level/block/CalibratedSculkSensorBlock +cti net/minecraft/world/level/block/BlockCampfire +ctj net/minecraft/world/level/block/CandleBlock +ctk net/minecraft/world/level/block/CandleCakeBlock +ctl net/minecraft/world/level/block/CarpetBlock +ctm net/minecraft/world/level/block/BlockCarrots +ctn net/minecraft/world/level/block/BlockCartographyTable +cto net/minecraft/world/level/block/BlockPumpkinCarved +ctp net/minecraft/world/level/block/BlockCauldron +ctq net/minecraft/world/level/block/CaveVines +ctr net/minecraft/world/level/block/CaveVinesBlock +cts net/minecraft/world/level/block/CaveVinesPlantBlock +ctt net/minecraft/world/level/block/CeilingHangingSignBlock +ctu net/minecraft/world/level/block/BlockChain +ctv net/minecraft/world/level/block/ChangeOverTimeBlock +ctw net/minecraft/world/level/block/CherryLeavesBlock +ctx net/minecraft/world/level/block/BlockChest +cty net/minecraft/world/level/block/ChiseledBookShelfBlock +ctz net/minecraft/world/level/block/BlockChorusFlower +cu net/minecraft/advancements/critereon/CriterionTriggerRecipeUnlocked +cua net/minecraft/world/level/block/BlockChorusFruit +cub net/minecraft/world/level/block/BlockCocoa +cuc net/minecraft/world/level/block/BlockCommand +cud net/minecraft/world/level/block/BlockRedstoneComparator +cue net/minecraft/world/level/block/BlockComposter +cue$a net/minecraft/world/level/block/BlockComposter$ContainerEmpty +cue$b net/minecraft/world/level/block/BlockComposter$ContainerInput +cue$c net/minecraft/world/level/block/BlockComposter$ContainerOutput +cuf net/minecraft/world/level/block/BlockConcretePowder +cug net/minecraft/world/level/block/BlockConduit +cuh net/minecraft/world/level/block/BlockCoral +cui net/minecraft/world/level/block/BlockCoralFan +cuj net/minecraft/world/level/block/BlockCoralPlant +cuk net/minecraft/world/level/block/BlockCoralFanWall +cul net/minecraft/world/level/block/BlockWorkbench +cum net/minecraft/world/level/block/BlockCrops +cun net/minecraft/world/level/block/BlockTall +cuo net/minecraft/world/level/block/BlockCryingObsidian +cup net/minecraft/world/level/block/BlockDaylightDetector +cuq net/minecraft/world/level/block/BlockDeadBush +cur net/minecraft/world/level/block/DecoratedPotBlock +cus net/minecraft/world/level/block/BlockMinecartDetector +cut net/minecraft/world/level/block/BlockDiodeAbstract +cuu net/minecraft/world/level/block/BlockDirectional +cuv net/minecraft/world/level/block/BlockGrassPath +cuw net/minecraft/world/level/block/BlockDispenser +cux net/minecraft/world/level/block/BlockDoor +cuy net/minecraft/world/level/block/DoubleBlockFinder +cuy$a net/minecraft/world/level/block/DoubleBlockFinder$BlockType +cuy$b net/minecraft/world/level/block/DoubleBlockFinder$Combiner +cuy$c net/minecraft/world/level/block/DoubleBlockFinder$Result +cuy$c$a net/minecraft/world/level/block/DoubleBlockFinder$Result$Double +cuy$c$b net/minecraft/world/level/block/DoubleBlockFinder$Result$Single +cuz net/minecraft/world/level/block/BlockTallPlant +cv net/minecraft/advancements/critereon/CriterionTriggerShotCrossbow +cva net/minecraft/world/level/block/BlockDragonEgg +cvb net/minecraft/world/level/block/DropExperienceBlock +cvc net/minecraft/world/level/block/BlockDropper +cvd net/minecraft/world/level/block/BlockEnchantmentTable +cve net/minecraft/world/level/block/BlockEndGateway +cvf net/minecraft/world/level/block/BlockEnderPortal +cvg net/minecraft/world/level/block/BlockEnderPortalFrame +cvh net/minecraft/world/level/block/BlockEndRod +cvi net/minecraft/world/level/block/BlockEnderChest +cvj net/minecraft/world/level/block/ITileEntity +cvk net/minecraft/world/level/block/EquipableCarvedPumpkinBlock +cvl net/minecraft/world/level/block/BlockAttachable +cvm net/minecraft/world/level/block/Fallable +cvn net/minecraft/world/level/block/BlockFalling +cvo net/minecraft/world/level/block/BlockSoil +cvp net/minecraft/world/level/block/BlockFence +cvq net/minecraft/world/level/block/BlockFenceGate +cvr net/minecraft/world/level/block/BlockFire +cvs net/minecraft/world/level/block/BlockFletchingTable +cvt net/minecraft/world/level/block/BlockFlowers +cvu net/minecraft/world/level/block/BlockFlowerPot +cvv net/minecraft/world/level/block/FrogspawnBlock +cvw net/minecraft/world/level/block/BlockIceFrost +cvx net/minecraft/world/level/block/BlockFungi +cvy net/minecraft/world/level/block/BlockFurnaceFurace +cvz net/minecraft/world/level/block/GameMasterBlock +cw net/minecraft/advancements/critereon/CriterionTriggerAbstract +cwa net/minecraft/world/level/block/BlockGlass +cwb net/minecraft/world/level/block/BlockGlazedTerracotta +cwc net/minecraft/world/level/block/GlowLichenBlock +cwd net/minecraft/world/level/block/BlockGrass +cwe net/minecraft/world/level/block/BlockGravel +cwf net/minecraft/world/level/block/BlockGrindstone +cwg net/minecraft/world/level/block/BlockGrowingAbstract +cwh net/minecraft/world/level/block/BlockGrowingStem +cwi net/minecraft/world/level/block/BlockGrowingTop +cwj net/minecraft/world/level/block/BlockHalfTransparent +cwk net/minecraft/world/level/block/HangingRootsBlock +cwl net/minecraft/world/level/block/BlockHay +cwm net/minecraft/world/level/block/BlockHoney +cwn net/minecraft/world/level/block/BlockHopper +cwo net/minecraft/world/level/block/BlockFacingHorizontal +cwp net/minecraft/world/level/block/BlockHugeMushroom +cwq net/minecraft/world/level/block/BlockIce +cwr net/minecraft/world/level/block/BlockMonsterEggs +cws net/minecraft/world/level/block/InfestedRotatedPillarBlock +cwt net/minecraft/world/level/block/BlockIronBars +cwu net/minecraft/world/level/block/BlockJigsaw +cwv net/minecraft/world/level/block/BlockJukeBox +cww net/minecraft/world/level/block/BlockKelp +cwx net/minecraft/world/level/block/BlockKelpPlant +cwy net/minecraft/world/level/block/BlockLadder +cwz net/minecraft/world/level/block/BlockLantern +cx net/minecraft/advancements/critereon/CriterionSlideDownBlock +cxa net/minecraft/world/level/block/LavaCauldronBlock +cxb net/minecraft/world/level/block/LayeredCauldronBlock +cxc net/minecraft/world/level/block/BlockLeaves +cxd net/minecraft/world/level/block/BlockLectern +cxf net/minecraft/world/level/block/BlockLever +cxg net/minecraft/world/level/block/LightBlock +cxh net/minecraft/world/level/block/LightningRodBlock +cxi net/minecraft/world/level/block/BlockFluids +cxj net/minecraft/world/level/block/IFluidContainer +cxk net/minecraft/world/level/block/BlockLoom +cxl net/minecraft/world/level/block/BlockMagma +cxm net/minecraft/world/level/block/MangroveLeavesBlock +cxn net/minecraft/world/level/block/MangrovePropaguleBlock +cxo net/minecraft/world/level/block/MangroveRootsBlock +cxp net/minecraft/world/level/block/BlockMelon +cxq net/minecraft/world/level/block/EnumBlockMirror +cxr net/minecraft/world/level/block/MossBlock +cxs net/minecraft/world/level/block/MudBlock +cxt net/minecraft/world/level/block/MultifaceBlock +cxu net/minecraft/world/level/block/MultifaceSpreader +cxv net/minecraft/world/level/block/BlockMushroom +cxw net/minecraft/world/level/block/BlockMycel +cxx net/minecraft/world/level/block/BlockPortal +cxy net/minecraft/world/level/block/BlockNetherSprouts +cxz net/minecraft/world/level/block/BlockNetherVinesUtil +cy net/minecraft/advancements/critereon/SlimePredicate +cya net/minecraft/world/level/block/BlockNetherWart +cyb net/minecraft/world/level/block/BlockNetherrack +cyc net/minecraft/world/level/block/BlockNote +cyd net/minecraft/world/level/block/BlockNylium +cye net/minecraft/world/level/block/BlockObserver +cyf net/minecraft/world/level/block/PiglinWallSkullBlock +cyg net/minecraft/world/level/block/PinkPetalsBlock +cyh net/minecraft/world/level/block/BlockSprawling +cyi net/minecraft/world/level/block/PitcherCropBlock +cyj net/minecraft/world/level/block/BlockSkullPlayer +cyk net/minecraft/world/level/block/BlockSkullPlayerWall +cyl net/minecraft/world/level/block/PointedDripstoneBlock +cym net/minecraft/world/level/block/BlockPotatoes +cyn net/minecraft/world/level/block/PowderSnowBlock +cyo net/minecraft/world/level/block/PowderSnowCauldronBlock +cyp net/minecraft/world/level/block/BlockPowered +cyq net/minecraft/world/level/block/BlockPoweredRail +cyr net/minecraft/world/level/block/BlockPressurePlateBinary +cyr$a net/minecraft/world/level/block/BlockPressurePlateBinary$EnumMobType +cys net/minecraft/world/level/block/BlockPumpkin +cyt net/minecraft/world/level/block/BlockMinecartTrack +cyu net/minecraft/world/level/block/MinecartTrackLogic +cyv net/minecraft/world/level/block/BlockRedstoneOre +cyw net/minecraft/world/level/block/BlockRedstoneWire +cyx net/minecraft/world/level/block/BlockRedstoneLamp +cyy net/minecraft/world/level/block/BlockRedstoneTorch +cyy$a net/minecraft/world/level/block/BlockRedstoneTorch$RedstoneUpdateInfo +cyz net/minecraft/world/level/block/BlockRedstoneTorchWall +cz net/minecraft/advancements/critereon/StartRidingTrigger +cza net/minecraft/world/level/block/EnumRenderType +czb net/minecraft/world/level/block/BlockRepeater +czc net/minecraft/world/level/block/BlockRespawnAnchor +czd net/minecraft/world/level/block/RodBlock +cze net/minecraft/world/level/block/RootedDirtBlock +czf net/minecraft/world/level/block/BlockRoots +czg net/minecraft/world/level/block/BlockRotatable +czh net/minecraft/world/level/block/EnumBlockRotation +czi net/minecraft/world/level/block/BlockSand +czj net/minecraft/world/level/block/BlockSapling +czk net/minecraft/world/level/block/BlockScaffolding +czl net/minecraft/world/level/block/SculkBehaviour +czm net/minecraft/world/level/block/SculkBlock +czn net/minecraft/world/level/block/SculkCatalystBlock +czo net/minecraft/world/level/block/SculkSensorBlock +czp net/minecraft/world/level/block/SculkShriekerBlock +czq net/minecraft/world/level/block/SculkSpreader +czr net/minecraft/world/level/block/SculkVeinBlock +czs net/minecraft/world/level/block/BlockSeaPickle +czt net/minecraft/world/level/block/SeagrassBlock +czu net/minecraft/world/level/block/BlockShulkerBox +czv net/minecraft/world/level/block/BlockSign +czw net/minecraft/world/level/block/IBlockWaterlogged +czx net/minecraft/world/level/block/BlockSkull +czx$b net/minecraft/world/level/block/BlockSkull$Type +czy net/minecraft/world/level/block/BlockStepAbstract +czz net/minecraft/world/level/block/BlockSlime +da net/minecraft/advancements/critereon/CriterionTriggerProperties +daa net/minecraft/world/level/block/SmallDripleafBlock +dab net/minecraft/world/level/block/BlockSmithingTable +dac net/minecraft/world/level/block/BlockSmoker +dad net/minecraft/world/level/block/SnifferEggBlock +dae net/minecraft/world/level/block/BlockSnow +daf net/minecraft/world/level/block/BlockDirtSnow +dag net/minecraft/world/level/block/BlockSoulFire +dah net/minecraft/world/level/block/BlockSlowSand +dai net/minecraft/world/level/block/SoundEffectType +daj net/minecraft/world/level/block/BlockMobSpawner +dak net/minecraft/world/level/block/BlockSponge +dal net/minecraft/world/level/block/SporeBlossomBlock +dam net/minecraft/world/level/block/BlockDirtSnowSpreadable +dan net/minecraft/world/level/block/BlockStainedGlass +dao net/minecraft/world/level/block/BlockStainedGlassPane +dap net/minecraft/world/level/block/BlockStairs +daq net/minecraft/world/level/block/BlockFloorSign +dar net/minecraft/world/level/block/BlockStem +das net/minecraft/world/level/block/BlockStemmed +dat net/minecraft/world/level/block/BlockStonecutter +dau net/minecraft/world/level/block/BlockStructure +dav net/minecraft/world/level/block/BlockStructureVoid +daw net/minecraft/world/level/block/BlockReed +dax net/minecraft/world/level/block/EnumBlockSupport +day net/minecraft/world/level/block/SuspiciousEffectHolder +daz net/minecraft/world/level/block/BlockSweetBerryBush +db net/minecraft/advancements/critereon/CriterionTriggerSummonedEntity +dba net/minecraft/world/level/block/BlockTallPlantFlower +dbb net/minecraft/world/level/block/BlockLongGrass +dbc net/minecraft/world/level/block/TallSeagrassBlock +dbd net/minecraft/world/level/block/BlockTarget +dbe net/minecraft/world/level/block/TintedGlassBlock +dbf net/minecraft/world/level/block/BlockTNT +dbg net/minecraft/world/level/block/BlockTorch +dbh net/minecraft/world/level/block/TorchflowerCropBlock +dbi net/minecraft/world/level/block/BlockTrapdoor +dbj net/minecraft/world/level/block/BlockChestTrapped +dbk net/minecraft/world/level/block/BlockTripwire +dbl net/minecraft/world/level/block/BlockTripwireHook +dbm net/minecraft/world/level/block/BlockTurtleEgg +dbn net/minecraft/world/level/block/BlockTwistingVines +dbo net/minecraft/world/level/block/BlockTwistingVinesPlant +dbp net/minecraft/world/level/block/BlockVine +dbq net/minecraft/world/level/block/BlockBannerWall +dbr net/minecraft/world/level/block/BlockCobbleWall +dbs net/minecraft/world/level/block/WallHangingSignBlock +dbt net/minecraft/world/level/block/BlockWallSign +dbu net/minecraft/world/level/block/BlockSkullWall +dbv net/minecraft/world/level/block/BlockTorchWall +dbw net/minecraft/world/level/block/BlockWaterLily +dbx net/minecraft/world/level/block/WeatheringCopper +dby net/minecraft/world/level/block/WeatheringCopperFullBlock +dbz net/minecraft/world/level/block/WeatheringCopperSlabBlock +dc net/minecraft/advancements/critereon/TagPredicate +dca net/minecraft/world/level/block/WeatheringCopperStairBlock +dcb net/minecraft/world/level/block/BlockWeb +dcc net/minecraft/world/level/block/BlockWeepingVines +dcd net/minecraft/world/level/block/BlockWeepingVinesPlant +dce net/minecraft/world/level/block/BlockPressurePlateWeighted +dcf net/minecraft/world/level/block/BlockWetSponge +dcg net/minecraft/world/level/block/BlockWitherRose +dch net/minecraft/world/level/block/BlockWitherSkull +dci net/minecraft/world/level/block/BlockWitherSkullWall +dcj net/minecraft/world/level/block/BlockCarpet +dck net/minecraft/world/level/block/entity/TileEntityFurnace +dcl net/minecraft/world/level/block/entity/TileEntityBanner +dcm net/minecraft/world/level/block/entity/EnumBannerPatternType +dcn net/minecraft/world/level/block/entity/BannerPatterns +dco net/minecraft/world/level/block/entity/TileEntityBarrel +dcp net/minecraft/world/level/block/entity/TileEntityContainer +dcq net/minecraft/world/level/block/entity/TileEntityBeacon +dcq$a net/minecraft/world/level/block/entity/TileEntityBeacon$BeaconColorTracker +dcr net/minecraft/world/level/block/entity/TileEntityBed +dcs net/minecraft/world/level/block/entity/TileEntityBeehive +dcs$a net/minecraft/world/level/block/entity/TileEntityBeehive$HiveBee +dcs$b net/minecraft/world/level/block/entity/TileEntityBeehive$ReleaseStatus +dct net/minecraft/world/level/block/entity/TileEntityBell +dcu net/minecraft/world/level/block/entity/TileEntityBlastFurnace +dcv net/minecraft/world/level/block/entity/TileEntity +dcw net/minecraft/world/level/block/entity/BlockEntityTicker +dcx net/minecraft/world/level/block/entity/TileEntityTypes +dcy net/minecraft/world/level/block/entity/TileEntityBrewingStand +dcz net/minecraft/world/level/block/entity/BrushableBlockEntity +dd net/minecraft/advancements/critereon/CriterionTriggerTamedAnimal +dda net/minecraft/world/level/block/entity/CalibratedSculkSensorBlockEntity +ddb net/minecraft/world/level/block/entity/TileEntityCampfire +ddc net/minecraft/world/level/block/entity/TileEntityChest +ddd net/minecraft/world/level/block/entity/ChestLidController +dde net/minecraft/world/level/block/entity/ChiseledBookShelfBlockEntity +ddf net/minecraft/world/level/block/entity/TileEntityCommand +ddf$a net/minecraft/world/level/block/entity/TileEntityCommand$Type +ddg net/minecraft/world/level/block/entity/TileEntityComparator +ddh net/minecraft/world/level/block/entity/TileEntityConduit +ddi net/minecraft/world/level/block/entity/ContainerOpenersCounter +ddj net/minecraft/world/level/block/entity/TileEntityLightDetector +ddk net/minecraft/world/level/block/entity/DecoratedPotBlockEntity +ddk$a net/minecraft/world/level/block/entity/DecoratedPotBlockEntity$Decoration +ddl net/minecraft/world/level/block/entity/DecoratedPotPatterns +ddm net/minecraft/world/level/block/entity/TileEntityDispenser +ddn net/minecraft/world/level/block/entity/TileEntityDropper +ddo net/minecraft/world/level/block/entity/TileEntityEnchantTable +ddp net/minecraft/world/level/block/entity/TileEntityEnderChest +ddq net/minecraft/world/level/block/entity/TileEntityFurnaceFurnace +ddr net/minecraft/world/level/block/entity/HangingSignBlockEntity +dds net/minecraft/world/level/block/entity/IHopper +ddt net/minecraft/world/level/block/entity/TileEntityHopper +ddu net/minecraft/world/level/block/entity/TileEntityJigsaw +ddu$a net/minecraft/world/level/block/entity/TileEntityJigsaw$JointType +ddv net/minecraft/world/level/block/entity/TileEntityJukeBox +ddw net/minecraft/world/level/block/entity/TileEntityLectern +ddx net/minecraft/world/level/block/entity/LidBlockEntity +ddy net/minecraft/world/level/block/entity/TileEntityLootable +ddz net/minecraft/world/level/block/entity/SculkCatalystBlockEntity +ddz$a net/minecraft/world/level/block/entity/SculkCatalystBlockEntity$CatalystListener +de net/minecraft/advancements/critereon/CriterionTriggerTargetHit +dea net/minecraft/world/level/block/entity/SculkSensorBlockEntity +deb net/minecraft/world/level/block/entity/SculkShriekerBlockEntity +dec net/minecraft/world/level/block/entity/TileEntityShulkerBox +dec$a net/minecraft/world/level/block/entity/TileEntityShulkerBox$AnimationPhase +ded net/minecraft/world/level/block/entity/TileEntitySign +dee net/minecraft/world/level/block/entity/SignText +def net/minecraft/world/level/block/entity/TileEntitySkull +deg net/minecraft/world/level/block/entity/TileEntitySmoker +deh net/minecraft/world/level/block/entity/TileEntityMobSpawner +dei net/minecraft/world/level/block/entity/TileEntityStructure +dei$a net/minecraft/world/level/block/entity/TileEntityStructure$UpdateType +dej net/minecraft/world/level/block/entity/TileEntityEndGateway +dek net/minecraft/world/level/block/entity/TileEntityEnderPortal +del net/minecraft/world/level/block/entity/TickingBlockEntity +dem net/minecraft/world/level/block/entity/TileEntityChestTrapped +deo net/minecraft/world/level/block/grower/WorldGenMegaTreeProvider +dep net/minecraft/world/level/block/grower/WorldGenTreeProvider +deq net/minecraft/world/level/block/grower/WorldGenTreeProviderAcacia +der net/minecraft/world/level/block/grower/AzaleaTreeGrower +des net/minecraft/world/level/block/grower/WorldGenTreeProviderBirch +det net/minecraft/world/level/block/grower/CherryTreeGrower +deu net/minecraft/world/level/block/grower/WorldGenMegaTreeProviderDarkOak +dev net/minecraft/world/level/block/grower/WorldGenMegaTreeProviderJungle +dew net/minecraft/world/level/block/grower/MangroveTreeGrower +dex net/minecraft/world/level/block/grower/WorldGenTreeProviderOak +dey net/minecraft/world/level/block/grower/WorldGenTreeProviderSpruce +df net/minecraft/advancements/critereon/CriterionTriggerVillagerTrade +dfb net/minecraft/world/level/block/piston/BlockPistonMoving +dfc net/minecraft/world/level/block/piston/BlockPiston +dfd net/minecraft/world/level/block/piston/BlockPistonExtension +dfe net/minecraft/world/level/block/piston/PistonUtil +dff net/minecraft/world/level/block/piston/TileEntityPiston +dfg net/minecraft/world/level/block/piston/PistonExtendsChecker +dfi net/minecraft/world/level/block/state/BlockBase +dfi$a net/minecraft/world/level/block/state/BlockBase$BlockData +dfi$a$a net/minecraft/world/level/block/state/BlockBase$BlockData$Cache +dfi$c net/minecraft/world/level/block/state/BlockBase$EnumRandomOffset +dfi$d net/minecraft/world/level/block/state/BlockBase$Info +dfj net/minecraft/world/level/block/state/IBlockData +dfk net/minecraft/world/level/block/state/BlockStateList +dfl net/minecraft/world/level/block/state/IBlockDataHolder +dfn net/minecraft/world/level/block/state/pattern/ShapeDetectorBlock +dfo net/minecraft/world/level/block/state/pattern/ShapeDetector +dfo$a net/minecraft/world/level/block/state/pattern/ShapeDetector$BlockLoader +dfo$b net/minecraft/world/level/block/state/pattern/ShapeDetector$ShapeDetectorCollection +dfp net/minecraft/world/level/block/state/pattern/ShapeDetectorBuilder +dfr net/minecraft/world/level/block/state/predicate/BlockPredicate +dfs net/minecraft/world/level/block/state/predicate/BlockStatePredicate +dfu net/minecraft/world/level/block/state/properties/BlockPropertyAttachPosition +dfv net/minecraft/world/level/block/state/properties/BlockPropertyBambooSize +dfw net/minecraft/world/level/block/state/properties/BlockPropertyBedPart +dfx net/minecraft/world/level/block/state/properties/BlockPropertyBellAttach +dfy net/minecraft/world/level/block/state/properties/BlockSetType +dfz net/minecraft/world/level/block/state/properties/BlockProperties +dg net/minecraft/advancements/critereon/CriterionTriggerUsedEnderEye +dga net/minecraft/world/level/block/state/properties/BlockStateBoolean +dgb net/minecraft/world/level/block/state/properties/BlockPropertyChestType +dgc net/minecraft/world/level/block/state/properties/BlockPropertyComparatorMode +dgd net/minecraft/world/level/block/state/properties/BlockStateDirection +dge net/minecraft/world/level/block/state/properties/BlockPropertyDoorHinge +dgf net/minecraft/world/level/block/state/properties/BlockPropertyDoubleBlockHalf +dgg net/minecraft/world/level/block/state/properties/DripstoneThickness +dgh net/minecraft/world/level/block/state/properties/BlockStateEnum +dgi net/minecraft/world/level/block/state/properties/BlockPropertyHalf +dgj net/minecraft/world/level/block/state/properties/BlockStateInteger +dgk net/minecraft/world/level/block/state/properties/BlockPropertyInstrument +dgl net/minecraft/world/level/block/state/properties/BlockPropertyPistonType +dgm net/minecraft/world/level/block/state/properties/IBlockState +dgn net/minecraft/world/level/block/state/properties/BlockPropertyTrackPosition +dgo net/minecraft/world/level/block/state/properties/BlockPropertyRedstoneSide +dgp net/minecraft/world/level/block/state/properties/RotationSegment +dgq net/minecraft/world/level/block/state/properties/SculkSensorPhase +dgr net/minecraft/world/level/block/state/properties/BlockPropertySlabType +dgs net/minecraft/world/level/block/state/properties/BlockPropertyStairsShape +dgt net/minecraft/world/level/block/state/properties/BlockPropertyStructureMode +dgu net/minecraft/world/level/block/state/properties/Tilt +dgv net/minecraft/world/level/block/state/properties/BlockPropertyWallHeight +dgw net/minecraft/world/level/block/state/properties/BlockPropertyWood +dgy net/minecraft/world/level/border/IWorldBorderListener +dgz net/minecraft/world/level/border/BorderStatus +dh net/minecraft/advancements/critereon/CriterionTriggerUsedTotem +dha net/minecraft/world/level/border/WorldBorder +dhc net/minecraft/world/level/chunk/BlockColumn +dhd net/minecraft/world/level/chunk/BulkSectionAccess +dhe net/minecraft/world/level/chunk/CarvingMask +dhf net/minecraft/world/level/chunk/IChunkAccess +dhg net/minecraft/world/level/chunk/ChunkGenerator +dhh net/minecraft/world/level/chunk/ChunkGeneratorStructureState +dhi net/minecraft/world/level/chunk/ChunkGenerators +dhj net/minecraft/world/level/chunk/IChunkProvider +dhk net/minecraft/world/level/chunk/ChunkStatus +dhk$a net/minecraft/world/level/chunk/ChunkStatus$Type +dhl net/minecraft/world/level/chunk/NibbleArray +dhm net/minecraft/world/level/chunk/ChunkEmpty +dhn net/minecraft/world/level/chunk/DataPaletteGlobal +dho net/minecraft/world/level/chunk/DataPaletteHash +dhp net/minecraft/world/level/chunk/ProtoChunkExtension +dhq net/minecraft/world/level/chunk/Chunk +dhq$b net/minecraft/world/level/chunk/Chunk$EnumTileEntityState +dhr net/minecraft/world/level/chunk/ChunkSection +dhs net/minecraft/world/level/chunk/LightChunk +dht net/minecraft/world/level/chunk/ILightAccess +dhu net/minecraft/world/level/chunk/DataPaletteLinear +dhv net/minecraft/world/level/chunk/MissingPaletteEntryException +dhw net/minecraft/world/level/chunk/DataPalette +dhx net/minecraft/world/level/chunk/DataPaletteExpandable +dhy net/minecraft/world/level/chunk/DataPaletteBlock +dhz net/minecraft/world/level/chunk/PalettedContainerRO +di net/minecraft/advancements/critereon/UsingItemTrigger +dia net/minecraft/world/level/chunk/ProtoChunk +dib net/minecraft/world/level/chunk/SingleValuePalette +dic net/minecraft/world/level/chunk/StructureAccess +did net/minecraft/world/level/chunk/ChunkConverter +did$b net/minecraft/world/level/chunk/ChunkConverter$Type +dif net/minecraft/world/level/chunk/storage/ChunkScanAccess +dig net/minecraft/world/level/chunk/storage/ChunkRegionLoader +dih net/minecraft/world/level/chunk/storage/IChunkLoader +dii net/minecraft/world/level/chunk/storage/EntityStorage +dij net/minecraft/world/level/chunk/storage/IOWorker +dij$b net/minecraft/world/level/chunk/storage/IOWorker$Priority +dik net/minecraft/world/level/chunk/storage/RegionFileBitSet +dil net/minecraft/world/level/chunk/storage/RegionFile +dil$a net/minecraft/world/level/chunk/storage/RegionFile$ChunkBuffer +dim net/minecraft/world/level/chunk/storage/RegionFileCache +din net/minecraft/world/level/chunk/storage/RegionFileCompression +dio net/minecraft/world/level/chunk/storage/RegionFileSection +diq net/minecraft/world/level/dimension/BuiltinDimensionTypes +dis net/minecraft/world/level/dimension/DimensionManager +dit net/minecraft/world/level/dimension/WorldDimension +diu net/minecraft/world/level/dimension/end/EnumDragonRespawn +div net/minecraft/world/level/dimension/end/EnderDragonBattle +diy net/minecraft/world/level/entity/ChunkEntities +diz net/minecraft/world/level/entity/ChunkStatusUpdateListener +dj net/minecraft/advancements/critereon/CriterionConditionRange +dja net/minecraft/world/level/entity/EntityAccess +djb net/minecraft/world/level/entity/EntityInLevelCallback +djc net/minecraft/world/level/entity/EntityLookup +djd net/minecraft/world/level/entity/EntityPersistentStorage +dje net/minecraft/world/level/entity/EntitySection +djf net/minecraft/world/level/entity/EntitySectionStorage +djg net/minecraft/world/level/entity/EntityTickList +djh net/minecraft/world/level/entity/EntityTypeTest +dji net/minecraft/world/level/entity/LevelCallback +djj net/minecraft/world/level/entity/LevelEntityGetter +djk net/minecraft/world/level/entity/LevelEntityGetterAdapter +djl net/minecraft/world/level/entity/PersistentEntitySectionManager +djn net/minecraft/world/level/entity/Visibility +djp net/minecraft/world/level/gameevent/BlockPositionSource +djq net/minecraft/world/level/gameevent/DynamicGameEventListener +djr net/minecraft/world/level/gameevent/EntityPositionSource +djs net/minecraft/world/level/gameevent/EuclideanGameEventListenerRegistry +djt net/minecraft/world/level/gameevent/GameEvent +dju net/minecraft/world/level/gameevent/GameEventDispatcher +djv net/minecraft/world/level/gameevent/GameEventListener +djw net/minecraft/world/level/gameevent/GameEventListenerRegistry +djx net/minecraft/world/level/gameevent/PositionSource +djy net/minecraft/world/level/gameevent/PositionSourceType +dka net/minecraft/world/level/gameevent/vibrations/VibrationInfo +dkb net/minecraft/world/level/gameevent/vibrations/VibrationSelector +dkc net/minecraft/world/level/gameevent/vibrations/VibrationSystem +dke net/minecraft/world/level/levelgen/Aquifer +dkf net/minecraft/world/level/levelgen/Beardifier +dkg net/minecraft/world/level/levelgen/BelowZeroRetrogen +dkh net/minecraft/world/level/levelgen/BitRandomSource +dki net/minecraft/world/level/levelgen/Column +dkj net/minecraft/world/level/levelgen/ChunkProviderDebug +dkl net/minecraft/world/level/levelgen/DensityFunction +dkm net/minecraft/world/level/levelgen/DensityFunctions +dkn net/minecraft/world/level/levelgen/ChunkProviderFlat +dko net/minecraft/world/level/levelgen/WorldGenStage +dko$a net/minecraft/world/level/levelgen/WorldGenStage$Features +dko$b net/minecraft/world/level/levelgen/WorldGenStage$Decoration +dkp net/minecraft/world/level/levelgen/GeodeBlockSettings +dkq net/minecraft/world/level/levelgen/GeodeCrackSettings +dkr net/minecraft/world/level/levelgen/GeodeLayerSettings +dks net/minecraft/world/level/levelgen/HeightMap +dks$a net/minecraft/world/level/levelgen/HeightMap$Type +dks$b net/minecraft/world/level/levelgen/HeightMap$Use +dkt net/minecraft/world/level/levelgen/LegacyRandomSource +dku net/minecraft/world/level/levelgen/MarsagliaPolarGaussian +dkv net/minecraft/world/level/levelgen/ChunkGeneratorAbstract +dkw net/minecraft/world/level/levelgen/NoiseChunk +dkx net/minecraft/world/level/levelgen/GeneratorSettingBase +dky net/minecraft/world/level/levelgen/NoiseRouter +dkz net/minecraft/world/level/levelgen/NoiseRouterData +dla net/minecraft/world/level/levelgen/NoiseSettings +dlb net/minecraft/world/level/levelgen/Noises +dlc net/minecraft/world/level/levelgen/OreVeinifier +dld net/minecraft/world/level/levelgen/MobSpawnerPatrol +dle net/minecraft/world/level/levelgen/MobSpawnerPhantom +dlf net/minecraft/world/level/levelgen/PositionalRandomFactory +dlg net/minecraft/world/level/levelgen/RandomState +dlh net/minecraft/world/level/levelgen/RandomSupport +dli net/minecraft/world/level/levelgen/SingleThreadedRandomSource +dlj net/minecraft/world/level/levelgen/SurfaceRules +dlk net/minecraft/world/level/levelgen/SurfaceSystem +dll net/minecraft/world/level/levelgen/ThreadSafeLegacyRandomSource +dlm net/minecraft/world/level/levelgen/VerticalAnchor +dln net/minecraft/world/level/levelgen/WorldDimensions +dlo net/minecraft/world/level/levelgen/GeneratorSettings +dlp net/minecraft/world/level/levelgen/WorldGenerationContext +dlq net/minecraft/world/level/levelgen/WorldOptions +dlr net/minecraft/world/level/levelgen/SeededRandom +dls net/minecraft/world/level/levelgen/Xoroshiro128PlusPlus +dlt net/minecraft/world/level/levelgen/XoroshiroRandomSource +dlu net/minecraft/world/level/levelgen/blending/Blender +dlv net/minecraft/world/level/levelgen/blending/BlendingData +dlx net/minecraft/world/level/levelgen/blockpredicates/AllOfPredicate +dly net/minecraft/world/level/levelgen/blockpredicates/AnyOfPredicate +dlz net/minecraft/world/level/levelgen/blockpredicates/BlockPredicate +dm net/minecraft/commands/CommandExceptionProvider +dma net/minecraft/world/level/levelgen/blockpredicates/BlockPredicateType +dmb net/minecraft/world/level/levelgen/blockpredicates/CombiningPredicate +dmc net/minecraft/world/level/levelgen/blockpredicates/HasSturdyFacePredicate +dmd net/minecraft/world/level/levelgen/blockpredicates/InsideWorldBoundsPredicate +dme net/minecraft/world/level/levelgen/blockpredicates/MatchingBlockTagPredicate +dmf net/minecraft/world/level/levelgen/blockpredicates/MatchingBlocksPredicate +dmg net/minecraft/world/level/levelgen/blockpredicates/MatchingFluidsPredicate +dmh net/minecraft/world/level/levelgen/blockpredicates/NotPredicate +dmi net/minecraft/world/level/levelgen/blockpredicates/ReplaceablePredicate +dmj net/minecraft/world/level/levelgen/blockpredicates/SolidPredicate +dmk net/minecraft/world/level/levelgen/blockpredicates/StateTestingPredicate +dml net/minecraft/world/level/levelgen/blockpredicates/TrueBlockPredicate +dmm net/minecraft/world/level/levelgen/blockpredicates/WouldSurvivePredicate +dmo net/minecraft/world/level/levelgen/carver/CanyonCarverConfiguration +dmp net/minecraft/world/level/levelgen/carver/WorldGenCanyon +dmq net/minecraft/world/level/levelgen/carver/WorldGenCarverConfiguration +dmr net/minecraft/world/level/levelgen/carver/CarverDebugSettings +dms net/minecraft/world/level/levelgen/carver/CarvingContext +dmt net/minecraft/world/level/levelgen/carver/CaveCarverConfiguration +dmu net/minecraft/world/level/levelgen/carver/WorldGenCaves +dmv net/minecraft/world/level/levelgen/carver/WorldGenCarverWrapper +dmw net/minecraft/world/level/levelgen/carver/WorldGenCavesHell +dmx net/minecraft/world/level/levelgen/carver/WorldGenCarverAbstract +dmz net/minecraft/world/level/levelgen/feature/WorldGenMushrooms +dn net/minecraft/commands/CommandBuildContext +dna net/minecraft/world/level/levelgen/feature/WorldGenFeatureBamboo +dnb net/minecraft/world/level/levelgen/feature/WorldGenFeatureBasaltColumns +dnc net/minecraft/world/level/levelgen/feature/WorldGenFeatureBasaltPillar +dnd net/minecraft/world/level/levelgen/feature/WorldGenTaigaStructure +dne net/minecraft/world/level/levelgen/feature/BlockColumnFeature +dnf net/minecraft/world/level/levelgen/feature/WorldGenFeatureBlockPile +dng net/minecraft/world/level/levelgen/feature/WorldGenFeatureBlueIce +dnh net/minecraft/world/level/levelgen/feature/WorldGenBonusChest +dni net/minecraft/world/level/levelgen/feature/WorldGenFeatureChorusPlant +dnj net/minecraft/world/level/levelgen/feature/WorldGenFeatureConfigured +dnk net/minecraft/world/level/levelgen/feature/WorldGenFeatureCoralClaw +dnl net/minecraft/world/level/levelgen/feature/WorldGenFeatureCoral +dnm net/minecraft/world/level/levelgen/feature/WorldGenFeatureCoralMushroom +dnn net/minecraft/world/level/levelgen/feature/WorldGenFeatureCoralTree +dno net/minecraft/world/level/levelgen/feature/WorldGenFeatureDelta +dnp net/minecraft/world/level/levelgen/feature/WorldGenDesertWell +dnq net/minecraft/world/level/levelgen/feature/DiskFeature +dnr net/minecraft/world/level/levelgen/feature/DripstoneClusterFeature +dns net/minecraft/world/level/levelgen/feature/DripstoneUtils +dnt net/minecraft/world/level/levelgen/feature/WorldGenEndGateway +dnu net/minecraft/world/level/levelgen/feature/WorldGenEndIsland +dnv net/minecraft/world/level/levelgen/feature/WorldGenEndTrophy +dnw net/minecraft/world/level/levelgen/feature/WorldGenerator +dny net/minecraft/world/level/levelgen/feature/FeaturePlaceContext +dnz net/minecraft/world/level/levelgen/feature/WorldGenFeatureFill +doa net/minecraft/world/level/levelgen/feature/WorldGenFossils +dob net/minecraft/world/level/levelgen/feature/FossilFeatureConfiguration +doc net/minecraft/world/level/levelgen/feature/GeodeFeature +dod net/minecraft/world/level/levelgen/feature/WorldGenLightStone1 +doe net/minecraft/world/level/levelgen/feature/WorldGenHugeMushroomBrown +dof net/minecraft/world/level/levelgen/feature/WorldGenFeatureHugeFungiConfiguration +dog net/minecraft/world/level/levelgen/feature/WorldGenFeatureHugeFungi +doh net/minecraft/world/level/levelgen/feature/WorldGenHugeMushroomRed +doi net/minecraft/world/level/levelgen/feature/WorldGenPackedIce2 +doj net/minecraft/world/level/levelgen/feature/WorldGenFeatureIceburg +dok net/minecraft/world/level/levelgen/feature/WorldGenFeatureKelp +dol net/minecraft/world/level/levelgen/feature/WorldGenLakes +dom net/minecraft/world/level/levelgen/feature/LargeDripstoneFeature +don net/minecraft/world/level/levelgen/feature/WorldGenDungeons +doo net/minecraft/world/level/levelgen/feature/MultifaceGrowthFeature +dop net/minecraft/world/level/levelgen/feature/WorldGenFeatureNetherForestVegetation +doq net/minecraft/world/level/levelgen/feature/WorldGenFeatureEmpty +dor net/minecraft/world/level/levelgen/feature/WorldGenMinable +dos net/minecraft/world/level/levelgen/feature/PointedDripstoneFeature +dot net/minecraft/world/level/levelgen/feature/WorldGenFeatureChoice +dou net/minecraft/world/level/levelgen/feature/WorldGenFeatureRandomPatch +dov net/minecraft/world/level/levelgen/feature/WorldGenFeatureRandomChoice +dow net/minecraft/world/level/levelgen/feature/WorldGenFeatureNetherrackReplaceBlobs +dox net/minecraft/world/level/levelgen/feature/WorldGenFeatureReplaceBlock +doy net/minecraft/world/level/levelgen/feature/RootSystemFeature +doz net/minecraft/world/level/levelgen/feature/ScatteredOreFeature +dp net/minecraft/commands/CustomFunction +dpa net/minecraft/world/level/levelgen/feature/SculkPatchFeature +dpb net/minecraft/world/level/levelgen/feature/WorldGenFeatureSeaPickel +dpc net/minecraft/world/level/levelgen/feature/WorldGenFeatureSeaGrass +dpd net/minecraft/world/level/levelgen/feature/WorldGenFeatureBlock +dpe net/minecraft/world/level/levelgen/feature/WorldGenFeatureRandom2Configuration +dpf net/minecraft/world/level/levelgen/feature/WorldGenFeatureIceSnow +dpg net/minecraft/world/level/levelgen/feature/WorldGenEnder +dpg$a net/minecraft/world/level/levelgen/feature/WorldGenEnder$Spike +dph net/minecraft/world/level/levelgen/feature/WorldGenLiquids +dpi net/minecraft/world/level/levelgen/feature/WorldGenTrees +dpj net/minecraft/world/level/levelgen/feature/WorldGenFeatureTwistingVines +dpk net/minecraft/world/level/levelgen/feature/UnderwaterMagmaFeature +dpl net/minecraft/world/level/levelgen/feature/VegetationPatchFeature +dpm net/minecraft/world/level/levelgen/feature/WorldGenVines +dpn net/minecraft/world/level/levelgen/feature/WorldGenFeatureEndPlatform +dpo net/minecraft/world/level/levelgen/feature/WaterloggedVegetationPatchFeature +dpp net/minecraft/world/level/levelgen/feature/WorldGenFeatureWeepingVines +dpq net/minecraft/world/level/levelgen/feature/WeightedPlacedFeature +dpr net/minecraft/world/level/levelgen/feature/configurations/BlockColumnConfiguration +dps net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureBlockPileConfiguration +dpt net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureLakeConfiguration +dpu net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureBasaltColumnsConfiguration +dpv net/minecraft/world/level/levelgen/feature/configurations/WorldGenDecoratorFrequencyConfiguration +dpw net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureDeltaConfiguration +dpx net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureCircleConfiguration +dpy net/minecraft/world/level/levelgen/feature/configurations/DripstoneClusterConfiguration +dpz net/minecraft/world/level/levelgen/feature/configurations/WorldGenEndGatewayConfiguration +dq net/minecraft/commands/CommandException +dqa net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureConfiguration +dqb net/minecraft/world/level/levelgen/feature/configurations/GeodeConfiguration +dqc net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureMushroomConfiguration +dqd net/minecraft/world/level/levelgen/feature/configurations/LargeDripstoneConfiguration +dqe net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureFillConfiguration +dqf net/minecraft/world/level/levelgen/feature/configurations/MultifaceGrowthConfiguration +dqg net/minecraft/world/level/levelgen/feature/configurations/NetherForestVegetationConfig +dqh net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureEmptyConfiguration +dqi net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureOreConfiguration +dqj net/minecraft/world/level/levelgen/feature/configurations/PointedDripstoneConfiguration +dqk net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureConfigurationChance +dql net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureChoiceConfiguration +dqm net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureRandomChoiceConfiguration +dqn net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureRandomPatchConfiguration +dqo net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureReplaceBlockConfiguration +dqp net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureRadiusConfiguration +dqq net/minecraft/world/level/levelgen/feature/configurations/RootSystemConfiguration +dqr net/minecraft/world/level/levelgen/feature/configurations/SculkPatchConfiguration +dqs net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureBlockConfiguration +dqt net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureRandom2 +dqu net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureEndSpikeConfiguration +dqv net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureHellFlowingLavaConfiguration +dqw net/minecraft/world/level/levelgen/feature/configurations/WorldGenFeatureTreeConfiguration +dqx net/minecraft/world/level/levelgen/feature/configurations/TwistingVinesConfig +dqy net/minecraft/world/level/levelgen/feature/configurations/UnderwaterMagmaConfiguration +dqz net/minecraft/world/level/levelgen/feature/configurations/VegetationPatchConfiguration +dr net/minecraft/commands/CommandSigningContext +drb net/minecraft/world/level/levelgen/feature/featuresize/FeatureSize +drc net/minecraft/world/level/levelgen/feature/featuresize/FeatureSizeType +drd net/minecraft/world/level/levelgen/feature/featuresize/FeatureSizeThreeLayers +dre net/minecraft/world/level/levelgen/feature/featuresize/FeatureSizeTwoLayers +drg net/minecraft/world/level/levelgen/feature/foliageplacers/WorldGenFoilagePlacerAcacia +drh net/minecraft/world/level/levelgen/feature/foliageplacers/WorldGenFoilagePlacerBlob +dri net/minecraft/world/level/levelgen/feature/foliageplacers/WorldGenFoilagePlacerBush +drj net/minecraft/world/level/levelgen/feature/foliageplacers/CherryFoliagePlacer +drk net/minecraft/world/level/levelgen/feature/foliageplacers/WorldGenFoilagePlacerDarkOak +drl net/minecraft/world/level/levelgen/feature/foliageplacers/WorldGenFoilagePlacerFancy +drm net/minecraft/world/level/levelgen/feature/foliageplacers/WorldGenFoilagePlacer +drn net/minecraft/world/level/levelgen/feature/foliageplacers/WorldGenFoilagePlacers +dro net/minecraft/world/level/levelgen/feature/foliageplacers/WorldGenFoilagePlacerJungle +drp net/minecraft/world/level/levelgen/feature/foliageplacers/WorldGenFoilagePlacerMegaPine +drq net/minecraft/world/level/levelgen/feature/foliageplacers/WorldGenFoilagePlacerPine +drr net/minecraft/world/level/levelgen/feature/foliageplacers/RandomSpreadFoliagePlacer +drs net/minecraft/world/level/levelgen/feature/foliageplacers/WorldGenFoilagePlacerSpruce +drv net/minecraft/world/level/levelgen/feature/rootplacers/AboveRootPlacement +drw net/minecraft/world/level/levelgen/feature/rootplacers/MangroveRootPlacement +drx net/minecraft/world/level/levelgen/feature/rootplacers/MangroveRootPlacer +dry net/minecraft/world/level/levelgen/feature/rootplacers/RootPlacer +drz net/minecraft/world/level/levelgen/feature/rootplacers/RootPlacerType +ds net/minecraft/commands/ICommandListener +dsb net/minecraft/world/level/levelgen/feature/stateproviders/WorldGenFeatureStateProvider +dsc net/minecraft/world/level/levelgen/feature/stateproviders/WorldGenFeatureStateProviders +dsd net/minecraft/world/level/levelgen/feature/stateproviders/DualNoiseProvider +dse net/minecraft/world/level/levelgen/feature/stateproviders/NoiseBasedStateProvider +dsf net/minecraft/world/level/levelgen/feature/stateproviders/NoiseProvider +dsg net/minecraft/world/level/levelgen/feature/stateproviders/NoiseThresholdProvider +dsh net/minecraft/world/level/levelgen/feature/stateproviders/RandomizedIntStateProvider +dsi net/minecraft/world/level/levelgen/feature/stateproviders/WorldGenFeatureStateProviderRotatedBlock +dsj net/minecraft/world/level/levelgen/feature/stateproviders/RuleBasedBlockStateProvider +dsk net/minecraft/world/level/levelgen/feature/stateproviders/WorldGenFeatureStateProviderSimpl +dsl net/minecraft/world/level/levelgen/feature/stateproviders/WorldGenFeatureStateProviderWeighted +dsn net/minecraft/world/level/levelgen/feature/treedecorators/WorldGenFeatureTreeAlterGround +dso net/minecraft/world/level/levelgen/feature/treedecorators/AttachedToLeavesDecorator +dsp net/minecraft/world/level/levelgen/feature/treedecorators/WorldGenFeatureTreeBeehive +dsq net/minecraft/world/level/levelgen/feature/treedecorators/WorldGenFeatureTreeCocoa +dsr net/minecraft/world/level/levelgen/feature/treedecorators/WorldGenFeatureTreeVineLeaves +dss net/minecraft/world/level/levelgen/feature/treedecorators/WorldGenFeatureTree +dst net/minecraft/world/level/levelgen/feature/treedecorators/WorldGenFeatureTrees +dsu net/minecraft/world/level/levelgen/feature/treedecorators/WorldGenFeatureTreeVineTrunk +dsw net/minecraft/world/level/levelgen/feature/trunkplacers/BendingTrunkPlacer +dsx net/minecraft/world/level/levelgen/feature/trunkplacers/CherryTrunkPlacer +dsy net/minecraft/world/level/levelgen/feature/trunkplacers/TrunkPlacerDarkOak +dsz net/minecraft/world/level/levelgen/feature/trunkplacers/TrunkPlacerFancy +dt net/minecraft/commands/CommandListenerWrapper +dta net/minecraft/world/level/levelgen/feature/trunkplacers/TrunkPlacerForking +dtb net/minecraft/world/level/levelgen/feature/trunkplacers/TrunkPlacerGiant +dtc net/minecraft/world/level/levelgen/feature/trunkplacers/TrunkPlacerMegaJungle +dtd net/minecraft/world/level/levelgen/feature/trunkplacers/TrunkPlacerStraight +dte net/minecraft/world/level/levelgen/feature/trunkplacers/TrunkPlacer +dtf net/minecraft/world/level/levelgen/feature/trunkplacers/TrunkPlacers +dtg net/minecraft/world/level/levelgen/feature/trunkplacers/UpwardsBranchingTrunkPlacer +dti net/minecraft/world/level/levelgen/flat/WorldGenFlatLayerInfo +dtj net/minecraft/world/level/levelgen/flat/FlatLevelGeneratorPreset +dtk net/minecraft/world/level/levelgen/flat/FlatLevelGeneratorPresets +dtl net/minecraft/world/level/levelgen/flat/GeneratorSettingsFlat +dtn net/minecraft/world/level/levelgen/heightproviders/BiasedToBottomHeight +dto net/minecraft/world/level/levelgen/heightproviders/ConstantHeight +dtp net/minecraft/world/level/levelgen/heightproviders/HeightProvider +dtq net/minecraft/world/level/levelgen/heightproviders/HeightProviderType +dtr net/minecraft/world/level/levelgen/heightproviders/TrapezoidHeight +dts net/minecraft/world/level/levelgen/heightproviders/UniformHeight +dtt net/minecraft/world/level/levelgen/heightproviders/VeryBiasedToBottomHeight +dtu net/minecraft/world/level/levelgen/heightproviders/WeightedListHeight +dtw net/minecraft/world/level/levelgen/material/MaterialRuleList +du net/minecraft/commands/CommandDispatcher +du$a net/minecraft/commands/CommandDispatcher$ServerType +dua net/minecraft/world/level/levelgen/placement/BiomeFilter +dub net/minecraft/world/level/levelgen/placement/BlockPredicateFilter +duc net/minecraft/world/level/levelgen/placement/CarvingMaskPlacement +dud net/minecraft/world/level/levelgen/placement/CaveSurface +due net/minecraft/world/level/levelgen/placement/CountOnEveryLayerPlacement +duf net/minecraft/world/level/levelgen/placement/CountPlacement +dug net/minecraft/world/level/levelgen/placement/EnvironmentScanPlacement +duh net/minecraft/world/level/levelgen/placement/HeightRangePlacement +dui net/minecraft/world/level/levelgen/placement/HeightmapPlacement +duj net/minecraft/world/level/levelgen/placement/InSquarePlacement +duk net/minecraft/world/level/levelgen/placement/NoiseBasedCountPlacement +dul net/minecraft/world/level/levelgen/placement/NoiseThresholdCountPlacement +dum net/minecraft/world/level/levelgen/placement/PlacedFeature +dun net/minecraft/world/level/levelgen/placement/PlacementContext +duo net/minecraft/world/level/levelgen/placement/PlacementFilter +dup net/minecraft/world/level/levelgen/placement/PlacementModifier +duq net/minecraft/world/level/levelgen/placement/PlacementModifierType +dur net/minecraft/world/level/levelgen/placement/RandomOffsetPlacement +dus net/minecraft/world/level/levelgen/placement/RarityFilter +dut net/minecraft/world/level/levelgen/placement/RepeatingPlacement +duu net/minecraft/world/level/levelgen/placement/SurfaceRelativeThresholdFilter +duv net/minecraft/world/level/levelgen/placement/SurfaceWaterDepthFilter +dux net/minecraft/world/level/levelgen/presets/WorldPreset +duy net/minecraft/world/level/levelgen/presets/WorldPresets +dv net/minecraft/commands/FunctionInstantiationException +dva net/minecraft/world/level/levelgen/structure/StructureBoundingBox +dvb net/minecraft/world/level/levelgen/structure/BuiltinStructureSets +dvc net/minecraft/world/level/levelgen/structure/BuiltinStructures +dvd net/minecraft/world/level/levelgen/structure/PersistentStructureLegacy +dve net/minecraft/world/level/levelgen/structure/WorldGenFeaturePillagerOutpostPoolPiece +dvg net/minecraft/world/level/levelgen/structure/WorldGenScatteredPiece +dvh net/minecraft/world/level/levelgen/structure/SinglePieceStructure +dvi net/minecraft/world/level/levelgen/structure/Structure +dvj net/minecraft/world/level/levelgen/structure/StructureCheck +dvk net/minecraft/world/level/levelgen/structure/StructureCheckResult +dvl net/minecraft/world/level/levelgen/structure/PersistentIndexed +dvm net/minecraft/world/level/levelgen/structure/StructurePiece +dvm$a net/minecraft/world/level/levelgen/structure/StructurePiece$StructurePieceBlockSelector +dvn net/minecraft/world/level/levelgen/structure/StructurePieceAccessor +dvo net/minecraft/world/level/levelgen/structure/StructureSet +dvp net/minecraft/world/level/levelgen/structure/StructureSpawnOverride +dvq net/minecraft/world/level/levelgen/structure/StructureStart +dvr net/minecraft/world/level/levelgen/structure/StructureType +dvs net/minecraft/world/level/levelgen/structure/DefinedStructurePiece +dvt net/minecraft/world/level/levelgen/structure/TerrainAdjustment +dvx net/minecraft/world/level/levelgen/structure/pieces/PiecesContainer +dvy net/minecraft/world/level/levelgen/structure/pieces/StructurePieceSerializationContext +dvz net/minecraft/world/level/levelgen/structure/pieces/WorldGenFeatureStructurePieceType +dw net/minecraft/commands/ICompletionProvider +dwa net/minecraft/world/level/levelgen/structure/pieces/StructurePiecesBuilder +dwc net/minecraft/world/level/levelgen/structure/placement/ConcentricRingsStructurePlacement +dwd net/minecraft/world/level/levelgen/structure/placement/RandomSpreadStructurePlacement +dwe net/minecraft/world/level/levelgen/structure/placement/RandomSpreadType +dwf net/minecraft/world/level/levelgen/structure/placement/StructurePlacement +dwg net/minecraft/world/level/levelgen/structure/placement/StructurePlacementType +dwi net/minecraft/world/level/levelgen/structure/pools/WorldGenFeatureDefinedStructurePoolEmpty +dwj net/minecraft/world/level/levelgen/structure/pools/WorldGenFeatureDefinedStructurePoolFeature +dwk net/minecraft/world/level/levelgen/structure/pools/WorldGenFeatureDefinedStructureJigsawJunction +dwl net/minecraft/world/level/levelgen/structure/pools/WorldGenFeatureDefinedStructureJigsawPlacement +dwm net/minecraft/world/level/levelgen/structure/pools/WorldGenFeatureDefinedStructurePoolLegacySingle +dwn net/minecraft/world/level/levelgen/structure/pools/WorldGenFeatureDefinedStructurePoolList +dwo net/minecraft/world/level/levelgen/structure/pools/WorldGenFeatureDefinedStructurePoolSingle +dwp net/minecraft/world/level/levelgen/structure/pools/WorldGenFeatureDefinedStructurePoolStructure +dwq net/minecraft/world/level/levelgen/structure/pools/WorldGenFeatureDefinedStructurePools +dwr net/minecraft/world/level/levelgen/structure/pools/WorldGenFeatureDefinedStructurePoolTemplate +dwr$a net/minecraft/world/level/levelgen/structure/pools/WorldGenFeatureDefinedStructurePoolTemplate$Matching +dwt net/minecraft/world/level/levelgen/structure/structures/BuriedTreasurePieces +dwu net/minecraft/world/level/levelgen/structure/structures/BuriedTreasureStructure +dwv net/minecraft/world/level/levelgen/structure/structures/DesertPyramidPiece +dww net/minecraft/world/level/levelgen/structure/structures/DesertPyramidStructure +dwx net/minecraft/world/level/levelgen/structure/structures/EndCityPieces +dwy net/minecraft/world/level/levelgen/structure/structures/EndCityStructure +dwz net/minecraft/world/level/levelgen/structure/structures/IglooPieces +dx net/minecraft/commands/arguments/ArgumentAngle +dxa net/minecraft/world/level/levelgen/structure/structures/IglooStructure +dxb net/minecraft/world/level/levelgen/structure/structures/JigsawStructure +dxc net/minecraft/world/level/levelgen/structure/structures/JungleTemplePiece +dxd net/minecraft/world/level/levelgen/structure/structures/JungleTempleStructure +dxe net/minecraft/world/level/levelgen/structure/structures/MineshaftPieces +dxf net/minecraft/world/level/levelgen/structure/structures/MineshaftStructure +dxg net/minecraft/world/level/levelgen/structure/structures/NetherFortressPieces +dxh net/minecraft/world/level/levelgen/structure/structures/NetherFortressStructure +dxi net/minecraft/world/level/levelgen/structure/structures/NetherFossilPieces +dxj net/minecraft/world/level/levelgen/structure/structures/NetherFossilStructure +dxk net/minecraft/world/level/levelgen/structure/structures/OceanMonumentPieces +dxl net/minecraft/world/level/levelgen/structure/structures/OceanMonumentStructure +dxm net/minecraft/world/level/levelgen/structure/structures/OceanRuinPieces +dxn net/minecraft/world/level/levelgen/structure/structures/OceanRuinStructure +dxo net/minecraft/world/level/levelgen/structure/structures/RuinedPortalPiece +dxp net/minecraft/world/level/levelgen/structure/structures/RuinedPortalStructure +dxq net/minecraft/world/level/levelgen/structure/structures/ShipwreckPieces +dxr net/minecraft/world/level/levelgen/structure/structures/ShipwreckStructure +dxs net/minecraft/world/level/levelgen/structure/structures/StrongholdPieces +dxt net/minecraft/world/level/levelgen/structure/structures/StrongholdStructure +dxu net/minecraft/world/level/levelgen/structure/structures/SwampHutPiece +dxv net/minecraft/world/level/levelgen/structure/structures/SwampHutStructure +dxw net/minecraft/world/level/levelgen/structure/structures/WoodlandMansionPieces +dxx net/minecraft/world/level/levelgen/structure/structures/WoodlandMansionStructure +dxz net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureTestTrue +dy net/minecraft/commands/arguments/ArgumentSignatures +dya net/minecraft/world/level/levelgen/structure/templatesystem/PosRuleTestAxisAlignedLinear +dyb net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureProcessorBlackstoneReplace +dyc net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureProcessorBlockAge +dyd net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureProcessorBlockIgnore +dye net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureTestBlock +dyf net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureProcessorRotation +dyg net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureTestBlockState +dyh net/minecraft/world/level/levelgen/structure/templatesystem/CappedProcessor +dyi net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureProcessorGravity +dyj net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureProcessorJigsawReplacement +dyk net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureProcessorLavaSubmergedBlock +dyl net/minecraft/world/level/levelgen/structure/templatesystem/PosRuleTestLinear +dym net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureProcessorNop +dyn net/minecraft/world/level/levelgen/structure/templatesystem/PosRuleTestTrue +dyo net/minecraft/world/level/levelgen/structure/templatesystem/PosRuleTest +dyp net/minecraft/world/level/levelgen/structure/templatesystem/PosRuleTestType +dyq net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureProcessorPredicates +dyr net/minecraft/world/level/levelgen/structure/templatesystem/ProtectedBlockProcessor +dys net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureTestRandomBlock +dyt net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureTestRandomBlockState +dyu net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureProcessorRule +dyv net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureRuleTest +dyw net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureRuleTestType +dyx net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureInfo +dyy net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureProcessor +dyz net/minecraft/world/level/levelgen/structure/templatesystem/ProcessorList +dz net/minecraft/commands/arguments/ArgumentChatFormat +dza net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureStructureProcessorType +dzb net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructure +dzb$c net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructure$BlockInfo +dzb$d net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructure$EntityInfo +dzc net/minecraft/world/level/levelgen/structure/templatesystem/StructureTemplateManager +dzd net/minecraft/world/level/levelgen/structure/templatesystem/DefinedStructureTestTag +dzf net/minecraft/world/level/levelgen/structure/templatesystem/rule/blockentity/AppendLoot +dzg net/minecraft/world/level/levelgen/structure/templatesystem/rule/blockentity/AppendStatic +dzh net/minecraft/world/level/levelgen/structure/templatesystem/rule/blockentity/Clear +dzi net/minecraft/world/level/levelgen/structure/templatesystem/rule/blockentity/Passthrough +dzj net/minecraft/world/level/levelgen/structure/templatesystem/rule/blockentity/RuleBlockEntityModifier +dzk net/minecraft/world/level/levelgen/structure/templatesystem/rule/blockentity/RuleBlockEntityModifierType +dzm net/minecraft/world/level/levelgen/synth/BlendedNoise +dzn net/minecraft/world/level/levelgen/synth/NoiseGeneratorPerlin +dzo net/minecraft/world/level/levelgen/synth/NoiseUtils +dzp net/minecraft/world/level/levelgen/synth/NoiseGeneratorNormal +dzq net/minecraft/world/level/levelgen/synth/NoiseGeneratorOctaves +dzr net/minecraft/world/level/levelgen/synth/NoiseGenerator3 +dzs net/minecraft/world/level/levelgen/synth/NoiseGenerator3Handler +dzu net/minecraft/world/level/lighting/LightEngineBlock +dzv net/minecraft/world/level/lighting/LightEngineStorageBlock +dzw net/minecraft/world/level/lighting/ChunkSkyLightSources +dzx net/minecraft/world/level/lighting/LightEngineStorageArray +dzy net/minecraft/world/level/lighting/LightEngineGraph +dzz net/minecraft/world/level/lighting/LightEngineLayerEventListener +dzz$a net/minecraft/world/level/lighting/LightEngineLayerEventListener$Void +e com/mojang/math/GivensParameters +ea net/minecraft/commands/arguments/ArgumentChatComponent +eaa net/minecraft/world/level/lighting/LightEngineStorage +eab net/minecraft/world/level/lighting/LevelLightEngine +eac net/minecraft/world/level/lighting/LeveledPriorityQueue +ead net/minecraft/world/level/lighting/LightEngine +eae net/minecraft/world/level/lighting/ILightEngine +eaf net/minecraft/world/level/lighting/LightEngineSky +eag net/minecraft/world/level/lighting/LightEngineStorageSky +eaj net/minecraft/world/level/material/FluidTypeEmpty +eak net/minecraft/world/level/material/FluidTypeFlowing +eal net/minecraft/world/level/material/FluidType +eam net/minecraft/world/level/material/Fluid +ean net/minecraft/world/level/material/FluidTypes +eap net/minecraft/world/level/material/FluidTypeLava +eaq net/minecraft/world/level/material/MaterialMapColor +ear net/minecraft/world/level/material/EnumPistonReaction +eas net/minecraft/world/level/material/FluidTypeWater +eav net/minecraft/world/level/pathfinder/AmphibiousNodeEvaluator +eaw net/minecraft/world/level/pathfinder/Path +eax net/minecraft/world/level/pathfinder/PathType +eay net/minecraft/world/level/pathfinder/PathfinderFlying +eaz net/minecraft/world/level/pathfinder/PathPoint +eb net/minecraft/commands/arguments/ArgumentNBTTag +eba net/minecraft/world/level/pathfinder/PathfinderAbstract +ebb net/minecraft/world/level/pathfinder/PathEntity +ebc net/minecraft/world/level/pathfinder/PathMode +ebd net/minecraft/world/level/pathfinder/Pathfinder +ebe net/minecraft/world/level/pathfinder/PathfinderWater +ebf net/minecraft/world/level/pathfinder/PathDestination +ebg net/minecraft/world/level/pathfinder/PathfinderNormal +ebi net/minecraft/world/level/portal/PortalTravelAgent +ebj net/minecraft/world/level/portal/ShapeDetectorShape +ebk net/minecraft/world/level/portal/BlockPortalShape +ebm net/minecraft/world/level/redstone/CollectingNeighborUpdater +ebo net/minecraft/world/level/redstone/NeighborUpdater +ebr net/minecraft/world/level/saveddata/PersistentBase +ebs net/minecraft/world/level/saveddata/maps/MapIconBanner +ebt net/minecraft/world/level/saveddata/maps/MapIcon +ebt$a net/minecraft/world/level/saveddata/maps/MapIcon$Type +ebu net/minecraft/world/level/saveddata/maps/WorldMapFrame +ebv net/minecraft/world/level/saveddata/maps/PersistentIdCounts +ebw net/minecraft/world/level/saveddata/maps/WorldMap +ebw$a net/minecraft/world/level/saveddata/maps/WorldMap$WorldMapHumanTracker +ebz net/minecraft/world/level/storage/PersistentCommandStorage +ec net/minecraft/commands/arguments/ArgumentDimension +eca net/minecraft/world/level/storage/DataVersion +ecb net/minecraft/world/level/storage/SecondaryWorldData +ecc net/minecraft/world/level/storage/WorldPersistentData +ecd net/minecraft/world/level/storage/WorldData +ece net/minecraft/world/level/storage/SavedFile +ecf net/minecraft/world/level/storage/LevelStorageException +ecg net/minecraft/world/level/storage/Convertable +ecg$c net/minecraft/world/level/storage/Convertable$ConversionSession +ech net/minecraft/world/level/storage/WorldInfo +eci net/minecraft/world/level/storage/LevelVersion +ecj net/minecraft/world/level/storage/WorldNBTStorage +eck net/minecraft/world/level/storage/WorldDataServer +ecl net/minecraft/world/level/storage/IWorldDataServer +ecm net/minecraft/world/level/storage/SaveData +ecn net/minecraft/world/level/storage/WorldDataMutable +eco net/minecraft/world/level/storage/loot/LootTables +ecp net/minecraft/world/level/storage/loot/IntRange +ecq net/minecraft/world/level/storage/loot/LootTableInfo +ecq$a net/minecraft/world/level/storage/loot/LootTableInfo$Builder +ecq$b net/minecraft/world/level/storage/loot/LootTableInfo$EntityTarget +ecr net/minecraft/world/level/storage/loot/LootItemUser +ecs net/minecraft/world/level/storage/loot/LootDataId +ect net/minecraft/world/level/storage/loot/LootDataManager +ecu net/minecraft/world/level/storage/loot/LootDataResolver +ecv net/minecraft/world/level/storage/loot/LootDataType +ecw net/minecraft/world/level/storage/loot/LootParams +ecx net/minecraft/world/level/storage/loot/LootSelector +ecy net/minecraft/world/level/storage/loot/LootTable +ecz net/minecraft/world/level/storage/loot/LootCollector +ed net/minecraft/commands/arguments/ArgumentAnchor +ed$a net/minecraft/commands/arguments/ArgumentAnchor$Anchor +eda net/minecraft/world/level/storage/loot/entries/LootEntryAlternatives +edb net/minecraft/world/level/storage/loot/entries/LootEntryChildren +edc net/minecraft/world/level/storage/loot/entries/LootEntryChildrenAbstract +edd net/minecraft/world/level/storage/loot/entries/LootSelectorDynamic +ede net/minecraft/world/level/storage/loot/entries/LootSelectorEmpty +edf net/minecraft/world/level/storage/loot/entries/LootEntryGroup +edg net/minecraft/world/level/storage/loot/entries/LootItem +edh net/minecraft/world/level/storage/loot/entries/LootEntries +edi net/minecraft/world/level/storage/loot/entries/LootEntry +edj net/minecraft/world/level/storage/loot/entries/LootEntryAbstract +edk net/minecraft/world/level/storage/loot/entries/LootEntryType +edl net/minecraft/world/level/storage/loot/entries/LootSelectorEntry +edm net/minecraft/world/level/storage/loot/entries/LootSelectorLootTable +edn net/minecraft/world/level/storage/loot/entries/LootEntrySequence +edo net/minecraft/world/level/storage/loot/entries/LootSelectorTag +edq net/minecraft/world/level/storage/loot/functions/LootItemFunctionApplyBonus +edr net/minecraft/world/level/storage/loot/functions/LootItemFunctionExplosionDecay +eds net/minecraft/world/level/storage/loot/functions/LootItemFunctionCopyState +edt net/minecraft/world/level/storage/loot/functions/LootItemFunctionCopyName +edt$a net/minecraft/world/level/storage/loot/functions/LootItemFunctionCopyName$Source +edu net/minecraft/world/level/storage/loot/functions/LootItemFunctionCopyNBT +edu$c net/minecraft/world/level/storage/loot/functions/LootItemFunctionCopyNBT$Action +edv net/minecraft/world/level/storage/loot/functions/LootItemFunctionEnchant +edw net/minecraft/world/level/storage/loot/functions/LootEnchantLevel +edx net/minecraft/world/level/storage/loot/functions/LootItemFunctionExplorationMap +edy net/minecraft/world/level/storage/loot/functions/LootItemFunctionFillPlayerHead +edz net/minecraft/world/level/storage/loot/functions/FunctionReference +ee net/minecraft/commands/arguments/ArgumentEntity +ee$a net/minecraft/commands/arguments/ArgumentEntity$Info +ee$a$a net/minecraft/commands/arguments/ArgumentEntity$Info$Template +eea net/minecraft/world/level/storage/loot/functions/LootItemFunctionUser +eeb net/minecraft/world/level/storage/loot/functions/LootItemFunctionLimitCount +eec net/minecraft/world/level/storage/loot/functions/LootItemFunctionConditional +eed net/minecraft/world/level/storage/loot/functions/LootItemFunction +eee net/minecraft/world/level/storage/loot/functions/LootItemFunctionType +eef net/minecraft/world/level/storage/loot/functions/LootItemFunctions +eeg net/minecraft/world/level/storage/loot/functions/LootEnchantFunction +eeh net/minecraft/world/level/storage/loot/functions/SequenceFunction +eei net/minecraft/world/level/storage/loot/functions/LootItemFunctionSetAttribute +eej net/minecraft/world/level/storage/loot/functions/SetBannerPatternFunction +eek net/minecraft/world/level/storage/loot/functions/LootItemFunctionSetContents +eel net/minecraft/world/level/storage/loot/functions/LootItemFunctionSetTable +eem net/minecraft/world/level/storage/loot/functions/SetEnchantmentsFunction +een net/minecraft/world/level/storage/loot/functions/SetInstrumentFunction +eeo net/minecraft/world/level/storage/loot/functions/LootItemFunctionSetCount +eep net/minecraft/world/level/storage/loot/functions/LootItemFunctionSetDamage +eeq net/minecraft/world/level/storage/loot/functions/LootItemFunctionSetLore +eer net/minecraft/world/level/storage/loot/functions/LootItemFunctionSetName +ees net/minecraft/world/level/storage/loot/functions/LootItemFunctionSetTag +eet net/minecraft/world/level/storage/loot/functions/SetPotionFunction +eeu net/minecraft/world/level/storage/loot/functions/LootItemFunctionSetStewEffect +eev net/minecraft/world/level/storage/loot/functions/LootItemFunctionSmelt +eey net/minecraft/world/level/storage/loot/parameters/LootContextParameter +eez net/minecraft/world/level/storage/loot/parameters/LootContextParameterSet +eez$a net/minecraft/world/level/storage/loot/parameters/LootContextParameterSet$Builder +ef net/minecraft/commands/arguments/GameModeArgument +efa net/minecraft/world/level/storage/loot/parameters/LootContextParameterSets +efb net/minecraft/world/level/storage/loot/parameters/LootContextParameters +efd net/minecraft/world/level/storage/loot/predicates/AllOfCondition +efe net/minecraft/world/level/storage/loot/predicates/AnyOfCondition +eff net/minecraft/world/level/storage/loot/predicates/LootItemConditionTableBonus +efg net/minecraft/world/level/storage/loot/predicates/CompositeLootItemCondition +efh net/minecraft/world/level/storage/loot/predicates/LootItemConditionReference +efi net/minecraft/world/level/storage/loot/predicates/LootItemConditionUser +efj net/minecraft/world/level/storage/loot/predicates/LootItemConditionDamageSourceProperties +efk net/minecraft/world/level/storage/loot/predicates/LootItemConditionEntityScore +efl net/minecraft/world/level/storage/loot/predicates/LootItemConditionSurvivesExplosion +efm net/minecraft/world/level/storage/loot/predicates/LootItemConditionInverted +efn net/minecraft/world/level/storage/loot/predicates/LootItemConditionLocationCheck +efo net/minecraft/world/level/storage/loot/predicates/LootItemConditionBlockStateProperty +efp net/minecraft/world/level/storage/loot/predicates/LootItemCondition +efq net/minecraft/world/level/storage/loot/predicates/LootItemConditionType +efr net/minecraft/world/level/storage/loot/predicates/LootItemConditions +efs net/minecraft/world/level/storage/loot/predicates/LootItemConditionEntityProperty +eft net/minecraft/world/level/storage/loot/predicates/LootItemConditionKilledByPlayer +efu net/minecraft/world/level/storage/loot/predicates/LootItemConditionRandomChance +efv net/minecraft/world/level/storage/loot/predicates/LootItemConditionRandomChanceWithLooting +efw net/minecraft/world/level/storage/loot/predicates/LootItemConditionMatchTool +efx net/minecraft/world/level/storage/loot/predicates/LootItemConditionTimeCheck +efy net/minecraft/world/level/storage/loot/predicates/ValueCheckCondition +efz net/minecraft/world/level/storage/loot/predicates/LootItemConditionWeatherCheck +eg net/minecraft/commands/arguments/ArgumentProfile +egb net/minecraft/world/level/storage/loot/providers/nbt/ContextNbtProvider +egc net/minecraft/world/level/storage/loot/providers/nbt/LootNbtProviderType +egd net/minecraft/world/level/storage/loot/providers/nbt/NbtProvider +ege net/minecraft/world/level/storage/loot/providers/nbt/NbtProviders +egf net/minecraft/world/level/storage/loot/providers/nbt/StorageNbtProvider +egh net/minecraft/world/level/storage/loot/providers/number/BinomialDistributionGenerator +egi net/minecraft/world/level/storage/loot/providers/number/ConstantValue +egj net/minecraft/world/level/storage/loot/providers/number/LootNumberProviderType +egk net/minecraft/world/level/storage/loot/providers/number/NumberProvider +egl net/minecraft/world/level/storage/loot/providers/number/NumberProviders +egm net/minecraft/world/level/storage/loot/providers/number/ScoreboardValue +egn net/minecraft/world/level/storage/loot/providers/number/UniformGenerator +egp net/minecraft/world/level/storage/loot/providers/score/ContextScoreboardNameProvider +egq net/minecraft/world/level/storage/loot/providers/score/FixedScoreboardNameProvider +egr net/minecraft/world/level/storage/loot/providers/score/LootScoreProviderType +egs net/minecraft/world/level/storage/loot/providers/score/ScoreboardNameProvider +egt net/minecraft/world/level/storage/loot/providers/score/ScoreboardNameProviders +egw net/minecraft/world/level/timers/CustomFunctionCallback +egx net/minecraft/world/level/timers/CustomFunctionCallbackTag +egy net/minecraft/world/level/timers/CustomFunctionCallbackTimer +egz net/minecraft/world/level/timers/CustomFunctionCallbackTimers +eh net/minecraft/commands/arguments/HeightmapTypeArgument +eha net/minecraft/world/level/timers/CustomFunctionCallbackTimerQueue +ehc net/minecraft/world/level/validation/ContentValidationException +ehd net/minecraft/world/level/validation/DirectoryValidator +ehe net/minecraft/world/level/validation/ForbiddenSymlinkInfo +ehf net/minecraft/world/level/validation/PathAllowList +ehi net/minecraft/world/phys/AxisAlignedBB +ehj net/minecraft/world/phys/MovingObjectPositionBlock +ehk net/minecraft/world/phys/MovingObjectPositionEntity +ehl net/minecraft/world/phys/MovingObjectPosition +ehl$a net/minecraft/world/phys/MovingObjectPosition$EnumMovingObjectType +ehm net/minecraft/world/phys/Vec2F +ehn net/minecraft/world/phys/Vec3D +ehp net/minecraft/world/phys/shapes/VoxelShapeArray +ehq net/minecraft/world/phys/shapes/VoxelShapeBitSet +ehr net/minecraft/world/phys/shapes/OperatorBoolean +ehs net/minecraft/world/phys/shapes/VoxelShapeCollision +eht net/minecraft/world/phys/shapes/VoxelShapeCubePoint +ehu net/minecraft/world/phys/shapes/VoxelShapeCube +ehv net/minecraft/world/phys/shapes/VoxelShapeCubeMerger +ehw net/minecraft/world/phys/shapes/VoxelShapeDiscrete +ehx net/minecraft/world/phys/shapes/VoxelShapeCollisionEntity +ehy net/minecraft/world/phys/shapes/VoxelShapeMergerIdentical +ehz net/minecraft/world/phys/shapes/VoxelShapeMerger +ei net/minecraft/commands/arguments/ArgumentChat +eia net/minecraft/world/phys/shapes/VoxelShapeMergerList +eib net/minecraft/world/phys/shapes/VoxelShapeMergerDisjoint +eic net/minecraft/world/phys/shapes/DoubleListOffset +eid net/minecraft/world/phys/shapes/VoxelShapes +eie net/minecraft/world/phys/shapes/VoxelShapeSlice +eif net/minecraft/world/phys/shapes/VoxelShapeDiscreteSlice +eig net/minecraft/world/phys/shapes/VoxelShape +eii net/minecraft/world/scores/DisplaySlot +eij net/minecraft/world/scores/ScoreboardObjective +eik net/minecraft/world/scores/ScoreboardTeam +eil net/minecraft/world/scores/ScoreboardScore +eim net/minecraft/world/scores/Scoreboard +ein net/minecraft/world/scores/PersistentScoreboard +eio net/minecraft/world/scores/ScoreboardTeamBase +eio$a net/minecraft/world/scores/ScoreboardTeamBase$EnumTeamPush +eio$b net/minecraft/world/scores/ScoreboardTeamBase$EnumNameTagVisibility +eip net/minecraft/world/scores/criteria/IScoreboardCriteria +eip$a net/minecraft/world/scores/criteria/IScoreboardCriteria$EnumScoreboardHealthDisplay +eis net/minecraft/world/ticks/TickListEmpty +eit net/minecraft/world/ticks/ContainerSingleItem +eiu net/minecraft/world/ticks/LevelChunkTicks +eiv net/minecraft/world/ticks/LevelTickAccess +eiw net/minecraft/world/ticks/TickListServer +eix net/minecraft/world/ticks/ProtoChunkTickList +eiy net/minecraft/world/ticks/TickListChunk +eiz net/minecraft/world/ticks/NextTickListEntry +ej net/minecraft/commands/arguments/ArgumentNBTKey +eja net/minecraft/world/ticks/SerializableTickContainer +ejb net/minecraft/world/ticks/TickList +ejc net/minecraft/world/ticks/TickContainerAccess +ejd net/minecraft/world/ticks/TickListPriority +eje net/minecraft/world/ticks/TickListWorldGen +ek net/minecraft/commands/arguments/ArgumentNBTBase +el net/minecraft/commands/arguments/ArgumentScoreboardObjective +em net/minecraft/commands/arguments/ArgumentScoreboardCriteria +en net/minecraft/commands/arguments/ArgumentMathOperation +eo net/minecraft/commands/arguments/ArgumentParticle +ep net/minecraft/commands/arguments/ArgumentCriterionValue +eq net/minecraft/commands/arguments/ResourceArgument +er net/minecraft/commands/arguments/ResourceKeyArgument +es net/minecraft/commands/arguments/ArgumentMinecraftKeyRegistered +et net/minecraft/commands/arguments/ResourceOrTagArgument +eu net/minecraft/commands/arguments/ResourceOrTagKeyArgument +ev net/minecraft/commands/arguments/ArgumentScoreholder +ew net/minecraft/commands/arguments/ArgumentScoreboardSlot +ex net/minecraft/commands/arguments/SignedArgument +ey net/minecraft/commands/arguments/ArgumentInventorySlot +ez net/minecraft/commands/arguments/StringRepresentableArgument +f com/mojang/math/MatrixUtil +fa net/minecraft/commands/arguments/ArgumentScoreboardTeam +fb net/minecraft/commands/arguments/TemplateMirrorArgument +fc net/minecraft/commands/arguments/TemplateRotationArgument +fd net/minecraft/commands/arguments/ArgumentTime +fe net/minecraft/commands/arguments/ArgumentUUID +ff net/minecraft/commands/arguments/blocks/ArgumentTileLocation +fg net/minecraft/commands/arguments/blocks/ArgumentBlockPredicate +fh net/minecraft/commands/arguments/blocks/ArgumentTile +fi net/minecraft/commands/arguments/blocks/ArgumentBlock +fk net/minecraft/commands/arguments/coordinates/ArgumentPosition +fl net/minecraft/commands/arguments/coordinates/ArgumentVec2I +fm net/minecraft/commands/arguments/coordinates/IVectorPosition +fn net/minecraft/commands/arguments/coordinates/ArgumentVectorPosition +fo net/minecraft/commands/arguments/coordinates/ArgumentRotation +fp net/minecraft/commands/arguments/coordinates/ArgumentRotationAxis +fq net/minecraft/commands/arguments/coordinates/ArgumentVec2 +fr net/minecraft/commands/arguments/coordinates/ArgumentVec3 +fs net/minecraft/commands/arguments/coordinates/ArgumentParserPosition +ft net/minecraft/commands/arguments/coordinates/VectorPosition +fv net/minecraft/commands/arguments/item/ArgumentTag +fw net/minecraft/commands/arguments/item/ArgumentItemStack +fx net/minecraft/commands/arguments/item/ArgumentPredicateItemStack +fy net/minecraft/commands/arguments/item/ArgumentParserItemStack +fz net/minecraft/commands/arguments/item/ArgumentItemPredicate +gc net/minecraft/commands/arguments/selector/EntitySelector +gd net/minecraft/commands/arguments/selector/ArgumentParserSelector +ge net/minecraft/commands/arguments/selector/options/PlayerSelector +gi net/minecraft/commands/synchronization/ArgumentTypeInfo +gj net/minecraft/commands/synchronization/ArgumentTypeInfos +gk net/minecraft/commands/synchronization/ArgumentUtils +gl net/minecraft/commands/synchronization/SingletonArgumentInfo +gm net/minecraft/commands/synchronization/CompletionProviders +gn net/minecraft/commands/synchronization/brigadier/DoubleArgumentInfo +go net/minecraft/commands/synchronization/brigadier/FloatArgumentInfo +gp net/minecraft/commands/synchronization/brigadier/IntegerArgumentInfo +gq net/minecraft/commands/synchronization/brigadier/LongArgumentInfo +gr net/minecraft/commands/synchronization/brigadier/ArgumentSerializerString +gu net/minecraft/core/EnumAxisCycle +gw net/minecraft/core/BlockPosition +gw$a net/minecraft/core/BlockPosition$MutableBlockPosition +gx net/minecraft/core/CursorPosition +gy net/minecraft/core/DefaultedMappedRegistry +gz net/minecraft/core/RegistryBlocks +h com/mojang/math/PointGroupO +ha net/minecraft/core/EnumDirection +ha$a net/minecraft/core/EnumDirection$EnumAxis +ha$b net/minecraft/core/EnumDirection$EnumAxisDirection +ha$c net/minecraft/core/EnumDirection$EnumDirectionLimit +hb net/minecraft/core/EnumDirection8 +hc net/minecraft/core/BlockPropertyJigsawOrientation +hd net/minecraft/core/GlobalPos +he net/minecraft/core/Holder +hf net/minecraft/core/HolderGetter +hg net/minecraft/core/HolderLookup +hh net/minecraft/core/HolderOwner +hi net/minecraft/core/HolderSet +hi$c net/minecraft/core/HolderSet$Named +hj net/minecraft/core/Registry +hk net/minecraft/core/RegistryBlockID +hl net/minecraft/core/LayeredRegistryAccess +hm net/minecraft/core/RegistryMaterials +hn net/minecraft/core/NonNullList +ho net/minecraft/core/IPosition +hp net/minecraft/core/QuartPos +hq net/minecraft/core/IRegistry +hr net/minecraft/core/IRegistryCustom +hr$b net/minecraft/core/IRegistryCustom$Dimension +hs net/minecraft/core/RegistryCodecs +ht net/minecraft/core/RegistrySetBuilder +hu net/minecraft/core/RegistrySynchronization +hv net/minecraft/core/Vector3f +hw net/minecraft/core/SectionPosition +hx net/minecraft/core/UUIDUtil +hy net/minecraft/core/BaseBlockPosition +hz net/minecraft/core/IRegistryWritable +i com/mojang/math/PointGroupS +ia net/minecraft/core/cauldron/CauldronInteraction +ic net/minecraft/core/dispenser/DispenseBehaviorProjectile +id net/minecraft/core/dispenser/SourceBlock +ie net/minecraft/core/dispenser/DispenseBehaviorBoat +ig net/minecraft/core/dispenser/DispenseBehaviorItem +ih net/minecraft/core/dispenser/IDispenseBehavior +ii net/minecraft/core/dispenser/DispenseBehaviorMaybe +ij net/minecraft/core/dispenser/DispenseBehaviorShears +ik net/minecraft/core/dispenser/DispenseBehaviorShulkerBox +in net/minecraft/core/particles/ParticleParamBlock +io net/minecraft/core/particles/DustColorTransitionOptions +ip net/minecraft/core/particles/ParticleParamRedstone +iq net/minecraft/core/particles/DustParticleOptionsBase +ir net/minecraft/core/particles/ParticleParamItem +it net/minecraft/core/particles/ParticleParam +iu net/minecraft/core/particles/Particle +iv net/minecraft/core/particles/Particles +iw net/minecraft/core/particles/SculkChargeParticleOptions +ix net/minecraft/core/particles/ShriekParticleOption +iy net/minecraft/core/particles/ParticleType +iz net/minecraft/core/particles/VibrationParticleOption +j com/mojang/math/Transformation +jb net/minecraft/core/registries/BuiltInRegistries +jc net/minecraft/core/registries/Registries +jg net/minecraft/data/CachedOutput +ji net/minecraft/data/DebugReportProvider +jk net/minecraft/data/PackOutput +l net/minecraft/BlockUtil +l$a net/minecraft/BlockUtil$Rectangle +l$b net/minecraft/BlockUtil$IntBounds +m net/minecraft/CharPredicate +mh net/minecraft/data/registries/VanillaRegistries +mj net/minecraft/data/structures/DebugReportNBT +n net/minecraft/EnumChatFormat +net/minecraft/server/Main net/minecraft/server/Main +net/minecraft/server/MinecraftServer net/minecraft/server/MinecraftServer +net/minecraft/server/MinecraftServer$a net/minecraft/server/MinecraftServer$ReloadableResources +net/minecraft/server/MinecraftServer$b net/minecraft/server/MinecraftServer$ServerResourcePackInfo +net/minecraft/server/MinecraftServer$c net/minecraft/server/MinecraftServer$TimeProfiler +net/minecraft/util/profiling/jfr/event/NetworkSummaryEvent net/minecraft/util/profiling/jfr/event/NetworkSummaryEvent +ni net/minecraft/data/worldgen/AncientCityStructurePieces +nj net/minecraft/data/worldgen/AncientCityStructurePools +nk net/minecraft/data/worldgen/WorldGenFeatureBastionBridge +nl net/minecraft/data/worldgen/WorldGenFeatureBastionHoglinStable +nm net/minecraft/data/worldgen/WorldGenFeatureBastionUnits +nn net/minecraft/data/worldgen/WorldGenFeatureBastionPieces +no net/minecraft/data/worldgen/WorldGenFeatureBastionExtra +np net/minecraft/data/worldgen/WorldGenFeatureBastionTreasure +nq net/minecraft/data/worldgen/BiomeSettings +nr net/minecraft/data/worldgen/BootstapContext +ns net/minecraft/data/worldgen/WorldGenCarvers +nt net/minecraft/data/worldgen/WorldGenFeatureDesertVillage +nu net/minecraft/data/worldgen/DimensionTypes +nv net/minecraft/data/worldgen/NoiseData +nw net/minecraft/data/worldgen/WorldGenFeaturePillagerOutpostPieces +nx net/minecraft/data/worldgen/WorldGenFeatureVillagePlain +ny net/minecraft/data/worldgen/WorldGenFeaturePieces +nz net/minecraft/data/worldgen/ProcessorLists +o net/minecraft/CrashReport +oa net/minecraft/data/worldgen/WorldGenFeatureVillageSavanna +ob net/minecraft/data/worldgen/WorldGenFeatureVillageSnowy +oc net/minecraft/data/worldgen/StructureSets +od net/minecraft/data/worldgen/Structures +oe net/minecraft/data/worldgen/SurfaceRuleData +of net/minecraft/data/worldgen/WorldGenFeatureVillageTaiga +og net/minecraft/data/worldgen/TerrainProvider +oh net/minecraft/data/worldgen/TrailRuinsStructurePools +oi net/minecraft/data/worldgen/WorldGenFeatureVillages +oj net/minecraft/data/worldgen/biome/BiomeData +ok net/minecraft/data/worldgen/biome/EndBiomes +ol net/minecraft/data/worldgen/biome/NetherBiomes +om net/minecraft/data/worldgen/biome/OverworldBiomes +oo net/minecraft/data/worldgen/features/AquaticFeatures +op net/minecraft/data/worldgen/features/CaveFeatures +oq net/minecraft/data/worldgen/features/EndFeatures +or net/minecraft/data/worldgen/features/FeatureUtils +os net/minecraft/data/worldgen/features/MiscOverworldFeatures +ot net/minecraft/data/worldgen/features/NetherFeatures +ou net/minecraft/data/worldgen/features/OreFeatures +ov net/minecraft/data/worldgen/features/PileFeatures +ow net/minecraft/data/worldgen/features/TreeFeatures +ox net/minecraft/data/worldgen/features/VegetationFeatures +p net/minecraft/CrashReportSystemDetails +p$a net/minecraft/CrashReportSystemDetails$CrashReportDetail +pa net/minecraft/data/worldgen/placement/AquaticPlacements +pb net/minecraft/data/worldgen/placement/CavePlacements +pc net/minecraft/data/worldgen/placement/EndPlacements +pd net/minecraft/data/worldgen/placement/MiscOverworldPlacements +pe net/minecraft/data/worldgen/placement/NetherPlacements +pf net/minecraft/data/worldgen/placement/OrePlacements +pg net/minecraft/data/worldgen/placement/PlacementUtils +ph net/minecraft/data/worldgen/placement/TreePlacements +pi net/minecraft/data/worldgen/placement/VegetationPlacements +pj net/minecraft/data/worldgen/placement/VillagePlacements +pl net/minecraft/gametest/framework/AfterBatch +pm net/minecraft/gametest/framework/BeforeBatch +pn net/minecraft/gametest/framework/ExhaustedAttemptsException +po net/minecraft/gametest/framework/GameTest +pp net/minecraft/gametest/framework/GameTestHarnessAssertion +pq net/minecraft/gametest/framework/GameTestHarnessAssertionPosition +pr net/minecraft/gametest/framework/GameTestHarnessBatch +ps net/minecraft/gametest/framework/GameTestHarnessBatchRunner +pt net/minecraft/gametest/framework/GameTestHarnessEvent +pu net/minecraft/gametest/framework/GameTestGenerator +pv net/minecraft/gametest/framework/GameTestHarnessHelper +pw net/minecraft/gametest/framework/GameTestHarnessInfo +px net/minecraft/gametest/framework/GameTestHarnessListener +py net/minecraft/gametest/framework/GameTestHarnessRegistry +pz net/minecraft/gametest/framework/GameTestHarnessRunner +q net/minecraft/CrashReportCallable +qa net/minecraft/gametest/framework/GameTestHarnessSequence +qc net/minecraft/gametest/framework/GameTestHarnessTicker +qd net/minecraft/gametest/framework/GameTestHarnessTimeout +qe net/minecraft/gametest/framework/GlobalTestReporter +qg net/minecraft/gametest/framework/GameTestHarnessLogger +qh net/minecraft/gametest/framework/GameTestHarnessCollector +qi net/minecraft/gametest/framework/ReportGameListener +qj net/minecraft/gametest/framework/GameTestHarnessStructures +ql net/minecraft/gametest/framework/GameTestHarnessTestClassArgument +qm net/minecraft/gametest/framework/GameTestHarnessTestCommand +qn net/minecraft/gametest/framework/GameTestHarnessTestFunction +qo net/minecraft/gametest/framework/GameTestHarnessTestFunctionArgument +qp net/minecraft/gametest/framework/GameTestHarnessITestReporter +qr net/minecraft/locale/LocaleLanguage +qt net/minecraft/nbt/NBTTagByteArray +qu net/minecraft/nbt/NBTTagByte +qv net/minecraft/nbt/NBTList +qw net/minecraft/nbt/NBTTagCompound +qx net/minecraft/nbt/NBTTagDouble +qy net/minecraft/nbt/NBTTagEnd +qz net/minecraft/nbt/NBTTagFloat +r net/minecraft/DefaultUncaughtExceptionHandler +ra net/minecraft/nbt/NBTTagIntArray +rb net/minecraft/nbt/NBTTagInt +rc net/minecraft/nbt/NBTTagList +rd net/minecraft/nbt/NBTTagLongArray +re net/minecraft/nbt/NBTTagLong +rf net/minecraft/nbt/NBTReadLimiter +rg net/minecraft/nbt/NbtAccounterException +rh net/minecraft/nbt/NBTCompressedStreamTools +ri net/minecraft/nbt/DynamicOpsNBT +rj net/minecraft/nbt/GameProfileSerializer +rk net/minecraft/nbt/NBTNumber +rl net/minecraft/nbt/NBTTagShort +rm net/minecraft/nbt/SnbtPrinterTagVisitor +rn net/minecraft/nbt/StreamTagVisitor +ro net/minecraft/nbt/NBTTagString +rp net/minecraft/nbt/StringTagVisitor +rq net/minecraft/nbt/NBTBase +rr net/minecraft/nbt/MojangsonParser +rs net/minecraft/nbt/NBTTagType +rt net/minecraft/nbt/NBTTagTypes +ru net/minecraft/nbt/TagVisitor +rv net/minecraft/nbt/TextComponentTagVisitor +rx net/minecraft/nbt/visitors/CollectFields +ry net/minecraft/nbt/visitors/CollectToTag +rz net/minecraft/nbt/visitors/FieldSelector +s net/minecraft/ThreadNamedUncaughtExceptionHandler +sa net/minecraft/nbt/visitors/FieldTree +sc net/minecraft/nbt/visitors/SkipFields +se net/minecraft/network/BandwidthDebugMonitor +sf net/minecraft/network/PacketEncryptionHandler +sg net/minecraft/network/PacketDecrypter +sh net/minecraft/network/PacketEncrypter +si net/minecraft/network/ClientPongPacketListener +sj net/minecraft/network/ClientboundPacketListener +sk net/minecraft/network/PacketDecompressor +sl net/minecraft/network/PacketCompressor +sm net/minecraft/network/NetworkManager +sn net/minecraft/network/EnumProtocol +so net/minecraft/network/PacketDataSerializer +sp net/minecraft/network/PacketBundlePacker +sq net/minecraft/network/PacketBundleUnpacker +sr net/minecraft/network/PacketDecoder +ss net/minecraft/network/PacketEncoder +st net/minecraft/network/PacketFlowValidator +su net/minecraft/network/PacketListener +sv net/minecraft/network/PacketSendListener +sw net/minecraft/network/ProtocolSwapHandler +sx net/minecraft/network/NetworkManagerServer +sy net/minecraft/network/ServerboundPacketListener +sz net/minecraft/network/SkipEncodeException +t net/minecraft/MinecraftVersion +ta net/minecraft/network/TickablePacketListener +tb net/minecraft/network/Utf8String +tc net/minecraft/network/VarInt +td net/minecraft/network/VarLong +te net/minecraft/network/PacketSplitter +tf net/minecraft/network/PacketPrepender +tg net/minecraft/network/chat/ChatDecorator +th net/minecraft/network/chat/ChatMessageType +ti net/minecraft/network/chat/ChatDecoration +tj net/minecraft/network/chat/ChatClickable +tj$a net/minecraft/network/chat/ChatClickable$EnumClickAction +tk net/minecraft/network/chat/CommonComponents +tl net/minecraft/network/chat/IChatBaseComponent +tl$a net/minecraft/network/chat/IChatBaseComponent$ChatSerializer +tm net/minecraft/network/chat/ComponentContents +tn net/minecraft/network/chat/ChatComponentUtils +to net/minecraft/network/chat/FilterMask +tp net/minecraft/network/chat/IChatFormatted +tq net/minecraft/network/chat/ChatHoverable +tq$a net/minecraft/network/chat/ChatHoverable$EnumHoverAction +tr net/minecraft/network/chat/LastSeenMessages +tt net/minecraft/network/chat/LastSeenMessagesValidator +tu net/minecraft/network/chat/LastSeenTrackedEntry +tw net/minecraft/network/chat/MessageSignature +tx net/minecraft/network/chat/MessageSignatureCache +ty net/minecraft/network/chat/IChatMutableComponent +tz net/minecraft/network/chat/OutgoingChatMessage +ua net/minecraft/network/chat/PlayerChatMessage +ub net/minecraft/network/chat/RemoteChatSession +uc net/minecraft/network/chat/SignableCommand +ud net/minecraft/network/chat/SignedMessageBody +ue net/minecraft/network/chat/SignedMessageChain +uf net/minecraft/network/chat/SignedMessageLink +ug net/minecraft/network/chat/SignedMessageValidator +uh net/minecraft/network/chat/ChatModifier +uh$b net/minecraft/network/chat/ChatModifier$ChatModifierSerializer +uj net/minecraft/network/chat/ChatHexColor +uk net/minecraft/network/chat/ThrowingComponent +ul net/minecraft/network/chat/contents/BlockDataSource +um net/minecraft/network/chat/contents/DataSource +un net/minecraft/network/chat/contents/EntityDataSource +uo net/minecraft/network/chat/contents/KeybindContents +up net/minecraft/network/chat/contents/KeybindResolver +uq net/minecraft/network/chat/contents/LiteralContents +ur net/minecraft/network/chat/contents/NbtContents +us net/minecraft/network/chat/contents/ScoreContents +ut net/minecraft/network/chat/contents/SelectorContents +uu net/minecraft/network/chat/contents/StorageDataSource +uv net/minecraft/network/chat/contents/TranslatableContents +uw net/minecraft/network/chat/contents/TranslatableFormatException +v net/minecraft/FileUtils +va net/minecraft/network/protocol/BundleDelimiterPacket +vb net/minecraft/network/protocol/BundlePacket +vc net/minecraft/network/protocol/BundlerInfo +vd net/minecraft/network/protocol/Packet +ve net/minecraft/network/protocol/EnumProtocolDirection +vf net/minecraft/network/protocol/PlayerConnectionUtils +vg net/minecraft/network/protocol/common/ClientCommonPacketListener +vh net/minecraft/network/protocol/common/ClientboundCustomPayloadPacket +vi net/minecraft/network/protocol/common/ClientboundDisconnectPacket +vj net/minecraft/network/protocol/common/ClientboundKeepAlivePacket +vk net/minecraft/network/protocol/common/ClientboundPingPacket +vl net/minecraft/network/protocol/common/ClientboundResourcePackPacket +vm net/minecraft/network/protocol/common/ClientboundUpdateTagsPacket +vn net/minecraft/network/protocol/common/ServerCommonPacketListener +vo net/minecraft/network/protocol/common/ServerboundClientInformationPacket +vp net/minecraft/network/protocol/common/ServerboundCustomPayloadPacket +vq net/minecraft/network/protocol/common/ServerboundKeepAlivePacket +vr net/minecraft/network/protocol/common/ServerboundPongPacket +vs net/minecraft/network/protocol/common/ServerboundResourcePackPacket +vt net/minecraft/network/protocol/common/custom/BeeDebugPayload +vu net/minecraft/network/protocol/common/custom/BrainDebugPayload +vv net/minecraft/network/protocol/common/custom/BrandPayload +vw net/minecraft/network/protocol/common/custom/CustomPacketPayload +vx net/minecraft/network/protocol/common/custom/DiscardedPayload +vy net/minecraft/network/protocol/common/custom/GameEventDebugPayload +vz net/minecraft/network/protocol/common/custom/GameEventListenerDebugPayload +wa net/minecraft/network/protocol/common/custom/GameTestAddMarkerDebugPayload +wb net/minecraft/network/protocol/common/custom/GameTestClearMarkersDebugPayload +wc net/minecraft/network/protocol/common/custom/GoalDebugPayload +wd net/minecraft/network/protocol/common/custom/HiveDebugPayload +we net/minecraft/network/protocol/common/custom/NeighborUpdatesDebugPayload +wf net/minecraft/network/protocol/common/custom/PathfindingDebugPayload +wg net/minecraft/network/protocol/common/custom/PoiAddedDebugPayload +wh net/minecraft/network/protocol/common/custom/PoiRemovedDebugPayload +wi net/minecraft/network/protocol/common/custom/PoiTicketCountDebugPayload +wj net/minecraft/network/protocol/common/custom/RaidsDebugPayload +wk net/minecraft/network/protocol/common/custom/StructuresDebugPayload +wl net/minecraft/network/protocol/common/custom/VillageSectionsDebugPayload +wm net/minecraft/network/protocol/common/custom/WorldGenAttemptDebugPayload +wp net/minecraft/network/protocol/configuration/ClientConfigurationPacketListener +wq net/minecraft/network/protocol/configuration/ClientboundFinishConfigurationPacket +wr net/minecraft/network/protocol/configuration/ClientboundRegistryDataPacket +ws net/minecraft/network/protocol/configuration/ClientboundUpdateEnabledFeaturesPacket +wt net/minecraft/network/protocol/configuration/ServerConfigurationPacketListener +wu net/minecraft/network/protocol/configuration/ServerboundFinishConfigurationPacket +ww net/minecraft/network/protocol/game/PacketListenerPlayOut +wx net/minecraft/network/protocol/game/PacketPlayOutSpawnEntity +wy net/minecraft/network/protocol/game/PacketPlayOutSpawnEntityExperienceOrb +wz net/minecraft/network/protocol/game/PacketPlayOutAnimation +x net/minecraft/Optionull +xa net/minecraft/network/protocol/game/PacketPlayOutStatistic +xb net/minecraft/network/protocol/game/ClientboundBlockChangedAckPacket +xc net/minecraft/network/protocol/game/PacketPlayOutBlockBreakAnimation +xd net/minecraft/network/protocol/game/PacketPlayOutTileEntityData +xe net/minecraft/network/protocol/game/PacketPlayOutBlockAction +xf net/minecraft/network/protocol/game/PacketPlayOutBlockChange +xg net/minecraft/network/protocol/game/PacketPlayOutBoss +xg$c net/minecraft/network/protocol/game/PacketPlayOutBoss$Action +xh net/minecraft/network/protocol/game/ClientboundBundlePacket +xi net/minecraft/network/protocol/game/PacketPlayOutServerDifficulty +xj net/minecraft/network/protocol/game/ClientboundChunkBatchFinishedPacket +xk net/minecraft/network/protocol/game/ClientboundChunkBatchStartPacket +xl net/minecraft/network/protocol/game/ClientboundChunksBiomesPacket +xm net/minecraft/network/protocol/game/ClientboundClearTitlesPacket +xn net/minecraft/network/protocol/game/PacketPlayOutTabComplete +xo net/minecraft/network/protocol/game/PacketPlayOutCommands +xp net/minecraft/network/protocol/game/PacketPlayOutCloseWindow +xq net/minecraft/network/protocol/game/PacketPlayOutWindowItems +xr net/minecraft/network/protocol/game/PacketPlayOutWindowData +xs net/minecraft/network/protocol/game/PacketPlayOutSetSlot +xt net/minecraft/network/protocol/game/PacketPlayOutSetCooldown +xu net/minecraft/network/protocol/game/ClientboundCustomChatCompletionsPacket +xu$a net/minecraft/network/protocol/game/ClientboundCustomChatCompletionsPacket$Action +xv net/minecraft/network/protocol/game/ClientboundDamageEventPacket +xw net/minecraft/network/protocol/game/ClientboundDeleteChatPacket +xx net/minecraft/network/protocol/game/ClientboundDisguisedChatPacket +xy net/minecraft/network/protocol/game/PacketPlayOutEntityStatus +xz net/minecraft/network/protocol/game/PacketPlayOutExplosion +y net/minecraft/ReportedException +ya net/minecraft/network/protocol/game/PacketPlayOutUnloadChunk +yb net/minecraft/network/protocol/game/PacketPlayOutGameStateChange +yc net/minecraft/network/protocol/game/PacketPlayOutOpenWindowHorse +yd net/minecraft/network/protocol/game/ClientboundHurtAnimationPacket +ye net/minecraft/network/protocol/game/ClientboundInitializeBorderPacket +yf net/minecraft/network/protocol/game/ClientboundLevelChunkPacketData +yg net/minecraft/network/protocol/game/ClientboundLevelChunkWithLightPacket +yh net/minecraft/network/protocol/game/PacketPlayOutWorldEvent +yi net/minecraft/network/protocol/game/PacketPlayOutWorldParticles +yj net/minecraft/network/protocol/game/PacketPlayOutLightUpdate +yk net/minecraft/network/protocol/game/ClientboundLightUpdatePacketData +yl net/minecraft/network/protocol/game/PacketPlayOutLogin +ym net/minecraft/network/protocol/game/PacketPlayOutMap +yn net/minecraft/network/protocol/game/PacketPlayOutOpenWindowMerchant +yo net/minecraft/network/protocol/game/PacketPlayOutEntity +yo$a net/minecraft/network/protocol/game/PacketPlayOutEntity$PacketPlayOutRelEntityMove +yo$b net/minecraft/network/protocol/game/PacketPlayOutEntity$PacketPlayOutRelEntityMoveLook +yo$c net/minecraft/network/protocol/game/PacketPlayOutEntity$PacketPlayOutEntityLook +yp net/minecraft/network/protocol/game/PacketPlayOutVehicleMove +yq net/minecraft/network/protocol/game/PacketPlayOutOpenBook +yr net/minecraft/network/protocol/game/PacketPlayOutOpenWindow +ys net/minecraft/network/protocol/game/PacketPlayOutOpenSignEditor +yt net/minecraft/network/protocol/game/PacketPlayOutAutoRecipe +yu net/minecraft/network/protocol/game/PacketPlayOutAbilities +yv net/minecraft/network/protocol/game/ClientboundPlayerChatPacket +yw net/minecraft/network/protocol/game/ClientboundPlayerCombatEndPacket +yx net/minecraft/network/protocol/game/ClientboundPlayerCombatEnterPacket +yy net/minecraft/network/protocol/game/ClientboundPlayerCombatKillPacket +yz net/minecraft/network/protocol/game/ClientboundPlayerInfoRemovePacket +z net/minecraft/ResourceKeyInvalidException +za net/minecraft/network/protocol/game/ClientboundPlayerInfoUpdatePacket +zb net/minecraft/network/protocol/game/PacketPlayOutLookAt +zc net/minecraft/network/protocol/game/PacketPlayOutPosition +zd net/minecraft/network/protocol/game/PacketPlayOutRecipes +zd$a net/minecraft/network/protocol/game/PacketPlayOutRecipes$Action +ze net/minecraft/network/protocol/game/PacketPlayOutEntityDestroy +zf net/minecraft/network/protocol/game/PacketPlayOutRemoveEntityEffect +zg net/minecraft/network/protocol/game/PacketPlayOutRespawn +zh net/minecraft/network/protocol/game/PacketPlayOutEntityHeadRotation +zi net/minecraft/network/protocol/game/PacketPlayOutMultiBlockChange +zj net/minecraft/network/protocol/game/PacketPlayOutSelectAdvancementTab +zk net/minecraft/network/protocol/game/ClientboundServerDataPacket +zl net/minecraft/network/protocol/game/ClientboundSetActionBarTextPacket +zm net/minecraft/network/protocol/game/ClientboundSetBorderCenterPacket +zn net/minecraft/network/protocol/game/ClientboundSetBorderLerpSizePacket +zo net/minecraft/network/protocol/game/ClientboundSetBorderSizePacket +zp net/minecraft/network/protocol/game/ClientboundSetBorderWarningDelayPacket +zq net/minecraft/network/protocol/game/ClientboundSetBorderWarningDistancePacket +zr net/minecraft/network/protocol/game/PacketPlayOutCamera +zs net/minecraft/network/protocol/game/PacketPlayOutHeldItemSlot +zt net/minecraft/network/protocol/game/PacketPlayOutViewCentre +zu net/minecraft/network/protocol/game/PacketPlayOutViewDistance +zv net/minecraft/network/protocol/game/PacketPlayOutSpawnPosition +zw net/minecraft/network/protocol/game/PacketPlayOutScoreboardDisplayObjective +zx net/minecraft/network/protocol/game/PacketPlayOutEntityMetadata +zy net/minecraft/network/protocol/game/PacketPlayOutAttachEntity +zz net/minecraft/network/protocol/game/PacketPlayOutEntityVelocity