Merge branch 'development' into development-v3
This commit is contained in:
commit
748f10b77b
|
@ -1,5 +1,9 @@
|
|||
package com.songoda.core.compatibility;
|
||||
|
||||
/**
|
||||
* @deprecated Usage is highly discouraged – use com.songoda.core.nms.Nms#getImplementations() instead
|
||||
*/
|
||||
@Deprecated
|
||||
public enum ClassMapping {
|
||||
BIOME_BASE("world.level.biome", "BiomeBase"),
|
||||
BIOME_STORAGE("world.level.chunk", "BiomeStorage"),
|
||||
|
|
|
@ -33,6 +33,12 @@ public enum CompatibleMaterial {
|
|||
DARK_OAK_DOOR_ITEM(431),
|
||||
*/
|
||||
|
||||
/* 1.19.3 */
|
||||
ENDER_DRAGON_SPAWN_EGG(),
|
||||
IRON_GOLEM_SPAWN_EGG(),
|
||||
SNOW_GOLEM_SPAWN_EGG(),
|
||||
WITHER_SPAWN_EGG(),
|
||||
|
||||
/* 1.19 */
|
||||
ACACIA_CHEST_BOAT(),
|
||||
ALLAY_SPAWN_EGG(),
|
||||
|
|
|
@ -6,7 +6,7 @@ import org.bukkit.inventory.ItemStack;
|
|||
import java.lang.reflect.Method;
|
||||
|
||||
/**
|
||||
* @deprecated Horrible to maintain, and it gets worse with every new Minecraft version. Should be replaced with NMS
|
||||
* @deprecated Usage is highly discouraged – use com.songoda.core.nms.Nms#getImplementations() instead
|
||||
*/
|
||||
@Deprecated
|
||||
public enum MethodMapping {
|
||||
|
|
|
@ -85,8 +85,8 @@ public abstract class SongodaPlugin extends JavaPlugin {
|
|||
ChatColor.YELLOW + "License setup steps:\n" +
|
||||
ChatColor.YELLOW + "Visit the link mentioned above and click the 'Create License' button.\n" +
|
||||
ChatColor.YELLOW + "Copy the following IP address and UUID and click create.\n" +
|
||||
ChatColor.YELLOW + "IP: " + externalIP + "\n" +
|
||||
ChatColor.YELLOW + "UUID: " + serverUuid + "\n" +
|
||||
ChatColor.YELLOW + "IP: " + externalIP + "\n" +
|
||||
ChatColor.RED + "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~";
|
||||
console.sendMessage(message);
|
||||
}).start();
|
||||
|
@ -97,7 +97,7 @@ public abstract class SongodaPlugin extends JavaPlugin {
|
|||
|
||||
console.sendMessage(" "); // blank line to separate chatter
|
||||
console.sendMessage(ChatColor.GREEN + "=============================");
|
||||
console.sendMessage(String.format("%s%s %s by %sSongoda <3!", ChatColor.GRAY,
|
||||
console.sendMessage(String.format("%s%s %s by %sCraftaro <3!", ChatColor.GRAY,
|
||||
getDescription().getName(), getDescription().getVersion(), ChatColor.DARK_PURPLE));
|
||||
console.sendMessage(String.format("%sAction: %s%s%s...", ChatColor.GRAY,
|
||||
ChatColor.GREEN, "Enabling", ChatColor.GRAY));
|
||||
|
@ -146,7 +146,7 @@ public abstract class SongodaPlugin extends JavaPlugin {
|
|||
|
||||
console.sendMessage(" "); // blank line to separate chatter
|
||||
console.sendMessage(ChatColor.GREEN + "=============================");
|
||||
console.sendMessage(String.format("%s%s %s by %sSongoda <3!", ChatColor.GRAY,
|
||||
console.sendMessage(String.format("%s%s %s by %sCraftaro <3!", ChatColor.GRAY,
|
||||
getDescription().getName(), getDescription().getVersion(), ChatColor.DARK_PURPLE));
|
||||
console.sendMessage(String.format("%sAction: %s%s%s...", ChatColor.GRAY,
|
||||
ChatColor.RED, "Disabling", ChatColor.GRAY));
|
||||
|
@ -216,7 +216,7 @@ public abstract class SongodaPlugin extends JavaPlugin {
|
|||
if (unfinishedTasks > 0) {
|
||||
getLogger().log(Level.WARNING,
|
||||
String.format("A DataManager has been forcefully terminated with %d unfinished tasks - " +
|
||||
"This can be a serious problem, please report it to us (Songoda)!", unfinishedTasks));
|
||||
"This can be a serious problem, please report it to us (Craftaro / Songoda)!", unfinishedTasks));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -226,7 +226,7 @@ public class ChatMessage {
|
|||
|
||||
Object packet;
|
||||
if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_19)) {
|
||||
packet = mc_PacketPlayOutChat_new.newInstance(mc_IChatBaseComponent_ChatSerializer_a.invoke(null, gson.toJson(textList)), mc_PacketPlayOutChat_new_1_19_0 ? 1 : true);
|
||||
packet = mc_PacketPlayOutChat_new.newInstance(mc_IChatBaseComponent_ChatSerializer_a.invoke(null, gson.toJson(textList)), mc_PacketPlayOutChat_new_1_19_0 ? 1 : false);
|
||||
} else if (ServerVersion.isServerVersionAtLeast(ServerVersion.V1_16)) {
|
||||
packet = mc_PacketPlayOutChat_new.newInstance(
|
||||
mc_IChatBaseComponent_ChatSerializer_a.invoke(null, gson.toJson(textList)),
|
||||
|
|
|
@ -372,6 +372,10 @@ public class CommandManager implements CommandExecutor, TabCompleter {
|
|||
// Set tab complete
|
||||
commandObject.setTabCompleter(tabManager);
|
||||
|
||||
if (command.equalsIgnoreCase("songoda")) {
|
||||
commandObject.setAliases(Collections.singletonList("craftaro"));
|
||||
}
|
||||
|
||||
// Register the command
|
||||
Field fieldKnownCommands = SimpleCommandMap.class.getDeclaredField("knownCommands");
|
||||
fieldKnownCommands.setAccessible(true);
|
||||
|
|
|
@ -65,7 +65,7 @@ public class MainCommand extends AbstractCommand {
|
|||
.sendTo(sender);
|
||||
}
|
||||
|
||||
sender.sendMessage(ChatColor.DARK_GRAY + "- " + ChatColor.YELLOW + "/songoda" + ChatColor.GRAY + " - Opens the Songoda plugin GUI");
|
||||
sender.sendMessage(ChatColor.DARK_GRAY + "- " + ChatColor.YELLOW + "/craftaro" + ChatColor.GRAY + " - Opens the Craftaro plugin GUI");
|
||||
sender.sendMessage("");
|
||||
|
||||
if (nestedCommands != null) {
|
||||
|
|
|
@ -12,7 +12,7 @@ public class SongodaCoreCommand extends AbstractCommand {
|
|||
protected GuiManager guiManager;
|
||||
|
||||
public SongodaCoreCommand() {
|
||||
super(false, "songoda");
|
||||
super(CommandType.CONSOLE_OK, "craftaro", "songoda");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -24,7 +24,9 @@ public class SongodaCoreCommand extends AbstractCommand {
|
|||
|
||||
guiManager.showGUI((Player) sender, new SongodaCoreOverviewGUI());
|
||||
} else {
|
||||
sender.sendMessage("/songoda diag");
|
||||
sender.sendMessage("/craftaro diag");
|
||||
sender.sendMessage("/craftaro myip");
|
||||
sender.sendMessage("/craftaro uuid");
|
||||
}
|
||||
|
||||
return ReturnType.SUCCESS;
|
||||
|
@ -37,7 +39,7 @@ public class SongodaCoreCommand extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/songoda";
|
||||
return "/craftaro";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -9,66 +9,26 @@ import org.bukkit.Bukkit;
|
|||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.List;
|
||||
|
||||
public class SongodaCoreDiagCommand extends AbstractCommand {
|
||||
private final DecimalFormat format = new DecimalFormat("##.##");
|
||||
private final DecimalFormat decimalFormat = new DecimalFormat("##.##");
|
||||
|
||||
private Object serverInstance;
|
||||
private Field tpsField;
|
||||
private Object nmsServerInstance;
|
||||
private Field recentTpsOnNmsServer;
|
||||
|
||||
public SongodaCoreDiagCommand() {
|
||||
super(CommandType.CONSOLE_OK, "diag");
|
||||
|
||||
try {
|
||||
serverInstance = ClassMapping.MINECRAFT_SERVER.getClazz().getMethod("getServer").invoke(null);
|
||||
tpsField = serverInstance.getClass().getField("recentTps");
|
||||
} catch (NoSuchFieldException | SecurityException | IllegalAccessException | IllegalArgumentException
|
||||
| InvocationTargetException | NoSuchMethodException ex) {
|
||||
this.nmsServerInstance = ClassMapping.MINECRAFT_SERVER.getClazz().getMethod("getServer").invoke(null);
|
||||
this.recentTpsOnNmsServer = this.nmsServerInstance.getClass().getField("recentTps");
|
||||
} catch (ReflectiveOperationException | SecurityException | IllegalArgumentException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ReturnType runCommand(CommandSender sender, String... args) {
|
||||
sender.sendMessage("");
|
||||
sender.sendMessage("Songoda Diagnostics Information");
|
||||
sender.sendMessage("");
|
||||
sender.sendMessage("Plugins:");
|
||||
|
||||
for (PluginInfo plugin : SongodaCore.getPlugins()) {
|
||||
sender.sendMessage(plugin.getJavaPlugin().getName()
|
||||
+ " (" + plugin.getJavaPlugin().getDescription().getVersion() + " Core " + plugin.getCoreLibraryVersion() + ")");
|
||||
}
|
||||
|
||||
sender.sendMessage("");
|
||||
sender.sendMessage("Server Version: " + Bukkit.getVersion());
|
||||
sender.sendMessage("NMS: " + ServerProject.getServerVersion() + " " + ServerVersion.getServerVersionString());
|
||||
sender.sendMessage("Operating System: " + System.getProperty("os.name"));
|
||||
sender.sendMessage("Allocated Memory: " + format.format(Runtime.getRuntime().maxMemory() / (1024 * 1024)) + "Mb");
|
||||
sender.sendMessage("Online Players: " + Bukkit.getOnlinePlayers().size());
|
||||
|
||||
if (tpsField != null) {
|
||||
try {
|
||||
double[] tps = ((double[]) tpsField.get(serverInstance));
|
||||
|
||||
sender.sendMessage("TPS from last 1m, 5m, 15m: " + format.format(tps[0]) + ", "
|
||||
+ format.format(tps[1]) + ", " + format.format(tps[2]));
|
||||
} catch (IllegalAccessException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
return ReturnType.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> onTab(CommandSender sender, String... args) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
return "songoda.admin";
|
||||
|
@ -76,11 +36,60 @@ public class SongodaCoreDiagCommand extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/songoda diag";
|
||||
return "/craftaro diag";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Display diagnostics information.";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ReturnType runCommand(CommandSender sender, String... args) {
|
||||
sender.sendMessage("");
|
||||
sender.sendMessage("Craftaro Diagnostics Information");
|
||||
sender.sendMessage("");
|
||||
sender.sendMessage("Plugins:");
|
||||
|
||||
for (PluginInfo plugin : SongodaCore.getPlugins()) {
|
||||
sender.sendMessage(String.format("%s v%s (Core v%s)",
|
||||
plugin.getJavaPlugin().getName(),
|
||||
plugin.getJavaPlugin().getDescription().getVersion(),
|
||||
plugin.getCoreLibraryVersion()));
|
||||
}
|
||||
|
||||
sender.sendMessage("");
|
||||
sender.sendMessage("Server Version: " + Bukkit.getVersion());
|
||||
sender.sendMessage("NMS: " + ServerProject.getServerVersion() + " " + ServerVersion.getServerVersionString());
|
||||
sender.sendMessage("Operating System: " + System.getProperty("os.name"));
|
||||
sender.sendMessage("Allocated Memory: " + getRuntimeMaxMemory());
|
||||
sender.sendMessage("Online Players: " + Bukkit.getOnlinePlayers().size());
|
||||
sendCurrentTps(sender);
|
||||
sender.sendMessage("");
|
||||
|
||||
return ReturnType.SUCCESS;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected List<String> onTab(CommandSender sender, String... args) {
|
||||
return null;
|
||||
}
|
||||
|
||||
private String getRuntimeMaxMemory() {
|
||||
return this.decimalFormat.format(Runtime.getRuntime().maxMemory() / (1024 * 1024)) + " MiB";
|
||||
}
|
||||
|
||||
private void sendCurrentTps(CommandSender receiver) {
|
||||
if (this.recentTpsOnNmsServer == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
double[] tps = ((double[]) this.recentTpsOnNmsServer.get(this.nmsServerInstance));
|
||||
|
||||
receiver.sendMessage(String.format("TPS from last 1m, 5m, 15m: %s, %s, %s", this.decimalFormat.format(tps[0]), this.decimalFormat.format(tps[1]), this.decimalFormat.format(tps[2])));
|
||||
} catch (IllegalAccessException ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,7 +63,7 @@ public class SongodaCoreIPCommand extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/songoda myip";
|
||||
return "/craftaro myip";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,7 +16,7 @@ final class SongodaCoreOverviewGUI extends Gui {
|
|||
// could do pages, too, but don't think we'll have that many at a time for a while
|
||||
int max = (int) Math.ceil(plugins.size() / 9.);
|
||||
setRows(max);
|
||||
setTitle("Songoda Plugins");
|
||||
setTitle("Craftaro Plugins");
|
||||
|
||||
// TODO: this could use some decorating
|
||||
|
||||
|
|
|
@ -40,12 +40,12 @@ public class SongodaCoreUUIDCommand extends AbstractCommand {
|
|||
|
||||
@Override
|
||||
public String getPermissionNode() {
|
||||
return "songodacore.admin";
|
||||
return "songoda.admin";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSyntax() {
|
||||
return "/songodacore uuid";
|
||||
return "/craftaro uuid";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -55,7 +55,7 @@ public class CustomizableGui extends Gui {
|
|||
}
|
||||
|
||||
config.setNodeComment("overrides", "For information on how to apply overrides please visit\n" +
|
||||
"https://wiki.songoda.com/Gui");
|
||||
"https://wiki.craftaro.com/index.php/Gui");
|
||||
config.setNodeComment("overrides.example", "This is just an example and does not override to any items in this GUI.");
|
||||
|
||||
config.createEntry("overrides.example.item", CompatibleMaterial.STONE)
|
||||
|
|
|
@ -101,7 +101,10 @@ public class DropUtils {
|
|||
Bukkit.getScheduler().runTask(SongodaCore.getHijackedPlugin(), () -> {
|
||||
for (String command : commands) {
|
||||
if (entity.getKiller() != null) {
|
||||
command = command.replace("%player%", entity.getKiller().getName());
|
||||
command = command.replace("%player%", entity.getKiller().getName()
|
||||
.replace("%x%", String.valueOf((int) entity.getLocation().getX()))
|
||||
.replace("%y%", String.valueOf((int) entity.getLocation().getY()))
|
||||
.replace("%z%", String.valueOf((int) entity.getLocation().getZ())));
|
||||
}
|
||||
|
||||
if (!command.contains("%player%")) {
|
||||
|
|
|
@ -4,9 +4,11 @@ import com.google.gson.annotations.SerializedName;
|
|||
import com.songoda.core.compatibility.CompatibleMaterial;
|
||||
import com.songoda.core.utils.ItemUtils;
|
||||
import com.songoda.core.utils.TextUtils;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.EnchantmentStorageMeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
@ -149,6 +151,25 @@ public class Loot {
|
|||
return null;
|
||||
}
|
||||
|
||||
//Create enchantment book
|
||||
if (item.getType().equals(Material.ENCHANTED_BOOK)) {
|
||||
EnchantmentStorageMeta meta = (EnchantmentStorageMeta) item.getItemMeta();
|
||||
for (Map.Entry<String, Integer> entry : this.enchants.entrySet()) {
|
||||
if (entry.getValue() == null) continue;
|
||||
|
||||
//TODO add random enchants
|
||||
// if (entry.getKey().equalsIgnoreCase("RANDOM")) {
|
||||
// item = ItemUtils.applyRandomEnchants(item, entry.getValue());
|
||||
//
|
||||
// continue;
|
||||
// }
|
||||
|
||||
meta.addStoredEnchant(Enchantment.getByName(entry.getKey()), entry.getValue(), true);
|
||||
}
|
||||
item.setItemMeta(meta);
|
||||
return item;
|
||||
}
|
||||
|
||||
Map<Enchantment, Integer> enchants = new HashMap<>();
|
||||
for (Map.Entry<String, Integer> entry : this.enchants.entrySet()) {
|
||||
if (entry.getValue() == null) continue;
|
||||
|
|
|
@ -22,6 +22,10 @@ import java.lang.reflect.Method;
|
|||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
* @deprecated This class will be removed in the future and replaced with a more maintainable system.
|
||||
*/
|
||||
@Deprecated
|
||||
public class BlockUtilsModern {
|
||||
protected static void _updatePressurePlateModern(Block plate, int power) {
|
||||
BlockData blockData = plate.getBlockData();
|
||||
|
|
|
@ -3,13 +3,12 @@ package com.songoda.core.nms.world;
|
|||
import org.bukkit.Chunk;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockState;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
public interface WorldCore {
|
||||
SSpawner getSpawner(Location location);
|
||||
|
||||
|
@ -29,12 +28,7 @@ public interface WorldCore {
|
|||
*/
|
||||
void randomTickChunk(Chunk bukkitChunk, int tickAmount) throws ReflectiveOperationException;
|
||||
|
||||
/**
|
||||
* Manually trigger the updateAdjacentComparators method for containers
|
||||
*
|
||||
* @param loc The Location of the container
|
||||
*/
|
||||
void updateAdjacentComparators(@NotNull Location loc);
|
||||
void updateAdjacentComparators(@NotNull Block bukkitBlock);
|
||||
|
||||
/**
|
||||
* Ticks all inactive spawners in a specific chunk ignoring the minimum required players within a specific range.<br>
|
||||
|
|
|
@ -19,12 +19,11 @@ import org.bukkit.World;
|
|||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_10_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_10_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_10_R1.block.CraftBlock;
|
||||
import org.bukkit.craftbukkit.v1_10_R1.util.CraftMagicNumbers;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -87,13 +86,12 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(loc.getBlock().getType());
|
||||
public void updateAdjacentComparators(@NotNull org.bukkit.block.Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = ((CraftWorld) craftBlock.getWorld()).getHandle();
|
||||
|
||||
BlockPosition blockPos = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(bukkitBlock.getType());
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,12 +19,11 @@ import org.bukkit.World;
|
|||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.block.CraftBlock;
|
||||
import org.bukkit.craftbukkit.v1_11_R1.util.CraftMagicNumbers;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -87,13 +86,12 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(loc.getBlock().getType());
|
||||
public void updateAdjacentComparators(@NotNull org.bukkit.block.Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = ((CraftWorld) craftBlock.getWorld()).getHandle();
|
||||
|
||||
BlockPosition blockPos = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(bukkitBlock.getType());
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,12 +19,11 @@ import org.bukkit.World;
|
|||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock;
|
||||
import org.bukkit.craftbukkit.v1_12_R1.util.CraftMagicNumbers;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -87,13 +86,12 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(loc.getBlock().getType());
|
||||
public void updateAdjacentComparators(@NotNull org.bukkit.block.Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = ((CraftWorld) craftBlock.getWorld()).getHandle();
|
||||
|
||||
BlockPosition blockPos = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(bukkitBlock.getType());
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.songoda.core.nms.world.SItemStack;
|
|||
import com.songoda.core.nms.world.SSpawner;
|
||||
import com.songoda.core.nms.world.SWorld;
|
||||
import com.songoda.core.nms.world.WorldCore;
|
||||
import net.minecraft.server.v1_13_R1.Block;
|
||||
import net.minecraft.server.v1_13_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_13_R1.Chunk;
|
||||
import net.minecraft.server.v1_13_R1.ChunkSection;
|
||||
|
@ -17,15 +16,13 @@ import net.minecraft.server.v1_13_R1.MobSpawnerAbstract;
|
|||
import net.minecraft.server.v1_13_R1.WorldServer;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_13_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_13_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_13_R1.block.CraftBlock;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -92,13 +89,10 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
public void updateAdjacentComparators(@NotNull Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = craftBlock.getCraftWorld().getHandle();
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = ((CraftBlock) loc.getBlock()).getNMS().getBlock();
|
||||
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
serverLevel.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.songoda.core.nms.world.SItemStack;
|
|||
import com.songoda.core.nms.world.SSpawner;
|
||||
import com.songoda.core.nms.world.SWorld;
|
||||
import com.songoda.core.nms.world.WorldCore;
|
||||
import net.minecraft.server.v1_13_R2.Block;
|
||||
import net.minecraft.server.v1_13_R2.BlockPosition;
|
||||
import net.minecraft.server.v1_13_R2.Chunk;
|
||||
import net.minecraft.server.v1_13_R2.ChunkSection;
|
||||
|
@ -17,15 +16,13 @@ import net.minecraft.server.v1_13_R2.MobSpawnerAbstract;
|
|||
import net.minecraft.server.v1_13_R2.WorldServer;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_13_R2.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_13_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_13_R2.block.CraftBlock;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -99,13 +96,10 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
public void updateAdjacentComparators(@NotNull Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = craftBlock.getCraftWorld().getHandle();
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = ((CraftBlock) loc.getBlock()).getNMS().getBlock();
|
||||
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
serverLevel.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.songoda.core.nms.world.SItemStack;
|
|||
import com.songoda.core.nms.world.SSpawner;
|
||||
import com.songoda.core.nms.world.SWorld;
|
||||
import com.songoda.core.nms.world.WorldCore;
|
||||
import net.minecraft.server.v1_14_R1.Block;
|
||||
import net.minecraft.server.v1_14_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_14_R1.Chunk;
|
||||
import net.minecraft.server.v1_14_R1.ChunkCoordIntPair;
|
||||
|
@ -19,15 +18,13 @@ import net.minecraft.server.v1_14_R1.MobSpawnerAbstract;
|
|||
import net.minecraft.server.v1_14_R1.WorldServer;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_14_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_14_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_14_R1.block.CraftBlock;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -96,13 +93,10 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
public void updateAdjacentComparators(@NotNull Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = craftBlock.getCraftWorld().getHandle();
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = ((CraftBlock) loc.getBlock()).getNMS().getBlock();
|
||||
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
serverLevel.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.songoda.core.nms.world.SItemStack;
|
|||
import com.songoda.core.nms.world.SSpawner;
|
||||
import com.songoda.core.nms.world.SWorld;
|
||||
import com.songoda.core.nms.world.WorldCore;
|
||||
import net.minecraft.server.v1_15_R1.Block;
|
||||
import net.minecraft.server.v1_15_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_15_R1.Chunk;
|
||||
import net.minecraft.server.v1_15_R1.ChunkCoordIntPair;
|
||||
|
@ -19,15 +18,13 @@ import net.minecraft.server.v1_15_R1.MobSpawnerAbstract;
|
|||
import net.minecraft.server.v1_15_R1.WorldServer;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_15_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_15_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_15_R1.block.CraftBlock;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -99,13 +96,10 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
public void updateAdjacentComparators(@NotNull Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = craftBlock.getCraftWorld().getHandle();
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = ((CraftBlock) loc.getBlock()).getNMS().getBlock();
|
||||
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
serverLevel.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.songoda.core.nms.world.SItemStack;
|
|||
import com.songoda.core.nms.world.SSpawner;
|
||||
import com.songoda.core.nms.world.SWorld;
|
||||
import com.songoda.core.nms.world.WorldCore;
|
||||
import net.minecraft.server.v1_16_R1.Block;
|
||||
import net.minecraft.server.v1_16_R1.BlockPosition;
|
||||
import net.minecraft.server.v1_16_R1.Chunk;
|
||||
import net.minecraft.server.v1_16_R1.ChunkCoordIntPair;
|
||||
|
@ -19,15 +18,13 @@ import net.minecraft.server.v1_16_R1.MobSpawnerAbstract;
|
|||
import net.minecraft.server.v1_16_R1.WorldServer;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_16_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_16_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_16_R1.block.CraftBlock;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -100,13 +97,10 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
public void updateAdjacentComparators(@NotNull Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = craftBlock.getCraftWorld().getHandle();
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = ((CraftBlock) loc.getBlock()).getNMS().getBlock();
|
||||
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
serverLevel.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.songoda.core.nms.world.SItemStack;
|
|||
import com.songoda.core.nms.world.SSpawner;
|
||||
import com.songoda.core.nms.world.SWorld;
|
||||
import com.songoda.core.nms.world.WorldCore;
|
||||
import net.minecraft.server.v1_16_R2.Block;
|
||||
import net.minecraft.server.v1_16_R2.BlockPosition;
|
||||
import net.minecraft.server.v1_16_R2.Chunk;
|
||||
import net.minecraft.server.v1_16_R2.ChunkCoordIntPair;
|
||||
|
@ -19,15 +18,13 @@ import net.minecraft.server.v1_16_R2.MobSpawnerAbstract;
|
|||
import net.minecraft.server.v1_16_R2.WorldServer;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_16_R2.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_16_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_16_R2.block.CraftBlock;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -100,13 +97,10 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
public void updateAdjacentComparators(@NotNull Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = craftBlock.getCraftWorld().getHandle();
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = ((CraftBlock) loc.getBlock()).getNMS().getBlock();
|
||||
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
serverLevel.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,7 +7,6 @@ import com.songoda.core.nms.world.SItemStack;
|
|||
import com.songoda.core.nms.world.SSpawner;
|
||||
import com.songoda.core.nms.world.SWorld;
|
||||
import com.songoda.core.nms.world.WorldCore;
|
||||
import net.minecraft.server.v1_16_R3.Block;
|
||||
import net.minecraft.server.v1_16_R3.BlockPosition;
|
||||
import net.minecraft.server.v1_16_R3.Chunk;
|
||||
import net.minecraft.server.v1_16_R3.ChunkCoordIntPair;
|
||||
|
@ -19,15 +18,13 @@ import net.minecraft.server.v1_16_R3.MobSpawnerAbstract;
|
|||
import net.minecraft.server.v1_16_R3.WorldServer;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_16_R3.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_16_R3.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_16_R3.block.CraftBlock;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -101,13 +98,10 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
public void updateAdjacentComparators(@NotNull Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = craftBlock.getCraftWorld().getHandle();
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = ((CraftBlock) loc.getBlock()).getNMS().getBlock();
|
||||
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
serverLevel.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,22 +12,19 @@ import net.minecraft.server.level.WorldServer;
|
|||
import net.minecraft.util.profiling.GameProfilerFiller;
|
||||
import net.minecraft.world.level.ChunkCoordIntPair;
|
||||
import net.minecraft.world.level.MobSpawnerAbstract;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.IBlockData;
|
||||
import net.minecraft.world.level.chunk.Chunk;
|
||||
import net.minecraft.world.level.chunk.ChunkSection;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_17_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_17_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_17_R1.block.CraftBlock;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -99,13 +96,10 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
public void updateAdjacentComparators(@NotNull Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = craftBlock.getCraftWorld().getHandle();
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = ((CraftBlock) loc.getBlock()).getNMS().getBlock();
|
||||
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
serverLevel.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,22 +12,19 @@ import net.minecraft.server.level.ServerLevel;
|
|||
import net.minecraft.util.profiling.ProfilerFiller;
|
||||
import net.minecraft.world.level.BaseSpawner;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
import net.minecraft.world.level.chunk.LevelChunkSection;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_18_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_18_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_18_R1.block.CraftBlock;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -96,13 +93,10 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
public void updateAdjacentComparators(@NotNull Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
ServerLevel serverLevel = craftBlock.getCraftWorld().getHandle();
|
||||
|
||||
ServerLevel serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPos blockPos = new BlockPos(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = ((CraftBlock) loc.getBlock()).getNMS().getBlock();
|
||||
|
||||
serverLevel.updateNeighbourForOutputSignal(blockPos, nmsBlock);
|
||||
serverLevel.updateNeighbourForOutputSignal(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,22 +12,19 @@ import net.minecraft.server.level.ServerLevel;
|
|||
import net.minecraft.util.profiling.ProfilerFiller;
|
||||
import net.minecraft.world.level.BaseSpawner;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
import net.minecraft.world.level.chunk.LevelChunkSection;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_18_R2.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_18_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_18_R2.block.CraftBlock;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -95,13 +92,10 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
public void updateAdjacentComparators(@NotNull Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
ServerLevel serverLevel = craftBlock.getCraftWorld().getHandle();
|
||||
|
||||
ServerLevel serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPos blockPos = new BlockPos(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = ((CraftBlock) loc.getBlock()).getNMS().getBlock();
|
||||
|
||||
serverLevel.updateNeighbourForOutputSignal(blockPos, nmsBlock);
|
||||
serverLevel.updateNeighbourForOutputSignal(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,6 @@
|
|||
</plugins>
|
||||
</build>
|
||||
|
||||
|
||||
<dependencies>
|
||||
<!--suppress VulnerableLibrariesLocal -->
|
||||
<dependency>
|
||||
|
|
|
@ -12,13 +12,13 @@ import net.minecraft.server.level.ServerLevel;
|
|||
import net.minecraft.util.profiling.ProfilerFiller;
|
||||
import net.minecraft.world.level.BaseSpawner;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
import net.minecraft.world.level.chunk.LevelChunkSection;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_19_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_19_R1.CraftWorld;
|
||||
|
@ -93,13 +93,10 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
public void updateAdjacentComparators(@NotNull Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
ServerLevel serverLevel = craftBlock.getCraftWorld().getHandle();
|
||||
|
||||
ServerLevel serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPos blockPos = new BlockPos(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = ((CraftBlock) loc.getBlock()).getNMS().getBlock();
|
||||
|
||||
serverLevel.updateNeighbourForOutputSignal(blockPos, nmsBlock);
|
||||
serverLevel.updateNeighbourForOutputSignal(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,22 +12,19 @@ import net.minecraft.server.level.ServerLevel;
|
|||
import net.minecraft.util.profiling.ProfilerFiller;
|
||||
import net.minecraft.world.level.BaseSpawner;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
import net.minecraft.world.level.chunk.LevelChunkSection;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_19_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_19_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_19_R1.block.CraftBlock;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -93,13 +90,10 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
public void updateAdjacentComparators(@NotNull Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
ServerLevel serverLevel = craftBlock.getCraftWorld().getHandle();
|
||||
|
||||
ServerLevel serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPos blockPos = new BlockPos(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = ((CraftBlock) loc.getBlock()).getNMS().getBlock();
|
||||
|
||||
serverLevel.updateNeighbourForOutputSignal(blockPos, nmsBlock);
|
||||
serverLevel.updateNeighbourForOutputSignal(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,22 +12,19 @@ import net.minecraft.server.level.ServerLevel;
|
|||
import net.minecraft.util.profiling.ProfilerFiller;
|
||||
import net.minecraft.world.level.BaseSpawner;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
import net.minecraft.world.level.chunk.LevelChunkSection;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_19_R2.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_19_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_19_R2.block.CraftBlock;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -93,13 +90,10 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
public void updateAdjacentComparators(@NotNull Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
ServerLevel serverLevel = craftBlock.getCraftWorld().getHandle();
|
||||
|
||||
ServerLevel serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPos blockPos = new BlockPos(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = ((CraftBlock) loc.getBlock()).getNMS().getBlock();
|
||||
|
||||
serverLevel.updateNeighbourForOutputSignal(blockPos, nmsBlock);
|
||||
serverLevel.updateNeighbourForOutputSignal(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,10 +40,10 @@ public class AnvilView extends AnvilMenu implements CustomAnvil {
|
|||
|
||||
static {
|
||||
try {
|
||||
mc_ContainerAnvil_repairInventory = ItemCombinerMenu.class.getDeclaredField("p");
|
||||
mc_ContainerAnvil_repairInventory = ItemCombinerMenu.class.getDeclaredField("q");
|
||||
mc_ContainerAnvil_repairInventory.setAccessible(true);
|
||||
|
||||
mc_ContainerAnvil_resultInventory = ItemCombinerMenu.class.getDeclaredField("o");
|
||||
mc_ContainerAnvil_resultInventory = ItemCombinerMenu.class.getDeclaredField("r");
|
||||
mc_ContainerAnvil_resultInventory.setAccessible(true);
|
||||
|
||||
mc_ContainerAnvil_bukkitEntity = AnvilMenu.class.getDeclaredField("bukkitEntity");
|
||||
|
|
|
@ -12,22 +12,20 @@ import net.minecraft.server.level.ServerLevel;
|
|||
import net.minecraft.util.profiling.ProfilerFiller;
|
||||
import net.minecraft.world.level.BaseSpawner;
|
||||
import net.minecraft.world.level.ChunkPos;
|
||||
import net.minecraft.world.level.block.Block;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.chunk.ChunkStatus;
|
||||
import net.minecraft.world.level.chunk.LevelChunk;
|
||||
import net.minecraft.world.level.chunk.LevelChunkSection;
|
||||
import net.minecraft.world.level.material.FluidState;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_19_R3.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_19_R3.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_19_R3.util.CraftMagicNumbers;
|
||||
import org.bukkit.craftbukkit.v1_19_R3.block.CraftBlock;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -56,7 +54,7 @@ public class WorldCoreImpl implements WorldCore {
|
|||
*/
|
||||
@Override
|
||||
public void randomTickChunk(org.bukkit.Chunk bukkitChunk, int tickAmount) {
|
||||
LevelChunk chunk = ((CraftChunk) bukkitChunk).getHandle();
|
||||
LevelChunk chunk = (LevelChunk) ((CraftChunk) bukkitChunk).getHandle(ChunkStatus.FULL);
|
||||
ServerLevel world = chunk.q;
|
||||
ProfilerFiller gameprofilerfiller = world.getProfiler();
|
||||
|
||||
|
@ -93,13 +91,10 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
public void updateAdjacentComparators(@NotNull Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
ServerLevel serverLevel = craftBlock.getCraftWorld().getHandle();
|
||||
|
||||
ServerLevel serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPos blockPos = new BlockPos(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(loc.getBlock().getType());
|
||||
|
||||
serverLevel.updateNeighbourForOutputSignal(blockPos, nmsBlock);
|
||||
serverLevel.updateNeighbourForOutputSignal(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,12 +19,11 @@ import org.bukkit.World;
|
|||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_8_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_8_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_8_R1.block.CraftBlock;
|
||||
import org.bukkit.craftbukkit.v1_8_R1.util.CraftMagicNumbers;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -89,13 +88,12 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(loc.getBlock().getType());
|
||||
public void updateAdjacentComparators(@NotNull org.bukkit.block.Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = ((CraftWorld) craftBlock.getWorld()).getHandle();
|
||||
|
||||
BlockPosition blockPos = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(bukkitBlock.getType());
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,12 +19,11 @@ import org.bukkit.World;
|
|||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_8_R2.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_8_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_8_R2.block.CraftBlock;
|
||||
import org.bukkit.craftbukkit.v1_8_R2.util.CraftMagicNumbers;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -89,13 +88,12 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(loc.getBlock().getType());
|
||||
public void updateAdjacentComparators(@NotNull org.bukkit.block.Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = ((CraftWorld) craftBlock.getWorld()).getHandle();
|
||||
|
||||
BlockPosition blockPos = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(bukkitBlock.getType());
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,12 +19,11 @@ import org.bukkit.World;
|
|||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.block.CraftBlock;
|
||||
import org.bukkit.craftbukkit.v1_8_R3.util.CraftMagicNumbers;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -88,13 +87,12 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(loc.getBlock().getType());
|
||||
public void updateAdjacentComparators(@NotNull org.bukkit.block.Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = ((CraftWorld) craftBlock.getWorld()).getHandle();
|
||||
|
||||
BlockPosition blockPos = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(bukkitBlock.getType());
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,12 +19,11 @@ import org.bukkit.World;
|
|||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_9_R1.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_9_R1.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_9_R1.block.CraftBlock;
|
||||
import org.bukkit.craftbukkit.v1_9_R1.util.CraftMagicNumbers;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
@Override
|
||||
public SSpawner getSpawner(Location location) {
|
||||
|
@ -88,13 +87,12 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(loc.getBlock().getType());
|
||||
public void updateAdjacentComparators(@NotNull org.bukkit.block.Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = ((CraftWorld) craftBlock.getWorld()).getHandle();
|
||||
|
||||
BlockPosition blockPos = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(bukkitBlock.getType());
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,12 +19,11 @@ import org.bukkit.World;
|
|||
import org.bukkit.block.CreatureSpawner;
|
||||
import org.bukkit.craftbukkit.v1_9_R2.CraftChunk;
|
||||
import org.bukkit.craftbukkit.v1_9_R2.CraftWorld;
|
||||
import org.bukkit.craftbukkit.v1_9_R2.block.CraftBlock;
|
||||
import org.bukkit.craftbukkit.v1_9_R2.util.CraftMagicNumbers;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class WorldCoreImpl implements WorldCore {
|
||||
|
||||
@Override
|
||||
|
@ -88,13 +87,12 @@ public class WorldCoreImpl implements WorldCore {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void updateAdjacentComparators(@NotNull Location loc) {
|
||||
Objects.requireNonNull(loc.getWorld());
|
||||
|
||||
WorldServer serverLevel = ((CraftWorld) loc.getWorld()).getHandle();
|
||||
BlockPosition blockPos = new BlockPosition(loc.getX(), loc.getY(), loc.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(loc.getBlock().getType());
|
||||
public void updateAdjacentComparators(@NotNull org.bukkit.block.Block bukkitBlock) {
|
||||
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
|
||||
WorldServer serverLevel = ((CraftWorld) craftBlock.getWorld()).getHandle();
|
||||
|
||||
BlockPosition blockPos = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
|
||||
Block nmsBlock = CraftMagicNumbers.getBlock(bukkitBlock.getType());
|
||||
serverLevel.updateAdjacentComparators(blockPos, nmsBlock);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue