event) {
+ var server = (SoakServer) Bukkit.getServer();
+ server.getCommandMap().registerStored();
+ }
+
@Listener
public void registerCommands(RegisterCommandEvent event) {
event.register(this.container, SoakCommand.createSoakCommand(), "soak");
@@ -460,7 +453,7 @@ private void loadPlugins(boolean late) {
loadingPlugins.forEach(container -> ((AbstractSoakPluginContainer) container).instance()
.onPluginsConstructed());
if (late) {
- loadingPlugins.forEach(container -> ((AbstractSoakPluginContainer) container).getBukkitInstance().onLoad());
+ loadingPlugins.forEach(container -> container.getBukkitInstance().onLoad());
}
}
diff --git a/Launch-External/src/main/java/org/soak/plugin/loader/common/SpongeJavaPlugin.java b/Launch-External/src/main/java/org/soak/plugin/loader/common/SpongeJavaPlugin.java
index c522a38..7a38378 100644
--- a/Launch-External/src/main/java/org/soak/plugin/loader/common/SpongeJavaPlugin.java
+++ b/Launch-External/src/main/java/org/soak/plugin/loader/common/SpongeJavaPlugin.java
@@ -23,7 +23,6 @@
import java.io.File;
import java.io.InputStream;
-import java.net.URI;
import java.net.URL;
import java.util.*;
@@ -231,4 +230,9 @@ public boolean onCommand(@NotNull CommandSender commandSender, @NotNull Command
@NotNull String s, @NotNull String[] strings) {
return Collections.emptyList();
}
+
+ @Override
+ public @NotNull String namespace() {
+ return this.container.metadata().id();
+ }
}
diff --git a/Launch-Internal/build.gradle b/Launch-Internal/build.gradle
index 7fa0bbd..e19d3dd 100644
--- a/Launch-Internal/build.gradle
+++ b/Launch-Internal/build.gradle
@@ -26,9 +26,7 @@ dependencies {
implementation project(":Wrapper")
implementation 'org.spongepowered:spongeapi:' + property("SPONGE_VERSION")
-
- implementation 'io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT'
-
+ implementation 'io.papermc.paper:paper-api:' + property("BUKKIT_VERSION") + '.build.+'
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
diff --git a/MultiBuild b/MultiBuild
deleted file mode 160000
index bd28df3..0000000
--- a/MultiBuild
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit bd28df3aef207508c10ec9a56cffa52f036996b5
diff --git a/NMSBounce/build.gradle b/NMSBounce/build.gradle
deleted file mode 100644
index ab57f6c..0000000
--- a/NMSBounce/build.gradle
+++ /dev/null
@@ -1,36 +0,0 @@
-plugins {
- id 'java'
-}
-
-group = 'org.soak'
-version = '1.21.1.2412221049'
-
-
-repositories {
- mavenCentral()
- maven {
- url "https://repo.papermc.io/repository/maven-public"
- }
-}
-
-dependencies {
- implementation project(":Wrapper")
- implementation 'io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT'
- implementation 'org.spongepowered:spongeapi:' + property("SPONGE_VERSION")
-
- testImplementation platform('org.junit:junit-bom:5.10.0')
- testImplementation 'org.junit.jupiter:junit-jupiter'
-}
-
-java {
- sourceCompatibility = JavaVersion.VERSION_21;
- targetCompatibility = JavaVersion.VERSION_21;
-}
-
-jar {
- archiveFileName = "NMSBounce.jar"
-}
-
-test {
- useJUnitPlatform()
-}
\ No newline at end of file
diff --git a/NMSBounce/src/main/java/net/minecraft/core/HolderLookup.java b/NMSBounce/src/main/java/net/minecraft/core/HolderLookup.java
deleted file mode 100644
index 37c4f3a..0000000
--- a/NMSBounce/src/main/java/net/minecraft/core/HolderLookup.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package net.minecraft.core;
-
-public interface HolderLookup {
-
- interface a {
-
- }
-}
diff --git a/NMSBounce/src/main/java/net/minecraft/server/level/WorldServer.java b/NMSBounce/src/main/java/net/minecraft/server/level/WorldServer.java
deleted file mode 100644
index 2093c4e..0000000
--- a/NMSBounce/src/main/java/net/minecraft/server/level/WorldServer.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package net.minecraft.server.level;
-
-import net.minecraft.world.level.World;
-
-public class WorldServer extends World {
-
-}
diff --git a/NMSBounce/src/main/java/net/minecraft/world/IInventory.java b/NMSBounce/src/main/java/net/minecraft/world/IInventory.java
deleted file mode 100644
index 8c6f414..0000000
--- a/NMSBounce/src/main/java/net/minecraft/world/IInventory.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package net.minecraft.world;
-
-public interface IInventory {
-
-}
diff --git a/NMSBounce/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoal.java b/NMSBounce/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoal.java
deleted file mode 100644
index 4e11653..0000000
--- a/NMSBounce/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoal.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package net.minecraft.world.entity.ai.goal;
-
-public interface PathfinderGoal {
-}
diff --git a/NMSBounce/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalLookAtPlayer.java b/NMSBounce/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalLookAtPlayer.java
deleted file mode 100644
index 9e52c90..0000000
--- a/NMSBounce/src/main/java/net/minecraft/world/entity/ai/goal/PathfinderGoalLookAtPlayer.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package net.minecraft.world.entity.ai.goal;
-
-public interface PathfinderGoalLookAtPlayer extends PathfinderGoal{
-}
diff --git a/NMSBounce/src/main/java/net/minecraft/world/item/ItemStack.java b/NMSBounce/src/main/java/net/minecraft/world/item/ItemStack.java
deleted file mode 100644
index 0f14c92..0000000
--- a/NMSBounce/src/main/java/net/minecraft/world/item/ItemStack.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package net.minecraft.world.item;
-
-import org.soak.wrapper.inventory.SoakItemStack;
-
-public class ItemStack {
-
- private final SoakItemStack stack;
-
- public ItemStack(SoakItemStack stack) {
- this.stack = stack;
- }
-
- public SoakItemStack getSoak(){
- return this.stack;
- }
-}
diff --git a/NMSBounce/src/main/java/net/minecraft/world/item/trading/IMerchant.java b/NMSBounce/src/main/java/net/minecraft/world/item/trading/IMerchant.java
deleted file mode 100644
index 8410db5..0000000
--- a/NMSBounce/src/main/java/net/minecraft/world/item/trading/IMerchant.java
+++ /dev/null
@@ -1,4 +0,0 @@
-package net.minecraft.world.item.trading;
-
-public interface IMerchant {
-}
diff --git a/NMSBounce/src/main/java/net/minecraft/world/level/World.java b/NMSBounce/src/main/java/net/minecraft/world/level/World.java
deleted file mode 100644
index 569f4b2..0000000
--- a/NMSBounce/src/main/java/net/minecraft/world/level/World.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package net.minecraft.world.level;
-
-public class World {
-
-}
diff --git a/NMSBounce/src/main/java/net/minecraft/world/level/block/entity/TileEntityBrewingStand.java b/NMSBounce/src/main/java/net/minecraft/world/level/block/entity/TileEntityBrewingStand.java
deleted file mode 100644
index 9c20640..0000000
--- a/NMSBounce/src/main/java/net/minecraft/world/level/block/entity/TileEntityBrewingStand.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package net.minecraft.world.level.block.entity;
-
-public class TileEntityBrewingStand {
-
-}
diff --git a/NMSBounce/src/main/java/net/minecraft/world/level/block/entity/TileEntityDispenser.java b/NMSBounce/src/main/java/net/minecraft/world/level/block/entity/TileEntityDispenser.java
deleted file mode 100644
index 258a25f..0000000
--- a/NMSBounce/src/main/java/net/minecraft/world/level/block/entity/TileEntityDispenser.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package net.minecraft.world.level.block.entity;
-
-public class TileEntityDispenser {
-
-}
diff --git a/NMSBounce/src/main/java/net/minecraft/world/level/block/entity/TileEntityFurnaceFurnace.java b/NMSBounce/src/main/java/net/minecraft/world/level/block/entity/TileEntityFurnaceFurnace.java
deleted file mode 100644
index 10cdb26..0000000
--- a/NMSBounce/src/main/java/net/minecraft/world/level/block/entity/TileEntityFurnaceFurnace.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package net.minecraft.world.level.block.entity;
-
-public class TileEntityFurnaceFurnace {
-
-}
diff --git a/NMSBounce/src/main/java/net/minecraft/world/level/block/entity/TileEntityHopper.java b/NMSBounce/src/main/java/net/minecraft/world/level/block/entity/TileEntityHopper.java
deleted file mode 100644
index b591230..0000000
--- a/NMSBounce/src/main/java/net/minecraft/world/level/block/entity/TileEntityHopper.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package net.minecraft.world.level.block.entity;
-
-public class TileEntityHopper {
-
-}
diff --git a/NMSBounce/src/main/java/net/minecraft/world/level/block/state/properties/IBlockState.java b/NMSBounce/src/main/java/net/minecraft/world/level/block/state/properties/IBlockState.java
deleted file mode 100644
index 73d4039..0000000
--- a/NMSBounce/src/main/java/net/minecraft/world/level/block/state/properties/IBlockState.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package net.minecraft.world.level.block.state.properties;
-
-public interface IBlockState {
-
-}
diff --git a/NMSBounce/src/main/java/net/minecraft/world/level/chunk/IChunkAccess.java b/NMSBounce/src/main/java/net/minecraft/world/level/chunk/IChunkAccess.java
deleted file mode 100644
index e7e6775..0000000
--- a/NMSBounce/src/main/java/net/minecraft/world/level/chunk/IChunkAccess.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package net.minecraft.world.level.chunk;
-
-public interface IChunkAccess {
-
-}
diff --git a/NMSBounce/src/main/java/org/bukkit/craftbukkit/v1_21_R1/inventory/CraftItemStack.java b/NMSBounce/src/main/java/org/bukkit/craftbukkit/v1_21_R1/inventory/CraftItemStack.java
deleted file mode 100644
index 3b9c53a..0000000
--- a/NMSBounce/src/main/java/org/bukkit/craftbukkit/v1_21_R1/inventory/CraftItemStack.java
+++ /dev/null
@@ -1,377 +0,0 @@
-package org.bukkit.craftbukkit.v1_21_R1.inventory;
-
-import io.papermc.paper.inventory.ItemRarity;
-import io.papermc.paper.inventory.tooltip.TooltipContext;
-import io.papermc.paper.registry.set.RegistryKeySet;
-import net.kyori.adventure.text.Component;
-import net.kyori.adventure.text.event.HoverEvent;
-import org.bukkit.Material;
-import org.bukkit.enchantments.Enchantment;
-import org.bukkit.entity.LivingEntity;
-import org.bukkit.entity.Player;
-import org.bukkit.inventory.ItemFlag;
-import org.bukkit.inventory.ItemStack;
-import org.bukkit.inventory.meta.ItemMeta;
-import org.bukkit.material.MaterialData;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.jetbrains.annotations.Range;
-import org.jetbrains.annotations.Unmodifiable;
-import org.soak.wrapper.inventory.SoakItemStack;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Random;
-import java.util.Set;
-import java.util.function.Consumer;
-import java.util.function.UnaryOperator;
-
-/**
- * Wrapper for NMSBounce Itemstack ... a wrapper for SoakItemStack .... a wrapper for Sponge Itemstack
- *
- * this is why plugins shouldnt use NMS
- */
-public class CraftItemStack extends ItemStack {
-
- private final @NotNull net.minecraft.world.item.ItemStack handle;
-
- public CraftItemStack(@NotNull net.minecraft.world.item.ItemStack handle) {
- this.handle = handle;
- }
-
- public CraftItemStack() {
- this(new net.minecraft.world.item.ItemStack(new SoakItemStack()));
- }
-
- @Override
- public @NotNull Material getType() {
- return this.handle.getSoak().getType();
- }
-
- @SuppressWarnings("deprecation")
- @Override
- @Deprecated
- public void setType(@NotNull Material type) {
- this.handle.getSoak().setType(type);
- }
-
- @Override
- public @NotNull ItemStack withType(@NotNull Material type) {
- return this.handle.getSoak().withType(type);
- }
-
- @Override
- public int getAmount() {
- return this.handle.getSoak().getAmount();
- }
-
- @Override
- public void setAmount(int amount) {
- this.handle.getSoak().setAmount(amount);
- }
-
- @SuppressWarnings("removal")
- @Override
- @Deprecated
- public @Nullable MaterialData getData() {
- return this.handle.getSoak().getData();
- }
-
- @SuppressWarnings("removal")
- @Override
- public void setData(@Nullable MaterialData data) {
- this.handle.getSoak().setData(data);
- }
-
- @SuppressWarnings("deprecation")
- @Override
- @Deprecated
- public short getDurability() {
- return this.handle.getSoak().getDurability();
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public void setDurability(short durability) {
- this.handle.getSoak().setDurability(durability);
- }
-
- @Override
- public int getMaxStackSize() {
- return this.handle.getSoak().getMaxStackSize();
- }
-
- @Override
- public String toString() {
- return this.handle.getSoak().toString();
- }
-
- @SuppressWarnings("EqualsDoesntCheckParameterClass")
- @Override
- public boolean equals(Object obj) {
- return this.handle.getSoak().equals(obj);
- }
-
- @Override
- public boolean isSimilar(@Nullable ItemStack stack) {
- return this.handle.getSoak().isSimilar(stack);
- }
-
- @Override
- public @NotNull ItemStack clone() {
- return this.handle.getSoak().clone();
- }
-
- @Override
- public int hashCode() {
- return this.handle.getSoak().hashCode();
- }
-
- @Override
- public boolean containsEnchantment(@NotNull Enchantment ench) {
- return this.handle.getSoak().containsEnchantment(ench);
- }
-
- @Override
- public int getEnchantmentLevel(@NotNull Enchantment ench) {
- return this.handle.getSoak().getEnchantmentLevel(ench);
- }
-
- @Override
- public @NotNull Map getEnchantments() {
- return this.handle.getSoak().getEnchantments();
- }
-
- @Override
- public void addEnchantments(@NotNull Map enchantments) {
- this.handle.getSoak().addEnchantments(enchantments);
- }
-
- @Override
- public void addEnchantment(@NotNull Enchantment ench, int level) {
- this.handle.getSoak().addEnchantment(ench, level);
- }
-
- @Override
- public void addUnsafeEnchantments(@NotNull Map enchantments) {
- this.handle.getSoak().addUnsafeEnchantments(enchantments);
- }
-
- @Override
- public void addUnsafeEnchantment(@NotNull Enchantment ench, int level) {
- this.handle.getSoak().addUnsafeEnchantment(ench, level);
- }
-
- @Override
- public int removeEnchantment(@NotNull Enchantment ench) {
- return this.handle.getSoak().removeEnchantment(ench);
- }
-
- @Override
- public void removeEnchantments() {
- this.handle.getSoak().removeEnchantments();
- }
-
- @Override
- public @NotNull Map serialize() {
- return this.handle.getSoak().serialize();
- }
-
- @Override
- public boolean editMeta(@NotNull Consumer super ItemMeta> consumer) {
- return this.handle.getSoak().editMeta(consumer);
- }
-
- @Override
- public boolean editMeta(@NotNull Class metaClass, @NotNull Consumer super M> consumer) {
- return this.handle.getSoak().editMeta(metaClass, consumer);
- }
-
- @Override
- public ItemMeta getItemMeta() {
- return this.handle.getSoak().getItemMeta();
- }
-
- @Override
- public boolean hasItemMeta() {
- return this.handle.getSoak().hasItemMeta();
- }
-
- @Override
- public boolean setItemMeta(@Nullable ItemMeta itemMeta) {
- return this.handle.getSoak().setItemMeta(itemMeta);
- }
-
- @SuppressWarnings("removal")
- @Override
- @Deprecated(forRemoval = true)
- public @NotNull String getTranslationKey() {
- return this.handle.getSoak().getTranslationKey();
- }
-
- @Override
- public @NotNull ItemStack enchantWithLevels(@Range(from = 1L, to = 30L) int levels, boolean allowTreasure,
- @NotNull Random random) {
- return this.handle.getSoak().enchantWithLevels(levels, allowTreasure, random);
- }
-
- @Override
- public @NotNull ItemStack enchantWithLevels(@Range(from = 1L, to = 30L) int levels,
- @NotNull RegistryKeySet<@NotNull Enchantment> keySet,
- @NotNull Random random) {
- return this.handle.getSoak().enchantWithLevels(levels, keySet, random);
- }
-
- @Override
- public @NotNull HoverEvent asHoverEvent(@NotNull UnaryOperator op) {
- return this.handle.getSoak().asHoverEvent(op);
- }
-
- @Override
- public @NotNull Component displayName() {
- return this.handle.getSoak().displayName();
- }
-
- @Override
- public @NotNull ItemStack ensureServerConversions() {
- return this.handle.getSoak().ensureServerConversions();
- }
-
- @Override
- public byte[] serializeAsBytes() {
- return this.handle.getSoak().serializeAsBytes();
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public @Nullable String getI18NDisplayName() {
- return this.handle.getSoak().getI18NDisplayName();
- }
-
- @SuppressWarnings("removal")
- @Override
- @Deprecated(forRemoval = true)
- public int getMaxItemUseDuration() {
- return this.handle.getSoak().getMaxItemUseDuration();
- }
-
- @Override
- public int getMaxItemUseDuration(@NotNull LivingEntity entity) {
- return this.handle.getSoak().getMaxItemUseDuration(entity);
- }
-
- @Override
- public @NotNull ItemStack asOne() {
- return this.handle.getSoak().asOne();
- }
-
- @Override
- public @NotNull ItemStack asQuantity(int qty) {
- return this.handle.getSoak().asQuantity(qty);
- }
-
- @Override
- public @NotNull ItemStack add() {
- return this.handle.getSoak().add();
- }
-
- @Override
- public @NotNull ItemStack add(int qty) {
- return this.handle.getSoak().add(qty);
- }
-
- @Override
- public @NotNull ItemStack subtract() {
- return this.handle.getSoak().subtract();
- }
-
- @Override
- public @NotNull ItemStack subtract(int qty) {
- return this.handle.getSoak().subtract(qty);
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public @Nullable List getLore() {
- return this.handle.getSoak().getLore();
- }
-
- @SuppressWarnings("deprecation")
- @Override
- public void setLore(@Nullable List lore) {
- this.handle.getSoak().setLore(lore);
- }
-
- @Override
- public @Nullable List lore() {
- return this.handle.getSoak().lore();
- }
-
- @Override
- public void lore(@Nullable List extends Component> lore) {
- this.handle.getSoak().lore(lore);
- }
-
- @Override
- public void addItemFlags(@NotNull ItemFlag... itemFlags) {
- this.handle.getSoak().addItemFlags(itemFlags);
- }
-
- @Override
- public void removeItemFlags(@NotNull ItemFlag... itemFlags) {
- this.handle.getSoak().removeItemFlags(itemFlags);
- }
-
- @Override
- public @NotNull Set getItemFlags() {
- return this.handle.getSoak().getItemFlags();
- }
-
- @Override
- public boolean hasItemFlag(@NotNull ItemFlag flag) {
- return this.handle.getSoak().hasItemFlag(flag);
- }
-
- @Override
- public @NotNull String translationKey() {
- return this.handle.getSoak().translationKey();
- }
-
- @SuppressWarnings("removal")
- @Override
- @Deprecated(forRemoval = true)
- public @NotNull ItemRarity getRarity() {
- return this.handle.getSoak().getRarity();
- }
-
- @Override
- public boolean isRepairableBy(@NotNull ItemStack repairMaterial) {
- return this.handle.getSoak().isRepairableBy(repairMaterial);
- }
-
- @Override
- public boolean canRepair(@NotNull ItemStack toBeRepaired) {
- return this.handle.getSoak().canRepair(toBeRepaired);
- }
-
- @Override
- public @NotNull ItemStack damage(int amount, @NotNull LivingEntity livingEntity) {
- return this.handle.getSoak().damage(amount, livingEntity);
- }
-
- @Override
- public boolean isEmpty() {
- return this.handle.getSoak().isEmpty();
- }
-
- @Override
- public @NotNull @Unmodifiable List computeTooltipLines(@NotNull TooltipContext tooltipContext,
- @Nullable Player player) {
- return this.handle.getSoak().computeTooltipLines(tooltipContext, player);
- }
-
- @Override
- public @NotNull HoverEvent asHoverEvent() {
- return this.handle.getSoak().asHoverEvent();
- }
-}
diff --git a/Override/build.gradle b/Override/build.gradle
index dfcb0ca..c93f49b 100644
--- a/Override/build.gradle
+++ b/Override/build.gradle
@@ -21,7 +21,7 @@ repositories {
dependencies {
implementation 'org.spongepowered:spongeapi:' + property("SPONGE_VERSION")
- implementation 'io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT'
+ implementation 'io.papermc.paper:paper-api:' + property("BUKKIT_VERSION") + '.build.+'
}
test {
diff --git a/README.md b/README.md
index d53684c..8d975d3 100644
--- a/README.md
+++ b/README.md
@@ -33,7 +33,7 @@ in short, yes but newer
Pore was a Sponge plugin that allowed Bukkit plugins to run on older Sponge versions.
Soak is a Sponge plugin that allows Bukkit plugins to run on Sponge API 8+
-Pore ended for a (few reasons)[https://caseif.blog/content/post.php?id=41], here are some
+Pore ended for a [few reasons](https://caseif.blog/content/post.php?id=41), here are some
### Sponge has become increasing different to Bukkit
@@ -52,14 +52,9 @@ This has lead to more and more plugins using pure Bukkit API code, meaning that
With paper's hard fork now in place, the hope is that plugins target Paper's version of the Bukkit-API. PaperMC-API has
more methods than the Spigot-API, these methods can be used in place of interacting directly with NMS.
-#### NMS Bounce
+#### NMS built in mappings
-The Soak project has a module called ``NMSBounce``, that allows plugins that do interact with NMS to interact with Sponge
-code without any changes. This works as CraftBukkit implementations of Bukkit use Mojang mappings to map the original
-vanilla server.jar to human-readable code, but CraftBukkit implementations do not map the changes back. While in
-NeoForge, LexForge, Sponge Vanilla and Fabric, they map the changes back. This leaves the package of ``net.minecraft.server``
-open for use. There is a little bit of Java trickery to place Soak files in place of ``net.minecraft.server`` (such as
-an isolated classloader) but allows for wrapping NMS calls in Sponge API
+Minecraft has started to ship Mojang mappings directly in the Jar, this means that no mappings are needed and that all Mojang implementations will have the same NMS mappings. While there maybe a few exceptions whereby Paper/Forge/etc may modify the original function, but for the most part, if a plugin calls a NMS function, then it should now work
### Many plugins that do work, wont work with Forge mods
diff --git a/Wrapper/build.gradle b/Wrapper/build.gradle
index 90d53e6..4dabee2 100644
--- a/Wrapper/build.gradle
+++ b/Wrapper/build.gradle
@@ -19,25 +19,15 @@ repositories {
}
}
-sourceSets {
- api21 {
- main {}
- }
- generatedApi21 {
- main {}
- }
-}
-
dependencies {
implementation project(':Common')
implementation project(':CollectionStream')
implementation project(':MoseStream')
- implementation project(':MultiBuild:annotations')
implementation 'org.spongepowered:spongeapi:' + property("SPONGE_VERSION")
implementation 'org.spongepowered:configurate-jackson:4.1.2'
implementation 'org.jetbrains:annotations:26.0.1'
implementation 'net.bytebuddy:byte-buddy:1.15.10'
- implementation 'io.papermc.paper:paper-api:' + property("BUKKIT_VERSION") + '-R0.1-SNAPSHOT'
+ implementation 'io.papermc.paper:paper-api:' + property("BUKKIT_VERSION") + '.build.+'
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
diff --git a/Wrapper/src/main/java/org/soak/generate/bukkit/AttributeTypeList.java b/Wrapper/src/main/java/org/soak/generate/bukkit/AttributeTypeList.java
deleted file mode 100644
index 20ffa2e..0000000
--- a/Wrapper/src/main/java/org/soak/generate/bukkit/AttributeTypeList.java
+++ /dev/null
@@ -1,59 +0,0 @@
-package org.soak.generate.bukkit;
-
-import net.bytebuddy.ByteBuddy;
-import net.bytebuddy.dynamic.DynamicType;
-import org.bukkit.Keyed;
-import org.bukkit.Translatable;
-import org.spongepowered.api.entity.attribute.type.AttributeType;
-import org.spongepowered.api.entity.attribute.type.AttributeTypes;
-import org.spongepowered.api.registry.RegistryTypes;
-
-import java.util.EnumSet;
-import java.util.HashSet;
-
-public class AttributeTypeList {
-
- public static Class extends Enum>> LOADED_CLASS;
-
- public static DynamicType.Unloaded extends Enum>> createEntityTypeList() throws Exception {
- var attributeIterator = AttributeTypes.registry().stream().iterator();
- var attributes = new HashSet();
- while (attributeIterator.hasNext()) {
- var attribute = attributeIterator.next();
- var key = attribute.key(RegistryTypes.ATTRIBUTE_TYPE);
- var name = CommonGenerationCode.toName(key);
- attributes.add(name);
- }
- var classCreator = new ByteBuddy().makeEnumeration(attributes).name("org.bukkit.Attribute");
-
- return classCreator.implement(Keyed.class,
- Translatable.class,
- net.kyori.adventure.translation.Translatable.class).make();
- }
-
- public static > EnumSet values() {
- if (LOADED_CLASS == null) {
- throw new RuntimeException("EntityTypeList.LOADED_CLASS must be set");
- }
- return EnumSet.allOf((Class) LOADED_CLASS);
- }
-
- public static > T value(AttributeType type) {
- var enumName = CommonGenerationCode.toName(type.key(RegistryTypes.ATTRIBUTE_TYPE));
- EnumSet values = values();
- return values.stream()
- .filter(v -> v.name().equals(enumName))
- .findAny()
- .orElseThrow(() -> new RuntimeException("Found AttributeType name of '" + enumName + "' but couldnt " +
- "find the enum"));
- }
-
- public static AttributeType getAttributeType(Enum> enumEntry) {
- return AttributeTypes.registry()
- .stream()
- .filter(t -> CommonGenerationCode.toName(t.key(RegistryTypes.ATTRIBUTE_TYPE)).equals(enumEntry.name()))
- .findAny()
- .orElseThrow(() -> new IllegalArgumentException(
- "Could not find a registered AttributeType with the enum mapped name of '" + enumEntry.name() + "'"));
- }
-}
diff --git a/Wrapper/src/main/java/org/soak/map/SoakAttributeMap.java b/Wrapper/src/main/java/org/soak/map/SoakAttributeMap.java
index 9b1e71a..d6d21cf 100644
--- a/Wrapper/src/main/java/org/soak/map/SoakAttributeMap.java
+++ b/Wrapper/src/main/java/org/soak/map/SoakAttributeMap.java
@@ -1,23 +1,12 @@
package org.soak.map;
-import org.bukkit.attribute.Attribute;
-import org.soak.generate.bukkit.AttributeTypeList;
import org.spongepowered.api.entity.attribute.AttributeModifier;
import org.spongepowered.api.entity.attribute.AttributeOperation;
import org.spongepowered.api.entity.attribute.AttributeOperations;
-import org.spongepowered.api.entity.attribute.type.AttributeType;
import org.spongepowered.api.registry.DefaultedRegistryReference;
public class SoakAttributeMap {
- public static AttributeType toSponge(Attribute attribute) {
- return AttributeTypeList.getAttributeType(attribute);
- }
-
- public static > A toBukkit(AttributeType type) {
- return AttributeTypeList.value(type);
- }
-
public static DefaultedRegistryReference toSponge(org.bukkit.attribute.AttributeModifier.Operation operation) {
return switch (operation) {
case ADD_NUMBER -> AttributeOperations.ADDITION;
diff --git a/Wrapper/src/main/java/org/soak/map/SoakBannerMap.java b/Wrapper/src/main/java/org/soak/map/SoakBannerMap.java
deleted file mode 100644
index e2727ab..0000000
--- a/Wrapper/src/main/java/org/soak/map/SoakBannerMap.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.soak.map;
-
-import org.bukkit.block.banner.PatternType;
-import org.spongepowered.api.data.type.BannerPatternShape;
-import org.spongepowered.api.data.type.BannerPatternShapes;
-import org.spongepowered.api.registry.DefaultedRegistryReference;
-
-public class SoakBannerMap {
-
- public static PatternType toBukkit(BannerPatternShape shape) {
- System.err.println("Love to PatternType ByteBuddy");
- return PatternType.CREEPER;
- }
-
- public static DefaultedRegistryReference toSpongeGetter(PatternType type) {
- System.err.println("Love to PatternType ByteBuddy");
- return BannerPatternShapes.CREEPER;
- }
-
- public static BannerPatternShape toSponge(PatternType type) {
- return toSpongeGetter(type).get();
- }
-}
diff --git a/Wrapper/src/main/java/org/soak/map/SoakBiomeMap.java b/Wrapper/src/main/java/org/soak/map/SoakBiomeMap.java
deleted file mode 100644
index 4adf8eb..0000000
--- a/Wrapper/src/main/java/org/soak/map/SoakBiomeMap.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.soak.map;
-
-import org.bukkit.block.Biome;
-import org.spongepowered.api.registry.RegistryReference;
-import org.spongepowered.api.world.biome.Biomes;
-
-public class SoakBiomeMap {
-
- public static Biome toBukkit(org.spongepowered.api.world.biome.Biome sponge) {
- System.err.println("Biome requires ByteBuddy attention");
- return Biome.PLAINS;
- }
-
- public static org.spongepowered.api.world.biome.Biome toSponge(Biome biome) {
- return toSpongeGetter(biome).get();
- }
-
- public static RegistryReference toSpongeGetter(Biome bukkit) {
- System.err.println("Biome requires ByteBuddy attention");
- return Biomes.PLAINS;
- }
-}
diff --git a/Wrapper/src/main/java/org/soak/map/SoakBlockMap.java b/Wrapper/src/main/java/org/soak/map/SoakBlockMap.java
index 899939e..4297357 100644
--- a/Wrapper/src/main/java/org/soak/map/SoakBlockMap.java
+++ b/Wrapper/src/main/java/org/soak/map/SoakBlockMap.java
@@ -4,22 +4,11 @@
import org.soak.generate.bukkit.MaterialList;
import org.spongepowered.api.block.BlockType;
-import java.util.Arrays;
-import java.util.Optional;
-
public class SoakBlockMap {
+ //come on ... remove Material .... please
public static Material toBukkit(BlockType type) {
return MaterialList.value(type);
}
- //well done Paper, might just come back to paper because of that change
- public static org.bukkit.block.BlockType toBukkitType(BlockType type) {
- //doing this way for the time being
- return toBukkit(type).asBlockType();
- }
-
- public static Optional toSponge(Material material) {
- return MaterialList.getBlockType(material);
- }
}
diff --git a/Wrapper/src/main/java/org/soak/map/SoakDamageMap.java b/Wrapper/src/main/java/org/soak/map/SoakDamageMap.java
deleted file mode 100644
index c80bf3f..0000000
--- a/Wrapper/src/main/java/org/soak/map/SoakDamageMap.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.soak.map;
-
-import org.spongepowered.api.event.cause.entity.damage.DamageType;
-
-public class SoakDamageMap {
-
- public static DamageType toSponge(org.bukkit.damage.DamageType type) {
- throw new RuntimeException("Not implemented yet");
- }
-
- public static org.bukkit.damage.DamageType toBukkit(DamageType type) {
- throw new RuntimeException("Not implemented yet");
- }
-}
diff --git a/Wrapper/src/main/java/org/soak/map/SoakFluidTypeMap.java b/Wrapper/src/main/java/org/soak/map/SoakFluidTypeMap.java
deleted file mode 100644
index 1df490a..0000000
--- a/Wrapper/src/main/java/org/soak/map/SoakFluidTypeMap.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.soak.map;
-
-import org.bukkit.Fluid;
-import org.spongepowered.api.fluid.FluidType;
-import org.spongepowered.api.fluid.FluidTypes;
-import org.spongepowered.api.registry.RegistryTypes;
-
-public class SoakFluidTypeMap {
-
- public static Fluid toBukkit(FluidType type) {
- if (type.equals(FluidTypes.EMPTY.get())) {
- return null;
- }
- if (type.equals(FluidTypes.FLOWING_LAVA.get())) {
- return Fluid.FLOWING_LAVA;
- }
- if (type.equals(FluidTypes.LAVA.get())) {
- return Fluid.LAVA;
- }
- if (type.equals(FluidTypes.FLOWING_WATER.get())) {
- return Fluid.FLOWING_WATER;
- }
- if (type.equals(FluidTypes.WATER.get())) {
- return Fluid.WATER;
- }
- throw new RuntimeException("No mapping for " + type.key(RegistryTypes.FLUID_TYPE).formatted());
- }
-
- public static FluidType toSponge(Fluid fluid) {
- return switch (fluid) {
- case WATER -> FluidTypes.WATER.get();
- case FLOWING_WATER -> FluidTypes.FLOWING_WATER.get();
- case LAVA -> FluidTypes.LAVA.get();
- case FLOWING_LAVA -> FluidTypes.FLOWING_LAVA.get();
- default -> throw new RuntimeException("No mapping found for " + fluid.name());
- };
- }
-}
diff --git a/Wrapper/src/main/java/org/soak/map/SoakRegistryMap.java b/Wrapper/src/main/java/org/soak/map/SoakRegistryMap.java
new file mode 100644
index 0000000..67dbe1a
--- /dev/null
+++ b/Wrapper/src/main/java/org/soak/map/SoakRegistryMap.java
@@ -0,0 +1,125 @@
+package org.soak.map;
+
+import io.papermc.paper.registry.RegistryAccess;
+import io.papermc.paper.registry.RegistryKey;
+import org.bukkit.*;
+import org.bukkit.attribute.Attribute;
+import org.bukkit.block.banner.PatternType;
+import org.bukkit.entity.Frog;
+import org.bukkit.entity.Wolf;
+import org.bukkit.inventory.EquipmentSlot;
+import org.bukkit.inventory.MenuType;
+import org.jetbrains.annotations.NotNull;
+import org.spongepowered.api.ResourceKey;
+import org.spongepowered.api.block.BlockType;
+import org.spongepowered.api.block.BlockTypes;
+import org.spongepowered.api.data.type.*;
+import org.spongepowered.api.effect.sound.music.MusicDisc;
+import org.spongepowered.api.entity.attribute.type.AttributeType;
+import org.spongepowered.api.entity.attribute.type.AttributeTypes;
+import org.spongepowered.api.event.cause.entity.damage.DamageType;
+import org.spongepowered.api.fluid.FluidType;
+import org.spongepowered.api.fluid.FluidTypes;
+import org.spongepowered.api.item.inventory.ContainerType;
+import org.spongepowered.api.item.inventory.equipment.EquipmentType;
+import org.spongepowered.api.item.inventory.equipment.EquipmentTypes;
+import org.spongepowered.api.registry.DefaultedRegistryType;
+import org.spongepowered.api.registry.DefaultedRegistryValue;
+import org.spongepowered.api.registry.RegistryTypes;
+import org.spongepowered.api.world.biome.Biome;
+
+public class SoakRegistryMap {
+
+ public static > T toBukkit(Registry bukkitRegistry,
+ DefaultedRegistryType registryType, K spongeValue) {
+ return bukkitRegistry.get(SoakResourceKeyMap.mapToBukkit(spongeValue.key(registryType)));
+ }
+
+ public static > T toBukkit(RegistryKey bukkitRegistryKey,
+ DefaultedRegistryType registryType, K spongeValue) {
+ return toBukkit(RegistryAccess.registryAccess().getRegistry(bukkitRegistryKey), registryType, spongeValue);
+ }
+
+ public static > K toSponge(org.spongepowered.api.registry.Registry registryKey, T value) {
+ return toSpongeKeyed(registryKey, SoakResourceKeyMap.mapToSponge(value.key()));
+ }
+
+ public static > K toSpongeKeyed(org.spongepowered.api.registry.Registry registryKey, ResourceKey key) {
+ return registryKey.findValue(SoakResourceKeyMap.mapToSponge(key))
+ .orElseThrow(() -> new RuntimeException("Cannot find '" + key.asMinimalString() + "' from registry: " + registryKey.type()
+ .root()
+ .asMinimalString()));
+ }
+
+ @Deprecated
+ /*
+ * Used when paper still uses ``enum`` for registry values
+ */ public static , K extends DefaultedRegistryValue> K toVanillaSponge(org.spongepowered.api.registry.Registry registryKey, T value) {
+ return toSpongeKeyed(registryKey,
+ SoakResourceKeyMap.mapToSponge(NamespacedKey.minecraft(value.name().toLowerCase())));
+ }
+
+ public static AttributeType toSponge(@NotNull Attribute attribute) {
+ return toSponge(AttributeTypes.registry(), attribute);
+ }
+
+ public static BlockType toSpongeBlock(Material material) {
+ return toSponge(material.asBlockType());
+ }
+
+ public static BlockType toSponge(org.bukkit.block.BlockType type) {
+ return toSponge(BlockTypes.registry(), type);
+ }
+
+ public static EquipmentType toSponge(@NotNull EquipmentSlot equipmentSlot) {
+ return toVanillaSponge(EquipmentTypes.registry(), equipmentSlot);
+ }
+
+ public static MenuType toBukkit(ContainerType containerType) {
+ return toBukkit(Registry.MENU, RegistryTypes.CONTAINER_TYPE, containerType);
+ }
+
+ public static @NotNull org.bukkit.block.Biome toBukkit(Biome spongeBiome) {
+ return toBukkit(RegistryKey.BIOME, RegistryTypes.BIOME, spongeBiome);
+ }
+
+ public static FluidType toSponge(@NotNull Fluid item) {
+ return toSponge(FluidTypes.registry(), item);
+ }
+
+ public static Fluid toBukkit(FluidType fluidType) {
+ return toBukkit(Registry.FLUID, RegistryTypes.FLUID_TYPE, fluidType);
+ }
+
+ public static PatternType toBukkit(BannerPatternShape bannerPatternShape) {
+ return toBukkit(RegistryKey.BANNER_PATTERN, RegistryTypes.BANNER_PATTERN_SHAPE, bannerPatternShape);
+ }
+
+ public static org.bukkit.damage.DamageType toBukkit(DamageType damageType) {
+ return toBukkit(RegistryKey.DAMAGE_TYPE, RegistryTypes.DAMAGE_TYPE, damageType);
+ }
+
+ public static JukeboxSong toBukkit(MusicDisc musicDisc) {
+ return toBukkit(RegistryKey.JUKEBOX_SONG, RegistryTypes.MUSIC_DISC, musicDisc);
+ }
+
+ public static org.bukkit.block.BlockType toBukkit(BlockType blockType) {
+ return toBukkit(RegistryKey.BLOCK, RegistryTypes.BLOCK_TYPE, blockType);
+ }
+
+ public static Art toBukkit(ArtType artType) {
+ return toBukkit(Registry.ART, RegistryTypes.ART_TYPE, artType);
+ }
+
+ public static MusicInstrument toBukkit(InstrumentType instrumentType) {
+ return toBukkit(RegistryKey.INSTRUMENT, RegistryTypes.INSTRUMENT_TYPE, instrumentType);
+ }
+
+ public static Wolf.Variant toBukkit(WolfVariant wolfVariant) {
+ return toBukkit(RegistryKey.WOLF_VARIANT, RegistryTypes.WOLF_VARIANT, wolfVariant);
+ }
+
+ public static Frog.Variant toBukkit(FrogType frogType) {
+ return toBukkit(RegistryKey.FROG_VARIANT, RegistryTypes.FROG_TYPE, frogType);
+ }
+}
diff --git a/Wrapper/src/main/java/org/soak/map/SoakSoundMap.java b/Wrapper/src/main/java/org/soak/map/SoakSoundMap.java
index 752e312..b9e32ae 100644
--- a/Wrapper/src/main/java/org/soak/map/SoakSoundMap.java
+++ b/Wrapper/src/main/java/org/soak/map/SoakSoundMap.java
@@ -2,6 +2,7 @@
import net.kyori.adventure.key.Key;
import org.bukkit.JukeboxSong;
+import org.bukkit.Registry;
import org.bukkit.Sound;
import org.bukkit.SoundCategory;
import org.checkerframework.checker.nullness.qual.NonNull;
@@ -18,23 +19,4 @@ public static net.kyori.adventure.sound.Sound.Source toAdventure(SoundCategory c
}
return net.kyori.adventure.sound.Sound.Source.valueOf(category.name());
}
-
- public static @NonNull Key toAdventure(Sound sound) {
- return sound.key();
- }
-
- public static SoundType toSponge(String name) {
- var key = ResourceKey.minecraft(name);
- return SoundTypes.registry()
- .findValue(key)
- .orElseThrow(() -> new RuntimeException("No direct soundtype mapping for " + key.formatted()));
- }
-
- public static JukeboxSong toBukkit(MusicDisc disc) {
- throw new RuntimeException("Not implemented yet");
- }
-
- public static MusicDisc toSponge(JukeboxSong song) {
- throw new RuntimeException("Not implemented yet");
- }
}
diff --git a/Wrapper/src/main/java/org/soak/map/SoakSpawnReasonMap.java b/Wrapper/src/main/java/org/soak/map/SoakSpawnReasonMap.java
index 03573a9..16f8d1a 100644
--- a/Wrapper/src/main/java/org/soak/map/SoakSpawnReasonMap.java
+++ b/Wrapper/src/main/java/org/soak/map/SoakSpawnReasonMap.java
@@ -6,7 +6,6 @@
import org.spongepowered.api.event.cause.entity.SpawnType;
import org.spongepowered.api.event.cause.entity.SpawnTypes;
import org.spongepowered.api.item.ItemTypes;
-import org.spongepowered.api.registry.DefaultedRegistryReference;
import org.spongepowered.api.registry.RegistryTypes;
import java.util.Map;
@@ -43,20 +42,4 @@ public static CreatureSpawnEvent.SpawnReason toBukkit(SpawnType type, Cause caus
.orElseThrow(() -> new RuntimeException("Unknown spawn type and cause combo"));
}
- public static DefaultedRegistryReference toSponge(CreatureSpawnEvent.SpawnReason reason) {
- return switch (reason) {
- case BEEHIVE, SPAWNER, TRIAL_SPAWNER -> SpawnTypes.MOB_SPAWNER;
- case EGG, SPAWNER_EGG -> SpawnTypes.SPAWN_EGG;
- case BREEDING, OCELOT_BABY -> SpawnTypes.BREEDING;
- case BUILD_IRONGOLEM, BUILD_SNOWMAN, BUILD_WITHER, SILVERFISH_BLOCK -> SpawnTypes.BLOCK_SPAWNING;
- case ENCHANTMENT, OMINOUS_ITEM_SPAWNER, DEFAULT, POTION_EFFECT -> SpawnTypes.WORLD_SPAWNER;
- case COMMAND, MOUNT, CURED, TRAP, RAID, CUSTOM, DROWNED, DUPLICATION, ENDER_PEARL, FROZEN, INFECTION,
- JOCKEY, LIGHTNING, METAMORPHOSIS, NATURAL, NETHER_PORTAL, PATROL, PIGLIN_ZOMBIFIED, REINFORCEMENTS,
- SHEARED, SHOULDER_ENTITY, SLIME_SPLIT, SPELL, VILLAGE_DEFENSE, VILLAGE_INVASION -> SpawnTypes.CUSTOM;
- case DISPENSE_EGG -> SpawnTypes.DISPENSE;
- case EXPLOSION -> SpawnTypes.TNT_IGNITE;
- case CHUNK_GEN -> SpawnTypes.CHUNK_LOAD;
- };
- }
-
}
diff --git a/Wrapper/src/main/java/org/soak/map/SoakStructureMap.java b/Wrapper/src/main/java/org/soak/map/SoakStructureMap.java
index 96cd228..9acf845 100644
--- a/Wrapper/src/main/java/org/soak/map/SoakStructureMap.java
+++ b/Wrapper/src/main/java/org/soak/map/SoakStructureMap.java
@@ -37,7 +37,7 @@ public static org.bukkit.generator.structure.Structure toBukkit(Structure struct
public static org.bukkit.generator.structure.StructureType toBukkit(StructureType structure) {
- NamespacedKey namespace = SoakResourceKeyMap.mapToBukkit(structure.key(RegistryTypes.STRUCTURE));
+ NamespacedKey namespace = SoakResourceKeyMap.mapToBukkit(structure.key(RegistryTypes.STRUCTURE_TYPE));
Collection fakeReg = FakeRegistryHelper.getFields(org.bukkit.generator.structure.StructureType.class, org.bukkit.generator.structure.StructureType.class);
var opConstant = fakeReg.stream().filter(Objects::nonNull).filter(str -> str.getKey().equals(namespace)).findAny();
//orElseGet should only be used on the register
diff --git a/Wrapper/src/main/java/org/soak/map/event/entity/player/combat/SoakPlayerDeathEvent.java b/Wrapper/src/main/java/org/soak/map/event/entity/player/combat/SoakPlayerDeathEvent.java
index 9790b34..47320b3 100644
--- a/Wrapper/src/main/java/org/soak/map/event/entity/player/combat/SoakPlayerDeathEvent.java
+++ b/Wrapper/src/main/java/org/soak/map/event/entity/player/combat/SoakPlayerDeathEvent.java
@@ -58,7 +58,7 @@ public void handle(DropItemEvent.Destruct event) throws Exception {
.map(SoakItemStackMap::toBukkit)
.collect(Collectors.toList());
//TODO -> find exp
- var bukkitEvent = new PlayerDeathEvent(entity, bukkitDamageSource, items, 0, this.deathMessage);
+ var bukkitEvent = new PlayerDeathEvent(entity, bukkitDamageSource, items, 0, this.deathMessage, false);
fireEvent(bukkitEvent);
//TODO -> spawn the player back in if event is cancelled
//TODO -> cancel/change the message
diff --git a/Wrapper/src/main/java/org/soak/map/item/SoakRecipeMap.java b/Wrapper/src/main/java/org/soak/map/item/SoakRecipeMap.java
index f91d5ce..e010935 100644
--- a/Wrapper/src/main/java/org/soak/map/item/SoakRecipeMap.java
+++ b/Wrapper/src/main/java/org/soak/map/item/SoakRecipeMap.java
@@ -14,6 +14,7 @@
import org.spongepowered.api.item.recipe.single.StoneCutterRecipe;
import org.spongepowered.api.registry.RegistryTypes;
+import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
@@ -23,9 +24,10 @@ public class SoakRecipeMap {
public static Recipe toBukkit(org.spongepowered.api.item.recipe.Recipe> recipe) {
NamespacedKey key = SoakResourceKeyMap.mapToBukkit(recipe.type().key(RegistryTypes.RECIPE_TYPE));
var result = SoakItemStackMap.toBukkit(recipe.exemplaryResult());
- List inputs = recipe.ingredients();
+ List inputs = new ArrayList<>();
if (recipe instanceof CookingRecipe cooking) {
+ inputs.add(cooking.ingredient());
var input = SoakItemStackMap.toBukkit(cooking.ingredient().displayedItems().getFirst().type());
if (cooking.type().equals(RecipeTypes.SMELTING.get())) {
return new FurnaceRecipe(key,
@@ -57,7 +59,8 @@ public static Recipe toBukkit(org.spongepowered.api.item.recipe.Recipe> recipe
}
}
if (recipe instanceof StoneCutterRecipe stoneCutterRecipe) {
- var input = SoakItemStackMap.toBukkit(stoneCutterRecipe.ingredients().getFirst().displayedItems().getFirst().type());
+ inputs.add(stoneCutterRecipe.ingredient());
+ var input = SoakItemStackMap.toBukkit(stoneCutterRecipe.ingredient().displayedItems().getFirst().type());
return new StonecuttingRecipe(key, result, input);
}
@@ -67,6 +70,7 @@ public static Recipe toBukkit(org.spongepowered.api.item.recipe.Recipe> recipe
if (recipe instanceof ShapedCraftingRecipe shapedCrafting) {
+ inputs.addAll(shapedCrafting.ingredients());
var shaped = new ShapedRecipe(key, result);
int i = 0;
Map characterMap = new LinkedHashMap<>();
@@ -90,7 +94,8 @@ public static Recipe toBukkit(org.spongepowered.api.item.recipe.Recipe> recipe
return shaped;
}
- if (recipe instanceof ShapelessCraftingRecipe) {
+ if (recipe instanceof ShapelessCraftingRecipe shapelessCrafting) {
+ inputs = shapelessCrafting.ingredients();
var shapeless = new ShapelessRecipe(key, result);
inputs.stream()
.map(Ingredient::displayedItems)
@@ -100,7 +105,7 @@ public static Recipe toBukkit(org.spongepowered.api.item.recipe.Recipe> recipe
.forEach(shapeless::addIngredient);
return shapeless;
}
- throw new RuntimeException("Unknown mapping for recipetype " + recipe.type()
+ throw new RuntimeException("Unknown mapping for recipe type " + recipe.type()
.key(RegistryTypes.RECIPE_TYPE)
.formatted() + ": " + recipe.getClass().getName());
}
diff --git a/Wrapper/src/main/java/org/soak/utils/RegisterUtils.java b/Wrapper/src/main/java/org/soak/utils/RegisterUtils.java
index 8b9db0d..d03e89c 100644
--- a/Wrapper/src/main/java/org/soak/utils/RegisterUtils.java
+++ b/Wrapper/src/main/java/org/soak/utils/RegisterUtils.java
@@ -25,10 +25,12 @@ public static void registerMapViews() {
}
public static void registerMapView(ServerWorld world) {
- var mapInfo = Sponge.server()
- .mapStorage()
- .createNewMapInfo()
- .orElseThrow(() -> new IllegalStateException("Cannot create MapView"));
+ var opMapInfo = Sponge.server().mapStorage().createNewMapInfo();
+ if (opMapInfo.isEmpty()) {
+ System.err.println("Couldnt create map view for " + world.key() + ". Did event cancel it?");
+ return;
+ }
+ var mapInfo = opMapInfo.get();
mapInfo.offer(Keys.MAP_WORLD, world.key());
mapInfo.offer(Keys.MAP_TRACKS_PLAYERS, true);
}
diff --git a/Wrapper/src/main/java/org/soak/wrapper/SoakFluidTag.java b/Wrapper/src/main/java/org/soak/wrapper/SoakFluidTag.java
index e3c0ba3..15d6833 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/SoakFluidTag.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/SoakFluidTag.java
@@ -4,7 +4,7 @@
import org.bukkit.NamespacedKey;
import org.bukkit.Tag;
import org.jetbrains.annotations.NotNull;
-import org.soak.map.SoakFluidTypeMap;
+import org.soak.map.SoakRegistryMap;
import org.soak.map.SoakResourceKeyMap;
import org.soak.utils.TagHelper;
import org.spongepowered.api.fluid.FluidType;
@@ -14,20 +14,20 @@
public class SoakFluidTag implements Tag {
- private final org.spongepowered.api.tag.Tag tag;
+ private final org.spongepowered.api.tag.DefaultedTag tag;
- public SoakFluidTag(org.spongepowered.api.tag.Tag tag) {
+ public SoakFluidTag(org.spongepowered.api.tag.DefaultedTag tag) {
this.tag = tag;
}
@Override
public boolean isTagged(@NotNull Fluid item) {
- return SoakFluidTypeMap.toSponge(item).is(this.tag);
+ return SoakRegistryMap.toSponge(item).is(this.tag);
}
@Override
public @NotNull Set getValues() {
- return TagHelper.getFluidTypes(this.tag).map(SoakFluidTypeMap::toBukkit).collect(Collectors.toSet());
+ return TagHelper.getFluidTypes(this.tag).map(SoakRegistryMap::toBukkit).collect(Collectors.toSet());
}
@Override
diff --git a/Wrapper/src/main/java/org/soak/wrapper/SoakInternalApiBridge.java b/Wrapper/src/main/java/org/soak/wrapper/SoakInternalApiBridge.java
new file mode 100644
index 0000000..45f18d2
--- /dev/null
+++ b/Wrapper/src/main/java/org/soak/wrapper/SoakInternalApiBridge.java
@@ -0,0 +1,88 @@
+package org.soak.wrapper;
+
+import com.destroystokyo.paper.SkinParts;
+import io.papermc.paper.InternalAPIBridge;
+import io.papermc.paper.command.brigadier.CommandSourceStack;
+import io.papermc.paper.datacomponent.item.ResolvableProfile;
+import io.papermc.paper.entity.poi.PoiType;
+import io.papermc.paper.world.damagesource.CombatEntry;
+import io.papermc.paper.world.damagesource.FallLocationType;
+import net.kyori.adventure.text.Component;
+import org.bukkit.GameRule;
+import org.bukkit.block.Biome;
+import org.bukkit.damage.DamageEffect;
+import org.bukkit.damage.DamageSource;
+import org.bukkit.entity.LivingEntity;
+import org.bukkit.entity.Pose;
+import org.jspecify.annotations.Nullable;
+import org.soak.exception.NotImplementedException;
+import org.soak.utils.Singleton;
+import org.soak.wrapper.block.SoakLegacyCustomBiome;
+
+import java.util.Set;
+import java.util.function.Function;
+import java.util.function.Predicate;
+
+public class SoakInternalApiBridge implements InternalAPIBridge {
+
+ private final Singleton biome = new Singleton(SoakLegacyCustomBiome::new);
+
+ @Override
+ public DamageEffect getDamageEffect(String key) {
+ throw NotImplementedException.createByLazy(this, "getDamageEffect", String.class);
+ }
+
+ @Override
+ public PoiType.Occupancy createOccupancy(String enumNameEntry) {
+ throw NotImplementedException.createByLazy(this, "createOccupancy", String.class);
+ }
+
+ @Override
+ public Biome constructLegacyCustomBiome() {
+ return biome.get();
+ }
+
+ @Override
+ public CombatEntry createCombatEntry(LivingEntity entity, DamageSource damageSource, float damage) {
+ throw NotImplementedException.createByLazy(this, "createCombatEntry", LivingEntity.class);
+ }
+
+ @Override
+ public CombatEntry createCombatEntry(DamageSource damageSource, float damage,
+ @Nullable FallLocationType fallLocationType, float fallDistance) {
+ throw NotImplementedException.createByLazy(this, "createCombatEntry", DamageSource.class);
+ }
+
+ @Override
+ public Predicate restricted(Predicate predicate) {
+ throw NotImplementedException.createByLazy(this, "restricted", Predicate.class);
+ }
+
+ @Override
+ public ResolvableProfile defaultMannequinProfile() {
+ throw NotImplementedException.createByLazy(this, "defaultMannequinProfile");
+ }
+
+ @Override
+ public SkinParts.Mutable allSkinParts() {
+ throw NotImplementedException.createByLazy(this, "allSkinParts");
+ }
+
+ @Override
+ public Component defaultMannequinDescription() {
+ throw NotImplementedException.createByLazy(this, "defaultMannequinDescription");
+ }
+
+ @Override
+ public GameRule legacyGameRuleBridge(GameRule rule,
+ Function fromLegacyToModern,
+ Function toLegacyFromModern,
+ Class legacyClass) {
+ throw NotImplementedException.createByLazy(this, "legacyGameRuleBridge", GameRule.class);
+ }
+
+ @Override
+ public Set validMannequinPoses() {
+ throw NotImplementedException.createByLazy(this, "validMannequinPoses");
+ }
+}
diff --git a/Wrapper/src/main/java/org/soak/wrapper/SoakOfflinePlayer.java b/Wrapper/src/main/java/org/soak/wrapper/SoakOfflinePlayer.java
index 815b963..136f340 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/SoakOfflinePlayer.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/SoakOfflinePlayer.java
@@ -15,6 +15,7 @@
import org.spongepowered.api.Sponge;
import org.spongepowered.api.data.Keys;
import org.spongepowered.api.entity.living.player.User;
+import org.spongepowered.api.profile.GameProfile;
import org.spongepowered.api.service.ban.Ban;
import java.time.*;
@@ -40,6 +41,10 @@ public SoakOfflinePlayer(@NotNull CompletableFuture futureUser) {
futureUser.thenAccept(user -> this.user = user);
}
+ public SoakOfflinePlayer(GameProfile gameProfile) {
+ this(Sponge.server().userManager().load(gameProfile).thenApply(optionalUser -> optionalUser.orElseThrow(() -> new RuntimeException("Cannot load user of " + gameProfile.uuid() + " but was found in cache"))));
+ }
+
public @NotNull User spongeUser() {
LocalTime startTime = null;
while (this.user == null) {
@@ -169,38 +174,43 @@ public long getLastSeen() {
return respawnLocation.asLocation().map(SoakLocationMap::toBukkit).orElse(null);
}
+ @Override
+ public @org.jspecify.annotations.Nullable Location getRespawnLocation(boolean loadLocationAndValidate) {
+ throw NotImplementedException.createByLazy(this, "getRespawnLocation", boolean.class);
+ }
+
@Override
public void incrementStatistic(@NotNull Statistic arg0, @NotNull Material arg1, int arg2) {
throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "incrementStatistic",
- Statistic.class,
- Material.class,
- int.class);
+ "incrementStatistic",
+ Statistic.class,
+ Material.class,
+ int.class);
}
@Override
public void incrementStatistic(@NotNull Statistic arg0, @NotNull Material arg1) {
throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "incrementStatistic",
- Statistic.class,
- Material.class);
+ "incrementStatistic",
+ Statistic.class,
+ Material.class);
}
@Override
public void incrementStatistic(@NotNull Statistic arg0, @NotNull EntityType arg1) {
throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "incrementStatistic",
- Statistic.class,
- EntityType.class);
+ "incrementStatistic",
+ Statistic.class,
+ EntityType.class);
}
@Override
public void incrementStatistic(@NotNull Statistic arg0, @NotNull EntityType arg1, int arg2) {
throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "incrementStatistic",
- Statistic.class,
- EntityType.class,
- int.class);
+ "incrementStatistic",
+ Statistic.class,
+ EntityType.class,
+ int.class);
}
@Override
@@ -211,9 +221,9 @@ public void incrementStatistic(@NotNull Statistic arg0) {
@Override
public void incrementStatistic(@NotNull Statistic arg0, int arg1) {
throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "incrementStatistic",
- Statistic.class,
- int.class);
+ "incrementStatistic",
+ Statistic.class,
+ int.class);
}
@Override
@@ -224,52 +234,52 @@ public void decrementStatistic(@NotNull Statistic arg0) {
@Override
public void decrementStatistic(@NotNull Statistic arg0, @NotNull Material arg1, int arg2) {
throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "decrementStatistic",
- Statistic.class,
- Material.class,
- int.class);
+ "decrementStatistic",
+ Statistic.class,
+ Material.class,
+ int.class);
}
@Override
public void decrementStatistic(@NotNull Statistic arg0, @NotNull EntityType arg1) {
throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "decrementStatistic",
- Statistic.class,
- EntityType.class);
+ "decrementStatistic",
+ Statistic.class,
+ EntityType.class);
}
@Override
public void decrementStatistic(@NotNull Statistic arg0, @NotNull EntityType arg1, int arg2) {
throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "decrementStatistic",
- Statistic.class,
- EntityType.class,
- int.class);
+ "decrementStatistic",
+ Statistic.class,
+ EntityType.class,
+ int.class);
}
@Override
public void decrementStatistic(@NotNull Statistic arg0, int arg1) {
throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "decrementStatistic",
- Statistic.class,
- int.class);
+ "decrementStatistic",
+ Statistic.class,
+ int.class);
}
@Override
public void decrementStatistic(@NotNull Statistic arg0, @NotNull Material arg1) {
throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "decrementStatistic",
- Statistic.class,
- Material.class);
+ "decrementStatistic",
+ Statistic.class,
+ Material.class);
}
@Override
public void setStatistic(@NotNull Statistic arg0, @NotNull EntityType arg1, int arg2) {
throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "setStatistic",
- Statistic.class,
- EntityType.class,
- int.class);
+ "setStatistic",
+ Statistic.class,
+ EntityType.class,
+ int.class);
}
@Override
@@ -299,18 +309,18 @@ public void setStatistic(@NotNull Statistic arg0, int arg1) {
@Override
public void setStatistic(@NotNull Statistic arg0, @NotNull Material arg1, int arg2) {
throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "setStatistic",
- Statistic.class,
- Material.class,
- int.class);
+ "setStatistic",
+ Statistic.class,
+ Material.class,
+ int.class);
}
@Override
public int getStatistic(@NotNull Statistic arg0, @NotNull Material arg1) {
throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "getStatistic",
- Statistic.class,
- Material.class);
+ "getStatistic",
+ Statistic.class,
+ Material.class);
}
@Override
@@ -321,9 +331,9 @@ public int getStatistic(@NotNull Statistic arg0) {
@Override
public int getStatistic(@NotNull Statistic arg0, @NotNull EntityType arg1) {
throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "getStatistic",
- Statistic.class,
- EntityType.class);
+ "getStatistic",
+ Statistic.class,
+ EntityType.class);
}
@Override
diff --git a/Wrapper/src/main/java/org/soak/wrapper/SoakRegistry.java b/Wrapper/src/main/java/org/soak/wrapper/SoakRegistry.java
deleted file mode 100644
index 57e2a44..0000000
--- a/Wrapper/src/main/java/org/soak/wrapper/SoakRegistry.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.soak.wrapper;
-
-import org.bukkit.Keyed;
-import org.bukkit.NamespacedKey;
-import org.bukkit.Registry;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.soak.map.SoakResourceKeyMap;
-import org.spongepowered.api.registry.DefaultedRegistryType;
-import org.spongepowered.api.registry.RegistryEntry;
-
-import java.util.Iterator;
-import java.util.function.Function;
-import java.util.stream.Stream;
-
-public class SoakRegistry implements Registry
{
-
- private final DefaultedRegistryType registryType;
- private final Function map;
- private final Class
bukkitType;
-
- public SoakRegistry(DefaultedRegistryType registryType, Class
bukkitType, Function function) {
- this.registryType = registryType;
- this.map = function;
- this.bukkitType = bukkitType;
- }
-
- public Class
bukkitType() {
- return this.bukkitType;
- }
-
- @Override
- public @Nullable BR get(@NotNull NamespacedKey namespacedKey) {
- return registryType.get().findEntry(SoakResourceKeyMap.mapToSponge(namespacedKey)).map(RegistryEntry::value).map(map).orElse(null);
- }
-
- @Override
- public @NotNull BR getOrThrow(@NotNull NamespacedKey namespacedKey) {
- return stream().filter(br -> br.getKey().equals(namespacedKey)).findAny().orElseThrow();
- }
-
- @Override
- public @NotNull Stream
stream() {
- return registryType.get().stream().map(map);
- }
-
- @Override
- public @NotNull Iterator
iterator() {
- return stream().iterator();
- }
-}
diff --git a/Wrapper/src/main/java/org/soak/wrapper/SoakServer.java b/Wrapper/src/main/java/org/soak/wrapper/SoakServer.java
index ea7931b..64c6ec1 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/SoakServer.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/SoakServer.java
@@ -3,15 +3,11 @@
import com.destroystokyo.paper.MaterialSetTag;
import com.destroystokyo.paper.entity.ai.MobGoals;
import com.destroystokyo.paper.profile.PlayerProfile;
-import io.papermc.paper.ban.BanListType;
+import io.papermc.paper.configuration.ServerConfiguration;
import io.papermc.paper.datapack.DatapackManager;
-import io.papermc.paper.math.Position;
import io.papermc.paper.tag.EntitySetTag;
import io.papermc.paper.threadedregions.scheduler.AsyncScheduler;
-import io.papermc.paper.threadedregions.scheduler.GlobalRegionScheduler;
-import io.papermc.paper.threadedregions.scheduler.RegionScheduler;
import net.kyori.adventure.audience.Audience;
-import net.kyori.adventure.key.Key;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.format.NamedTextColor;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
@@ -26,12 +22,9 @@
import org.bukkit.entity.*;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.generator.ChunkGenerator;
-import org.bukkit.generator.structure.Structure;
import org.bukkit.inventory.*;
import org.bukkit.loot.LootTable;
-import org.bukkit.map.MapCursor;
import org.bukkit.map.MapView;
-import org.bukkit.packs.DataPackManager;
import org.bukkit.packs.ResourcePack;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.ServicesManager;
@@ -51,16 +44,15 @@
import org.soak.exception.NotImplementedException;
import org.soak.map.*;
import org.soak.map.item.SoakItemStackMap;
-import org.soak.map.item.SoakRecipeMap;
import org.soak.plugin.SoakExternalManager;
import org.soak.plugin.SoakManager;
import org.soak.utils.*;
import org.soak.utils.log.CustomLoggerFormat;
import org.soak.wrapper.block.data.SoakBlockData;
import org.soak.wrapper.command.SoakCommandMap;
+import org.soak.wrapper.command.SoakCommandSender;
import org.soak.wrapper.command.SoakConsoleCommandSender;
import org.soak.wrapper.entity.living.human.SoakPlayer;
-import org.soak.wrapper.entity.living.human.user.SoakLoadingUser;
import org.soak.wrapper.help.SoakHelpMap;
import org.soak.wrapper.inventory.SoakInventory;
import org.soak.wrapper.inventory.SoakItemFactory;
@@ -68,8 +60,13 @@
import org.soak.wrapper.plugin.SoakPluginManager;
import org.soak.wrapper.plugin.messaging.SoakMessenger;
import org.soak.wrapper.profile.SoakPlayerProfile;
+import org.soak.wrapper.registry.ISoakRegistry;
+import org.soak.wrapper.registry.SoakRegistry;
import org.soak.wrapper.scheduler.SoakBukkitScheduler;
-import org.soak.wrapper.world.SoakWorld;
+import org.soak.wrapper.server.ServerSplitBan;
+import org.soak.wrapper.server.ServerSplitItem;
+import org.soak.wrapper.server.ServerSplitRegion;
+import org.soak.wrapper.server.ServerSplitWorld;
import org.spongepowered.api.ResourceKey;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.block.BlockState;
@@ -88,16 +85,15 @@
import org.spongepowered.api.tag.FluidTypeTags;
import org.spongepowered.api.tag.ItemTypeTags;
import org.spongepowered.api.world.DefaultWorldKeys;
-import org.spongepowered.api.world.server.ServerWorld;
import java.awt.image.BufferedImage;
import java.io.File;
-import java.io.IOException;
import java.lang.reflect.Modifier;
import java.lang.reflect.ParameterizedType;
import java.net.InetAddress;
import java.net.InetSocketAddress;
import java.net.UnknownHostException;
+import java.nio.file.Path;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutionException;
@@ -113,7 +109,7 @@
Maybe worth splitting this out into their own managers and then using this
class to redirect the call to its respected manager.
*/
-public abstract class SoakServer implements Server {
+public class SoakServer implements Server, ServerSplitRegion, ServerSplitBan, ServerSplitWorld, ServerSplitItem {
private final Supplier serverSupplier;
private final Singleton messenger =
@@ -124,17 +120,10 @@ public abstract class SoakServer implements Server {
private final Singleton itemFactory = new Singleton<>(SoakItemFactory::new);
private final Singleton scheduler = new Singleton<>(SoakBukkitScheduler::new);
private final Singleton servicesManager = new Singleton<>(SimpleServicesManager::new);
- private final Singleton commandMap = new Singleton<>(SoakCommandMap::new);
+ private final SoakCommandMap commandMapNonDeclared = new SoakCommandMap();
private final Singleton helpMap = new Singleton<>(SoakHelpMap::new);
- private final Singleton> structureReg = new Singleton<>(
- () -> new SoakRegistry<>(RegistryTypes.STRUCTURE, Structure.class, t -> null));
- private final Singleton> structureTypeReg = new Singleton<>(
- () -> new SoakRegistry<>(RegistryTypes.STRUCTURE_TYPE,
- org.bukkit.generator.structure.StructureType.class,
- t -> null));
private final Singleton simplePluginManagerWrapper = new Singleton<>(() -> {
- var pm = new SimplePluginManager(this, commandMap.get());
+ var pm = new SimplePluginManager(this, commandMapNonDeclared);
pm.paperPluginManager = pluginManager.get();
return pm;
});
@@ -146,19 +135,24 @@ public abstract class SoakServer implements Server {
.filter(field -> Registry.class.isAssignableFrom(field.getType()))
.map(field -> {
try {
- var reg = (Registry>) field.get(null);
- return reg;
+ return (Registry>) field.get(null);
} catch (IllegalAccessException e) {
throw new RuntimeException(e);
}
})
.filter(Objects::nonNull)
- .filter(reg -> !(reg instanceof SoakRegistry, ?>))
+ .filter(reg -> !(reg instanceof SoakRegistry))
.collect(Collectors.toMap(reg -> {
- if (reg instanceof Registry.SimpleRegistry simpleReg) {
+ if (reg instanceof Registry.SimpleRegistry> simpleReg) {
var first = simpleReg.iterator().next();
return first.getClass();
}
+ if (reg instanceof ISoakRegistry, ?> soakRegistry) {
+ var key = soakRegistry.key();
+ if (key instanceof Class> clazz) {
+ return clazz;
+ }
+ }
var generic = (ParameterizedType) reg.getClass().getGenericInterfaces()[0];
return (Class>) generic.getActualTypeArguments()[0];
}, reg -> reg)));
@@ -176,357 +170,16 @@ public SoakServer(Supplier serverSupplier) {
this.serverSupplier = serverSupplier;
}
- @Override
- public boolean isAcceptingTransfers() {
- throw NotImplementedException.createByLazy(Server.class, "isAcceptingTransfers");
- }
-
- @Override
- public boolean isOwnedByCurrentRegion(@NotNull World world, @NotNull Position position) {
- return isOwnedByCurrentRegion(position.toLocation(world));
- }
-
- @Override
- public boolean isOwnedByCurrentRegion(@NotNull World world, @NotNull Position position, int squareRadiusChecks) {
- return isOwnedByCurrentRegion(position.toLocation(world), squareRadiusChecks);
- }
-
- @Override
- public boolean isOwnedByCurrentRegion(@NotNull Location location) {
- return isOwnedByCurrentRegion(location, 1);
- }
-
- @Override
- public boolean isOwnedByCurrentRegion(@NotNull Location location, int squareRadiusChunks) {
- var chunk = location.getChunk();
- return isOwnedByCurrentRegion(location.getWorld(), chunk.getX(), chunk.getZ(), squareRadiusChunks);
- }
-
- @Override
- public boolean isOwnedByCurrentRegion(@NotNull World world, int chunkX, int chunkZ) {
- return isOwnedByCurrentRegion(world, chunkX, chunkZ, 1);
- }
-
- @Override
- public boolean isOwnedByCurrentRegion(@NotNull World world, int chunkX, int chunkZ, int squareRadiusChunks) {
- throw NotImplementedException.createByLazy(Server.class,
- "isOwnedByCurrentRegion",
- World.class,
- int.class,
- int.class,
- int.class);
- }
-
- @Override
- public boolean isOwnedByCurrentRegion(@NotNull Entity entity) {
- return isOwnedByCurrentRegion(entity.getLocation());
- }
-
- @Override
- public @NotNull RegionScheduler getRegionScheduler() {
- throw NotImplementedException.createByLazy(Server.class, "getRegionScheduler");
- }
-
- @Override
- public @NotNull AsyncScheduler getAsyncScheduler() {
- throw NotImplementedException.createByLazy(Server.class, "getAsyncScheduler");
- }
-
- @Override
- public @NotNull GlobalRegionScheduler getGlobalRegionScheduler() {
- throw NotImplementedException.createByLazy(Server.class, "getGlobalRegionScheduler");
- }
-
- @Override
- public void banIP(@NotNull InetAddress inetAddress) {
- throw NotImplementedException.createByLazy(Server.class, "banIP", InetAddress.class);
- }
-
- @Override
- public void unbanIP(@NotNull InetAddress inetAddress) {
- throw NotImplementedException.createByLazy(Server.class, "unbanIP", InetAddress.class);
- }
-
- @Override
- public , E> @NotNull B getBanList(@NotNull BanListType banListType) {
- throw NotImplementedException.createByLazy(Server.class, "getBanList", BanListType.class);
- }
-
- @Override
- public @NotNull EntityFactory getEntityFactory() {
- throw NotImplementedException.createByLazy(Server.class, "getEntityFactory");
- }
-
- @Override
- public @NotNull ServerLinks getServerLinks() {
- throw NotImplementedException.createByLazy(Server.class, "getServerLinks");
- }
-
- @Override
- public @NotNull ItemStack craftItem(@NotNull ItemStack[] itemStacks, @NotNull World world) {
- throw NotImplementedException.createByLazy(Server.class, "craftItem", ItemStack[].class, World.class);
- }
-
- @Override
- public @NotNull ItemCraftResult craftItemResult(@NotNull ItemStack[] itemStacks, @NotNull World world,
- @NotNull Player player) {
- throw NotImplementedException.createByLazy(Server.class,
- "craftItemResult",
- ItemStack[].class,
- World.class,
- Player.class);
- }
-
- @Override
- public @NotNull ItemCraftResult craftItemResult(@NotNull ItemStack[] itemStacks, @NotNull World world) {
- throw NotImplementedException.createByLazy(Server.class, "craftItemResult", ItemStack[].class, World.class);
- }
-
- @Override
- public void updateResources() {
- throw NotImplementedException.createByLazy(Server.class, "updateResources");
- }
-
- @Override
- public void updateRecipes() {
- throw NotImplementedException.createByLazy(Server.class, "updateRecipes");
- }
-
- @Override
- public boolean removeRecipe(@NotNull NamespacedKey namespacedKey, boolean b) {
- throw NotImplementedException.createByLazy(Server.class, "removeRecipe", NamespacedKey.class, boolean.class);
- }
-
- @Override
- public @Nullable ItemStack createExplorerMap(@NotNull World world, @NotNull Location location,
- @NotNull org.bukkit.generator.structure.StructureType structureType,
- @NotNull MapCursor.Type type, int i, boolean b) {
- Bukkit bukkit;
- throw NotImplementedException.createByLazy(Server.class,
- "createExplorerMap",
- World.class,
- Location.class,
- org.bukkit.generator.structure.StructureType.class,
- MapCursor.Type.class,
- int.class,
- boolean.class);
- }
-
public org.spongepowered.api.Server spongeServer() {
return this.serverSupplier.get();
}
- @Override
- public @Nullable Recipe getRecipe(@NotNull NamespacedKey namespacedKey) {
- throw NotImplementedException.createByLazy(Server.class, "getRecipe", NamespacedKey.class);
- }
-
- @Override
- public @NotNull List getRecipesFor(@NotNull ItemStack itemStack) {
- throw NotImplementedException.createByLazy(Server.class, "getRecipesFor", ItemStack.class);
- }
-
- @Override
- public boolean unloadWorld(@NotNull String name, boolean save) {
- var world = getWorld(name);
- if (world == null) {
- return false;
- }
- return unloadWorld(world, save);
- }
-
- @Override
- public @Nullable World getWorld(@NotNull Key key) {
- var namespace = SoakResourceKeyMap.mapToSponge(key);
- if (namespace == null) {
- return null;
- }
- return Sponge.server()
- .worldManager()
- .worlds()
- .stream()
- .filter(world -> world.key().equals(namespace))
- .findAny()
- .map(world -> SoakManager.getManager().getMemoryStore().get(world))
- .orElse(null);
- }
-
- @Override
- public @Nullable World getWorld(@NotNull String s) {
- return Sponge.server()
- .worldManager()
- .worlds()
- .stream()
- .filter(world -> world.key().value().equalsIgnoreCase(s))
- .findAny()
- .map(world -> SoakManager.getManager().getMemoryStore().get(world))
- .orElse(null);
- }
-
- @Override
- public @Nullable World getWorld(@NotNull UUID uuid) {
- var worldManager = Sponge.server().worldManager();
- return worldManager.worldKey(uuid)
- .flatMap(worldManager::world)
- .map(world -> SoakManager.getManager().getMemoryStore().get(world))
- .orElse(null);
- }
-
- @Override
- public @Nullable ResourcePack getServerResourcePack() {
- throw NotImplementedException.createByLazy(Server.class, "getServerResourcePack");
- }
-
- @Override
- public boolean isLoggingIPs() {
- throw NotImplementedException.createByLazy(Server.class, "isLoggingIPs");
- }
-
- @Override
- public @NotNull ServerTickManager getServerTickManager() {
- throw NotImplementedException.createByLazy(Server.class, "getServerTickManager");
- }
-
- @Override
- public @NotNull Iterable> getTags(@NotNull String registry, @NotNull Class clazz) {
- throw NotImplementedException.createByLazy(Server.class, "getTags", String.class, Class.class);
- }
-
- @Override
- public Tag getTag(@NotNull String registry, @NotNull NamespacedKey tag,
- @NotNull Class clazz) {
- ResourceKey key = SoakResourceKeyMap.mapToSponge(tag);
- boolean classMatch = clazz.getName().equals(Material.class.getName());
- if (classMatch && registry.equals(Tag.REGISTRY_BLOCKS)) {
- var opTag = FakeRegistryHelper.>getFields(BlockTypeTags.class,
- org.spongepowered.api.tag.Tag.class)
- .stream()
- .filter(spongeTag -> spongeTag.key().equals(key))
- .findAny();
- if (opTag.isPresent()) {
- //noinspection unchecked
- return (Tag) (Object) new MaterialSetTag(tag,
- TagHelper.getBlockTypes(opTag.get())
- .map(SoakBlockMap::toBukkit)
- .collect(Collectors.toList()));
- }
- }
- if (classMatch && registry.equals(Tag.REGISTRY_ITEMS)) {
- var opTag = FakeRegistryHelper.>getFields(ItemTypeTags.class,
- org.spongepowered.api.tag.Tag.class)
- .stream()
- .filter(spongeTag -> spongeTag.key().equals(key))
- .findAny();
- if (opTag.isPresent()) {
- //noinspection unchecked
- return (Tag) (Object) new MaterialSetTag(tag,
- TagHelper.getItemTypes(opTag.get())
- .map(SoakItemStackMap::toBukkit)
- .collect(Collectors.toList()));
- }
- }
- if (clazz.getName().equals(EntityType.class.getName()) && registry.equals(Tag.REGISTRY_ENTITY_TYPES)) {
- var opTag =
- FakeRegistryHelper.>>getFields(
- EntityTypeTags.class,
- org.spongepowered.api.tag.Tag.class)
- .stream()
- .filter(spongeTag -> spongeTag.key().equals(key))
- .findAny();
- if (opTag.isPresent()) {
- //noinspection unchecked
- return (Tag) (Object) new EntitySetTag(tag,
- TagHelper.getEntityTypes(opTag.get())
- .map(SoakEntityMap::toBukkit)
- .collect(Collectors.toList()));
- }
- }
-
-
- //overrides
- if (registry.equals(Tag.REGISTRY_ITEMS) && tag.asString().equals("minecraft:coral_blocks")) {
- //noinspection unchecked
- return (Tag) (Object) new MaterialSetTag(tag,
- ItemTypes.registry()
- .stream()
- .filter(item -> item.key(RegistryTypes.ITEM_TYPE)
- .value()
- .contains("coral_blocks"))
- .map(SoakItemStackMap::toBukkit)
- .collect(Collectors.toList()));
- }
-
- if (registry.equals(Tag.REGISTRY_BLOCKS) && tag.asString().equals("minecraft:wool_carpets")) {
- Set itemTypes = TagHelper.getBlockTypes(BlockTypeTags.WOOL_CARPETS)
- .map(SoakBlockMap::toBukkit)
- .collect(Collectors.toSet());
- //noinspection unchecked
- return (Tag) (Object) new MaterialSetTag(tag, itemTypes);
- }
-
- if (registry.equals(Tag.REGISTRY_ITEMS) && tag.asString().equals("minecraft:wool_carpets")) {
- Set itemTypes = TagHelper.getItemTypes(ItemTypeTags.WOOL_CARPETS)
- .map(SoakItemStackMap::toBukkit)
- .collect(Collectors.toSet());
- //noinspection unchecked
- return (Tag) (Object) new MaterialSetTag(tag, itemTypes);
-
- }
-
- if (registry.equals(Tag.REGISTRY_FLUIDS) && tag.asString().equals("minecraft:water")) {
- //noinspection unchecked
- return (Tag) (Object) new SoakFluidTag(FluidTypeTags.WATER);
- }
-
- if (registry.equals(Tag.REGISTRY_FLUIDS) && tag.asString().equals("minecraft:lava")) {
- //noinspection unchecked
- return (Tag) (Object) new SoakFluidTag(FluidTypeTags.LAVA);
- }
-
- if (registry.equals(Tag.REGISTRY_ITEMS) && tag.asString().equals("minecraft:crops")) {
- var items = ItemTypes.registry()
- .stream()
- .filter(item -> org.spongepowered.api.item.inventory.ItemStack.of(item)
- .get(Keys.REPLENISHED_FOOD)
- .isPresent())
- .map(SoakItemStackMap::toBukkit)
- .collect(Collectors.toSet());
- //noinspection unchecked
- return (Tag) (Object) new MaterialSetTag(tag, items);
- }
- if (registry.equals(Tag.REGISTRY_ITEMS) && tag.asString().equals("minecraft:furnace_materials")) {
- var items = ItemTypes.registry()
- .stream()
- .filter(item -> org.spongepowered.api.item.inventory.ItemStack.of(item)
- .get(Keys.MAX_COOK_TIME)
- .isPresent())
- .map(SoakItemStackMap::toBukkit)
- .collect(Collectors.toSet());
- //noinspection unchecked
- return (Tag) (Object) new MaterialSetTag(tag, items);
- }
- SoakManager.getManager()
- .getLogger()
- .warn("No tag found of registry: '" + registry + "' Type: " + clazz.getSimpleName() + " id: " + tag.asString());
- return null;
- }
-
public void syncCommands() {
//Craftbukkit public method to reregister all commands and apply to all players as well as register to brig
var commandManager = this.spongeServer().commandManager();
this.spongeServer().streamOnlinePlayers().forEach(commandManager::updateCommandTreeForPlayer);
}
- @Override
- public @NotNull Server.Spigot spigot() {
- return new SoakSpigotServer();
- }
-
- @Override
- public @NotNull File getWorldContainer() {
- throw NotImplementedException.createByLazy(Server.class, "getWorldContainer");
- }
-
@Override
public @NotNull File getPluginsFolder() {
return new File("org/soak/generate/bukkit/plugins");
@@ -568,6 +221,9 @@ public void syncCommands() {
.orElseThrow(() -> new RuntimeException(
"No value found for last joined on a online player"))))
.buildList();
+ } @Override
+ public @NotNull AsyncScheduler getAsyncScheduler() {
+ throw NotImplementedException.createByLazy(Server.class, "getAsyncScheduler");
}
@Override
@@ -596,6 +252,9 @@ public int getViewDistance() {
@Override
public int getSimulationDistance() {
throw NotImplementedException.createByLazy(Server.class, "getSimulationDistance");
+ } @Override
+ public boolean isGlobalTickThread() {
+ throw NotImplementedException.createByLazy(this, "isGlobalTickThread");
}
@Override
@@ -631,6 +290,14 @@ public boolean getAllowNether() {
return this.spongeServer().worldManager().world(DefaultWorldKeys.THE_NETHER).isPresent();
}
+ @Override
+ public boolean isLoggingIPs() {
+ throw NotImplementedException.createByLazy(Server.class, "isLoggingIPs");
+ } @Override
+ public boolean isPaused() {
+ throw NotImplementedException.createByLazy(this, "isPaused");
+ }
+
@Override
public @NotNull List getInitialEnabledPacks() {
throw NotImplementedException.createByLazy(Server.class, "getInitialEnabledPacks");
@@ -642,8 +309,13 @@ public boolean getAllowNether() {
}
@Override
- public @NotNull DataPackManager getDataPackManager() {
- throw NotImplementedException.createByLazy(Server.class, "getDataPackManager");
+ public @NotNull ServerTickManager getServerTickManager() {
+ throw NotImplementedException.createByLazy(Server.class, "getServerTickManager");
+ }
+
+ @Override
+ public @Nullable ResourcePack getServerResourcePack() {
+ throw NotImplementedException.createByLazy(Server.class, "getServerResourcePack");
}
@Override
@@ -659,6 +331,9 @@ public boolean getAllowNether() {
@Override
public @NotNull String getResourcePackPrompt() {
throw NotImplementedException.createByLazy(Server.class, "getResourcePackPrompt");
+ } @Override
+ public void allowPausing(@NotNull Plugin plugin, boolean value) {
+ throw NotImplementedException.createByLazy(this, "allowPausing", Plugin.class, boolean.class);
}
@Override
@@ -666,6 +341,11 @@ public boolean isResourcePackRequired() {
throw NotImplementedException.createByLazy(Server.class, "isResourcePackRequired");
}
+ @Override
+ public boolean hasWhitelist() {
+ return this.spongeServer().isWhitelistEnabled();
+ }
+
@Override
public void setWhitelist(boolean value) {
throw NotImplementedException.createByLazy(SoakServer.class, "setWhitelist", boolean.class);
@@ -746,6 +426,9 @@ public int getTicksPerMonsterSpawns() {
@Override
public int getTicksPerWaterSpawns() {
throw NotImplementedException.createByLazy(SoakServer.class, "getTicksPerWaterSpawns");
+ } @Override
+ public @NotNull Iterable> getTags(@NotNull String registry, @NotNull Class clazz) {
+ throw NotImplementedException.createByLazy(Server.class, "getTags", String.class, Class.class);
}
@Override
@@ -768,6 +451,15 @@ public int getTicksPerSpawns(@NotNull SpawnCategory spawnCategory) {
throw NotImplementedException.createByLazy(Server.class, "getTicksPerSpawns", SpawnCategory.class);
}
+ @Override
+ public @Nullable Player getPlayer(@NotNull String s) {
+ return Sponge.server()
+ .player(s)
+ .map(player -> SoakManager.getManager().getMemoryStore().get(player))
+ .orElse(null);
+
+ }
+
@Override
public @Nullable Player getPlayerExact(@NotNull String name) {
return this.getOnlinePlayers().stream().filter(player -> player.getName().equals(name)).findAny().orElse(null);
@@ -785,96 +477,157 @@ public int getTicksPerSpawns(@NotNull SpawnCategory spawnCategory) {
.filter(player -> player.getName().toLowerCase().startsWith(name.toLowerCase()))
.map(player -> (Player) player)
.toList();
- }
-
- @Override
- public @Nullable UUID getPlayerUniqueId(@NotNull String playerName) {
- Player player = getPlayerExact(playerName);
- if (player == null) {
- return null;
+ } @Override
+ public Tag getTag(@NotNull String registry, @NotNull NamespacedKey tag,
+ @NotNull Class clazz) {
+ ResourceKey key = SoakResourceKeyMap.mapToSponge(tag);
+ boolean classMatch = clazz.getName().equals(Material.class.getName());
+ if (classMatch && registry.equals(Tag.REGISTRY_BLOCKS)) {
+ var opTag =
+ FakeRegistryHelper.>getFields(BlockTypeTags.class,
+ org.spongepowered.api.tag.DefaultedTag.class)
+ .stream()
+ .filter(spongeTag -> spongeTag.key().equals(key))
+ .findAny();
+ if (opTag.isPresent()) {
+ //noinspection unchecked
+ return (Tag) new MaterialSetTag(tag,
+ TagHelper.getBlockTypes(opTag.get())
+ .map(SoakBlockMap::toBukkit)
+ .collect(Collectors.toList()));
+ }
+ }
+ if (classMatch && registry.equals(Tag.REGISTRY_ITEMS)) {
+ var opTag =
+ FakeRegistryHelper.>getFields(ItemTypeTags.class,
+ org.spongepowered.api.tag.DefaultedTag.class)
+ .stream()
+ .filter(spongeTag -> spongeTag.key().equals(key))
+ .findAny();
+ if (opTag.isPresent()) {
+ //noinspection unchecked
+ return (Tag) new MaterialSetTag(tag,
+ TagHelper.getItemTypes(opTag.get())
+ .map(SoakItemStackMap::toBukkit)
+ .collect(Collectors.toList()));
+ }
+ }
+ if (clazz.getName().equals(EntityType.class.getName()) && registry.equals(Tag.REGISTRY_ENTITY_TYPES)) {
+ var opTag =
+ FakeRegistryHelper.>>getFields(
+ EntityTypeTags.class,
+ org.spongepowered.api.tag.DefaultedTag.class)
+ .stream()
+ .filter(spongeTag -> spongeTag.key().equals(key))
+ .findAny();
+ if (opTag.isPresent()) {
+ //noinspection unchecked
+ return (Tag) new EntitySetTag(tag,
+ TagHelper.getEntityTypes(opTag.get())
+ .map(SoakEntityMap::toBukkit)
+ .collect(Collectors.toList()));
+ }
}
- return player.getUniqueId();
- }
- @Override
- public @Nullable Player getPlayer(@NotNull UUID uuid) {
- return Sponge.server()
- .player(uuid)
- .map(player -> SoakManager.getManager().getMemoryStore().get(player))
- .orElse(null);
- }
- @Override
- public @Nullable Player getPlayer(@NotNull String s) {
- return Sponge.server()
- .player(s)
- .map(player -> SoakManager.getManager().getMemoryStore().get(player))
- .orElse(null);
+ //overrides
+ if (registry.equals(Tag.REGISTRY_ITEMS) && tag.asString().equals("minecraft:coral_blocks")) {
+ //noinspection unchecked
+ return (Tag) new MaterialSetTag(tag,
+ ItemTypes.registry()
+ .stream()
+ .filter(item -> item.key(RegistryTypes.ITEM_TYPE)
+ .value()
+ .contains("coral_blocks"))
+ .map(SoakItemStackMap::toBukkit)
+ .collect(Collectors.toList()));
+ }
- }
+ if (registry.equals(Tag.REGISTRY_BLOCKS) && tag.asString().equals("minecraft:wool_carpets")) {
+ Set itemTypes = TagHelper.getBlockTypes(BlockTypeTags.WOOL_CARPETS)
+ .map(SoakBlockMap::toBukkit)
+ .collect(Collectors.toSet());
+ //noinspection unchecked
+ return (Tag) new MaterialSetTag(tag, itemTypes);
+ }
- public @NotNull SoakPluginManager getSoakPluginManager() {
- return this.pluginManager.get();
- }
+ if (registry.equals(Tag.REGISTRY_ITEMS) && tag.asString().equals("minecraft:wool_carpets")) {
+ Set itemTypes = TagHelper.getItemTypes(ItemTypeTags.WOOL_CARPETS)
+ .map(SoakItemStackMap::toBukkit)
+ .collect(Collectors.toSet());
+ //noinspection unchecked
+ return (Tag) new MaterialSetTag(tag, itemTypes);
- @Override
- public @NotNull SimplePluginManager getPluginManager() {
- return this.simplePluginManagerWrapper.get();
- }
+ }
- @Override
- public @NotNull BukkitScheduler getScheduler() {
- return this.scheduler.get();
- }
+ if (registry.equals(Tag.REGISTRY_FLUIDS) && tag.asString().equals("minecraft:water")) {
+ //noinspection unchecked
+ return (Tag) new SoakFluidTag(FluidTypeTags.WATER);
+ }
- @Override
- public @NotNull ServicesManager getServicesManager() {
- return this.servicesManager.get();
+ if (registry.equals(Tag.REGISTRY_FLUIDS) && tag.asString().equals("minecraft:lava")) {
+ //noinspection unchecked
+ return (Tag) new SoakFluidTag(FluidTypeTags.LAVA);
+ }
+
+ if (registry.equals(Tag.REGISTRY_ITEMS) && tag.asString().equals("minecraft:crops")) {
+ var items = ItemTypes.registry()
+ .stream()
+ .filter(item -> org.spongepowered.api.item.inventory.ItemStack.of(item)
+ .get(Keys.REPLENISHED_FOOD)
+ .isPresent())
+ .map(SoakItemStackMap::toBukkit)
+ .collect(Collectors.toSet());
+ //noinspection unchecked
+ return (Tag) new MaterialSetTag(tag, items);
+ }
+ if (registry.equals(Tag.REGISTRY_ITEMS) && tag.asString().equals("minecraft:furnace_materials")) {
+ var items = ItemTypes.registry()
+ .stream()
+ .filter(item -> org.spongepowered.api.item.inventory.ItemStack.of(item)
+ .get(Keys.MAX_COOK_TIME)
+ .isPresent())
+ .map(SoakItemStackMap::toBukkit)
+ .collect(Collectors.toSet());
+ //noinspection unchecked
+ return (Tag) new MaterialSetTag(tag, items);
+ }
+ SoakManager.getManager()
+ .getLogger()
+ .warn("No tag found of registry: '" + registry + "' Type: " + clazz.getSimpleName() + " id: " + tag.asString());
+ return null;
}
@Override
- public @NotNull List getWorlds() {
- var builder = CollectionStreamBuilder.builder()
- .collection(this.spongeServer().worldManager().worlds())
- .basicMap(world -> (World) SoakManager.getManager().getMemoryStore().get(world));
- return ListMappingUtils.fromStream(builder,
- () -> this.spongeServer().worldManager().worlds().stream(),
- (spongeWorld, soakWorld) -> ((SoakWorld) soakWorld).sponge()
- .equals(spongeWorld),
- Comparator.comparing(world -> world.key().formatted())).buildList();
+ public @Nullable Player getPlayer(@NotNull UUID uuid) {
+ return Sponge.server()
+ .player(uuid)
+ .map(player -> SoakManager.getManager().getMemoryStore().get(player))
+ .orElse(null);
}
@Override
- public boolean isTickingWorlds() {
- throw NotImplementedException.createByLazy(Server.class, "isTickingWorlds");
+ public @Nullable UUID getPlayerUniqueId(@NotNull String playerName) {
+ Player player = getPlayerExact(playerName);
+ if (player == null) {
+ return null;
+ }
+ return player.getUniqueId();
}
@Override
- public @Nullable World createWorld(@NotNull WorldCreator creator) {
- throw NotImplementedException.createByLazy(SoakServer.class, "createWorld", WorldCreator.class);
+ public @NotNull SimplePluginManager getPluginManager() {
+ return this.simplePluginManagerWrapper.get();
}
@Override
- public boolean unloadWorld(@NotNull World world, boolean save) {
- var spongeWorld = ((SoakWorld) world).sponge();
- if (save) {
- try {
- spongeWorld.save();
- } catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- var worldManager = this.spongeServer().worldManager();
- try {
- return worldManager.unloadWorld(spongeWorld).get();
- } catch (InterruptedException | ExecutionException e) {
- throw new RuntimeException(e);
- }
+ public @NotNull BukkitScheduler getScheduler() {
+ return this.scheduler.get();
}
@Override
- public @NotNull WorldBorder createWorldBorder() {
- throw NotImplementedException.createByLazy(Server.class, "createWorldBorder");
+ public @NotNull ServicesManager getServicesManager() {
+ return this.servicesManager.get();
}
@Override
@@ -910,6 +663,9 @@ public boolean unloadWorld(@NotNull World world, boolean save) {
World.class,
Location.class,
StructureType.class);
+ } @Override
+ public @NotNull Server.Spigot spigot() {
+ return new SoakSpigotServer();
}
@Override
@@ -938,6 +694,16 @@ public void reloadData() {
throw NotImplementedException.createByLazy(SoakServer.class, "reloadData");
}
+ @Override
+ public void updateResources() {
+ throw NotImplementedException.createByLazy(Server.class, "updateResources");
+ }
+
+ @Override
+ public @NotNull java.util.logging.Logger getLogger() {
+ return this.logger;
+ }
+
@Override
public @Nullable PluginCommand getPluginCommand(@NotNull String name) {
PluginCommand pluginCommand = SoakManager.getManager()
@@ -968,117 +734,107 @@ public void reloadData() {
@Override
public void savePlayers() {
throw NotImplementedException.createByLazy(SoakServer.class, "savePlayers");
+ } @Override
+ public void restart() {
+ throw NotImplementedException.createByLazy(this, "restart");
}
@Override
public boolean dispatchCommand(@NotNull CommandSender sender, @NotNull String commandLine) throws CommandException {
- throw NotImplementedException.createByLazy(SoakServer.class,
- "dispatchCommand",
- CommandSender.class,
- String.class);
- }
-
- @Override
- public boolean addRecipe(@Nullable Recipe recipe) {
- return addRecipe(recipe, false);
- }
-
- @Override
- public boolean addRecipe(@Nullable Recipe recipe, boolean resendRecipes) {
- throw NotImplementedException.createByLazy(SoakServer.class, "addRecipe", Recipe.class, boolean.class);
+ var soakSender = (SoakCommandSender) sender;
+ try {
+ var result = Sponge.server()
+ .commandManager()
+ .process(soakSender.getSubject(), soakSender.getAudience(), commandLine);
+ return result.isSuccess();
+ } catch (org.spongepowered.api.command.exception.CommandException e) {
+ throw new CommandException(e.getMessage(), e);
+ }
}
@Override
- public @Nullable Recipe getCraftingRecipe(@NotNull ItemStack[] itemStacks, @NotNull World world) {
- throw NotImplementedException.createByLazy(Server.class, "getCraftingRecipe", ItemStack.class, World.class);
+ public @NotNull Map getCommandAliases() {
+ return Sponge.server()
+ .commandManager()
+ .knownMappings()
+ .stream()
+ .collect(Collectors.toMap(t -> t.primaryAlias(), t -> t.allAliases().toArray(String[]::new)));
}
@Override
- public @NotNull ItemStack craftItem(@NotNull ItemStack[] itemStacks, @NotNull World world, @NotNull Player player) {
- throw NotImplementedException.createByLazy(Server.class,
- "craftItem",
- ItemStack.class,
- World.class,
- Player.class);
+ public int getSpawnRadius() {
+ return SoakManager.getManager().getServerProperties().spawnProtection().orElse();
}
@Override
- public @NotNull Iterator recipeIterator() {
- return Sponge.server().recipeManager().all().stream().map(recipe -> {
- try {
- return SoakRecipeMap.toBukkit(recipe);
- } catch (RuntimeException e) {
- e.printStackTrace();
- return null;
- }
- }).filter(Objects::nonNull).iterator();
+ public void setSpawnRadius(int value) {
+ SoakManager.getManager().getServerProperties().spawnProtection().setMemoryValue(value);
}
@Override
- public void clearRecipes() {
- throw NotImplementedException.createByLazy(SoakServer.class, "clearRecipes");
+ public boolean shouldSendChatPreviews() {
+ throw NotImplementedException.createByLazy(Server.class, "shouldSendChatPreviews");
}
@Override
- public void resetRecipes() {
- throw NotImplementedException.createByLazy(SoakServer.class, "resetRecipes");
+ public boolean isEnforcingSecureProfiles() {
+ throw NotImplementedException.createByLazy(Server.class, "isEnforcingSecureProfiles");
}
@Override
- public boolean removeRecipe(@NotNull NamespacedKey key) {
- throw NotImplementedException.createByLazy(Server.class, "removeRecipe", NamespacedKey.class);
+ public boolean isAcceptingTransfers() {
+ throw NotImplementedException.createByLazy(Server.class, "isAcceptingTransfers");
}
@Override
- public @NotNull Map getCommandAliases() {
- throw NotImplementedException.createByLazy(SoakServer.class, "getCommandAliases", Map.class);
- }
-
- public ServerWorld defaultWorld() {
- return this.spongeServer()
- .worldManager()
- .world(DefaultWorldKeys.DEFAULT)
- .orElseThrow(() -> new RuntimeException("default world is not loaded"));
+ public boolean getHideOnlinePlayers() {
+ throw NotImplementedException.createByLazy(Server.class, "getHideOnlinePlayers");
}
@Override
- public int getSpawnRadius() {
- return SoakManager.getManager().getServerProperties().spawnProtection().orElse();
+ public boolean getOnlineMode() {
+ return this.spongeServer().isOnlineModeEnabled();
}
@Override
- public void setSpawnRadius(int value) {
- SoakManager.getManager().getServerProperties().spawnProtection().setMemoryValue(value);
+ public @NotNull ServerConfiguration getServerConfig() {
+ throw NotImplementedException.createByLazy(this, "getServerConfig");
}
@Override
- public boolean shouldSendChatPreviews() {
- throw NotImplementedException.createByLazy(Server.class, "shouldSendChatPreviews");
+ public boolean getAllowFlight() {
+ throw NotImplementedException.createByLazy(SoakServer.class, "getAllowFlight");
}
@Override
- public boolean isEnforcingSecureProfiles() {
- throw NotImplementedException.createByLazy(Server.class, "isEnforcingSecureProfiles");
+ public boolean isHardcore() {
+ return this.spongeServer().isHardcoreModeEnabled();
}
@Override
- public boolean getHideOnlinePlayers() {
- throw NotImplementedException.createByLazy(Server.class, "getHideOnlinePlayers");
+ public void shutdown() {
+ this.spongeServer().shutdown();
}
+ @Deprecated
@Override
- public boolean getOnlineMode() {
- return this.spongeServer().isOnlineModeEnabled();
+ public int broadcast(@NotNull String arg0, @NotNull String arg1) {
+ return broadcast(SoakMessageMap.toComponent(arg0), arg1);
}
@Override
- public boolean getAllowFlight() {
- throw NotImplementedException.createByLazy(SoakServer.class, "getAllowFlight");
+ public int broadcast(@NotNull Component message) {
+ Audience audience = this.spongeServer().broadcastAudience();
+ AtomicInteger count = new AtomicInteger();
+ audience.forEachAudience((au) -> count.set(count.get() + 1));
+ audience.sendMessage(message);
+ return count.get();
}
@Override
- public boolean isHardcore() {
- return this.spongeServer().isHardcoreModeEnabled();
+ public int broadcast(@NotNull Component message, @NotNull String from) {
+ var newComponent = Component.text("[" + from + "] ").color(NamedTextColor.GOLD).append(message);
+ return broadcast(newComponent);
}
@Override
@@ -1220,6 +976,11 @@ public void setDefaultGameMode(@NotNull GameMode arg0) {
throw NotImplementedException.createByLazy(Server.class, "setDefaultGameMode", GameMode.class);
}
+ @Override
+ public boolean forcesDefaultGameMode() {
+ throw NotImplementedException.createByLazy(this, "forcesDefaultGameMode");
+ }
+
@Override
public @NotNull ConsoleCommandSender getConsoleSender() {
return new SoakConsoleCommandSender();
@@ -1230,9 +991,19 @@ public void setDefaultGameMode(@NotNull GameMode arg0) {
throw NotImplementedException.createByLazy(Server.class, "createCommandSender", Consumer.class);
}
+ @Override
+ public @NotNull File getWorldContainer() {
+ throw NotImplementedException.createByLazy(Server.class, "getWorldContainer");
+ }
+
+ @Override
+ public @NotNull Path getLevelDirectory() {
+ throw NotImplementedException.createByLazy(Server.class, "getLevelDirectory");
+ }
+
@Override
public OfflinePlayer[] getOfflinePlayers() {
- return Sponge.server().userManager().streamAll().map(SoakLoadingUser::new).toArray(OfflinePlayer[]::new);
+ return Sponge.server().userManager().streamAll().map(SoakOfflinePlayer::new).toArray(OfflinePlayer[]::new);
}
@Override
@@ -1279,23 +1050,17 @@ public OfflinePlayer[] getOfflinePlayers() {
return createChestInventory(arg0, arg1, arg2);
}
- private Inventory createChestInventory(InventoryHolder holder, int size, @Nullable Component title) {
- int rows = (size / 9);
- var containerType = InventoryHelper.toChestContainerType(rows);
- var plugin = GeneralHelper.fromStackTrace();
- var inventory = ViewableInventory.builder().type(containerType).completeStructure().plugin(plugin).build();
- //TODO holder
- var bukkitInv = new SoakInventory<>(inventory);
- bukkitInv.setRequestedTitle(title);
- return bukkitInv;
- }
-
@Deprecated
@Override
public @NotNull Inventory createInventory(InventoryHolder arg0, int arg1, @NotNull String arg2) {
return createInventory(arg0, arg1, SoakMessageMap.toComponent(arg2));
}
+ @Override
+ public @NotNull Merchant createMerchant(Component arg0) {
+ throw NotImplementedException.createByLazy(Server.class, "createMerchant", Component.class);
+ }
+
@Deprecated
@Override
public @NotNull Merchant createMerchant(String arg0) {
@@ -1308,8 +1073,8 @@ public int getMaxChainedNeighborUpdates() {
}
@Override
- public @NotNull Merchant createMerchant(Component arg0) {
- throw NotImplementedException.createByLazy(Server.class, "createMerchant", Component.class);
+ public @NotNull Merchant createMerchant() {
+ throw NotImplementedException.createByLazy(this, "createMerchant");
}
@Override
@@ -1352,14 +1117,19 @@ public boolean isPrimaryThread() {
return this.spongeServer().onMainThread();
}
+ @Override
+ public @NotNull Component motd() {
+ return this.spongeServer().motd();
+ }
+
@Override
public void motd(@NotNull Component component) {
throw NotImplementedException.createByLazy(Server.class, "motd", Component.class);
}
@Override
- public @NotNull Component motd() {
- return this.spongeServer().motd();
+ public Component shutdownMessage() {
+ throw NotImplementedException.createByLazy(Server.class, "shutdownMessage");
}
@Deprecated
@@ -1374,8 +1144,8 @@ public void setMotd(@NotNull String s) {
}
@Override
- public Component shutdownMessage() {
- throw NotImplementedException.createByLazy(Server.class, "shutdownMessage");
+ public @NotNull ServerLinks getServerLinks() {
+ throw NotImplementedException.createByLazy(Server.class, "getServerLinks");
}
@Deprecated
@@ -1394,6 +1164,11 @@ public String getShutdownMessage() {
return this.itemFactory.get();
}
+ @Override
+ public @NotNull EntityFactory getEntityFactory() {
+ throw NotImplementedException.createByLazy(Server.class, "getEntityFactory");
+ }
+
@Override
public @NotNull ScoreboardManager getScoreboardManager() {
throw NotImplementedException.createByLazy(Server.class, "getScoreboardManager");
@@ -1409,21 +1184,82 @@ public CachedServerIcon getServerIcon() {
throw NotImplementedException.createByLazy(Server.class, "getServerIcon");
}
+ @Override
+ public @NotNull CachedServerIcon loadServerIcon(@NotNull File arg0) {
+ throw NotImplementedException.createByLazy(Server.class, "loadServerIcon", File.class);
+ }
+
@Override
public @NotNull CachedServerIcon loadServerIcon(@NotNull BufferedImage arg0) {
throw NotImplementedException.createByLazy(Server.class, "loadServerIcon", BufferedImage.class);
}
+ public @NotNull SoakPluginManager getSoakPluginManager() {
+ return this.pluginManager.get();
+ }
+
+ private Inventory createChestInventory(InventoryHolder holder, int size, @Nullable Component title) {
+ int rows = (size / 9);
+ var containerType = InventoryHelper.toChestContainerType(rows);
+ var plugin = GeneralHelper.fromStackTrace();
+ var inventory = ViewableInventory.builder().type(containerType).completeStructure().plugin(plugin).build();
+ //TODO holder
+ var bukkitInv = new SoakInventory<>(inventory);
+ bukkitInv.setRequestedTitle(title);
+ return bukkitInv;
+ }
+
@Override
- public @NotNull CachedServerIcon loadServerIcon(@NotNull File arg0) {
- throw NotImplementedException.createByLazy(Server.class, "loadServerIcon", File.class);
+ public @NotNull Iterable extends Audience> audiences() {
+ return this.spongeServer().audiences();
+ }
+
+ @Override
+ public void sendPluginMessage(@NotNull Plugin source, @NotNull String channel, byte[] message) {
+ throw NotImplementedException.createByLazy(Server.class,
+ "sendPluginMessage",
+ Plugin.class,
+ String.class,
+ byte[].class);
+ }
+
+ @Override
+ public @NotNull Set getListeningPluginChannels() {
+ throw NotImplementedException.createByLazy(Server.class, "getListeningPluginChannels");
}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@Override
public int getIdleTimeout() {
throw NotImplementedException.createByLazy(Server.class, "getIdleTimeout");
}
+ @Override
+ public int getPauseWhenEmptyTime() {
+ throw NotImplementedException.createByLazy(this, "getPauseWhenEmptyTime");
+ }
+
+ @Override
+ public void setPauseWhenEmptyTime(int seconds) {
+ throw NotImplementedException.createByLazy(this, "setPauseWhenEmptyTime", int.class);
+ }
+
+
@Override
public void setIdleTimeout(int arg0) {
throw NotImplementedException.createByLazy(Server.class, "setIdleTimeout", int.class);
@@ -1493,7 +1329,7 @@ public double getAverageTickTime() {
@Override
public @NotNull SoakCommandMap getCommandMap() {
- return this.commandMap.get();
+ return this.commandMapNonDeclared;
}
@Override
@@ -1530,10 +1366,7 @@ public Advancement getAdvancement(@NotNull NamespacedKey arg0) {
return createBlockData(material);
}
if (s.startsWith("[")) {
- s = SoakBlockMap.toSponge(material)
- .orElseThrow(() -> new IllegalStateException("Item cannot be converted to BlockState"))
- .key(RegistryTypes.BLOCK_TYPE)
- .formatted() + s;
+ s = SoakRegistryMap.toSpongeBlock(material).key(RegistryTypes.BLOCK_TYPE).formatted() + s;
}
var blockState = BlockState.fromString(s);
return new SoakBlockData(blockState);
@@ -1567,12 +1400,6 @@ public LootTable getLootTable(@NotNull NamespacedKey arg0) {
@Override
public @Nullable Registry getRegistry(@NotNull Class aClass) {
- if (aClass.isAssignableFrom(Structure.class)) {
- return (Registry) structureReg.get();
- }
- if (aClass.isAssignableFrom(org.bukkit.generator.structure.StructureType.class)) {
- return (Registry) structureTypeReg.get();
- }
return (Registry) this.registries.get().get(aClass);
}
@@ -1696,15 +1523,6 @@ public boolean isStopping() {
throw NotImplementedException.createByLazy(Server.class, "getPotionBrewer");
}
- @Override
- public boolean hasWhitelist() {
- return this.spongeServer().isWhitelistEnabled();
- }
-
- @Override
- public void shutdown() {
- this.spongeServer().shutdown();
- }
@Deprecated
@Override
@@ -1712,48 +1530,5 @@ public void shutdown() {
return this.unsafeValues.get();
}
- @Override
- public @NotNull java.util.logging.Logger getLogger() {
- return this.logger;
- }
-
- @Deprecated
- @Override
- public int broadcast(@NotNull String arg0, @NotNull String arg1) {
- return broadcast(SoakMessageMap.toComponent(arg0), arg1);
- }
-
- @Override
- public int broadcast(@NotNull Component message, @NotNull String from) {
- var newComponent = Component.text("[" + from + "] ").color(NamedTextColor.GOLD).append(message);
- return broadcast(newComponent);
- }
-
- @Override
- public int broadcast(@NotNull Component message) {
- Audience audience = this.spongeServer().broadcastAudience();
- AtomicInteger count = new AtomicInteger();
- audience.forEachAudience((au) -> count.set(count.get() + 1));
- audience.sendMessage(message);
- return count.get();
- }
-
- @Override
- public @NotNull Iterable extends Audience> audiences() {
- return this.spongeServer().audiences();
- }
-
- @Override
- public void sendPluginMessage(@NotNull Plugin source, @NotNull String channel, byte[] message) {
- throw NotImplementedException.createByLazy(Server.class,
- "sendPluginMessage",
- Plugin.class,
- String.class,
- byte[].class);
- }
- @Override
- public @NotNull Set getListeningPluginChannels() {
- throw NotImplementedException.createByLazy(Server.class, "getListeningPluginChannels");
- }
}
diff --git a/Wrapper/src/main/java/org/soak/wrapper/SoakUnsafeValues.java b/Wrapper/src/main/java/org/soak/wrapper/SoakUnsafeValues.java
index dd17ac8..9431a4f 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/SoakUnsafeValues.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/SoakUnsafeValues.java
@@ -2,11 +2,13 @@
import com.google.common.collect.Multimap;
import com.google.gson.JsonObject;
+import io.papermc.paper.entity.EntitySerializationFlag;
import io.papermc.paper.inventory.tooltip.TooltipContext;
import io.papermc.paper.plugin.lifecycle.event.LifecycleEventManager;
-import io.papermc.paper.registry.tag.Tag;
-import io.papermc.paper.registry.tag.TagKey;
+import io.papermc.paper.registry.RegistryAccess;
+import io.papermc.paper.registry.RegistryKey;
import net.kyori.adventure.text.Component;
+import net.kyori.adventure.text.event.HoverEvent;
import net.kyori.adventure.text.flattener.ComponentFlattener;
import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
@@ -20,7 +22,6 @@
import org.bukkit.attribute.AttributeModifier;
import org.bukkit.block.data.BlockData;
import org.bukkit.command.CommandSender;
-import org.bukkit.damage.DamageEffect;
import org.bukkit.damage.DamageSource;
import org.bukkit.damage.DamageType;
import org.bukkit.entity.Entity;
@@ -35,9 +36,9 @@
import org.bukkit.plugin.PluginDescriptionFile;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.potion.PotionType;
-import org.checkerframework.checker.units.qual.N;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jspecify.annotations.NonNull;
import org.soak.exception.NotImplementedException;
import org.soak.generate.bukkit.MaterialList;
import org.soak.map.item.SoakItemStackMap;
@@ -93,16 +94,11 @@ public LegacyComponentSerializer legacyComponentSerializer() {
public Component resolveWithContext(Component component, CommandSender commandSender, Entity entity, boolean b)
throws IOException {
throw NotImplementedException.createByLazy(UnsafeValues.class,
- "resolveWithContext",
- Component.class,
- CommandSender.class,
- Entity.class,
- boolean.class);
- }
-
- @Override
- public void reportTimings() {
- throw NotImplementedException.createByLazy(UnsafeValues.class, "reportTimings");
+ "resolveWithContext",
+ Component.class,
+ CommandSender.class,
+ Entity.class,
+ boolean.class);
}
@Override
@@ -220,9 +216,9 @@ public byte[] processClass(PluginDescriptionFile arg0, String arg1, byte[] arg2)
@Override
public Advancement loadAdvancement(NamespacedKey arg0, String arg1) {
throw NotImplementedException.createByLazy(UnsafeValues.class,
- "loadAdvancement",
- NamespacedKey.class,
- String.class);
+ "loadAdvancement",
+ NamespacedKey.class,
+ String.class);
}
@Override
@@ -234,9 +230,9 @@ public boolean removeAdvancement(NamespacedKey arg0) {
public Multimap getDefaultAttributeModifiers(Material material,
EquipmentSlot equipmentSlot) {
throw NotImplementedException.createByLazy(UnsafeValues.class,
- "getDefaultAttributeModifiers",
- Material.class,
- EquipmentSlot.class);
+ "getDefaultAttributeModifiers",
+ Material.class,
+ EquipmentSlot.class);
}
@Override
@@ -254,11 +250,6 @@ public String getItemTranslationKey(Material material) {
throw NotImplementedException.createByLazy(UnsafeValues.class, "getItemTranslationKey", Material.class);
}
- @Override
- public String getTimingsServerName() {
- throw NotImplementedException.createByLazy(UnsafeValues.class, "getTimingsServerName");
- }
-
@Override
public byte[] serializeItem(ItemStack arg0) {
throw NotImplementedException.createByLazy(UnsafeValues.class, "serializeItem", ItemStack.class);
@@ -284,13 +275,23 @@ public byte[] serializeEntity(Entity entity) {
throw NotImplementedException.createByLazy(UnsafeValues.class, "serializeEntity", Entity.class);
}
+ @Override
+ public byte @NotNull [] serializeEntity(@NotNull Entity entity, @NonNull @NotNull EntitySerializationFlag... serializationFlags) {
+ return new byte[0];
+ }
+
@Override
public Entity deserializeEntity(byte[] bytes, World world, boolean b) {
throw NotImplementedException.createByLazy(UnsafeValues.class,
- "deserializeEntity",
- byte.class,
- World.class,
- boolean.class);
+ "deserializeEntity",
+ byte.class,
+ World.class,
+ boolean.class);
+ }
+
+ @Override
+ public @NotNull Entity deserializeEntity(byte @NotNull [] data, @NotNull World world, boolean preserveUUID, boolean preservePassengers) {
+ return null;
}
@Override
@@ -308,11 +309,6 @@ public PotionType.InternalPotionData getInternalPotionData(NamespacedKey namespa
throw NotImplementedException.createByLazy(UnsafeValues.class, "getInternalPotionData", NamespacedKey.class);
}
- @Override
- public @Nullable DamageEffect getDamageEffect(@NotNull String s) {
- throw NotImplementedException.createByLazy(UnsafeValues.class, "getDamageEffect", String.class);
- }
-
@Override
@NotNull
public DamageSource.Builder createDamageSourceBuilder(@NotNull DamageType damageType) {
@@ -325,8 +321,8 @@ public String get(Class> aClass, String s) {
}
@Override
- public B get(Registry registry, NamespacedKey namespacedKey) {
- throw NotImplementedException.createByLazy(UnsafeValues.class, "get", Registry.class, NamespacedKey.class);
+ public @org.jspecify.annotations.Nullable B get(RegistryKey registry, NamespacedKey key) {
+ return RegistryAccess.registryAccess().getRegistry(registry).get(key);
}
@Override
@@ -347,9 +343,9 @@ public int nextEntityId() {
@Override
public boolean isValidRepairItemStack(@NotNull ItemStack arg0, @NotNull ItemStack arg1) {
throw NotImplementedException.createByLazy(UnsafeValues.class,
- "isValidRepairItemStack",
- ItemStack.class,
- ItemStack.class);
+ "isValidRepairItemStack",
+ ItemStack.class,
+ ItemStack.class);
}
@Override
@@ -360,36 +356,36 @@ public int getProtocolVersion() {
@Override
public boolean hasDefaultEntityAttributes(@NotNull NamespacedKey namespacedKey) {
throw NotImplementedException.createByLazy(UnsafeValues.class,
- "hasDefaultEntityAttributes",
- NamespacedKey.class);
+ "hasDefaultEntityAttributes",
+ NamespacedKey.class);
}
@Override
public @NotNull Attributable getDefaultEntityAttributes(@NotNull NamespacedKey namespacedKey) {
throw NotImplementedException.createByLazy(UnsafeValues.class,
- "getDefaultEntityAttributes",
- NamespacedKey.class);
+ "getDefaultEntityAttributes",
+ NamespacedKey.class);
}
@Override
public @NotNull NamespacedKey getBiomeKey(RegionAccessor regionAccessor, int i, int i1, int i2) {
throw NotImplementedException.createByLazy(UnsafeValues.class,
- "setBiomeKey",
- RegionAccessor.class,
- int.class,
- int.class,
- int.class);
+ "setBiomeKey",
+ RegionAccessor.class,
+ int.class,
+ int.class,
+ int.class);
}
@Override
public void setBiomeKey(RegionAccessor regionAccessor, int i, int i1, int i2, NamespacedKey namespacedKey) {
throw NotImplementedException.createByLazy(UnsafeValues.class,
- "setBiomeKey",
- RegionAccessor.class,
- int.class,
- int.class,
- int.class,
- NamespacedKey.class);
+ "setBiomeKey",
+ RegionAccessor.class,
+ int.class,
+ int.class,
+ int.class,
+ NamespacedKey.class);
}
@Override
@@ -400,16 +396,14 @@ public String getStatisticCriteriaKey(@NotNull Statistic statistic) {
@Override
public @Nullable Color getSpawnEggLayerColor(EntityType entityType, int i) {
throw NotImplementedException.createByLazy(UnsafeValues.class,
- "getSpawnEggLayerColor",
- EntityType.class,
- int.class);
+ "getSpawnEggLayerColor",
+ EntityType.class,
+ int.class);
}
@Override
public LifecycleEventManager<@NotNull Plugin> createPluginLifecycleEventManager(JavaPlugin javaPlugin,
BooleanSupplier booleanSupplier) {
- boolean test = booleanSupplier.getAsBoolean();
- //TODO work this one out, not on javadocs
return new SoakLifecycleEventManager<>();
}
@@ -418,20 +412,30 @@ public String getStatisticCriteriaKey(@NotNull Statistic statistic) {
@NotNull TooltipContext tooltipContext,
@Nullable Player player) {
throw NotImplementedException.createByLazy(UnsafeValues.class,
- "computeTooltipLines",
- ItemStack.class,
- TooltipContext.class,
- Player.class);
+ "computeTooltipLines",
+ ItemStack.class,
+ TooltipContext.class,
+ Player.class);
}
@Override
- public @Nullable Tag<@NotNull A> getTag(@NotNull TagKey tagKey) {
- throw NotImplementedException.createByLazy(UnsafeValues.class, "getTag", TagKey.class);
+ public ItemStack createEmptyStack() {
+ return new SoakItemStack();
}
@Override
- public ItemStack createEmptyStack() {
- return new SoakItemStack();
+ public @NotNull Map serializeStack(ItemStack itemStack) {
+ throw NotImplementedException.createByLazy(this, "serializeStack", ItemStack.class);
+ }
+
+ @Override
+ public @NotNull ItemStack deserializeStack(@NotNull Map args) {
+ throw NotImplementedException.createByLazy(this, "deserializeStack", Map.class);
+ }
+
+ @Override
+ public @NotNull ItemStack deserializeItemHover(HoverEvent.@NotNull ShowItem itemHover) {
+ throw NotImplementedException.createByLazy(this, "deserializeItemHover", HoverEvent.ShowItem.class);
}
@Override
diff --git a/Wrapper/src/main/java/org/soak/wrapper/SoakWorldBorder.java b/Wrapper/src/main/java/org/soak/wrapper/SoakWorldBorder.java
index 775977d..ecadf91 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/SoakWorldBorder.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/SoakWorldBorder.java
@@ -1,11 +1,14 @@
package org.soak.wrapper;
+import net.kyori.adventure.util.Ticks;
import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.WorldBorder;
+import org.checkerframework.checker.index.qual.NonNegative;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
+import org.jetbrains.annotations.Range;
import org.soak.exception.NotImplementedException;
import org.soak.wrapper.world.SoakWorld;
import org.spongepowered.api.world.server.ServerWorld;
@@ -19,8 +22,8 @@
//why isnt this in the world package Bukkit????
public class SoakWorldBorder implements WorldBorder {
- private @NotNull org.spongepowered.api.world.border.WorldBorder sponge;
private final @Nullable World world;
+ private @NotNull org.spongepowered.api.world.border.WorldBorder sponge;
public SoakWorldBorder(@NotNull org.spongepowered.api.world.border.WorldBorder sponge, @Nullable World world) {
this.sponge = sponge;
@@ -69,6 +72,12 @@ public void setSize(double size) {
setSize(size, 0);
}
+ @Override
+ public void changeSize(double newSize, @Range(from = 0L, to = 2147483647L) long ticks) {
+ update(t -> t.timeToTargetDiameter(Ticks.duration(ticks)).targetDiameter(newSize).initialDiameter(this.sponge.diameter()));
+
+ }
+
@Override
public void setSize(double size, long seconds) {
setSize(size, TimeUnit.SECONDS, seconds);
@@ -126,6 +135,16 @@ public void setWarningTime(int i) {
update(builder -> builder.warningTime(Duration.of(i, TimeUnit.SECONDS.toChronoUnit())));
}
+ @Override
+ public @NonNegative int getWarningTimeTicks() {
+ return 0;
+ }
+
+ @Override
+ public void setWarningTimeTicks(@NonNegative int ticks) {
+
+ }
+
@Override
public int getWarningDistance() {
return this.sponge.warningDistance();
@@ -153,9 +172,9 @@ public boolean isInside(@NotNull Location location) {
//this doesnt work with default world border
var worldBorderCenter = new Location(location.getWorld(),
- this.sponge.center().x(),
- location.getY(),
- this.sponge.center().y());
+ this.sponge.center().x(),
+ location.getY(),
+ this.sponge.center().y());
var distance = location.distance(worldBorderCenter);
var radius = this.sponge.safeZone() / 2;
return radius <= distance;
diff --git a/Wrapper/src/main/java/org/soak/wrapper/block/AbstractBlock.java b/Wrapper/src/main/java/org/soak/wrapper/block/AbstractBlock.java
index 7226da2..1572cf2 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/block/AbstractBlock.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/block/AbstractBlock.java
@@ -9,6 +9,7 @@
import org.bukkit.inventory.ItemStack;
import org.jetbrains.annotations.NotNull;
import org.soak.WrapperManager;
+import org.soak.exception.NotImplementedException;
import org.soak.map.SoakBlockMap;
import org.soak.map.SoakDirectionMap;
import org.soak.map.item.SoakItemStackMap;
@@ -47,6 +48,11 @@ public ServerLocation spongeLocation() {
return world.location(spongePosition());
}
+ @Override
+ public boolean isSuffocating() {
+ throw NotImplementedException.createByLazy(Block.class, "block");
+ }
+
@Override
public @NotNull String translationKey() {
return this.getTranslationKey();
diff --git a/Wrapper/src/main/java/org/soak/wrapper/block/SoakBiome.java b/Wrapper/src/main/java/org/soak/wrapper/block/SoakBiome.java
new file mode 100644
index 0000000..89f03f4
--- /dev/null
+++ b/Wrapper/src/main/java/org/soak/wrapper/block/SoakBiome.java
@@ -0,0 +1,37 @@
+package org.soak.wrapper.block;
+
+import org.bukkit.NamespacedKey;
+import org.bukkit.block.Biome;
+import org.jetbrains.annotations.NotNull;
+import org.jspecify.annotations.NonNull;
+import org.soak.map.SoakResourceKeyMap;
+import org.spongepowered.api.registry.RegistryTypes;
+
+public class SoakBiome implements Biome {
+
+ private final org.spongepowered.api.world.biome.Biome biome;
+
+ public SoakBiome(org.spongepowered.api.world.biome.Biome biome) {
+ this.biome = biome;
+ }
+
+ @Override
+ public @NotNull NamespacedKey getKey() {
+ return SoakResourceKeyMap.mapToBukkit(this.biome.key(RegistryTypes.BIOME));
+ }
+
+ @Override
+ public int compareTo(@NonNull Biome other) {
+ return getKey().compareTo(other.getKey());
+ }
+
+ @Override
+ public @NotNull String name() {
+ return this.getKey().value().toUpperCase();
+ }
+
+ @Override
+ public int ordinal() {
+ return RegistryTypes.BIOME.get().stream().toList().indexOf(this.biome);
+ }
+}
diff --git a/Wrapper/src/main/java/org/soak/wrapper/block/SoakBlock.java b/Wrapper/src/main/java/org/soak/wrapper/block/SoakBlock.java
index d61f890..52cf022 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/block/SoakBlock.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/block/SoakBlock.java
@@ -20,6 +20,7 @@
import org.soak.WrapperManager;
import org.soak.exception.NotImplementedException;
import org.soak.map.SoakBlockMap;
+import org.soak.map.SoakRegistryMap;
import org.soak.map.item.SoakItemStackMap;
import org.soak.plugin.SoakManager;
import org.soak.wrapper.block.data.CommonBlockData;
@@ -99,8 +100,7 @@ public void setBlockData(@NotNull BlockData arg0, boolean arg1) {
@Override
public void setType(@NotNull Material arg0, boolean arg1) {
- var blockType = SoakBlockMap.toSponge(arg0)
- .orElseThrow(() -> new RuntimeException(arg0.name() + " is not a block"));
+ var blockType = SoakRegistryMap.toSpongeBlock(arg0);
var blockChangeFlag = arg1 ? BlockChangeFlags.ALL : BlockChangeFlags.NOTIFY_CLIENTS;
this.block.setBlockType(blockType, blockChangeFlag);
}
@@ -173,10 +173,15 @@ public boolean breakNaturally(@NotNull ItemStack arg0, boolean arg1) {
@Override
public boolean breakNaturally(@NotNull ItemStack itemStack, boolean b, boolean b1) {
throw NotImplementedException.createByLazy(Block.class,
- "breakNaturally",
- ItemStack.class,
- boolean.class,
- boolean.class);
+ "breakNaturally",
+ ItemStack.class,
+ boolean.class,
+ boolean.class);
+ }
+
+ @Override
+ public boolean breakNaturally(@NotNull ItemStack tool, boolean triggerEffect, boolean dropExperience, boolean forceEffect) {
+ throw NotImplementedException.createByLazy(Block.class, "block", ItemStack.class, boolean.class, boolean.class, boolean.class);
}
@Override
@@ -268,11 +273,11 @@ public String getTranslationKey() {
public RayTraceResult rayTrace(@NotNull Location arg0, @NotNull Vector arg1, double arg2,
@NotNull FluidCollisionMode arg3) {
throw NotImplementedException.createByLazy(Block.class,
- "rayTrace",
- Location.class,
- Vector.class,
- double.class,
- FluidCollisionMode.class);
+ "rayTrace",
+ Location.class,
+ Vector.class,
+ double.class,
+ FluidCollisionMode.class);
}
@Override
diff --git a/Wrapper/src/main/java/org/soak/wrapper/block/SoakBlockSnapshot.java b/Wrapper/src/main/java/org/soak/wrapper/block/SoakBlockSnapshot.java
index a49a548..f179e64 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/block/SoakBlockSnapshot.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/block/SoakBlockSnapshot.java
@@ -237,6 +237,11 @@ public boolean breakNaturally(@NotNull ItemStack itemStack, boolean b, boolean b
boolean.class);
}
+ @Override
+ public boolean breakNaturally(@NotNull ItemStack tool, boolean triggerEffect, boolean dropExperience, boolean forceEffect) {
+ throw NotImplementedException.createByLazy(Block.class, "breakNaturally", ItemStack.class, boolean.class, boolean.class, boolean.class);
+ }
+
@Override
public boolean isPassable() {
throw NotImplementedException.createByLazy(Block.class, "isPassable");
diff --git a/Wrapper/src/main/java/org/soak/wrapper/block/SoakLegacyCustomBiome.java b/Wrapper/src/main/java/org/soak/wrapper/block/SoakLegacyCustomBiome.java
new file mode 100644
index 0000000..672b15e
--- /dev/null
+++ b/Wrapper/src/main/java/org/soak/wrapper/block/SoakLegacyCustomBiome.java
@@ -0,0 +1,32 @@
+package org.soak.wrapper.block;
+
+import org.bukkit.NamespacedKey;
+import org.bukkit.block.Biome;
+import org.jetbrains.annotations.NotNull;
+import org.jspecify.annotations.NonNull;
+
+public class SoakLegacyCustomBiome implements Biome {
+
+ @Override
+ public @NotNull NamespacedKey getKey() {
+ return NamespacedKey.fromString("soak:custom_legacy_biome");
+ }
+
+ @Override
+ public int compareTo(@NonNull Biome other) {
+ if (other instanceof SoakLegacyCustomBiome) {
+ return 0;
+ }
+ return -1;
+ }
+
+ @Override
+ public @NotNull String name() {
+ return "CUSTOM";
+ }
+
+ @Override
+ public int ordinal() {
+ return -1;
+ }
+}
diff --git a/Wrapper/src/main/java/org/soak/wrapper/block/data/AbstractBlockData.java b/Wrapper/src/main/java/org/soak/wrapper/block/data/AbstractBlockData.java
index df7c30b..f0199eb 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/block/data/AbstractBlockData.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/block/data/AbstractBlockData.java
@@ -45,6 +45,11 @@ public static CommonBlockData internalCreateBlockData(BlockState state) {
}
}
+ @Override
+ public boolean isReplaceable() {
+ return this.sponge().get(Keys.IS_REPLACEABLE).orElse(false);
+ }
+
@Override
public @NotNull VoxelShape getCollisionShape(@NotNull Location location) {
throw NotImplementedException.createByLazy(BlockData.class, "getCollisionShape", Location.class);
@@ -112,9 +117,9 @@ public boolean isSupported(@NotNull Location location) {
@Override
public boolean isFaceSturdy(@NotNull BlockFace blockFace, @NotNull BlockSupport blockSupport) {
throw NotImplementedException.createByLazy(BlockData.class,
- "isFaceSturdy",
- BlockFace.class,
- BlockSupport.class);
+ "isFaceSturdy",
+ BlockFace.class,
+ BlockSupport.class);
}
@Override
diff --git a/Wrapper/src/main/java/org/soak/wrapper/block/data/type/SoakBed.java b/Wrapper/src/main/java/org/soak/wrapper/block/data/type/SoakBed.java
index 32683b1..88e358c 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/block/data/type/SoakBed.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/block/data/type/SoakBed.java
@@ -49,4 +49,5 @@ public void setOccupied(boolean b) {
public @NotNull AbstractBlockData clone() {
return new SoakBed(this.sponge());
}
+
}
diff --git a/Wrapper/src/main/java/org/soak/wrapper/block/state/AbstractBlockState.java b/Wrapper/src/main/java/org/soak/wrapper/block/state/AbstractBlockState.java
index 7c2de05..7f984b5 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/block/state/AbstractBlockState.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/block/state/AbstractBlockState.java
@@ -52,6 +52,13 @@ public AbstractBlockState(@Nullable ServerLocation location, @NotNull org.sponge
this.state = state;
}
+ public static AbstractBlockState wrap(@Nullable ServerLocation location, org.spongepowered.api.block.BlockState state, boolean isSnapshot) {
+ if (state.type().is(BlockTypeTags.ALL_SIGNS)) {
+ return new SignBlockState(location, state, isSnapshot);
+ }
+ return new BasicBlockState(location, state);
+ }
+
public @NotNull org.spongepowered.api.block.BlockState spongeState() {
return this.state;
}
@@ -67,13 +74,6 @@ public Optional extends BlockEntity> spongeEntity() {
return this.location.blockEntity();
}
- public static AbstractBlockState wrap(@Nullable ServerLocation location, org.spongepowered.api.block.BlockState state, boolean isSnapshot) {
- if (state.type().is(BlockTypeTags.ALL_SIGNS)) {
- return new SignBlockState(location, state, isSnapshot);
- }
- return new BasicBlockState(location, state);
- }
-
protected abstract AbstractBlockState createCopy(@Nullable ServerLocation location, @NotNull org.spongepowered.api.block.BlockState state);
protected abstract void onPostApply(@NotNull ServerLocation location);
@@ -228,7 +228,7 @@ public void setRawData(byte b) {
@Override
public boolean isPlaced() {
- if(this.location == null){
+ if (this.location == null) {
return false;
}
return this.location.block().type().equals(this.state.type());
@@ -266,4 +266,9 @@ public boolean hasMetadata(@NotNull String metadataKey) {
public void removeMetadata(@NotNull String metadataKey, @NotNull Plugin owningPlugin) {
throw NotImplementedException.createByLazy(AbstractBlockState.class, "metadataKey", String.class, Plugin.class);
}
+
+ @Override
+ public boolean isSuffocating() {
+ throw NotImplementedException.createByLazy(AbstractBlockState.class, "isSuffocating");
+ }
}
diff --git a/Wrapper/src/main/java/org/soak/wrapper/block/state/DispenserBlockState.java b/Wrapper/src/main/java/org/soak/wrapper/block/state/DispenserBlockState.java
index 913f14f..d79ecea 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/block/state/DispenserBlockState.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/block/state/DispenserBlockState.java
@@ -3,6 +3,7 @@
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.serializer.legacy.LegacyComponentSerializer;
import org.bukkit.block.Dispenser;
+import org.bukkit.inventory.ItemStack;
import org.bukkit.projectiles.BlockProjectileSource;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -105,6 +106,11 @@ public void setLock(@Nullable String s) {
this.lockedToken.set(s);
}
+ @Override
+ public void setLockItem(@Nullable ItemStack key) {
+throw NotImplementedException.createByLazy(Dispenser.class, "setLockItem", ItemStack.class);
+ }
+
@Override
protected AbstractBlockState createCopy(@Nullable ServerLocation location, @NotNull BlockState state) {
return new DispenserBlockState(location, state, this.isSnapshot(), this.customName, this.lockedToken);
diff --git a/Wrapper/src/main/java/org/soak/wrapper/command/SoakCommandMap.java b/Wrapper/src/main/java/org/soak/wrapper/command/SoakCommandMap.java
index 244199c..4aef041 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/command/SoakCommandMap.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/command/SoakCommandMap.java
@@ -8,17 +8,23 @@
import org.soak.command.BukkitRawCommand;
import org.soak.plugin.SoakManager;
import org.soak.utils.GeneralHelper;
+import org.soak.wrapper.plugin.SoakPluginManager;
import org.spongepowered.api.Sponge;
+import org.spongepowered.plugin.PluginContainer;
-import java.util.Collections;
+import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.Objects;
public class SoakCommandMap extends SimpleCommandMap {
+ private final Collection registerLater = new ArrayList<>();
+ private final boolean canAcceptCommands;
public SoakCommandMap() {
super(Bukkit.getServer(), new HashMap<>());
+ canAcceptCommands = true;
}
@Override
@@ -26,15 +32,45 @@ public boolean register(@NotNull String label, @NotNull String fallbackPrefix, @
return registerCommand(command, fallbackPrefix, label);
}
+ public void registerStored() {
+ var rawRegister = Sponge.server()
+ .commandManager()
+ .registrar(org.spongepowered.api.command.Command.Raw.class)
+ .orElseThrow(() -> new RuntimeException("Cannot register late commands"));
+ this.registerLater.forEach(r -> rawRegister.register(r.container, r.cmd, r.name, r.aliases));
+ }
+
private boolean registerCommand(@NotNull Command command, @NotNull String fallback, @Nullable String label) {
+ if(!this.canAcceptCommands){
+ return false;
+ }
this.knownCommands.put(Objects.requireNonNullElseGet(label, command::getLabel), command);
boolean result = command.register(this);
-
- var rawRegister = Sponge.server().commandManager().registrar(org.spongepowered.api.command.Command.Raw.class).orElseThrow(() -> new RuntimeException("Cannot register late command of '" + label + "'"));
- var plugin = GeneralHelper.fromStackTrace();
- var soakPlugin = SoakManager.getManager().getSoakContainer(plugin).orElseThrow(() -> new RuntimeException("Cannot get the soakPlugin from '" + plugin.metadata().id() + "'"));
+ var plugin = fallback.equals("bukkit") ? SoakManager.getManager().getOwnContainer() : GeneralHelper.fromStackTrace();
+ var soakPlugin = SoakManager.getManager()
+ .getSoakContainer(plugin)
+ .orElseThrow(() -> new RuntimeException("Cannot get the soakPlugin from '" + plugin.metadata()
+ .id() + "'"));
var bukkitRawWrapper = new BukkitRawCommand(soakPlugin, command);
- rawRegister.register(plugin, bukkitRawWrapper, command.getName(), command.getAliases().toArray(String[]::new));
+ if (Sponge.isServerAvailable()) {
+ var rawRegister = Sponge.server()
+ .commandManager()
+ .registrar(org.spongepowered.api.command.Command.Raw.class)
+ .orElseThrow(() -> new RuntimeException("Cannot register late command of '" + label + "'"));
+ rawRegister.register(plugin,
+ bukkitRawWrapper,
+ command.getName(),
+ command.getAliases().toArray(String[]::new));
+ } else {
+ registerLater.add(new SpongeRawCommand(plugin,
+ bukkitRawWrapper,
+ command.getName(),
+ command.getAliases().toArray(String[]::new)));
+ }
return result;
}
+
+ record SpongeRawCommand(PluginContainer container, BukkitRawCommand cmd, String name, String[] aliases) {
+
+ }
}
diff --git a/Wrapper/src/main/java/org/soak/wrapper/entity/AbstractEntity.java b/Wrapper/src/main/java/org/soak/wrapper/entity/AbstractEntity.java
index 0788d00..517623e 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/entity/AbstractEntity.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/entity/AbstractEntity.java
@@ -1,9 +1,12 @@
package org.soak.wrapper.entity;
+import io.papermc.paper.datacomponent.DataComponentType;
+import io.papermc.paper.entity.LookAnchor;
import io.papermc.paper.entity.TeleportFlag;
import io.papermc.paper.threadedregions.scheduler.EntityScheduler;
import net.kyori.adventure.audience.Audience;
import net.kyori.adventure.text.Component;
+import net.kyori.adventure.util.TriState;
import org.bukkit.*;
import org.bukkit.block.BlockFace;
import org.bukkit.block.PistonMoveReaction;
@@ -11,6 +14,7 @@
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
+import org.bukkit.inventory.ItemStack;
import org.bukkit.metadata.MetadataValue;
import org.bukkit.persistence.PersistentDataContainer;
import org.bukkit.plugin.Plugin;
@@ -69,7 +73,7 @@ public AbstractEntity(Subject subject, Audience audience, E entity) {
private static SoakEntity wrapEntity(SE entity) {
EntityTypeMappingEntry entityTypeMapping =
(EntityTypeMappingEntry) EntityTypeList.getEntityTypeMapping(
- entity.type());
+ entity.type());
if (!entityTypeMapping.isFinal()) {
entityTypeMapping.updateWithSoakClass((Class) entity.getClass());
}
@@ -78,13 +82,53 @@ private static AbstractLivingEntity wrap(E living) {
- return (AbstractLivingEntity) (Object) wrapEntity(living);
+ return wrapEntity(living);
}
public static AbstractEntity> wrap(E entity) {
return wrapEntity(entity);
}
+ @Override
+ public @org.jspecify.annotations.Nullable T getData(DataComponentType.Valued type) {
+ throw NotImplementedException.createByLazy(Player.class, "getData", DataComponentType.Valued.class);
+ }
+
+ @Override
+ public @org.jspecify.annotations.Nullable T getDataOrDefault(DataComponentType.Valued extends T> type, @org.jspecify.annotations.Nullable T fallback) {
+ throw NotImplementedException.createByLazy(Player.class, "getDataOrDefault", DataComponentType.Valued.class, Object.class);
+ }
+
+ @Override
+ public boolean hasData(DataComponentType type) {
+ throw NotImplementedException.createByLazy(Player.class, "hasData", DataComponentType.class);
+ }
+
+ @Override
+ public boolean isTrackedBy(@NotNull Player player) {
+ throw NotImplementedException.createByLazy(Player.class, "isTrackedBy", Player.class);
+ }
+
+ @Override
+ public void lookAt(double v, double v1, double v2, @NotNull LookAnchor lookAnchor) {
+ throw NotImplementedException.createByLazy(Player.class,
+ "lookAt",
+ double.class,
+ double.class,
+ double.class,
+ LookAnchor.class);
+ }
+
+ @Override
+ public @NotNull ItemStack getPickItemStack() {
+ throw NotImplementedException.createByLazy(HumanEntity.class, "getPickItemStack");
+ }
+
+ @Override
+ public @NotNull TriState getVisualFire() {
+ throw NotImplementedException.createByLazy(HumanEntity.class, "getVisualFire");
+ }
+
public E spongeEntity() {
return this.entity;
}
@@ -153,9 +197,9 @@ public boolean isEmpty() {
@Override
public @NotNull Location getLocation() {
var loc = new Location(this.getWorld(),
- this.entity.position().x(),
- this.entity.position().y(),
- this.entity.position().z());
+ this.entity.position().x(),
+ this.entity.position().y(),
+ this.entity.position().z());
var spongeRotation = this.entity.rotation();
loc.setPitch((float) spongeRotation.x());
loc.setYaw((float) spongeRotation.y());
@@ -223,6 +267,11 @@ public boolean isVisualFire() {
throw NotImplementedException.createByLazy(Entity.class, "isVisualFire");
}
+ @Override
+ public void setVisualFire(@NotNull TriState fire) {
+ throw NotImplementedException.createByLazy(HumanEntity.class, "setVisualFire", TriState.class);
+ }
+
@Override
public void setVisualFire(boolean b) {
throw NotImplementedException.createByLazy(Entity.class, "setVisualFire", boolean.class);
@@ -317,9 +366,9 @@ public boolean isUnderWater() {
@Override
public boolean spawnAt(@NotNull Location location, @NotNull CreatureSpawnEvent.SpawnReason spawnReason) {
throw NotImplementedException.createByLazy(Entity.class,
- "spawnAt",
- Location.class,
- CreatureSpawnEvent.SpawnReason.class);
+ "spawnAt",
+ Location.class,
+ CreatureSpawnEvent.SpawnReason.class);
}
@@ -398,10 +447,10 @@ public boolean isInWater() {
var thisLocation = getLocation();
var near = this.getWorld().getNearbyEntities(thisLocation, x, y, z);
return ListMappingUtils.fromStream(CollectionStreamBuilder.builder().collection(near).basicMap(t -> t),
- near::stream,
- Object::equals,
- Comparator.comparingDouble(entity -> entity.getLocation()
- .distanceSquared(thisLocation))).buildList();
+ near::stream,
+ Object::equals,
+ Comparator.comparingDouble(entity -> entity.getLocation()
+ .distanceSquared(thisLocation))).buildList();
}
@Override
diff --git a/Wrapper/src/main/java/org/soak/wrapper/entity/living/AbstractLivingEntity.java b/Wrapper/src/main/java/org/soak/wrapper/entity/living/AbstractLivingEntity.java
index 6599e2d..211cce1 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/entity/living/AbstractLivingEntity.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/entity/living/AbstractLivingEntity.java
@@ -2,12 +2,13 @@
import com.destroystokyo.paper.block.TargetBlockInfo;
import com.destroystokyo.paper.entity.TargetEntityInfo;
+import io.papermc.paper.datacomponent.DataComponentType;
+import io.papermc.paper.entity.LookAnchor;
+import io.papermc.paper.world.damagesource.CombatTracker;
import net.kyori.adventure.audience.Audience;
+import net.kyori.adventure.key.Key;
import net.kyori.adventure.util.TriState;
-import org.bukkit.FluidCollisionMode;
-import org.bukkit.Location;
-import org.bukkit.Material;
-import org.bukkit.Sound;
+import org.bukkit.*;
import org.bukkit.block.Block;
import org.bukkit.block.BlockFace;
import org.bukkit.damage.DamageSource;
@@ -26,7 +27,7 @@
import org.jetbrains.annotations.Range;
import org.soak.Constants;
import org.soak.exception.NotImplementedException;
-import org.soak.map.SoakBlockMap;
+import org.soak.map.SoakRegistryMap;
import org.soak.plugin.SoakManager;
import org.soak.utils.GeneralHelper;
import org.soak.wrapper.block.SoakBlock;
@@ -55,6 +56,37 @@ public AbstractLivingEntity(Subject subject, Audience audience, E entity) {
super(subject, audience, entity);
}
+ @Override
+ public void kill(DamageSource damageSource) {
+ var soakSource = (SoakDamageSource) damageSource;
+ this.spongeEntity().damage(Integer.MAX_VALUE, soakSource.spongeSource());
+ }
+
+ @Override
+ public @NotNull Key getWaypointStyle() {
+ throw NotImplementedException.createByLazy(Player.class, "getWaypointStyle");
+ }
+
+ @Override
+ public void setWaypointStyle(@Nullable Key key) {
+ throw NotImplementedException.createByLazy(Player.class, "setWaypointStyle", Key.class);
+ }
+
+ @Override
+ public @Nullable Color getWaypointColor() {
+ throw NotImplementedException.createByLazy(Player.class, "getWaypointColor");
+ }
+
+ @Override
+ public void setWaypointColor(@Nullable Color color) {
+ throw NotImplementedException.createByLazy(Player.class, "setWaypointColor", Color.class);
+ }
+
+ @Override
+ public @NotNull CombatTracker getCombatTracker() {
+ throw NotImplementedException.createByLazy(Player.class, "getCombatTracker");
+ }
+
@Override
public boolean canUseEquipmentSlot(@NotNull EquipmentSlot equipmentSlot) {
throw NotImplementedException.createByLazy(LivingEntity.class, "canUseEquipmentSlot", EquipmentSlot.class);
@@ -164,10 +196,10 @@ public boolean canBreatheUnderwater() {
@Override
public void knockback(double v, double v1, double v2) {
throw NotImplementedException.createByLazy(LivingEntity.class,
- "knockback",
- double.class,
- double.class,
- double.class);
+ "knockback",
+ double.class,
+ double.class,
+ double.class);
}
@Override
@@ -178,9 +210,9 @@ public void broadcastSlotBreak(@NotNull EquipmentSlot equipmentSlot) {
@Override
public void broadcastSlotBreak(@NotNull EquipmentSlot equipmentSlot, @NotNull Collection collection) {
throw NotImplementedException.createByLazy(LivingEntity.class,
- "broadcastSlotBreak",
- EquipmentSlot.class,
- Collection.class);
+ "broadcastSlotBreak",
+ EquipmentSlot.class,
+ Collection.class);
}
@Override
@@ -191,9 +223,9 @@ public void broadcastSlotBreak(@NotNull EquipmentSlot equipmentSlot, @NotNull Co
@Override
public void damageItemStack(@NotNull EquipmentSlot equipmentSlot, int i) {
throw NotImplementedException.createByLazy(LivingEntity.class,
- "damageItemStack",
- EquipmentSlot.class,
- int.class);
+ "damageItemStack",
+ EquipmentSlot.class,
+ int.class);
}
@Override
@@ -224,9 +256,9 @@ public RayTraceResult rayTraceBlocks(double arg0) {
@Override
public RayTraceResult rayTraceBlocks(double arg0, @NotNull FluidCollisionMode arg1) {
throw NotImplementedException.createByLazy(LivingEntity.class,
- "rayTraceBlocks",
- double.class,
- FluidCollisionMode.class);
+ "rayTraceBlocks",
+ double.class,
+ FluidCollisionMode.class);
}
@Override
@@ -243,9 +275,9 @@ public TargetEntityInfo getTargetEntityInfo(int arg0, boolean arg1) {
@Override
public void playPickupItemAnimation(@NotNull Item arg0, int arg1) {
throw NotImplementedException.createByLazy(LivingEntity.class,
- "playPickupItemAnimation",
- Item.class,
- int.class);
+ "playPickupItemAnimation",
+ Item.class,
+ int.class);
}
@Override
@@ -284,8 +316,7 @@ public double getEyeHeight(boolean ignorePose) {
return false;
}
return transparent.stream()
- .map(mat -> SoakBlockMap.toSponge(mat)
- .orElseThrow(() -> new RuntimeException(mat.name() + " is not a block")))
+ .map(SoakRegistryMap::toSpongeBlock)
.anyMatch(type -> type.equals(locatableBlock.blockState().type()));
}))
.limit(maxDistance)
@@ -293,34 +324,34 @@ public double getEyeHeight(boolean ignorePose) {
return opBlock.flatMap(block -> block.selectedObject().location().onServer())
.map(SoakBlock::new)
.orElseGet(() -> new SoakBlock((ServerWorld) this.spongeEntity().world(),
- this.spongeEntity().eyePosition().get().toInt()));
+ this.spongeEntity().eyePosition().get().toInt()));
}
@Override
@Deprecated
public @Nullable Block getTargetBlock(int maxDistance, @NotNull TargetBlockInfo.FluidMode fluidMode) {
throw NotImplementedException.createByLazy(LivingEntity.class,
- "getTargetBlockExact",
- int.class,
- FluidCollisionMode.class);
+ "getTargetBlockExact",
+ int.class,
+ FluidCollisionMode.class);
}
@Override
@Deprecated
public @Nullable BlockFace getTargetBlockFace(int maxDistance, @NotNull TargetBlockInfo.FluidMode fluidMode) {
throw NotImplementedException.createByLazy(LivingEntity.class,
- "getTargetBlockFace",
- int.class,
- TargetBlockInfo.FluidMode.class);
+ "getTargetBlockFace",
+ int.class,
+ TargetBlockInfo.FluidMode.class);
}
@Override
@Deprecated
public @Nullable TargetBlockInfo getTargetBlockInfo(int maxDistance, @NotNull TargetBlockInfo.FluidMode fluidMode) {
throw NotImplementedException.createByLazy(LivingEntity.class,
- "getTargetBlockInfo",
- int.class,
- TargetBlockInfo.FluidMode.class);
+ "getTargetBlockInfo",
+ int.class,
+ TargetBlockInfo.FluidMode.class);
}
@Override
@@ -331,9 +362,9 @@ public Block getTargetBlockExact(int arg0) {
@Override
public @Nullable Block getTargetBlockExact(int maxDistance, @NotNull FluidCollisionMode fluidCollisionMode) {
throw NotImplementedException.createByLazy(LivingEntity.class,
- "getTargetBlockExact",
- int.class,
- FluidCollisionMode.class);
+ "getTargetBlockExact",
+ int.class,
+ FluidCollisionMode.class);
}
@Override
@@ -426,8 +457,8 @@ public void setNoDamageTicks(int arg0) {
SoakManager.getManager()
.getLogger()
.warn(badPlugin.metadata()
- .id() + " attempted to set minecraft data off thread. This should not be done. Moving " +
- "action to main thread");
+ .id() + " attempted to set minecraft data off thread. This should not be done. Moving " +
+ "action to main thread");
Sponge.server().scheduler().executor(badPlugin).submit(() -> setNoDamageTicks(arg0));
}
@@ -455,9 +486,9 @@ public void setKiller(Player arg0) {
@Override
public boolean addPotionEffect(@NotNull PotionEffect arg0, boolean arg1) {
throw NotImplementedException.createByLazy(LivingEntity.class,
- "addPotionEffect",
- PotionEffect.class,
- boolean.class);
+ "addPotionEffect",
+ PotionEffect.class,
+ boolean.class);
}
@Override
diff --git a/Wrapper/src/main/java/org/soak/wrapper/entity/living/AbstractMob.java b/Wrapper/src/main/java/org/soak/wrapper/entity/living/AbstractMob.java
index 565bbad..aa70165 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/entity/living/AbstractMob.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/entity/living/AbstractMob.java
@@ -2,6 +2,7 @@
import com.destroystokyo.paper.entity.Pathfinder;
import net.kyori.adventure.audience.Audience;
+import net.kyori.adventure.util.TriState;
import org.bukkit.Location;
import org.bukkit.Sound;
import org.bukkit.entity.Entity;
@@ -25,6 +26,21 @@ public AbstractMob(Subject subject, Audience audience, E entity) {
super(subject, audience, entity);
}
+ @Override
+ public boolean shouldDespawnInPeaceful() {
+ throw NotImplementedException.createByLazy(Mob.class, "shouldDespawnInPeaceful");
+ }
+
+ @Override
+ public void setDespawnInPeacefulOverride(TriState state) {
+ throw NotImplementedException.createByLazy(Mob.class, "setDespawnInReacefulOverride", TriState.class);
+ }
+
+ @Override
+ public TriState getDespawnInPeacefulOverride() {
+ throw NotImplementedException.createByLazy(Mob.class, "getSpawnInPeacefulOverride");
+ }
+
@Override
public @NotNull Pathfinder getPathfinder() {
throw NotImplementedException.createByLazy(Mob.class, "getPathfinder");
diff --git a/Wrapper/src/main/java/org/soak/wrapper/entity/living/human/AbstractHumanBase.java b/Wrapper/src/main/java/org/soak/wrapper/entity/living/human/AbstractHumanBase.java
index 6ad12ec..3fd0e06 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/entity/living/human/AbstractHumanBase.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/entity/living/human/AbstractHumanBase.java
@@ -1,27 +1,31 @@
package org.soak.wrapper.entity.living.human;
+import io.papermc.paper.datacomponent.DataComponentType;
+import io.papermc.paper.entity.LookAnchor;
+import io.papermc.paper.world.damagesource.CombatTracker;
import net.kyori.adventure.audience.Audience;
-import org.bukkit.GameMode;
-import org.bukkit.Location;
-import org.bukkit.Material;
-import org.bukkit.NamespacedKey;
+import net.kyori.adventure.key.Key;
+import net.kyori.adventure.util.TriState;
+import org.bukkit.*;
import org.bukkit.block.Sign;
import org.bukkit.block.sign.Side;
+import org.bukkit.damage.DamageSource;
import org.bukkit.entity.*;
import org.bukkit.inventory.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.soak.exception.NotImplementedException;
import org.soak.map.SoakGameModeMap;
+import org.soak.map.SoakRegistryMap;
+import org.soak.wrapper.damage.SoakDamageSource;
import org.soak.wrapper.entity.living.AbstractLivingEntity;
import org.spongepowered.api.data.Keys;
import org.spongepowered.api.entity.living.Humanoid;
-import org.spongepowered.api.item.inventory.equipment.EquipmentTypes;
-import org.spongepowered.api.registry.RegistryTypes;
import org.spongepowered.api.service.permission.Subject;
import java.util.Collection;
import java.util.Set;
+import java.util.function.Consumer;
public abstract class AbstractHumanBase extends AbstractLivingEntity implements HumanEntity {
@@ -29,23 +33,64 @@ public AbstractHumanBase(Subject subject, Audience audience, E entity) {
super(subject, audience, entity);
}
+ @Override
+ public @org.jspecify.annotations.Nullable Item dropItem(int slot, int amount, boolean throwRandomly, @org.jspecify.annotations.Nullable Consumer- entityOperation) {
+ throw NotImplementedException.createByLazy(HumanEntity.class, "dropItem", int.class, int.class, boolean.class, Consumer.class);
+ }
+
+ @Override
+ public @org.jspecify.annotations.Nullable Item dropItem(EquipmentSlot slot, int amount, boolean throwRandomly, @org.jspecify.annotations.Nullable Consumer
- entityOperation) {
+ throw NotImplementedException.createByLazy(HumanEntity.class, "dropItem", EquipmentSlot.class, int.class, boolean.class, Consumer.class);
+ }
+
+ @Override
+ public @org.jspecify.annotations.Nullable Item dropItem(ItemStack itemStack, boolean throwRandomly, @org.jspecify.annotations.Nullable Consumer
- entityOperation) {
+ throw NotImplementedException.createByLazy(HumanEntity.class, "dropItem", ItemStack.class, boolean.class, Consumer.class);
+ }
+
+ @Override
+ public boolean hasCooldown(ItemStack item) {
+ throw NotImplementedException.createByLazy(HumanEntity.class, "hasCooldown", ItemStack.class);
+ }
+
+ @Override
+ public int getCooldown(ItemStack item) {
+ throw NotImplementedException.createByLazy(HumanEntity.class, "getCooldown", ItemStack.class);
+ }
+
+ @Override
+ public void setCooldown(ItemStack item, int ticks) {
+ throw NotImplementedException.createByLazy(HumanEntity.class, "setCooldown", ItemStack.class, int.class);
+ }
+
+ @Override
+ public int getCooldown(Key key) {
+ throw NotImplementedException.createByLazy(HumanEntity.class, "getCooldown", Key.class);
+ }
+
+ @Override
+ public void setCooldown(Key key, int ticks) {
+ throw NotImplementedException.createByLazy(HumanEntity.class, "setCooldown", Key.class, int.class);
+ }
+
+ @Override
+ public @org.jspecify.annotations.Nullable Location getPotentialRespawnLocation() {
+ throw NotImplementedException.createByLazy(HumanEntity.class, "getPotentialRespawnLocation");
+ }
+
+
@Override
public void startRiptideAttack(int i, float v, @Nullable ItemStack itemStack) {
throw NotImplementedException.createByLazy(HumanEntity.class,
- "startRiptideAttack",
- int.class,
- float.class,
- ItemStack.class);
+ "startRiptideAttack",
+ int.class,
+ float.class,
+ ItemStack.class);
}
@Override
public boolean canUseEquipmentSlot(@NotNull EquipmentSlot equipmentSlot) {
- var equipmentType = EquipmentTypes.registry()
- .stream()
- .filter(type -> equipmentSlot.name().equalsIgnoreCase(type.key(RegistryTypes.EQUIPMENT_TYPE).value()))
- .findAny()
- .orElseThrow();
- //TODO move to map
+ var equipmentType = SoakRegistryMap.toSponge(equipmentSlot);
return this.entity.canEquip(equipmentType);
}
@@ -104,9 +149,9 @@ public void setShoulderEntityLeft(Entity arg0) {
@Override
public boolean setWindowProperty(InventoryView.@NotNull Property arg0, int arg1) {
throw NotImplementedException.createByLazy(HumanEntity.class,
- "setWindowProperty",
- InventoryView.Property.class,
- int.class);
+ "setWindowProperty",
+ InventoryView.Property.class,
+ int.class);
}
@Override
@@ -142,9 +187,9 @@ public InventoryView openAnvil(Location arg0, boolean arg1) {
@Override
public InventoryView openCartographyTable(Location arg0, boolean arg1) {
throw NotImplementedException.createByLazy(HumanEntity.class,
- "openCartographyTable",
- Location.class,
- boolean.class);
+ "openCartographyTable",
+ Location.class,
+ boolean.class);
}
@Override
@@ -160,9 +205,9 @@ public InventoryView openLoom(Location arg0, boolean arg1) {
@Override
public InventoryView openSmithingTable(Location arg0, boolean arg1) {
throw NotImplementedException.createByLazy(HumanEntity.class,
- "openSmithingTable",
- Location.class,
- boolean.class);
+ "openSmithingTable",
+ Location.class,
+ boolean.class);
}
@Override
diff --git a/Wrapper/src/main/java/org/soak/wrapper/entity/living/human/SoakPlayer.java b/Wrapper/src/main/java/org/soak/wrapper/entity/living/human/SoakPlayer.java
index 7574dcf..e01c09c 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/entity/living/human/SoakPlayer.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/entity/living/human/SoakPlayer.java
@@ -3,7 +3,9 @@
import com.destroystokyo.paper.ClientOption;
import com.destroystokyo.paper.Title;
import com.destroystokyo.paper.profile.PlayerProfile;
+import io.papermc.paper.connection.PlayerGameConnection;
import io.papermc.paper.entity.LookAnchor;
+import io.papermc.paper.entity.PlayerGiveResult;
import io.papermc.paper.math.Position;
import net.kyori.adventure.bossbar.BossBar;
import net.kyori.adventure.text.Component;
@@ -41,9 +43,9 @@
import org.soak.wrapper.block.data.SoakBlockData;
import org.soak.wrapper.block.state.AbstractBlockState;
import org.soak.wrapper.inventory.SoakInventory;
+import org.soak.wrapper.inventory.carrier.SoakPlayerInventory;
import org.soak.wrapper.inventory.view.AbstractInventoryView;
import org.soak.wrapper.inventory.view.SoakOpeningInventoryView;
-import org.soak.wrapper.inventory.carrier.SoakPlayerInventory;
import org.soak.wrapper.world.SoakWorld;
import org.spongepowered.api.Sponge;
import org.spongepowered.api.data.Keys;
@@ -55,7 +57,6 @@
import org.spongepowered.api.service.ban.BanTypes;
import org.spongepowered.api.statistic.Statistics;
import org.spongepowered.api.util.RespawnLocation;
-import org.spongepowered.math.vector.Vector3d;
import java.net.InetAddress;
import java.net.InetSocketAddress;
@@ -118,7 +119,7 @@ public boolean discoverRecipe(@NotNull NamespacedKey key) {
SoakInventory> soakInv = (SoakInventory>) inventory;
try {
return openInventory(soakInv.sponge(),
- soakInv.requestedTitle().orElse(null)).map(AbstractInventoryView::wrap).orElse(null);
+ soakInv.requestedTitle().orElse(null)).map(AbstractInventoryView::wrap).orElse(null);
} catch (UnsupportedOperationException ex) {
Sponge.server()
.scheduler()
@@ -358,10 +359,10 @@ public void setStatistic(@NotNull Statistic statistic, int value) {
@Override
public void setStatistic(@NotNull Statistic arg0, @NotNull Material arg1, int arg2) {
throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "setStatistic",
- Statistic.class,
- Material.class,
- int.class);
+ "setStatistic",
+ Statistic.class,
+ Material.class,
+ int.class);
}
private Optional> statistic(Statistic statistic,
@@ -374,13 +375,13 @@ private Optional> sta
.filter(entry -> entry.getKey()
.criterion()
.orElseThrow()
- .key(RegistryTypes.STATISTIC)
+ .key(RegistryTypes.CRITERION)
.equals(spongeKey))
.filter(entry -> entry.getKey() instanceof org.spongepowered.api.statistic.Statistic.TypeInstance>)
.filter(entry -> {
var typedStatistic =
((org.spongepowered.api.statistic.Statistic.TypeInstance>) entry.getKey()).type();
- if (SoakBlockMap.toSponge(material).map(typedStatistic::equals).orElse(false)) {
+ if (SoakRegistryMap.toSpongeBlock(material).equals(typedStatistic)) {
return true;
}
return SoakItemStackMap.toSponge(material).map(typedStatistic::equals).orElse(false);
@@ -402,7 +403,7 @@ private Optional> sta
.filter(entry -> entry.getKey()
.criterion()
.orElseThrow()
- .key(RegistryTypes.STATISTIC)
+ .key(RegistryTypes.CRITERION)
.equals(spongeKey))
.findAny();
}
@@ -423,7 +424,7 @@ public Optional> stat
.filter(entry -> entry.getKey()
.criterion()
.orElseThrow()
- .key(RegistryTypes.STATISTIC)
+ .key(RegistryTypes.CRITERION)
.equals(spongeKey))
.filter(entry -> entry.getKey() instanceof org.spongepowered.api.statistic.Statistic.TypeInstance>)
.filter(entry -> ((org.spongepowered.api.statistic.Statistic.TypeInstance>) entry.getKey()).type()
@@ -533,10 +534,10 @@ public void setResourcePack(@NotNull String arg0, byte[] arg1) {
@Override
public void setResourcePack(@NotNull String s, byte[] bytes, @Nullable String s1) {
throw NotImplementedException.createByLazy(Player.class,
- "setResourcePack",
- String.class,
- byte.class,
- String.class);
+ "setResourcePack",
+ String.class,
+ byte.class,
+ String.class);
}
@Override
@@ -552,22 +553,22 @@ public void setResourcePack(@NotNull String s, byte[] bytes, @Nullable String s1
@Override
public void setResourcePack(@NotNull String s, byte @Nullable [] bytes, @Nullable Component component, boolean b) {
throw NotImplementedException.createByLazy(Player.class,
- "setResourcePack",
- String.class,
- byte.class,
- Component.class,
- boolean.class);
+ "setResourcePack",
+ String.class,
+ byte.class,
+ Component.class,
+ boolean.class);
}
@Override
public void setResourcePack(@NotNull UUID uuid, @NotNull String s, byte[] bytes, @Nullable String s1, boolean b) {
throw NotImplementedException.createByLazy(Player.class,
- "setResourcePack",
- UUID.class,
- String.class,
- byte[].class,
- String.class,
- boolean.class);
+ "setResourcePack",
+ UUID.class,
+ String.class,
+ byte[].class,
+ String.class,
+ boolean.class);
}
@@ -575,12 +576,12 @@ public void setResourcePack(@NotNull UUID uuid, @NotNull String s, byte[] bytes,
public void setResourcePack(@NotNull UUID uuid, @NotNull String s, byte @Nullable [] bytes,
@Nullable Component component, boolean b) {
throw NotImplementedException.createByLazy(Player.class,
- "setResourcePack",
- UUID.class,
- String.class,
- byte[].class,
- Component.class,
- boolean.class);
+ "setResourcePack",
+ UUID.class,
+ String.class,
+ byte[].class,
+ Component.class,
+ boolean.class);
}
@@ -597,11 +598,11 @@ 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) {
throw NotImplementedException.createByLazy(Player.class,
- "setResourcePack",
- String.class,
- String.class,
- boolean.class,
- Component.class);
+ "setResourcePack",
+ String.class,
+ String.class,
+ boolean.class,
+ Component.class);
}
@Deprecated
@@ -653,10 +654,10 @@ public void setHealthScale(double arg0) {
@Override
public void sendHealthUpdate(double v, int i, float v1) {
throw NotImplementedException.createByLazy(Player.class,
- "sendHealthUpdate",
- double.class,
- int.class,
- float.class);
+ "sendHealthUpdate",
+ double.class,
+ int.class,
+ float.class);
}
@Override
@@ -683,196 +684,196 @@ public void resetTitle() {
public void spawnParticle(@NotNull Particle arg0, @NotNull Location arg1, int arg2, double arg3, double arg4,
double arg5) {
throw NotImplementedException.createByLazy(Player.class,
- "spawnParticle",
- Particle.class,
- Location.class,
- int.class,
- double.class,
- double.class,
- double.class);
+ "spawnParticle",
+ Particle.class,
+ Location.class,
+ int.class,
+ double.class,
+ double.class,
+ double.class);
}
@Override
public void spawnParticle(@NotNull Particle arg0, double arg1, double arg2, double arg3, int arg4, double arg5,
double arg6, double arg7) {
throw NotImplementedException.createByLazy(Player.class,
- "spawnParticle",
- Particle.class,
- double.class,
- double.class,
- double.class,
- int.class,
- double.class,
- double.class,
- double.class);
+ "spawnParticle",
+ Particle.class,
+ double.class,
+ double.class,
+ double.class,
+ int.class,
+ double.class,
+ double.class,
+ double.class);
}
@Override
public void spawnParticle(@NotNull Particle arg0, @NotNull Location arg1, int arg2, double arg3, double arg4,
double arg5, Object arg6) {
throw NotImplementedException.createByLazy(Player.class,
- "spawnParticle",
- Particle.class,
- Location.class,
- int.class,
- double.class,
- double.class,
- double.class,
- Object.class);
+ "spawnParticle",
+ Particle.class,
+ Location.class,
+ int.class,
+ double.class,
+ double.class,
+ double.class,
+ Object.class);
}
@Override
public void spawnParticle(@NotNull Particle arg0, double arg1, double arg2, double arg3, int arg4, double arg5,
double arg6, double arg7, Object arg8) {
throw NotImplementedException.createByLazy(Player.class,
- "spawnParticle",
- Particle.class,
- double.class,
- double.class,
- double.class,
- int.class,
- double.class,
- double.class,
- double.class,
- Object.class);
+ "spawnParticle",
+ Particle.class,
+ double.class,
+ double.class,
+ double.class,
+ int.class,
+ double.class,
+ double.class,
+ double.class,
+ Object.class);
}
@Override
public void spawnParticle(@NotNull Particle arg0, @NotNull Location arg1, int arg2, double arg3, double arg4,
double arg5, double arg6) {
throw NotImplementedException.createByLazy(Player.class,
- "spawnParticle",
- Particle.class,
- Location.class,
- int.class,
- double.class,
- double.class,
- double.class,
- double.class);
+ "spawnParticle",
+ Particle.class,
+ Location.class,
+ int.class,
+ double.class,
+ double.class,
+ double.class,
+ double.class);
}
@Override
public void spawnParticle(@NotNull Particle arg0, double arg1, double arg2, double arg3, int arg4, double arg5,
double arg6, double arg7, double arg8) {
throw NotImplementedException.createByLazy(Player.class,
- "spawnParticle",
- Particle.class,
- double.class,
- double.class,
- double.class,
- int.class,
- double.class,
- double.class,
- double.class,
- double.class);
+ "spawnParticle",
+ Particle.class,
+ double.class,
+ double.class,
+ double.class,
+ int.class,
+ double.class,
+ double.class,
+ double.class,
+ double.class);
}
@Override
public void spawnParticle(@NotNull Particle particle, @NotNull Location location, int i, double v, double v1,
double v2, double v3, @Nullable T t, boolean b) {
throw NotImplementedException.createByLazy(Player.class,
- "spawnParticle",
- Particle.class,
- Location.class,
- int.class,
- double.class,
- double.class,
- double.class,
- double.class,
- Object.class,
- boolean.class);
+ "spawnParticle",
+ Particle.class,
+ Location.class,
+ int.class,
+ double.class,
+ double.class,
+ double.class,
+ double.class,
+ Object.class,
+ boolean.class);
}
@Override
public void spawnParticle(@NotNull Particle particle, double v, double v1, double v2, int i, double v3,
double v4, double v5, double v6, @Nullable T t, boolean b) {
throw NotImplementedException.createByLazy(Player.class,
- "spawnParticle",
- Particle.class,
- double.class,
- double.class,
- double.class,
- int.class,
- double.class,
- double.class,
- double.class,
- double.class,
- Object.class,
- boolean.class);
+ "spawnParticle",
+ Particle.class,
+ double.class,
+ double.class,
+ double.class,
+ int.class,
+ double.class,
+ double.class,
+ double.class,
+ double.class,
+ Object.class,
+ boolean.class);
}
@Override
public void spawnParticle(@NotNull Particle arg0, @NotNull Location arg1, int arg2, double arg3, double arg4,
double arg5, double arg6, Object arg7) {
throw NotImplementedException.createByLazy(Player.class,
- "spawnParticle",
- Particle.class,
- Location.class,
- int.class,
- double.class,
- double.class,
- double.class,
- double.class,
- Object.class);
+ "spawnParticle",
+ Particle.class,
+ Location.class,
+ int.class,
+ double.class,
+ double.class,
+ double.class,
+ double.class,
+ Object.class);
}
@Override
public void spawnParticle(@NotNull Particle arg0, double arg1, double arg2, double arg3, int arg4, double arg5,
double arg6, double arg7, double arg8, Object arg9) {
throw NotImplementedException.createByLazy(Player.class,
- "spawnParticle",
- Particle.class,
- double.class,
- double.class,
- double.class,
- int.class,
- double.class,
- double.class,
- double.class,
- double.class,
- Object.class);
+ "spawnParticle",
+ Particle.class,
+ double.class,
+ double.class,
+ double.class,
+ int.class,
+ double.class,
+ double.class,
+ double.class,
+ double.class,
+ Object.class);
}
@Override
public void spawnParticle(@NotNull Particle arg0, @NotNull Location arg1, int arg2) {
throw NotImplementedException.createByLazy(Player.class,
- "spawnParticle",
- Particle.class,
- Location.class,
- int.class);
+ "spawnParticle",
+ Particle.class,
+ Location.class,
+ int.class);
}
@Override
public void spawnParticle(@NotNull Particle arg0, double arg1, double arg2, double arg3, int arg4, Object arg5) {
throw NotImplementedException.createByLazy(Player.class,
- "spawnParticle",
- Particle.class,
- double.class,
- double.class,
- double.class,
- int.class,
- Object.class);
+ "spawnParticle",
+ Particle.class,
+ double.class,
+ double.class,
+ double.class,
+ int.class,
+ Object.class);
}
@Override
public void spawnParticle(@NotNull Particle arg0, @NotNull Location arg1, int arg2, Object arg3) {
throw NotImplementedException.createByLazy(Player.class,
- "spawnParticle",
- Particle.class,
- Location.class,
- int.class,
- Object.class);
+ "spawnParticle",
+ Particle.class,
+ Location.class,
+ int.class,
+ Object.class);
}
@Override
public void spawnParticle(@NotNull Particle arg0, double arg1, double arg2, double arg3, int arg4) {
throw NotImplementedException.createByLazy(Player.class,
- "spawnParticle",
- Particle.class,
- double.class,
- double.class,
- double.class,
- int.class);
+ "spawnParticle",
+ Particle.class,
+ double.class,
+ double.class,
+ double.class,
+ int.class);
}
@Override
@@ -961,6 +962,11 @@ public void openSign(@NotNull Sign sign, @NotNull Side side) {
throw NotImplementedException.createByLazy(Player.class, "openSign", Sign.class, Side.class);
}
+ @Override
+ public void openVirtualSign(Position block, Side side) {
+ throw NotImplementedException.createByLazy(Player.class, "openVirtualSign", Position.class, Side.class);
+ }
+
@Override
public void showDemoScreen() {
throw NotImplementedException.createByLazy(Player.class, "showDemoScreen");
@@ -991,12 +997,12 @@ public boolean hasResourcePack() {
@Override
public void addResourcePack(@NotNull UUID uuid, @NotNull String s, byte[] bytes, @Nullable String s1, boolean b) {
throw NotImplementedException.createByLazy(Player.class,
- "addResourcePack",
- UUID.class,
- String.class,
- byte[].class,
- String.class,
- boolean.class);
+ "addResourcePack",
+ UUID.class,
+ String.class,
+ byte[].class,
+ String.class,
+ boolean.class);
}
@Override
@@ -1072,23 +1078,13 @@ public String getClientBrandName() {
throw NotImplementedException.createByLazy(Player.class, "getClientBrandName");
}
- @Override
- public void lookAt(double v, double v1, double v2, @NotNull LookAnchor lookAnchor) {
- throw NotImplementedException.createByLazy(Player.class,
- "lookAt",
- double.class,
- double.class,
- double.class,
- LookAnchor.class);
- }
-
@Override
public void lookAt(@NotNull Entity entity, @NotNull LookAnchor lookAnchor, @NotNull LookAnchor lookAnchor1) {
throw NotImplementedException.createByLazy(Player.class,
- "lookAt",
- Entity.class,
- LookAnchor.class,
- LookAnchor.class);
+ "lookAt",
+ Entity.class,
+ LookAnchor.class,
+ LookAnchor.class);
}
@Override
@@ -1178,6 +1174,26 @@ public void sendEntityEffect(@NotNull EntityEffect entityEffect, @NotNull Entity
throw NotImplementedException.createByLazy(Player.class, "sendEntityEffect", EntityEffect.class, Entity.class);
}
+ @Override
+ public PlayerGiveResult give(Collection items, boolean dropIfFull) {
+ return null;
+ }
+
+ @Override
+ public int getDeathScreenScore() {
+ return 0;
+ }
+
+ @Override
+ public void setDeathScreenScore(int score) {
+
+ }
+
+ @Override
+ public PlayerGameConnection getConnection() {
+ return null;
+ }
+
@Override
public void giveExp(int arg0, boolean arg1) {
throw NotImplementedException.createByLazy(Player.class, "giveExp", int.class, boolean.class);
@@ -1215,6 +1231,16 @@ public void setPlayerListName(String arg0) {
throw NotImplementedException.createByLazy(Player.class, "setPlayerListName", String.class);
}
+ @Override
+ public int getPlayerListOrder() {
+ throw NotImplementedException.createByLazy(Player.class, "getPlayerListOrder");
+ }
+
+ @Override
+ public void setPlayerListOrder(int order) {
+ throw NotImplementedException.createByLazy(Player.class, "setPlayerListOrder", int.class);
+ }
+
@Deprecated
@Override
public String getPlayerListHeader() {
@@ -1243,27 +1269,27 @@ public void setPlayerListFooter(String arg0) {
@Override
public void setPlayerListHeaderFooter(BaseComponent[] arg0, BaseComponent[] arg1) {
throw NotImplementedException.createByLazy(Player.class,
- "setPlayerListHeaderFooter",
- BaseComponent[].class,
- BaseComponent[].class);
+ "setPlayerListHeaderFooter",
+ BaseComponent[].class,
+ BaseComponent[].class);
}
@Deprecated
@Override
public void setPlayerListHeaderFooter(String arg0, String arg1) {
throw NotImplementedException.createByLazy(Player.class,
- "setPlayerListHeaderFooter",
- String.class,
- String.class);
+ "setPlayerListHeaderFooter",
+ String.class,
+ String.class);
}
@Deprecated
@Override
public void setPlayerListHeaderFooter(BaseComponent arg0, BaseComponent arg1) {
throw NotImplementedException.createByLazy(Player.class,
- "setPlayerListHeaderFooter",
- BaseComponent.class,
- BaseComponent.class);
+ "setPlayerListHeaderFooter",
+ BaseComponent.class,
+ BaseComponent.class);
}
@Override
@@ -1300,9 +1326,9 @@ public void abandonConversation(@NotNull Conversation conversation) {
@Override
public void abandonConversation(@NotNull Conversation conversation, @NotNull ConversationAbandonedEvent details) {
throw NotImplementedException.createByLazy(Player.class,
- "abandonConversation",
- Conversation.class,
- ConversationAbandonedEvent.class);
+ "abandonConversation",
+ Conversation.class,
+ ConversationAbandonedEvent.class);
}
@Override
@@ -1331,22 +1357,22 @@ public void kick(Component arg0, @NotNull PlayerKickEvent.Cause arg1) {
public > @Nullable E ban(@Nullable String s, @Nullable Date date,
@Nullable String s1, boolean b) {
throw NotImplementedException.createByLazy(Player.class,
- "ban",
- String.class,
- Date.class,
- String.class,
- boolean.class);
+ "ban",
+ String.class,
+ Date.class,
+ String.class,
+ boolean.class);
}
@Override
public > @Nullable E ban(@Nullable String s, @Nullable Instant instant,
@Nullable String s1, boolean b) {
throw NotImplementedException.createByLazy(Player.class,
- "ban",
- String.class,
- Instant.class,
- String.class,
- boolean.class);
+ "ban",
+ String.class,
+ Instant.class,
+ String.class,
+ boolean.class);
}
@@ -1355,22 +1381,22 @@ public void kick(Component arg0, @NotNull PlayerKickEvent.Cause arg1) {
@Nullable Duration duration,
@Nullable String s1, boolean b) {
throw NotImplementedException.createByLazy(Player.class,
- "ban",
- String.class,
- Duration.class,
- String.class,
- boolean.class);
+ "ban",
+ String.class,
+ Duration.class,
+ String.class,
+ boolean.class);
}
@Override
public @Nullable BanEntry banIp(@Nullable String s, @Nullable Date date, @Nullable String s1,
boolean b) {
throw NotImplementedException.createByLazy(Player.class,
- "ban",
- String.class,
- Date.class,
- String.class,
- boolean.class);
+ "ban",
+ String.class,
+ Date.class,
+ String.class,
+ boolean.class);
}
@@ -1378,22 +1404,22 @@ public void kick(Component arg0, @NotNull PlayerKickEvent.Cause arg1) {
public @Nullable BanEntry banIp(@Nullable String s, @Nullable Instant instant, @Nullable String s1,
boolean b) {
throw NotImplementedException.createByLazy(Player.class,
- "ban",
- String.class,
- Instant.class,
- String.class,
- boolean.class);
+ "ban",
+ String.class,
+ Instant.class,
+ String.class,
+ boolean.class);
}
@Override
public @Nullable BanEntry banIp(@Nullable String s, @Nullable Duration duration, @Nullable String s1
, boolean b) {
throw NotImplementedException.createByLazy(Player.class,
- "ban",
- String.class,
- Duration.class,
- String.class,
- boolean.class);
+ "ban",
+ String.class,
+ Duration.class,
+ String.class,
+ boolean.class);
}
@Override
@@ -1476,6 +1502,12 @@ public void setBedSpawnLocation(@Nullable Location location) {
throw NotImplementedException.createByLazy(Player.class, "getRespawnLocation");
}
+ @Override
+ public @org.jspecify.annotations.Nullable Location getRespawnLocation(boolean loadLocationAndValidate) {
+ throw NotImplementedException.createByLazy(Player.class, "getRespawnLocation", boolean.class);
+
+ }
+
@Override
public void setRespawnLocation(@Nullable Location location) {
throw NotImplementedException.createByLazy(Player.class, "setRespawnLocation", Location.class);
@@ -1486,6 +1518,16 @@ public void setRespawnLocation(@Nullable Location location, boolean b) {
throw NotImplementedException.createByLazy(Player.class, "setRespawnLocation", Location.class, boolean.class);
}
+ @Override
+ public Collection getEnderPearls() {
+ throw NotImplementedException.createByLazy(Player.class, "getEnderPearls");
+ }
+
+ @Override
+ public Input getCurrentInput() {
+ throw NotImplementedException.createByLazy(Player.class, "getCurrentInput");
+ }
+
@Override
public void setBedSpawnLocation(@Nullable Location location, boolean force) {
var world = (SoakWorld) (location == null ? this.getWorld() : location.getWorld());
@@ -1508,75 +1550,72 @@ public void playNote(@NotNull Location arg0, byte arg1, byte arg2) {
@Override
public void playNote(@NotNull Location arg0, @NotNull Instrument arg1, @NotNull Note arg2) {
throw NotImplementedException.createByLazy(Player.class,
- "playNote",
- Location.class,
- Instrument.class,
- Note.class);
+ "playNote",
+ Location.class,
+ Instrument.class,
+ Note.class);
}
@Override
public void playSound(@NotNull Location arg0, @NotNull Sound arg1, float arg2, float arg3) {
throw NotImplementedException.createByLazy(Player.class,
- "playSound",
- Location.class,
- Sound.class,
- float.class,
- float.class);
+ "playSound",
+ Location.class,
+ Sound.class,
+ float.class,
+ float.class);
}
@Override
public void playSound(@NotNull Location arg0, @NotNull String arg1, @NotNull SoundCategory arg2, float arg3,
float arg4) {
- var soundType = SoakSoundMap.toSponge(arg1);
- var soundSource = SoakSoundMap.toAdventure(arg2);
- var sound = net.kyori.adventure.sound.Sound.sound(soundType, soundSource, arg3, arg4);
- this.spongeEntity().playSound(sound, new Vector3d(arg0.getX(), arg0.getY(), arg0.getZ()));
+ throw NotImplementedException.createByLazy(Player.class, "playSound", Location.class, String.class, SoundCategory.class, float.class, float.class);
}
@Override
public void playSound(@NotNull Location location, @NotNull Sound sound, @NotNull SoundCategory soundCategory,
float v, float v1, long l) {
throw NotImplementedException.createByLazy(Player.class,
- "playSound",
- Location.class,
- Sound.class,
- SoundCategory.class,
- float.class,
- float.class,
- long.class);
+ "playSound",
+ Location.class,
+ Sound.class,
+ SoundCategory.class,
+ float.class,
+ float.class,
+ long.class);
}
@Override
public void playSound(@NotNull Location location, @NotNull String s, @NotNull SoundCategory soundCategory,
float v, float v1, long l) {
throw NotImplementedException.createByLazy(Player.class,
- "playSound",
- Location.class,
- String.class,
- SoundCategory.class,
- float.class,
- float.class,
- long.class);
+ "playSound",
+ Location.class,
+ String.class,
+ SoundCategory.class,
+ float.class,
+ float.class,
+ long.class);
}
@Override
public void playSound(@NotNull Entity entity, @NotNull Sound sound, float v, float v1) {
throw NotImplementedException.createByLazy(Player.class,
- "playSound",
- Entity.class,
- Sound.class,
- float.class,
- float.class);
+ "playSound",
+ Entity.class,
+ Sound.class,
+ float.class,
+ float.class);
}
@Override
public void playSound(@NotNull Entity entity, @NotNull String s, float v, float v1) {
throw NotImplementedException.createByLazy(Player.class,
- "playSound",
- Entity.class,
- String.class,
- float.class,
- float.class);
+ "playSound",
+ Entity.class,
+ String.class,
+ float.class,
+ float.class);
}
@@ -1584,12 +1623,12 @@ public void playSound(@NotNull Entity entity, @NotNull String s, float v, float
public void playSound(@NotNull Entity entity, @NotNull Sound sound, @NotNull SoundCategory soundCategory, float v
, float v1) {
throw NotImplementedException.createByLazy(Player.class,
- "playSound",
- Entity.class,
- Sound.class,
- SoundCategory.class,
- float.class,
- float.class);
+ "playSound",
+ Entity.class,
+ Sound.class,
+ SoundCategory.class,
+ float.class,
+ float.class);
}
@@ -1597,60 +1636,60 @@ public void playSound(@NotNull Entity entity, @NotNull Sound sound, @NotNull Sou
public void playSound(@NotNull Entity entity, @NotNull String s, @NotNull SoundCategory soundCategory, float v,
float v1) {
throw NotImplementedException.createByLazy(Player.class,
- "playSound",
- Entity.class,
- String.class,
- SoundCategory.class,
- float.class,
- float.class);
+ "playSound",
+ Entity.class,
+ String.class,
+ SoundCategory.class,
+ float.class,
+ float.class);
}
@Override
public void playSound(@NotNull Entity entity, @NotNull Sound sound, @NotNull SoundCategory soundCategory, float v
, float v1, long l) {
throw NotImplementedException.createByLazy(Player.class,
- "playSound",
- Entity.class,
- Sound.class,
- SoundCategory.class,
- float.class,
- float.class,
- long.class);
+ "playSound",
+ Entity.class,
+ Sound.class,
+ SoundCategory.class,
+ float.class,
+ float.class,
+ long.class);
}
@Override
public void playSound(@NotNull Entity entity, @NotNull String s, @NotNull SoundCategory soundCategory, float v,
float v1, long l) {
throw NotImplementedException.createByLazy(Player.class,
- "playSound",
- Entity.class,
- String.class,
- SoundCategory.class,
- float.class,
- float.class,
- long.class);
+ "playSound",
+ Entity.class,
+ String.class,
+ SoundCategory.class,
+ float.class,
+ float.class,
+ long.class);
}
@Override
public void playSound(@NotNull Location arg0, @NotNull String arg1, float arg2, float arg3) {
throw NotImplementedException.createByLazy(Player.class,
- "playSound",
- Location.class,
- String.class,
- float.class,
- float.class);
+ "playSound",
+ Location.class,
+ String.class,
+ float.class,
+ float.class);
}
@Override
public void playSound(@NotNull Location arg0, @NotNull Sound arg1, @NotNull SoundCategory arg2, float arg3,
float arg4) {
throw NotImplementedException.createByLazy(Player.class,
- "playSound",
- Location.class,
- Sound.class,
- SoundCategory.class,
- float.class,
- float.class);
+ "playSound",
+ Location.class,
+ Sound.class,
+ SoundCategory.class,
+ float.class,
+ float.class);
}
@Override
@@ -1698,10 +1737,10 @@ public boolean breakBlock(@NotNull Block block) {
@Override
public void playEffect(@NotNull Location arg0, @NotNull Effect arg1, Object arg2) {
throw NotImplementedException.createByLazy(Player.class,
- "playEffect",
- Location.class,
- Effect.class,
- Object.class);
+ "playEffect",
+ Location.class,
+ Effect.class,
+ Object.class);
}
@Override
@@ -1709,9 +1748,9 @@ public void sendBlockChange(@NotNull Location atPosition, @NotNull BlockData dat
SoakBlockData soakData = (SoakBlockData) data;
this.spongeEntity()
.sendBlockChange(atPosition.getBlockX(),
- atPosition.getBlockY(),
- atPosition.getBlockZ(),
- soakData.sponge());
+ atPosition.getBlockY(),
+ atPosition.getBlockZ(),
+ soakData.sponge());
}
@Override
@@ -1735,10 +1774,10 @@ public void sendBlockChanges(@NotNull Collection collection, boolean
@Override
public void sendBlockChange(@NotNull Location arg0, @NotNull Material arg1, byte arg2) {
throw NotImplementedException.createByLazy(Player.class,
- "sendBlockChange",
- Location.class,
- Material.class,
- byte.class);
+ "sendBlockChange",
+ Location.class,
+ Material.class,
+ byte.class);
}
@Override
@@ -1762,10 +1801,10 @@ public void sendMultiBlockChange(@NotNull Map extends Position, BlockData> map
@Override
public void sendBlockDamage(@NotNull Location location, float v, @NotNull Entity entity) {
throw NotImplementedException.createByLazy(Player.class,
- "sendBlockDamage",
- Location.class,
- float.class,
- Entity.class);
+ "sendBlockDamage",
+ Location.class,
+ float.class,
+ Entity.class);
}
@@ -1778,10 +1817,10 @@ public void sendBlockDamage(@NotNull Location location, float v, int i) {
public void sendEquipmentChange(@NotNull LivingEntity livingEntity, @NotNull EquipmentSlot equipmentSlot,
@Nullable ItemStack itemStack) {
throw NotImplementedException.createByLazy(Player.class,
- "sendEquipmentChange",
- LivingEntity.class,
- EquipmentSlot.class,
- ItemStack.class);
+ "sendEquipmentChange",
+ LivingEntity.class,
+ EquipmentSlot.class,
+ ItemStack.class);
}
@@ -1796,22 +1835,22 @@ public void sendSignChange(@NotNull Location location, @Nullable List extends
@NotNull DyeColor dyeColor, boolean b)
throws IllegalArgumentException {
throw NotImplementedException.createByLazy(Player.class,
- "sendSignChange",
- Location.class,
- List.class,
- DyeColor.class,
- boolean.class);
+ "sendSignChange",
+ Location.class,
+ List.class,
+ DyeColor.class,
+ boolean.class);
}
@Deprecated
public boolean sendChunkChange(@NotNull Location arg0, int arg1, int arg2, int arg3, byte[] arg4) {
throw NotImplementedException.createByLazy(Player.class,
- "sendChunkChange",
- Location.class,
- int.class,
- int.class,
- int.class,
- byte[].class);
+ "sendChunkChange",
+ Location.class,
+ int.class,
+ int.class,
+ int.class,
+ byte[].class);
}
@SuppressWarnings("deprecation")
@@ -1819,20 +1858,20 @@ public boolean sendChunkChange(@NotNull Location arg0, int arg1, int arg2, int a
@Deprecated
public void sendSignChange(@NotNull Location arg0, List arg1, @NotNull DyeColor arg2) {
throw NotImplementedException.createByLazy(Player.class,
- "sendSignChange",
- Location.class,
- List.class,
- DyeColor.class);
+ "sendSignChange",
+ Location.class,
+ List.class,
+ DyeColor.class);
}
@Deprecated
@Override
public void sendSignChange(@NotNull Location arg0, String[] arg1, @NotNull DyeColor arg2) {
throw NotImplementedException.createByLazy(Player.class,
- "sendSignChange",
- Location.class,
- String[].class,
- DyeColor.class);
+ "sendSignChange",
+ Location.class,
+ String[].class,
+ DyeColor.class);
}
@Override
@@ -1840,11 +1879,11 @@ public void sendSignChange(@NotNull Location location, @Nullable String[] string
boolean b)
throws IllegalArgumentException {
throw NotImplementedException.createByLazy(Player.class,
- "sendSignChange",
- Location.class,
- String[].class,
- DyeColor.class,
- boolean.class);
+ "sendSignChange",
+ Location.class,
+ String[].class,
+ DyeColor.class,
+ boolean.class);
}
@Override
@@ -1856,18 +1895,18 @@ public void sendBlockUpdate(@NotNull Location location, @NotNull TileState tileS
@Override
public void sendPotionEffectChange(@NotNull LivingEntity livingEntity, @NotNull PotionEffect potionEffect) {
throw NotImplementedException.createByLazy(Player.class,
- "sendPotionEffectChange",
- LivingEntity.class,
- PotionEffect.class);
+ "sendPotionEffectChange",
+ LivingEntity.class,
+ PotionEffect.class);
}
@Override
public void sendPotionEffectChangeRemove(@NotNull LivingEntity livingEntity,
@NotNull PotionEffectType potionEffectType) {
throw NotImplementedException.createByLazy(Player.class,
- "sendPotionEffectChangeRemove",
- LivingEntity.class,
- PotionEffectType.class);
+ "sendPotionEffectChangeRemove",
+ LivingEntity.class,
+ PotionEffectType.class);
}
@Deprecated
@@ -1955,35 +1994,35 @@ public void showTitle(BaseComponent arg0) {
@Override
public void showTitle(BaseComponent[] arg0, BaseComponent[] arg1, int arg2, int arg3, int arg4) {
throw NotImplementedException.createByLazy(Player.class,
- "showTitle",
- BaseComponent[].class,
- BaseComponent[].class,
- int.class,
- int.class,
- int.class);
+ "showTitle",
+ BaseComponent[].class,
+ BaseComponent[].class,
+ int.class,
+ int.class,
+ int.class);
}
@Deprecated
@Override
public void showTitle(BaseComponent arg0, BaseComponent arg1, int arg2, int arg3, int arg4) {
throw NotImplementedException.createByLazy(Player.class,
- "showTitle",
- BaseComponent.class,
- BaseComponent.class,
- int.class,
- int.class,
- int.class);
+ "showTitle",
+ BaseComponent.class,
+ BaseComponent.class,
+ int.class,
+ int.class,
+ int.class);
}
@Override
public void sendTitle(String arg0, String arg1, int arg2, int arg3, int arg4) {
throw NotImplementedException.createByLazy(Player.class,
- "sendTitle",
- String.class,
- String.class,
- int.class,
- int.class,
- int.class);
+ "sendTitle",
+ String.class,
+ String.class,
+ int.class,
+ int.class,
+ int.class);
}
@Deprecated
@@ -2274,10 +2313,10 @@ public int getProtocolVersion() {
@Override
public void sendPluginMessage(@NotNull Plugin source, @NotNull String channel, byte[] message) {
throw NotImplementedException.createByLazy(Player.class,
- "sendPluginMessage",
- Plugin.class,
- String.class,
- byte[].class);
+ "sendPluginMessage",
+ Plugin.class,
+ String.class,
+ byte[].class);
}
@Override
diff --git a/Wrapper/src/main/java/org/soak/wrapper/entity/living/human/user/SoakLoadedUser.java b/Wrapper/src/main/java/org/soak/wrapper/entity/living/human/user/SoakLoadedUser.java
deleted file mode 100644
index fe9eb8b..0000000
--- a/Wrapper/src/main/java/org/soak/wrapper/entity/living/human/user/SoakLoadedUser.java
+++ /dev/null
@@ -1,257 +0,0 @@
-package org.soak.wrapper.entity.living.human.user;
-
-import com.destroystokyo.paper.profile.PlayerProfile;
-import io.papermc.paper.persistence.PersistentDataContainerView;
-import org.bukkit.*;
-import org.bukkit.entity.EntityType;
-import org.bukkit.entity.Player;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.soak.WrapperManager;
-import org.soak.exception.NotImplementedException;
-import org.soak.map.SoakLocationMap;
-import org.soak.plugin.SoakManager;
-import org.soak.wrapper.profile.SoakPlayerProfile;
-import org.spongepowered.api.data.Keys;
-import org.spongepowered.api.entity.living.player.User;
-import org.spongepowered.api.util.RespawnLocation;
-
-import java.time.Duration;
-import java.time.Instant;
-import java.util.Date;
-import java.util.Map;
-import java.util.UUID;
-
-@Deprecated(forRemoval = true)
-public class SoakLoadedUser implements OfflinePlayer {
-
- private final User user;
-
- public SoakLoadedUser(@NotNull User user) {
- this.user = user;
- }
-
- @Override
- public boolean isOnline() {
- return user.isOnline();
- }
-
- @Override
- public boolean isConnected() {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "isConnected");
- }
-
- @Override
- public @Nullable Location getRespawnLocation() {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "getRespawnLocation");
- }
-
- @Override
- public @Nullable Location getLocation() {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "getLocation");
- }
-
- @Override
- public @NotNull PersistentDataContainerView getPersistentDataContainer() {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "getPersistentDataContainer");
- }
-
- @Override
- public > @Nullable E ban(@Nullable String s, @Nullable Date date, @Nullable String s1) {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "ban", String.class, Date.class, String.class);
- }
-
- @Override
- public > @Nullable E ban(@Nullable String s, @Nullable Instant instant, @Nullable String s1) {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "ban", String.class, Instant.class, String.class);
- }
-
- @Override
- public > @Nullable E ban(@Nullable String s, @Nullable Duration duration, @Nullable String s1) {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "ban", String.class, Duration.class, String.class);
- }
-
- @Override
- public @Nullable String getName() {
- return user.name();
- }
-
- @Override
- public @NotNull UUID getUniqueId() {
- return user.uniqueId();
- }
-
- @Override
- public @NotNull PlayerProfile getPlayerProfile() {
- return new SoakPlayerProfile(user.profile(), true);
- }
-
- @Override
- public boolean isBanned() {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "isBanned");
- }
-
- @Override
- public boolean isWhitelisted() {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "isWhitelisted");
- }
-
- @Override
- public void setWhitelisted(boolean b) {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "isWhitelisted", boolean.class);
- }
-
- @Override
- public @Nullable Player getPlayer() {
- return user.player().map(player -> SoakManager.getManager().getMemoryStore().get(player)).orElse(null);
- }
-
- @Override
- public long getFirstPlayed() {
- return user.get(Keys.FIRST_DATE_JOINED).map(Instant::getNano).orElse(0);
- }
-
- @Override
- public long getLastPlayed() {
- return user.get(Keys.LAST_DATE_JOINED).map(Instant::getNano).orElse(0);
- }
-
- @Override
- public boolean hasPlayedBefore() {
- return user.get(Keys.FIRST_DATE_JOINED).isPresent();
- }
-
- @Override
- public @Nullable Location getBedSpawnLocation() {
- return user
- .get(Keys.RESPAWN_LOCATIONS)
- .map(map -> map.get(user.worldKey()))
- .flatMap(RespawnLocation::asLocation)
- .map(SoakLocationMap::toBukkit)
- .orElse(null);
- }
-
- @Override
- public long getLastLogin() {
- return this.getLastPlayed();
- }
-
- @Override
- public long getLastSeen() {
- return this.getLastPlayed();
- }
-
- @Override
- public void incrementStatistic(@NotNull Statistic statistic) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "incrementStatistic", Statistic.class);
- }
-
- @Override
- public void decrementStatistic(@NotNull Statistic statistic) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "decrementStatistic", Statistic.class);
-
- }
-
- @Override
- public void incrementStatistic(@NotNull Statistic statistic, int i) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "incrementStatistic", Statistic.class, int.class);
-
- }
-
- @Override
- public void decrementStatistic(@NotNull Statistic statistic, int i) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "decrementStatistic", Statistic.class, int.class);
-
- }
-
- @Override
- public void setStatistic(@NotNull Statistic statistic, int i) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "setStatistic", Statistic.class, int.class);
- }
-
- @Override
- public int getStatistic(@NotNull Statistic statistic) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "getStatistic", Statistic.class);
- }
-
- @Override
- public void incrementStatistic(@NotNull Statistic statistic, @NotNull Material material) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "incrementStatistic", Statistic.class, Material.class);
- }
-
- @Override
- public void decrementStatistic(@NotNull Statistic statistic, @NotNull Material material) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "decrementStatistic", Statistic.class, Material.class);
- }
-
- @Override
- public int getStatistic(@NotNull Statistic statistic, @NotNull Material material) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "getStatistic", Statistic.class, Material.class);
- }
-
- @Override
- public void incrementStatistic(@NotNull Statistic statistic, @NotNull Material material, int i) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "incrementStatistic", Statistic.class, Material.class, int.class);
- }
-
- @Override
- public void decrementStatistic(@NotNull Statistic statistic, @NotNull Material material, int i) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "decrementStatistic", Statistic.class, Material.class, int.class);
- }
-
- @Override
- public void setStatistic(@NotNull Statistic statistic, @NotNull Material material, int i) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "setStatistic", Statistic.class, Material.class, int.class);
- }
-
- @Override
- public void incrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "incrementStatistic", Statistic.class, EntityType.class);
-
- }
-
- @Override
- public void decrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "decrementStatistic", Statistic.class, EntityType.class);
- }
-
- @Override
- public int getStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "getStatistic", Statistic.class, EntityType.class);
- }
-
- @Override
- public void incrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType, int i) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "incrementStatistic", Statistic.class, EntityType.class, int.class);
- }
-
- @Override
- public void decrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType, int i) {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "decrementStatistic", Statistic.class);
- }
-
- @Override
- public void setStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType, int i) {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "setStatistic", Statistic.class, EntityType.class, int.class);
- }
-
- @Override
- public @Nullable Location getLastDeathLocation() {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "getLastDeathLocation");
- }
-
- @Override
- public @NotNull Map serialize() {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "serialize");
- }
-
- @Override
- public boolean isOp() {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "isOp");
- }
-
- @Override
- public void setOp(boolean b) {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "setOp", boolean.class);
- }
-}
diff --git a/Wrapper/src/main/java/org/soak/wrapper/entity/living/human/user/SoakLoadingUser.java b/Wrapper/src/main/java/org/soak/wrapper/entity/living/human/user/SoakLoadingUser.java
deleted file mode 100644
index d55fe98..0000000
--- a/Wrapper/src/main/java/org/soak/wrapper/entity/living/human/user/SoakLoadingUser.java
+++ /dev/null
@@ -1,338 +0,0 @@
-package org.soak.wrapper.entity.living.human.user;
-
-import com.destroystokyo.paper.profile.PlayerProfile;
-import io.papermc.paper.persistence.PersistentDataContainerView;
-import org.bukkit.*;
-import org.bukkit.entity.EntityType;
-import org.bukkit.entity.Player;
-import org.jetbrains.annotations.NotNull;
-import org.jetbrains.annotations.Nullable;
-import org.soak.WrapperManager;
-import org.soak.exception.NotImplementedException;
-import org.soak.plugin.SoakManager;
-import org.soak.wrapper.profile.SoakPlayerProfile;
-import org.spongepowered.api.Sponge;
-import org.spongepowered.api.profile.GameProfile;
-
-import java.time.Duration;
-import java.time.Instant;
-import java.util.Date;
-import java.util.Map;
-import java.util.UUID;
-import java.util.function.Function;
-
-@Deprecated(forRemoval = true)
-public class SoakLoadingUser implements OfflinePlayer {
-
- private final GameProfile profile;
- private @Nullable SoakLoadedUser loaded;
-
- public SoakLoadingUser(@NotNull GameProfile profile) {
- this.profile = profile;
- Sponge.server()
- .userManager()
- .loadOrCreate(profile.uuid())
- .thenAccept(user -> loaded = new SoakLoadedUser(user));
- }
-
- private T checkLoadedSimple(Function run, T value) {
- return checkLoaded(run, profile -> value);
- }
-
- private T checkLoaded(Function run, Function elser) {
- if (this.loaded == null) {
- return elser.apply(this.profile);
- }
- return run.apply(this.loaded);
- }
-
- @Override
- public boolean isOnline() {
- return checkLoadedSimple(SoakLoadedUser::isOnline, false);
- }
-
- @Override
- public boolean isConnected() {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "isConnected");
- }
-
- @Override
- public @Nullable String getName() {
- return profile.name().orElse(null);
- }
-
- @Override
- public @NotNull UUID getUniqueId() {
- return profile.uniqueId();
- }
-
- @Override
- public @NotNull PlayerProfile getPlayerProfile() {
- return new SoakPlayerProfile(this.profile, true);
- }
-
- @Override
- public boolean isBanned() {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "isBanned");
- }
-
- @Override
- public > @Nullable E ban(@Nullable String s, @Nullable Date date,
- @Nullable String s1) {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "ban", String.class, Date.class, String.class);
- }
-
- @Override
- public > @Nullable E ban(@Nullable String s, @Nullable Instant instant,
- @Nullable String s1) {
- throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "ban",
- String.class,
- Instant.class,
- String.class);
- }
-
- @Override
- public > @Nullable E ban(@Nullable String s,
- @Nullable Duration duration,
- @Nullable String s1) {
- throw NotImplementedException.createByLazy(OfflinePlayer.class,
- "ban",
- String.class,
- Duration.class,
- String.class);
- }
-
- @Override
- public boolean isWhitelisted() {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "isWhitelisted");
- }
-
- @Override
- public void setWhitelisted(boolean b) {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "isWhitelisted", boolean.class);
- }
-
- @Override
- public @Nullable Player getPlayer() {
- return Sponge.server()
- .onlinePlayers()
- .stream()
- .filter(player -> player.profile().equals(this.profile))
- .findAny()
- .map(player -> SoakManager.getManager().getMemoryStore().get(player))
- .orElse(null);
- }
-
- @Override
- public long getFirstPlayed() {
- return checkLoadedSimple(SoakLoadedUser::getFirstPlayed, 0L);
- }
-
- @Override
- public long getLastPlayed() {
- return checkLoadedSimple(SoakLoadedUser::getLastPlayed, 0L);
- }
-
- @Override
- public boolean hasPlayedBefore() {
- return checkLoadedSimple(SoakLoadedUser::hasPlayedBefore, false);
- }
-
- @Override
- public @Nullable Location getBedSpawnLocation() {
- return checkLoadedSimple(SoakLoadedUser::getBedSpawnLocation, null);
- }
-
- @Override
- public long getLastLogin() {
- return this.getLastPlayed();
- }
-
- @Override
- public long getLastSeen() {
- return this.getLastPlayed();
- }
-
- @Override
- public @Nullable Location getRespawnLocation() {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "getRespawnLocation");
- }
-
- @Override
- public void incrementStatistic(@NotNull Statistic statistic) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "incrementStatistic", Statistic.class);
- }
-
- @Override
- public void decrementStatistic(@NotNull Statistic statistic) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "decrementStatistic", Statistic.class);
-
- }
-
- @Override
- public void incrementStatistic(@NotNull Statistic statistic, int i) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class,
- "incrementStatistic",
- Statistic.class,
- int.class);
-
- }
-
- @Override
- public void decrementStatistic(@NotNull Statistic statistic, int i) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class,
- "decrementStatistic",
- Statistic.class,
- int.class);
-
- }
-
- @Override
- public void setStatistic(@NotNull Statistic statistic, int i) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "setStatistic", Statistic.class, int.class);
- }
-
- @Override
- public int getStatistic(@NotNull Statistic statistic) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "getStatistic", Statistic.class);
- }
-
- @Override
- public void incrementStatistic(@NotNull Statistic statistic, @NotNull Material material)
- throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class,
- "incrementStatistic",
- Statistic.class,
- Material.class);
- }
-
- @Override
- public void decrementStatistic(@NotNull Statistic statistic, @NotNull Material material)
- throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class,
- "decrementStatistic",
- Statistic.class,
- Material.class);
- }
-
- @Override
- public int getStatistic(@NotNull Statistic statistic, @NotNull Material material) throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class,
- "getStatistic",
- Statistic.class,
- Material.class);
- }
-
- @Override
- public void incrementStatistic(@NotNull Statistic statistic, @NotNull Material material, int i)
- throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class,
- "incrementStatistic",
- Statistic.class,
- Material.class,
- int.class);
- }
-
- @Override
- public void decrementStatistic(@NotNull Statistic statistic, @NotNull Material material, int i)
- throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class,
- "decrementStatistic",
- Statistic.class,
- Material.class,
- int.class);
- }
-
- @Override
- public void setStatistic(@NotNull Statistic statistic, @NotNull Material material, int i)
- throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class,
- "setStatistic",
- Statistic.class,
- Material.class,
- int.class);
- }
-
- @Override
- public void incrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType)
- throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class,
- "incrementStatistic",
- Statistic.class,
- EntityType.class);
-
- }
-
- @Override
- public void decrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType)
- throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class,
- "decrementStatistic",
- Statistic.class,
- EntityType.class);
- }
-
- @Override
- public int getStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType)
- throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class,
- "getStatistic",
- Statistic.class,
- EntityType.class);
- }
-
- @Override
- public void incrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType, int i)
- throws IllegalArgumentException {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class,
- "incrementStatistic",
- Statistic.class,
- EntityType.class,
- int.class);
- }
-
- @Override
- public void decrementStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType, int i) {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "decrementStatistic", Statistic.class);
- }
-
- @Override
- public void setStatistic(@NotNull Statistic statistic, @NotNull EntityType entityType, int i) {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class,
- "setStatistic",
- Statistic.class,
- EntityType.class,
- int.class);
- }
-
- @Override
- public @Nullable Location getLastDeathLocation() {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "getLastDeathLocation");
- }
-
- @Override
- public @Nullable Location getLocation() {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "getLocation");
- }
-
- @Override
- public @NotNull PersistentDataContainerView getPersistentDataContainer() {
- throw NotImplementedException.createByLazy(OfflinePlayer.class, "getPersistentDataContainer");
- }
-
- @Override
- public @NotNull Map serialize() {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "serialize");
- }
-
- @Override
- public boolean isOp() {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "isOp");
- }
-
- @Override
- public void setOp(boolean b) {
- throw NotImplementedException.createByLazy(SoakLoadedUser.class, "setOp", boolean.class);
- }
-}
diff --git a/Wrapper/src/main/java/org/soak/wrapper/inventory/SoakItemTypeTyped.java b/Wrapper/src/main/java/org/soak/wrapper/inventory/SoakItemTypeTyped.java
index 6f095e0..1a78a4a 100644
--- a/Wrapper/src/main/java/org/soak/wrapper/inventory/SoakItemTypeTyped.java
+++ b/Wrapper/src/main/java/org/soak/wrapper/inventory/SoakItemTypeTyped.java
@@ -1,6 +1,7 @@
package org.soak.wrapper.inventory;
import com.google.common.collect.Multimap;
+import io.papermc.paper.datacomponent.DataComponentType;
import net.kyori.adventure.text.TranslatableComponent;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
@@ -22,6 +23,7 @@
import org.spongepowered.api.tag.ItemTypeTags;
import java.lang.reflect.InvocationTargetException;
+import java.util.Set;
import java.util.function.Consumer;
public class SoakItemTypeTyped implements ItemType.Typed