From f127f9030d51fc1bbbc8a753e9d985b641386a28 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 7 Apr 2024 12:22:10 +1000 Subject: [PATCH] #1363: Add API to copy BlockState to a new Location By: lbenav8095 --- .../craftbukkit/block/CapturedBlockState.java | 13 ++++++++---- .../bukkit/craftbukkit/block/CraftBanner.java | 12 ++++++++--- .../bukkit/craftbukkit/block/CraftBarrel.java | 12 ++++++++--- .../bukkit/craftbukkit/block/CraftBeacon.java | 12 ++++++++--- .../bukkit/craftbukkit/block/CraftBed.java | 12 ++++++++--- .../craftbukkit/block/CraftBeehive.java | 11 +++++++--- .../bukkit/craftbukkit/block/CraftBell.java | 12 ++++++++--- .../craftbukkit/block/CraftBlastFurnace.java | 12 ++++++++--- .../block/CraftBlockEntityState.java | 11 +++++++--- .../craftbukkit/block/CraftBlockState.java | 20 ++++++++++++++----- .../craftbukkit/block/CraftBrewingStand.java | 12 ++++++++--- .../block/CraftBrushableBlock.java | 12 ++++++++--- .../block/CraftCalibratedSculkSensor.java | 12 ++++++++--- .../craftbukkit/block/CraftCampfire.java | 12 ++++++++--- .../bukkit/craftbukkit/block/CraftChest.java | 12 ++++++++--- .../block/CraftChiseledBookshelf.java | 12 ++++++++--- .../craftbukkit/block/CraftCommandBlock.java | 12 ++++++++--- .../craftbukkit/block/CraftComparator.java | 12 ++++++++--- .../craftbukkit/block/CraftConduit.java | 12 ++++++++--- .../craftbukkit/block/CraftContainer.java | 8 ++++++-- .../craftbukkit/block/CraftCrafter.java | 12 ++++++++--- .../block/CraftCreatureSpawner.java | 12 ++++++++--- .../block/CraftDaylightDetector.java | 12 ++++++++--- .../craftbukkit/block/CraftDecoratedPot.java | 12 ++++++++--- .../craftbukkit/block/CraftDispenser.java | 12 ++++++++--- .../craftbukkit/block/CraftDropper.java | 12 ++++++++--- .../block/CraftEnchantingTable.java | 12 ++++++++--- .../craftbukkit/block/CraftEndGateway.java | 11 +++++++--- .../craftbukkit/block/CraftEndPortal.java | 12 ++++++++--- .../craftbukkit/block/CraftEnderChest.java | 12 ++++++++--- .../craftbukkit/block/CraftFurnace.java | 8 ++++++-- .../block/CraftFurnaceFurnace.java | 12 ++++++++--- .../craftbukkit/block/CraftHangingSign.java | 12 ++++++++--- .../bukkit/craftbukkit/block/CraftHopper.java | 12 ++++++++--- .../bukkit/craftbukkit/block/CraftJigsaw.java | 12 ++++++++--- .../craftbukkit/block/CraftJukebox.java | 12 ++++++++--- .../craftbukkit/block/CraftLectern.java | 12 ++++++++--- .../craftbukkit/block/CraftLootable.java | 8 ++++++-- .../craftbukkit/block/CraftMovingPiston.java | 12 ++++++++--- .../craftbukkit/block/CraftSculkCatalyst.java | 12 ++++++++--- .../craftbukkit/block/CraftSculkSensor.java | 12 ++++++++--- .../craftbukkit/block/CraftSculkShrieker.java | 12 ++++++++--- .../craftbukkit/block/CraftShulkerBox.java | 12 ++++++++--- .../bukkit/craftbukkit/block/CraftSign.java | 12 ++++++++--- .../bukkit/craftbukkit/block/CraftSkull.java | 12 ++++++++--- .../bukkit/craftbukkit/block/CraftSmoker.java | 12 ++++++++--- .../block/CraftStructureBlock.java | 12 ++++++++--- .../block/CraftSuspiciousSand.java | 12 ++++++++--- .../craftbukkit/block/CraftTrialSpawner.java | 12 ++++++++--- 49 files changed, 435 insertions(+), 147 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java index 262e472f4d..2027649c9c 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CapturedBlockState.java @@ -8,6 +8,7 @@ import net.minecraft.world.level.GeneratorAccessSeed; import net.minecraft.world.level.World; import net.minecraft.world.level.block.entity.TileEntity; import net.minecraft.world.level.block.entity.TileEntityBeehive; +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.block.Block; import org.bukkit.block.BlockState; @@ -23,9 +24,8 @@ public final class CapturedBlockState extends CraftBlockState { this.treeBlock = treeBlock; } - protected CapturedBlockState(CapturedBlockState state) { - super(state); - + protected CapturedBlockState(CapturedBlockState state, Location location) { + super(state, location); this.treeBlock = state.treeBlock; } @@ -74,7 +74,12 @@ public final class CapturedBlockState extends CraftBlockState { @Override public CapturedBlockState copy() { - return new CapturedBlockState(this); + return new CapturedBlockState(this, null); + } + + @Override + public CapturedBlockState copy(Location location) { + return new CapturedBlockState(this, location); } public static CapturedBlockState getBlockState(World world, BlockPosition pos, int flag) { diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java index 05961f0335..12da5c8d75 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBanner.java @@ -9,6 +9,7 @@ import net.minecraft.world.item.EnumColor; import net.minecraft.world.level.block.BlockBannerAbstract; import net.minecraft.world.level.block.entity.TileEntityBanner; import org.bukkit.DyeColor; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Banner; import org.bukkit.block.banner.Pattern; @@ -23,8 +24,8 @@ public class CraftBanner extends CraftBlockEntityState impleme super(world, tileEntity); } - protected CraftBanner(CraftBanner state) { - super(state); + protected CraftBanner(CraftBanner state, Location location) { + super(state, location); } @Override @@ -107,6 +108,11 @@ public class CraftBanner extends CraftBlockEntityState impleme @Override public CraftBanner copy() { - return new CraftBanner(this); + return new CraftBanner(this, null); + } + + @Override + public CraftBanner copy(Location location) { + return new CraftBanner(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java index 3a4c9844fa..cf0b4baedc 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBarrel.java @@ -4,6 +4,7 @@ import net.minecraft.sounds.SoundEffects; import net.minecraft.world.level.block.BlockBarrel; import net.minecraft.world.level.block.entity.TileEntityBarrel; import net.minecraft.world.level.block.state.IBlockData; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Barrel; import org.bukkit.craftbukkit.inventory.CraftInventory; @@ -15,8 +16,8 @@ public class CraftBarrel extends CraftLootable implements Barr super(world, tileEntity); } - protected CraftBarrel(CraftBarrel state) { - super(state); + protected CraftBarrel(CraftBarrel state, Location location) { + super(state, location); } @Override @@ -65,6 +66,11 @@ public class CraftBarrel extends CraftLootable implements Barr @Override public CraftBarrel copy() { - return new CraftBarrel(this); + return new CraftBarrel(this, null); + } + + @Override + public CraftBarrel copy(Location location) { + return new CraftBarrel(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java index df2177a6f1..115056f830 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBeacon.java @@ -6,6 +6,7 @@ import net.minecraft.world.ChestLock; import net.minecraft.world.entity.player.EntityHuman; import net.minecraft.world.level.block.entity.TileEntity; import net.minecraft.world.level.block.entity.TileEntityBeacon; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Beacon; import org.bukkit.craftbukkit.potion.CraftPotionEffectType; @@ -20,8 +21,8 @@ public class CraftBeacon extends CraftBlockEntityState impleme super(world, tileEntity); } - protected CraftBeacon(CraftBeacon state) { - super(state); + protected CraftBeacon(CraftBeacon state, Location location) { + super(state, location); } @Override @@ -99,6 +100,11 @@ public class CraftBeacon extends CraftBlockEntityState impleme @Override public CraftBeacon copy() { - return new CraftBeacon(this); + return new CraftBeacon(this, null); + } + + @Override + public CraftBeacon copy(Location location) { + return new CraftBeacon(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBed.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBed.java index 5bb2c75999..d77cea208c 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBed.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBed.java @@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.entity.TileEntityBed; import org.bukkit.DyeColor; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Bed; @@ -11,8 +12,8 @@ public class CraftBed extends CraftBlockEntityState implements Be super(world, tileEntity); } - protected CraftBed(CraftBed state) { - super(state); + protected CraftBed(CraftBed state, Location location) { + super(state, location); } @Override @@ -62,6 +63,11 @@ public class CraftBed extends CraftBlockEntityState implements Be @Override public CraftBed copy() { - return new CraftBed(this); + return new CraftBed(this, null); + } + + @Override + public CraftBed copy(Location location) { + return new CraftBed(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java index 01f637e291..4586f18265 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBeehive.java @@ -20,8 +20,8 @@ public class CraftBeehive extends CraftBlockEntityState imple super(world, tileEntity); } - protected CraftBeehive(CraftBeehive state) { - super(state); + protected CraftBeehive(CraftBeehive state, Location location) { + super(state, location); } @Override @@ -88,6 +88,11 @@ public class CraftBeehive extends CraftBlockEntityState imple @Override public CraftBeehive copy() { - return new CraftBeehive(this); + return new CraftBeehive(this, null); + } + + @Override + public CraftBeehive copy(Location location) { + return new CraftBeehive(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBell.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBell.java index eb0b93128a..824283a83c 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBell.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBell.java @@ -6,6 +6,7 @@ import net.minecraft.world.level.block.BlockBell; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.TileEntity; import net.minecraft.world.level.block.entity.TileEntityBell; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Bell; import org.bukkit.block.BlockFace; @@ -18,8 +19,8 @@ public class CraftBell extends CraftBlockEntityState implements super(world, tileEntity); } - protected CraftBell(CraftBell state) { - super(state); + protected CraftBell(CraftBell state, Location location) { + super(state, location); } @Override @@ -74,6 +75,11 @@ public class CraftBell extends CraftBlockEntityState implements @Override public CraftBell copy() { - return new CraftBell(this); + return new CraftBell(this, null); + } + + @Override + public CraftBell copy(Location location) { + return new CraftBell(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlastFurnace.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlastFurnace.java index c27ff1de4b..bb0dca4183 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlastFurnace.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlastFurnace.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.entity.TileEntityBlastFurnace; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.BlastFurnace; @@ -10,12 +11,17 @@ public class CraftBlastFurnace extends CraftFurnace impl super(world, tileEntity); } - protected CraftBlastFurnace(CraftBlastFurnace state) { - super(state); + protected CraftBlastFurnace(CraftBlastFurnace state, Location location) { + super(state, location); } @Override public CraftBlastFurnace copy() { - return new CraftBlastFurnace(this); + return new CraftBlastFurnace(this, null); + } + + @Override + public CraftBlastFurnace copy(Location location) { + return new CraftBlastFurnace(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java index e5ad58d9b4..d1e3904bd8 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java @@ -28,8 +28,8 @@ public class CraftBlockEntityState extends CraftBlockState this.load(snapshot); } - protected CraftBlockEntityState(CraftBlockEntityState state) { - super(state); + protected CraftBlockEntityState(CraftBlockEntityState state, Location location) { + super(state, location); this.tileEntity = createSnapshot(state.snapshot); this.snapshot = tileEntity; loadData(state.getSnapshotNBT()); @@ -134,6 +134,11 @@ public class CraftBlockEntityState extends CraftBlockState @Override public CraftBlockEntityState copy() { - return new CraftBlockEntityState<>(this); + return new CraftBlockEntityState<>(this, null); + } + + @Override + public CraftBlockEntityState copy(Location location) { + return new CraftBlockEntityState<>(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java index 306dbd920d..e2aaf4c803 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java @@ -50,10 +50,15 @@ public class CraftBlockState implements BlockState { data = blockData; } - // Creates a unplaced copy (world == null copy) - protected CraftBlockState(CraftBlockState state) { - this.world = null; - this.position = state.getPosition().immutable(); + // Creates an unplaced copy of the given CraftBlockState at the given location + protected CraftBlockState(CraftBlockState state, @Nullable Location location) { + if (location == null) { + this.world = null; + this.position = state.getPosition().immutable(); + } else { + this.world = (CraftWorld) location.getWorld(); + this.position = CraftLocation.toBlockPosition(location); + } this.data = state.data; this.flag = state.flag; setWorldHandle(state.getWorldHandle()); @@ -330,6 +335,11 @@ public class CraftBlockState implements BlockState { @Override public CraftBlockState copy() { - return new CraftBlockState(this); + return new CraftBlockState(this, null); + } + + @Override + public BlockState copy(Location location) { + return new CraftBlockState(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBrewingStand.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBrewingStand.java index d64cf9dec6..8b00bd160e 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBrewingStand.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBrewingStand.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.entity.TileEntityBrewingStand; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.BrewingStand; import org.bukkit.craftbukkit.inventory.CraftInventoryBrewer; @@ -12,8 +13,8 @@ public class CraftBrewingStand extends CraftContainer im super(world, tileEntity); } - protected CraftBrewingStand(CraftBrewingStand state) { - super(state); + protected CraftBrewingStand(CraftBrewingStand state, Location location) { + super(state, location); } @Override @@ -52,6 +53,11 @@ public class CraftBrewingStand extends CraftContainer im @Override public CraftBrewingStand copy() { - return new CraftBrewingStand(this); + return new CraftBrewingStand(this, null); + } + + @Override + public CraftBrewingStand copy(Location location) { + return new CraftBrewingStand(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBrushableBlock.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBrushableBlock.java index 631de25b58..6d3944dd11 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBrushableBlock.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBrushableBlock.java @@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.resources.MinecraftKey; import net.minecraft.world.level.block.entity.BrushableBlockEntity; import org.bukkit.Bukkit; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.BrushableBlock; import org.bukkit.craftbukkit.inventory.CraftItemStack; @@ -16,8 +17,8 @@ public class CraftBrushableBlock extends CraftBlockEntityState imp super(world, tileEntity); } - protected CraftCampfire(CraftCampfire state) { - super(state); + protected CraftCampfire(CraftCampfire state, Location location) { + super(state, location); } @Override @@ -54,6 +55,11 @@ public class CraftCampfire extends CraftBlockEntityState imp @Override public CraftCampfire copy() { - return new CraftCampfire(this); + return new CraftCampfire(this, null); + } + + @Override + public CraftCampfire copy(Location location) { + return new CraftCampfire(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java index 0eb6e09af9..04d86c680c 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChest.java @@ -5,6 +5,7 @@ import net.minecraft.world.level.block.BlockChest; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.TileEntityChest; import net.minecraft.world.level.block.state.IBlockData; +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Chest; @@ -19,8 +20,8 @@ public class CraftChest extends CraftLootable implements Chest super(world, tileEntity); } - protected CraftChest(CraftChest state) { - super(state); + protected CraftChest(CraftChest state, Location location) { + super(state, location); } @Override @@ -84,6 +85,11 @@ public class CraftChest extends CraftLootable implements Chest @Override public CraftChest copy() { - return new CraftChest(this); + return new CraftChest(this, null); + } + + @Override + public CraftChest copy(Location location) { + return new CraftChest(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChiseledBookshelf.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChiseledBookshelf.java index 28bfa62098..8728658a98 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChiseledBookshelf.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftChiseledBookshelf.java @@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.ChiseledBookShelfBlock; import net.minecraft.world.level.block.entity.ChiseledBookShelfBlockEntity; import net.minecraft.world.phys.Vec2F; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.BlockFace; import org.bukkit.block.ChiseledBookshelf; @@ -17,8 +18,8 @@ public class CraftChiseledBookshelf extends CraftBlockEntityState super(world, tileEntity); } - protected CraftCommandBlock(CraftCommandBlock state) { - super(state); + protected CraftCommandBlock(CraftCommandBlock state, Location location) { + super(state, location); } @Override @@ -37,6 +38,11 @@ public class CraftCommandBlock extends CraftBlockEntityState @Override public CraftCommandBlock copy() { - return new CraftCommandBlock(this); + return new CraftCommandBlock(this, null); + } + + @Override + public CraftCommandBlock copy(Location location) { + return new CraftCommandBlock(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftComparator.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftComparator.java index 75c7902411..cdb27f8118 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftComparator.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftComparator.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.entity.TileEntityComparator; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Comparator; @@ -10,12 +11,17 @@ public class CraftComparator extends CraftBlockEntityState super(world, tileEntity); } - protected CraftComparator(CraftComparator state) { - super(state); + protected CraftComparator(CraftComparator state, Location location) { + super(state, location); } @Override public CraftComparator copy() { - return new CraftComparator(this); + return new CraftComparator(this, null); + } + + @Override + public CraftComparator copy(Location location) { + return new CraftComparator(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java index c15ac5b032..6f1f27bd83 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftConduit.java @@ -6,6 +6,7 @@ import net.minecraft.core.BlockPosition; import net.minecraft.world.entity.EntityLiving; import net.minecraft.world.level.block.entity.TileEntityConduit; import net.minecraft.world.phys.AxisAlignedBB; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.Conduit; @@ -19,13 +20,18 @@ public class CraftConduit extends CraftBlockEntityState imple super(world, tileEntity); } - protected CraftConduit(CraftConduit state) { - super(state); + protected CraftConduit(CraftConduit state, Location location) { + super(state, location); } @Override public CraftConduit copy() { - return new CraftConduit(this); + return new CraftConduit(this, null); + } + + @Override + public CraftConduit copy(Location location) { + return new CraftConduit(this, location); } @Override diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftContainer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftContainer.java index 16e7b64f79..675b742d3f 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftContainer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftContainer.java @@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.ChestLock; import net.minecraft.world.level.block.entity.TileEntityContainer; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Container; import org.bukkit.craftbukkit.util.CraftChatMessage; @@ -12,8 +13,8 @@ public abstract class CraftContainer extends Craf super(world, tileEntity); } - protected CraftContainer(CraftContainer state) { - super(state); + protected CraftContainer(CraftContainer state, Location location) { + super(state, location); } @Override @@ -53,4 +54,7 @@ public abstract class CraftContainer extends Craf @Override public abstract CraftContainer copy(); + + @Override + public abstract CraftContainer copy(Location location); } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftCrafter.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftCrafter.java index 68fc6eb7ca..d5894a96dd 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftCrafter.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftCrafter.java @@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.block; import com.google.common.base.Preconditions; import net.minecraft.world.level.block.entity.CrafterBlockEntity; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Crafter; import org.bukkit.craftbukkit.inventory.CraftInventory; @@ -13,8 +14,8 @@ public class CraftCrafter extends CraftLootable implements C super(world, tileEntity); } - protected CraftCrafter(CraftCrafter state) { - super(state); + protected CraftCrafter(CraftCrafter state, Location location) { + super(state, location); } @Override @@ -33,7 +34,12 @@ public class CraftCrafter extends CraftLootable implements C @Override public CraftCrafter copy() { - return new CraftCrafter(this); + return new CraftCrafter(this, null); + } + + @Override + public CraftCrafter copy(Location location) { + return new CraftCrafter(this, location); } @Override diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java index d9bb4bf6c2..77e7cf2d54 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftCreatureSpawner.java @@ -13,6 +13,7 @@ import net.minecraft.util.random.WeightedEntry.b; import net.minecraft.world.entity.EntityTypes; import net.minecraft.world.level.MobSpawnerData; import net.minecraft.world.level.block.entity.TileEntityMobSpawner; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.CreatureSpawner; import org.bukkit.block.spawner.SpawnRule; @@ -28,8 +29,8 @@ public class CraftCreatureSpawner extends CraftBlockEntityState implement super(world, tileEntity); } - protected CraftDispenser(CraftDispenser state) { - super(state); + protected CraftDispenser(CraftDispenser state, Location location) { + super(state, location); } @Override @@ -65,6 +66,11 @@ public class CraftDispenser extends CraftLootable implement @Override public CraftDispenser copy() { - return new CraftDispenser(this); + return new CraftDispenser(this, null); + } + + @Override + public CraftDispenser copy(Location location) { + return new CraftDispenser(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftDropper.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftDropper.java index c8a9dd8372..98f5935573 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftDropper.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftDropper.java @@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.BlockDropper; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.TileEntityDropper; +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Block; @@ -17,8 +18,8 @@ public class CraftDropper extends CraftLootable implements Dr super(world, tileEntity); } - protected CraftDropper(CraftDropper state) { - super(state); + protected CraftDropper(CraftDropper state, Location location) { + super(state, location); } @Override @@ -49,6 +50,11 @@ public class CraftDropper extends CraftLootable implements Dr @Override public CraftDropper copy() { - return new CraftDropper(this); + return new CraftDropper(this, null); + } + + @Override + public CraftDropper copy(Location location) { + return new CraftDropper(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEnchantingTable.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEnchantingTable.java index d8ab94b8ce..87613252f6 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEnchantingTable.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEnchantingTable.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.entity.TileEntityEnchantTable; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.EnchantingTable; import org.bukkit.craftbukkit.util.CraftChatMessage; @@ -11,8 +12,8 @@ public class CraftEnchantingTable extends CraftBlockEntityState super(world, tileEntity); } - protected CraftEndGateway(CraftEndGateway state) { - super(state); + protected CraftEndGateway(CraftEndGateway state, Location location) { + super(state, location); } @Override @@ -66,6 +66,11 @@ public class CraftEndGateway extends CraftBlockEntityState @Override public CraftEndGateway copy() { - return new CraftEndGateway(this); + return new CraftEndGateway(this, null); + } + + @Override + public CraftEndGateway copy(Location location) { + return new CraftEndGateway(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEndPortal.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEndPortal.java index 29d8ef3b10..38787ce4d2 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEndPortal.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEndPortal.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.entity.TileEntityEnderPortal; +import org.bukkit.Location; import org.bukkit.World; public class CraftEndPortal extends CraftBlockEntityState { @@ -9,12 +10,17 @@ public class CraftEndPortal extends CraftBlockEntityState super(world, tileEntity); } - protected CraftEndPortal(CraftEndPortal state) { - super(state); + protected CraftEndPortal(CraftEndPortal state, Location location) { + super(state, location); } @Override public CraftEndPortal copy() { - return new CraftEndPortal(this); + return new CraftEndPortal(this, null); + } + + @Override + public CraftEndPortal copy(Location location) { + return new CraftEndPortal(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java index 0c4fd5a0f0..746d23c01d 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftEnderChest.java @@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.entity.TileEntityEnderChest; import net.minecraft.world.level.block.state.IBlockData; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.EnderChest; @@ -11,8 +12,8 @@ public class CraftEnderChest extends CraftBlockEntityState super(world, tileEntity); } - protected CraftEnderChest(CraftEnderChest state) { - super(state); + protected CraftEnderChest(CraftEnderChest state, Location location) { + super(state, location); } @Override @@ -43,6 +44,11 @@ public class CraftEnderChest extends CraftBlockEntityState @Override public CraftEnderChest copy() { - return new CraftEnderChest(this); + return new CraftEnderChest(this, null); + } + + @Override + public CraftEnderChest copy(Location location) { + return new CraftEnderChest(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java index 8e4db069b7..905db9fbd5 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftFurnace.java @@ -6,6 +6,7 @@ import net.minecraft.resources.MinecraftKey; import net.minecraft.world.level.block.BlockFurnace; import net.minecraft.world.level.block.entity.TileEntityFurnace; import org.bukkit.Bukkit; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Furnace; import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace; @@ -20,8 +21,8 @@ public abstract class CraftFurnace extends CraftCon super(world, tileEntity); } - protected CraftFurnace(CraftFurnace state) { - super(state); + protected CraftFurnace(CraftFurnace state, Location location) { + super(state, location); } @Override @@ -85,4 +86,7 @@ public abstract class CraftFurnace extends CraftCon @Override public abstract CraftFurnace copy(); + + @Override + public abstract CraftFurnace copy(Location location); } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftFurnaceFurnace.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftFurnaceFurnace.java index 60e36850db..8776d39456 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftFurnaceFurnace.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftFurnaceFurnace.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.entity.TileEntityFurnaceFurnace; +import org.bukkit.Location; import org.bukkit.World; public class CraftFurnaceFurnace extends CraftFurnace { @@ -9,12 +10,17 @@ public class CraftFurnaceFurnace extends CraftFurnace super(world, tileEntity); } - protected CraftFurnaceFurnace(CraftFurnaceFurnace state) { - super(state); + protected CraftFurnaceFurnace(CraftFurnaceFurnace state, Location location) { + super(state, location); } @Override public CraftFurnaceFurnace copy() { - return new CraftFurnaceFurnace(this); + return new CraftFurnaceFurnace(this, null); + } + + @Override + public CraftFurnaceFurnace copy(Location location) { + return new CraftFurnaceFurnace(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftHangingSign.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftHangingSign.java index 19ae36483c..27b38321f9 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftHangingSign.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftHangingSign.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.entity.HangingSignBlockEntity; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.HangingSign; @@ -10,12 +11,17 @@ public class CraftHangingSign extends CraftSign implemen super(world, tileEntity); } - protected CraftHangingSign(CraftHangingSign state) { - super(state); + protected CraftHangingSign(CraftHangingSign state, Location location) { + super(state, location); } @Override public CraftHangingSign copy() { - return new CraftHangingSign(this); + return new CraftHangingSign(this, null); + } + + @Override + public CraftHangingSign copy(Location location) { + return new CraftHangingSign(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java index bb9f6005d2..70bc3338d9 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftHopper.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.entity.TileEntityHopper; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Hopper; import org.bukkit.craftbukkit.inventory.CraftInventory; @@ -12,8 +13,8 @@ public class CraftHopper extends CraftLootable implements Hopp super(world, tileEntity); } - protected CraftHopper(CraftHopper state) { - super(state); + protected CraftHopper(CraftHopper state, Location location) { + super(state, location); } @Override @@ -32,6 +33,11 @@ public class CraftHopper extends CraftLootable implements Hopp @Override public CraftHopper copy() { - return new CraftHopper(this); + return new CraftHopper(this, null); + } + + @Override + public CraftHopper copy(Location location) { + return new CraftHopper(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftJigsaw.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftJigsaw.java index 43549465e0..3a98aac04d 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftJigsaw.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftJigsaw.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.entity.TileEntityJigsaw; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Jigsaw; @@ -10,12 +11,17 @@ public class CraftJigsaw extends CraftBlockEntityState impleme super(world, tileEntity); } - protected CraftJigsaw(CraftJigsaw state) { - super(state); + protected CraftJigsaw(CraftJigsaw state, Location location) { + super(state, location); } @Override public CraftJigsaw copy() { - return new CraftJigsaw(this); + return new CraftJigsaw(this, null); + } + + @Override + public CraftJigsaw copy(Location location) { + return new CraftJigsaw(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java index 3906fa6f2a..841c1f92b9 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftJukebox.java @@ -5,6 +5,7 @@ import net.minecraft.world.level.block.BlockJukeBox; import net.minecraft.world.level.block.entity.TileEntity; import net.minecraft.world.level.block.entity.TileEntityJukeBox; import org.bukkit.Effect; +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Jukebox; @@ -20,8 +21,8 @@ public class CraftJukebox extends CraftBlockEntityState imple super(world, tileEntity); } - protected CraftJukebox(CraftJukebox state) { - super(state); + protected CraftJukebox(CraftJukebox state, Location location) { + super(state, location); } @Override @@ -154,6 +155,11 @@ public class CraftJukebox extends CraftBlockEntityState imple @Override public CraftJukebox copy() { - return new CraftJukebox(this); + return new CraftJukebox(this, null); + } + + @Override + public CraftJukebox copy(Location location) { + return new CraftJukebox(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftLectern.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftLectern.java index 3e99941ab1..76c11ad34b 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftLectern.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftLectern.java @@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.BlockLectern; import net.minecraft.world.level.block.entity.TileEntityLectern; +import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.World; import org.bukkit.block.Lectern; @@ -14,8 +15,8 @@ public class CraftLectern extends CraftBlockEntityState imple super(world, tileEntity); } - protected CraftLectern(CraftLectern state) { - super(state); + protected CraftLectern(CraftLectern state, Location location) { + super(state, location); } @Override @@ -55,6 +56,11 @@ public class CraftLectern extends CraftBlockEntityState imple @Override public CraftLectern copy() { - return new CraftLectern(this); + return new CraftLectern(this, null); + } + + @Override + public CraftLectern copy(Location location) { + return new CraftLectern(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java index 2b96471da0..6714e7fa16 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftLootable.java @@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.resources.MinecraftKey; import net.minecraft.world.level.block.entity.TileEntityLootable; import org.bukkit.Bukkit; +import org.bukkit.Location; import org.bukkit.Nameable; import org.bukkit.World; import org.bukkit.craftbukkit.util.CraftNamespacedKey; @@ -15,8 +16,8 @@ public abstract class CraftLootable extends CraftC super(world, tileEntity); } - protected CraftLootable(CraftLootable state) { - super(state); + protected CraftLootable(CraftLootable state, Location location) { + super(state, location); } @Override @@ -60,4 +61,7 @@ public abstract class CraftLootable extends CraftC @Override public abstract CraftLootable copy(); + + @Override + public abstract CraftLootable copy(Location location); } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftMovingPiston.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftMovingPiston.java index a94a647b56..cd4e2ef9c5 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftMovingPiston.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftMovingPiston.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.piston.TileEntityPiston; +import org.bukkit.Location; import org.bukkit.World; public class CraftMovingPiston extends CraftBlockEntityState { @@ -9,12 +10,17 @@ public class CraftMovingPiston extends CraftBlockEntityState { super(world, tileEntity); } - protected CraftMovingPiston(CraftMovingPiston state) { - super(state); + protected CraftMovingPiston(CraftMovingPiston state, Location location) { + super(state, location); } @Override public CraftMovingPiston copy() { - return new CraftMovingPiston(this); + return new CraftMovingPiston(this, null); + } + + @Override + public CraftMovingPiston copy(Location location) { + return new CraftMovingPiston(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSculkCatalyst.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSculkCatalyst.java index d0eb52ef01..dfc0c52f0a 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSculkCatalyst.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSculkCatalyst.java @@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.block; import com.google.common.base.Preconditions; import net.minecraft.core.BlockPosition; import net.minecraft.world.level.block.entity.SculkCatalystBlockEntity; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.SculkCatalyst; @@ -13,8 +14,8 @@ public class CraftSculkCatalyst extends CraftBlockEntityState extends CraftBlo super(world, tileEntity); } - protected CraftSculkSensor(CraftSculkSensor state) { - super(state); + protected CraftSculkSensor(CraftSculkSensor state, Location location) { + super(state, location); } @Override @@ -28,6 +29,11 @@ public class CraftSculkSensor extends CraftBlo @Override public CraftSculkSensor copy() { - return new CraftSculkSensor<>(this); + return new CraftSculkSensor<>(this, null); + } + + @Override + public CraftSculkSensor copy(Location location) { + return new CraftSculkSensor<>(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSculkShrieker.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSculkShrieker.java index 2bff19c73b..af97c980b8 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSculkShrieker.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSculkShrieker.java @@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.server.level.EntityPlayer; import net.minecraft.world.level.block.entity.SculkShriekerBlockEntity; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.SculkShrieker; import org.bukkit.craftbukkit.entity.CraftPlayer; @@ -13,8 +14,8 @@ public class CraftSculkShrieker extends CraftBlockEntityState impleme super(world, tileEntity); } - protected CraftShulkerBox(CraftShulkerBox state) { - super(state); + protected CraftShulkerBox(CraftShulkerBox state, Location location) { + super(state, location); } @Override @@ -66,6 +67,11 @@ public class CraftShulkerBox extends CraftLootable impleme @Override public CraftShulkerBox copy() { - return new CraftShulkerBox(this); + return new CraftShulkerBox(this, null); + } + + @Override + public CraftShulkerBox copy(Location location) { + return new CraftShulkerBox(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java index 19830d02af..ae670045b9 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSign.java @@ -6,6 +6,7 @@ import net.minecraft.network.chat.IChatBaseComponent; import net.minecraft.world.level.block.entity.TileEntitySign; import org.bukkit.Bukkit; import org.bukkit.DyeColor; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Sign; import org.bukkit.block.sign.Side; @@ -29,8 +30,8 @@ public class CraftSign extends CraftBlockEntityState state) { - super(state); + protected CraftSign(CraftSign state, Location location) { + super(state, location); this.front = new CraftSignSide(this.getSnapshot().getFrontText()); this.back = new CraftSignSide(this.getSnapshot().getBackText()); } @@ -136,7 +137,12 @@ public class CraftSign extends CraftBlockEntityState copy() { - return new CraftSign(this); + return new CraftSign(this, null); + } + + @Override + public CraftSign copy(Location location) { + return new CraftSign(this, location); } public static void openSign(Sign sign, Player player, Side side) { diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java index 2702d98077..d8bbc75ac0 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java @@ -7,6 +7,7 @@ import net.minecraft.resources.MinecraftKey; import net.minecraft.server.MinecraftServer; import net.minecraft.world.level.block.entity.TileEntitySkull; import org.bukkit.Bukkit; +import org.bukkit.Location; import org.bukkit.NamespacedKey; import org.bukkit.OfflinePlayer; import org.bukkit.SkullType; @@ -31,8 +32,8 @@ public class CraftSkull extends CraftBlockEntityState implement super(world, tileEntity); } - protected CraftSkull(CraftSkull state) { - super(state); + protected CraftSkull(CraftSkull state, Location location) { + super(state, location); } @Override @@ -206,6 +207,11 @@ public class CraftSkull extends CraftBlockEntityState implement @Override public CraftSkull copy() { - return new CraftSkull(this); + return new CraftSkull(this, null); + } + + @Override + public CraftSkull copy(Location location) { + return new CraftSkull(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSmoker.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSmoker.java index fbb431468e..aa5d93931c 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSmoker.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftSmoker.java @@ -1,6 +1,7 @@ package org.bukkit.craftbukkit.block; import net.minecraft.world.level.block.entity.TileEntitySmoker; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Smoker; @@ -10,12 +11,17 @@ public class CraftSmoker extends CraftFurnace implements Smoke super(world, tileEntity); } - protected CraftSmoker(CraftSmoker state) { - super(state); + protected CraftSmoker(CraftSmoker state, Location location) { + super(state, location); } @Override public CraftSmoker copy() { - return new CraftSmoker(this); + return new CraftSmoker(this, null); + } + + @Override + public CraftSmoker copy(Location location) { + return new CraftSmoker(this, location); } } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftStructureBlock.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftStructureBlock.java index 9b39a73807..3bde3b7b1a 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftStructureBlock.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftStructureBlock.java @@ -5,6 +5,7 @@ import net.minecraft.world.level.block.EnumBlockMirror; import net.minecraft.world.level.block.EnumBlockRotation; import net.minecraft.world.level.block.entity.TileEntityStructure; import net.minecraft.world.level.block.state.properties.BlockPropertyStructureMode; +import org.bukkit.Location; import org.bukkit.World; import org.bukkit.block.Structure; import org.bukkit.block.structure.Mirror; @@ -23,8 +24,8 @@ public class CraftStructureBlock extends CraftBlockEntityState