Merge branch 'development'

This commit is contained in:
Christian Koop 2023-04-22 16:21:44 +02:00
commit 24fc39ab16
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3
55 changed files with 306 additions and 29 deletions

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -1,5 +1,9 @@
package com.songoda.core.compatibility;
/**
* @deprecated Usage is highly discouraged use NMSManager instead
*/
@Deprecated
public enum ClassMapping {
BIOME_BASE("world.level.biome", "BiomeBase"),
BIOME_STORAGE("world.level.chunk", "BiomeStorage"),

View File

@ -32,6 +32,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(),

View File

@ -5,6 +5,10 @@ import org.bukkit.inventory.ItemStack;
import java.lang.reflect.Method;
/**
* @deprecated Usage is highly discouraged use NMSManager instead
*/
@Deprecated
public enum MethodMapping {
MC_ITEM_STACK__GET_TAG("getTag", "getTag", "s", "t", "u"),
MC_ITEM_STACK__SET_TAG("setTag", "setTag", "c", "c", "c", ClassMapping.NBT_TAG_COMPOUND.getClazz()),

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -55,7 +55,7 @@ public class SongodaCore {
/**
* @since coreRevision 6
*/
private final static String coreVersion = "2.6.19";
private final static String coreVersion = "2.6.20";
/**
* This is specific to the website api

View File

@ -4,6 +4,7 @@ import com.songoda.core.compatibility.ClassMapping;
import com.songoda.core.compatibility.CompatibleMaterial;
import com.songoda.core.compatibility.MethodMapping;
import com.songoda.core.compatibility.ServerVersion;
import com.songoda.core.nms.NmsManager;
import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material;
@ -19,6 +20,10 @@ import java.util.Set;
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 BlockUtils {
protected static final Set<Material> DOORS;
protected static final Set<Material> PRESSURE_PLATES;
@ -337,7 +342,10 @@ public class BlockUtils {
* Manually trigger the updateAdjacentComparators method for containers
*
* @param loc The Location of the container
*
* @deprecated Broken in/since Spigot 1.19.4! Use {@link com.songoda.core.nms.world.WorldCore#updateAdjacentComparators(Block)} on {@link NmsManager#getWorld()} instead
*/
@Deprecated
public static void updateAdjacentComparators(Location loc) {
if (loc == null || loc.getWorld() == null) {
return;

View File

@ -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();

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -3,12 +3,11 @@ 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 java.lang.reflect.InvocationTargetException;
public interface WorldCore {
SSpawner getSpawner(CreatureSpawner spawner);
@ -30,6 +29,8 @@ public interface WorldCore {
*/
void randomTickChunk(Chunk bukkitChunk, int tickAmount) throws ReflectiveOperationException;
void updateAdjacentComparators(Block bukkitBlock);
/**
* Ticks all inactive spawners in a specific chunk ignoring the minimum required players within a specific range.<br>
* A spawner is deemed inactive if no player is within its activation range.

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,6 +18,8 @@ import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.craftbukkit.v1_10_R1.CraftChunk;
import org.bukkit.craftbukkit.v1_10_R1.block.CraftBlock;
import org.bukkit.craftbukkit.v1_10_R1.util.CraftMagicNumbers;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -85,4 +87,14 @@ public class WorldCoreImpl implements WorldCore {
}
}
}
@Override
public void updateAdjacentComparators(org.bukkit.block.Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.server.v1_10_R1.World nmsWorld = craftChunk.getHandle().getWorld();
BlockPosition blockPosition = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
nmsWorld.updateAdjacentComparators(blockPosition, CraftMagicNumbers.getBlock(craftBlock));
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,6 +18,8 @@ import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.craftbukkit.v1_11_R1.CraftChunk;
import org.bukkit.craftbukkit.v1_11_R1.block.CraftBlock;
import org.bukkit.craftbukkit.v1_11_R1.util.CraftMagicNumbers;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -85,4 +87,14 @@ public class WorldCoreImpl implements WorldCore {
}
}
}
@Override
public void updateAdjacentComparators(org.bukkit.block.Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.server.v1_11_R1.World nmsWorld = craftChunk.getHandle().getWorld();
BlockPosition blockPosition = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
nmsWorld.updateAdjacentComparators(blockPosition, CraftMagicNumbers.getBlock(craftBlock));
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,6 +18,8 @@ import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.craftbukkit.v1_12_R1.CraftChunk;
import org.bukkit.craftbukkit.v1_12_R1.block.CraftBlock;
import org.bukkit.craftbukkit.v1_12_R1.util.CraftMagicNumbers;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -85,4 +87,14 @@ public class WorldCoreImpl implements WorldCore {
}
}
}
@Override
public void updateAdjacentComparators(org.bukkit.block.Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.server.v1_12_R1.World nmsWorld = craftChunk.getHandle().getWorld();
BlockPosition blockPosition = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
nmsWorld.updateAdjacentComparators(blockPosition, CraftMagicNumbers.getBlock(craftBlock));
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -16,8 +16,10 @@ 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.block.CraftBlock;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -89,4 +91,13 @@ public class WorldCoreImpl implements WorldCore {
}
}
}
@Override
public void updateAdjacentComparators(Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.server.v1_13_R1.World nmsWorld = craftChunk.getHandle().getWorld();
nmsWorld.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -16,8 +16,10 @@ 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.block.CraftBlock;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -96,4 +98,13 @@ public class WorldCoreImpl implements WorldCore {
chunk.world.methodProfiler.exit();
}
@Override
public void updateAdjacentComparators(Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.server.v1_13_R2.World nmsWorld = craftChunk.getHandle().getWorld();
nmsWorld.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,8 +18,10 @@ 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.block.CraftBlock;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -93,4 +95,13 @@ public class WorldCoreImpl implements WorldCore {
profiler.exit();
}
@Override
public void updateAdjacentComparators(Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.server.v1_14_R1.World nmsWorld = craftChunk.getHandle().getWorld();
nmsWorld.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,8 +18,10 @@ 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.block.CraftBlock;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -96,4 +98,13 @@ public class WorldCoreImpl implements WorldCore {
profiler.exit();
}
@Override
public void updateAdjacentComparators(Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.server.v1_15_R1.World nmsWorld = craftChunk.getHandle().getWorld();
nmsWorld.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,8 +18,10 @@ 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.block.CraftBlock;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -97,4 +99,13 @@ public class WorldCoreImpl implements WorldCore {
profiler.exit();
}
@Override
public void updateAdjacentComparators(Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.server.v1_16_R1.World nmsWorld = craftChunk.getHandle().getWorld();
nmsWorld.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,8 +18,10 @@ 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.block.CraftBlock;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -97,4 +99,13 @@ public class WorldCoreImpl implements WorldCore {
profiler.exit();
}
@Override
public void updateAdjacentComparators(Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.server.v1_16_R2.World nmsWorld = craftChunk.getHandle().getWorld();
nmsWorld.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,8 +18,10 @@ 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.block.CraftBlock;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -98,4 +100,13 @@ public class WorldCoreImpl implements WorldCore {
profiler.exit();
}
@Override
public void updateAdjacentComparators(Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.server.v1_16_R3.World nmsWorld = craftChunk.getHandle().getWorld();
nmsWorld.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,8 +18,10 @@ 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.block.CraftBlock;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -96,4 +98,13 @@ public class WorldCoreImpl implements WorldCore {
profiler.exit();
}
@Override
public void updateAdjacentComparators(Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.world.level.World nmsWorld = craftChunk.getHandle().getWorld();
nmsWorld.updateAdjacentComparators(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
}
}

View File

@ -19,7 +19,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,8 +18,10 @@ 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_18_R1.CraftChunk;
import org.bukkit.craftbukkit.v1_18_R1.block.CraftBlock;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -93,4 +95,13 @@ public class WorldCoreImpl implements WorldCore {
gameprofilerfiller.c();
}
@Override
public void updateAdjacentComparators(Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
WorldServer nmsWorld = craftChunk.getHandle().q;
nmsWorld.c(craftBlock.getPosition(), craftBlock.getNMS().b());
}
}

View File

@ -60,7 +60,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,8 +18,10 @@ 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.block.CraftBlock;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -92,4 +94,13 @@ public class WorldCoreImpl implements WorldCore {
gameProfilerFiller.pop();
}
@Override
public void updateAdjacentComparators(Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
ServerLevel nmsWorld = craftChunk.getHandle().q;
nmsWorld.updateNeighbourForOutputSignal(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
}
}

View File

@ -60,7 +60,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,8 +18,10 @@ 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.block.CraftBlock;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -90,4 +92,13 @@ public class WorldCoreImpl implements WorldCore {
}
}
}
@Override
public void updateAdjacentComparators(Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
ServerLevel nmsWorld = craftChunk.getHandle().q;
nmsWorld.updateNeighbourForOutputSignal(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
}
}

View File

@ -60,7 +60,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,8 +18,10 @@ 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.block.CraftBlock;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -90,4 +92,13 @@ public class WorldCoreImpl implements WorldCore {
}
}
}
@Override
public void updateAdjacentComparators(Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
ServerLevel nmsWorld = craftChunk.getHandle().q;
nmsWorld.updateNeighbourForOutputSignal(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
}
}

View File

@ -60,7 +60,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,8 +18,10 @@ 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.block.CraftBlock;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -90,4 +92,13 @@ public class WorldCoreImpl implements WorldCore {
}
}
}
@Override
public void updateAdjacentComparators(Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
ServerLevel nmsWorld = craftChunk.getHandle().q;
nmsWorld.updateNeighbourForOutputSignal(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
}
}

View File

@ -60,7 +60,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -19,8 +19,10 @@ 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.block.CraftBlock;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -91,4 +93,13 @@ public class WorldCoreImpl implements WorldCore {
}
}
}
@Override
public void updateAdjacentComparators(Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
LevelChunk nmsChunk = (LevelChunk) craftChunk.getHandle(ChunkStatus.FULL);
nmsChunk.q.updateNeighbourForOutputSignal(craftBlock.getPosition(), craftBlock.getNMS().getBlock());
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,6 +18,8 @@ import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.craftbukkit.v1_8_R1.CraftChunk;
import org.bukkit.craftbukkit.v1_8_R1.block.CraftBlock;
import org.bukkit.craftbukkit.v1_8_R1.util.CraftMagicNumbers;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -87,4 +89,14 @@ public class WorldCoreImpl implements WorldCore {
}
}
}
@Override
public void updateAdjacentComparators(org.bukkit.block.Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.server.v1_8_R1.World nmsWorld = craftChunk.getHandle().getWorld();
BlockPosition blockPosition = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
nmsWorld.updateAdjacentComparators(blockPosition, CraftMagicNumbers.getBlock(craftBlock));
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,6 +18,8 @@ import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.craftbukkit.v1_8_R2.CraftChunk;
import org.bukkit.craftbukkit.v1_8_R2.block.CraftBlock;
import org.bukkit.craftbukkit.v1_8_R2.util.CraftMagicNumbers;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -87,4 +89,14 @@ public class WorldCoreImpl implements WorldCore {
}
}
}
@Override
public void updateAdjacentComparators(org.bukkit.block.Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.server.v1_8_R2.World nmsWorld = craftChunk.getHandle().getWorld();
BlockPosition blockPosition = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
nmsWorld.updateAdjacentComparators(blockPosition, CraftMagicNumbers.getBlock(craftBlock));
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,6 +18,8 @@ import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.craftbukkit.v1_8_R3.CraftChunk;
import org.bukkit.craftbukkit.v1_8_R3.block.CraftBlock;
import org.bukkit.craftbukkit.v1_8_R3.util.CraftMagicNumbers;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -86,4 +88,14 @@ public class WorldCoreImpl implements WorldCore {
}
}
}
@Override
public void updateAdjacentComparators(org.bukkit.block.Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.server.v1_8_R3.World nmsWorld = craftChunk.getHandle().getWorld();
BlockPosition blockPosition = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
nmsWorld.updateAdjacentComparators(blockPosition, CraftMagicNumbers.getBlock(craftBlock));
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,6 +18,8 @@ import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.craftbukkit.v1_9_R1.CraftChunk;
import org.bukkit.craftbukkit.v1_9_R1.block.CraftBlock;
import org.bukkit.craftbukkit.v1_9_R1.util.CraftMagicNumbers;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -86,4 +88,14 @@ public class WorldCoreImpl implements WorldCore {
}
}
}
@Override
public void updateAdjacentComparators(org.bukkit.block.Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.server.v1_9_R1.World nmsWorld = craftChunk.getHandle().getWorld();
BlockPosition blockPosition = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
nmsWorld.updateAdjacentComparators(blockPosition, CraftMagicNumbers.getBlock(craftBlock));
}
}

View File

@ -7,7 +7,7 @@
<parent>
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -18,6 +18,8 @@ import org.bukkit.Location;
import org.bukkit.World;
import org.bukkit.block.CreatureSpawner;
import org.bukkit.craftbukkit.v1_9_R2.CraftChunk;
import org.bukkit.craftbukkit.v1_9_R2.block.CraftBlock;
import org.bukkit.craftbukkit.v1_9_R2.util.CraftMagicNumbers;
import org.bukkit.inventory.ItemStack;
public class WorldCoreImpl implements WorldCore {
@ -85,4 +87,14 @@ public class WorldCoreImpl implements WorldCore {
}
}
}
@Override
public void updateAdjacentComparators(org.bukkit.block.Block bukkitBlock) {
CraftBlock craftBlock = (CraftBlock) bukkitBlock;
CraftChunk craftChunk = (CraftChunk) bukkitBlock.getChunk();
net.minecraft.server.v1_9_R2.World nmsWorld = craftChunk.getHandle().getWorld();
BlockPosition blockPosition = new BlockPosition(craftBlock.getX(), craftBlock.getY(), craftBlock.getZ());
nmsWorld.updateAdjacentComparators(blockPosition, CraftMagicNumbers.getBlock(craftBlock));
}
}

View File

@ -6,7 +6,7 @@
<groupId>com.songoda</groupId>
<artifactId>SongodaCore-Modules</artifactId>
<version>2.6.19</version>
<version>2.6.20</version>
<packaging>pom</packaging>
<!-- Run 'mvn versions:set -DgenerateBackupPoms=false -DnewVersion=X.Y.Z' to update version recursively -->