#1363: Add API to copy BlockState to a new Location

By: lbenav8095 <lubensaico@gmail.com>
This commit is contained in:
CraftBukkit/Spigot 2024-04-07 12:22:10 +10:00
parent f2f79d2380
commit f127f9030d
49 changed files with 435 additions and 147 deletions

View file

@ -8,6 +8,7 @@ import net.minecraft.world.level.GeneratorAccessSeed;
import net.minecraft.world.level.World; import net.minecraft.world.level.World;
import net.minecraft.world.level.block.entity.TileEntity; import net.minecraft.world.level.block.entity.TileEntity;
import net.minecraft.world.level.block.entity.TileEntityBeehive; import net.minecraft.world.level.block.entity.TileEntityBeehive;
import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.BlockState; import org.bukkit.block.BlockState;
@ -23,9 +24,8 @@ public final class CapturedBlockState extends CraftBlockState {
this.treeBlock = treeBlock; this.treeBlock = treeBlock;
} }
protected CapturedBlockState(CapturedBlockState state) { protected CapturedBlockState(CapturedBlockState state, Location location) {
super(state); super(state, location);
this.treeBlock = state.treeBlock; this.treeBlock = state.treeBlock;
} }
@ -74,7 +74,12 @@ public final class CapturedBlockState extends CraftBlockState {
@Override @Override
public CapturedBlockState copy() { 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) { public static CapturedBlockState getBlockState(World world, BlockPosition pos, int flag) {

View file

@ -9,6 +9,7 @@ import net.minecraft.world.item.EnumColor;
import net.minecraft.world.level.block.BlockBannerAbstract; import net.minecraft.world.level.block.BlockBannerAbstract;
import net.minecraft.world.level.block.entity.TileEntityBanner; import net.minecraft.world.level.block.entity.TileEntityBanner;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Banner; import org.bukkit.block.Banner;
import org.bukkit.block.banner.Pattern; import org.bukkit.block.banner.Pattern;
@ -23,8 +24,8 @@ public class CraftBanner extends CraftBlockEntityState<TileEntityBanner> impleme
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftBanner(CraftBanner state) { protected CraftBanner(CraftBanner state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -107,6 +108,11 @@ public class CraftBanner extends CraftBlockEntityState<TileEntityBanner> impleme
@Override @Override
public CraftBanner copy() { public CraftBanner copy() {
return new CraftBanner(this); return new CraftBanner(this, null);
}
@Override
public CraftBanner copy(Location location) {
return new CraftBanner(this, location);
} }
} }

View file

@ -4,6 +4,7 @@ import net.minecraft.sounds.SoundEffects;
import net.minecraft.world.level.block.BlockBarrel; import net.minecraft.world.level.block.BlockBarrel;
import net.minecraft.world.level.block.entity.TileEntityBarrel; import net.minecraft.world.level.block.entity.TileEntityBarrel;
import net.minecraft.world.level.block.state.IBlockData; import net.minecraft.world.level.block.state.IBlockData;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Barrel; import org.bukkit.block.Barrel;
import org.bukkit.craftbukkit.inventory.CraftInventory; import org.bukkit.craftbukkit.inventory.CraftInventory;
@ -15,8 +16,8 @@ public class CraftBarrel extends CraftLootable<TileEntityBarrel> implements Barr
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftBarrel(CraftBarrel state) { protected CraftBarrel(CraftBarrel state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -65,6 +66,11 @@ public class CraftBarrel extends CraftLootable<TileEntityBarrel> implements Barr
@Override @Override
public CraftBarrel copy() { public CraftBarrel copy() {
return new CraftBarrel(this); return new CraftBarrel(this, null);
}
@Override
public CraftBarrel copy(Location location) {
return new CraftBarrel(this, location);
} }
} }

View file

@ -6,6 +6,7 @@ import net.minecraft.world.ChestLock;
import net.minecraft.world.entity.player.EntityHuman; import net.minecraft.world.entity.player.EntityHuman;
import net.minecraft.world.level.block.entity.TileEntity; import net.minecraft.world.level.block.entity.TileEntity;
import net.minecraft.world.level.block.entity.TileEntityBeacon; import net.minecraft.world.level.block.entity.TileEntityBeacon;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Beacon; import org.bukkit.block.Beacon;
import org.bukkit.craftbukkit.potion.CraftPotionEffectType; import org.bukkit.craftbukkit.potion.CraftPotionEffectType;
@ -20,8 +21,8 @@ public class CraftBeacon extends CraftBlockEntityState<TileEntityBeacon> impleme
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftBeacon(CraftBeacon state) { protected CraftBeacon(CraftBeacon state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -99,6 +100,11 @@ public class CraftBeacon extends CraftBlockEntityState<TileEntityBeacon> impleme
@Override @Override
public CraftBeacon copy() { public CraftBeacon copy() {
return new CraftBeacon(this); return new CraftBeacon(this, null);
}
@Override
public CraftBeacon copy(Location location) {
return new CraftBeacon(this, location);
} }
} }

View file

@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.TileEntityBed; import net.minecraft.world.level.block.entity.TileEntityBed;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Bed; import org.bukkit.block.Bed;
@ -11,8 +12,8 @@ public class CraftBed extends CraftBlockEntityState<TileEntityBed> implements Be
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftBed(CraftBed state) { protected CraftBed(CraftBed state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -62,6 +63,11 @@ public class CraftBed extends CraftBlockEntityState<TileEntityBed> implements Be
@Override @Override
public CraftBed copy() { public CraftBed copy() {
return new CraftBed(this); return new CraftBed(this, null);
}
@Override
public CraftBed copy(Location location) {
return new CraftBed(this, location);
} }
} }

View file

@ -20,8 +20,8 @@ public class CraftBeehive extends CraftBlockEntityState<TileEntityBeehive> imple
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftBeehive(CraftBeehive state) { protected CraftBeehive(CraftBeehive state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -88,6 +88,11 @@ public class CraftBeehive extends CraftBlockEntityState<TileEntityBeehive> imple
@Override @Override
public CraftBeehive copy() { public CraftBeehive copy() {
return new CraftBeehive(this); return new CraftBeehive(this, null);
}
@Override
public CraftBeehive copy(Location location) {
return new CraftBeehive(this, location);
} }
} }

View file

@ -6,6 +6,7 @@ import net.minecraft.world.level.block.BlockBell;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.entity.TileEntity; import net.minecraft.world.level.block.entity.TileEntity;
import net.minecraft.world.level.block.entity.TileEntityBell; import net.minecraft.world.level.block.entity.TileEntityBell;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Bell; import org.bukkit.block.Bell;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
@ -18,8 +19,8 @@ public class CraftBell extends CraftBlockEntityState<TileEntityBell> implements
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftBell(CraftBell state) { protected CraftBell(CraftBell state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -74,6 +75,11 @@ public class CraftBell extends CraftBlockEntityState<TileEntityBell> implements
@Override @Override
public CraftBell copy() { public CraftBell copy() {
return new CraftBell(this); return new CraftBell(this, null);
}
@Override
public CraftBell copy(Location location) {
return new CraftBell(this, location);
} }
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.TileEntityBlastFurnace; import net.minecraft.world.level.block.entity.TileEntityBlastFurnace;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.BlastFurnace; import org.bukkit.block.BlastFurnace;
@ -10,12 +11,17 @@ public class CraftBlastFurnace extends CraftFurnace<TileEntityBlastFurnace> impl
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftBlastFurnace(CraftBlastFurnace state) { protected CraftBlastFurnace(CraftBlastFurnace state, Location location) {
super(state); super(state, location);
} }
@Override @Override
public CraftBlastFurnace copy() { public CraftBlastFurnace copy() {
return new CraftBlastFurnace(this); return new CraftBlastFurnace(this, null);
}
@Override
public CraftBlastFurnace copy(Location location) {
return new CraftBlastFurnace(this, location);
} }
} }

View file

@ -28,8 +28,8 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
this.load(snapshot); this.load(snapshot);
} }
protected CraftBlockEntityState(CraftBlockEntityState<T> state) { protected CraftBlockEntityState(CraftBlockEntityState<T> state, Location location) {
super(state); super(state, location);
this.tileEntity = createSnapshot(state.snapshot); this.tileEntity = createSnapshot(state.snapshot);
this.snapshot = tileEntity; this.snapshot = tileEntity;
loadData(state.getSnapshotNBT()); loadData(state.getSnapshotNBT());
@ -134,6 +134,11 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
@Override @Override
public CraftBlockEntityState<T> copy() { public CraftBlockEntityState<T> copy() {
return new CraftBlockEntityState<>(this); return new CraftBlockEntityState<>(this, null);
}
@Override
public CraftBlockEntityState<T> copy(Location location) {
return new CraftBlockEntityState<>(this, location);
} }
} }

View file

@ -50,10 +50,15 @@ public class CraftBlockState implements BlockState {
data = blockData; data = blockData;
} }
// Creates a unplaced copy (world == null copy) // Creates an unplaced copy of the given CraftBlockState at the given location
protected CraftBlockState(CraftBlockState state) { protected CraftBlockState(CraftBlockState state, @Nullable Location location) {
if (location == null) {
this.world = null; this.world = null;
this.position = state.getPosition().immutable(); this.position = state.getPosition().immutable();
} else {
this.world = (CraftWorld) location.getWorld();
this.position = CraftLocation.toBlockPosition(location);
}
this.data = state.data; this.data = state.data;
this.flag = state.flag; this.flag = state.flag;
setWorldHandle(state.getWorldHandle()); setWorldHandle(state.getWorldHandle());
@ -330,6 +335,11 @@ public class CraftBlockState implements BlockState {
@Override @Override
public CraftBlockState copy() { public CraftBlockState copy() {
return new CraftBlockState(this); return new CraftBlockState(this, null);
}
@Override
public BlockState copy(Location location) {
return new CraftBlockState(this, location);
} }
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.TileEntityBrewingStand; import net.minecraft.world.level.block.entity.TileEntityBrewingStand;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.BrewingStand; import org.bukkit.block.BrewingStand;
import org.bukkit.craftbukkit.inventory.CraftInventoryBrewer; import org.bukkit.craftbukkit.inventory.CraftInventoryBrewer;
@ -12,8 +13,8 @@ public class CraftBrewingStand extends CraftContainer<TileEntityBrewingStand> im
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftBrewingStand(CraftBrewingStand state) { protected CraftBrewingStand(CraftBrewingStand state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -52,6 +53,11 @@ public class CraftBrewingStand extends CraftContainer<TileEntityBrewingStand> im
@Override @Override
public CraftBrewingStand copy() { public CraftBrewingStand copy() {
return new CraftBrewingStand(this); return new CraftBrewingStand(this, null);
}
@Override
public CraftBrewingStand copy(Location location) {
return new CraftBrewingStand(this, location);
} }
} }

View file

@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.block;
import net.minecraft.resources.MinecraftKey; import net.minecraft.resources.MinecraftKey;
import net.minecraft.world.level.block.entity.BrushableBlockEntity; import net.minecraft.world.level.block.entity.BrushableBlockEntity;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.BrushableBlock; import org.bukkit.block.BrushableBlock;
import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.inventory.CraftItemStack;
@ -16,8 +17,8 @@ public class CraftBrushableBlock extends CraftBlockEntityState<BrushableBlockEnt
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftBrushableBlock(CraftBrushableBlock state) { protected CraftBrushableBlock(CraftBrushableBlock state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -71,6 +72,11 @@ public class CraftBrushableBlock extends CraftBlockEntityState<BrushableBlockEnt
@Override @Override
public CraftBrushableBlock copy() { public CraftBrushableBlock copy() {
return new CraftBrushableBlock(this); return new CraftBrushableBlock(this, null);
}
@Override
public CraftBrushableBlock copy(Location location) {
return new CraftBrushableBlock(this, location);
} }
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.CalibratedSculkSensorBlockEntity; import net.minecraft.world.level.block.entity.CalibratedSculkSensorBlockEntity;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.CalibratedSculkSensor; import org.bukkit.block.CalibratedSculkSensor;
@ -10,12 +11,17 @@ public class CraftCalibratedSculkSensor extends CraftSculkSensor<CalibratedSculk
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftCalibratedSculkSensor(CraftCalibratedSculkSensor state) { protected CraftCalibratedSculkSensor(CraftCalibratedSculkSensor state, Location location) {
super(state); super(state, location);
} }
@Override @Override
public CraftCalibratedSculkSensor copy() { public CraftCalibratedSculkSensor copy() {
return new CraftCalibratedSculkSensor(this); return new CraftCalibratedSculkSensor(this, null);
}
@Override
public CraftCalibratedSculkSensor copy(Location location) {
return new CraftCalibratedSculkSensor(this, location);
} }
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.TileEntityCampfire; import net.minecraft.world.level.block.entity.TileEntityCampfire;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Campfire; import org.bukkit.block.Campfire;
import org.bukkit.craftbukkit.inventory.CraftItemStack; import org.bukkit.craftbukkit.inventory.CraftItemStack;
@ -12,8 +13,8 @@ public class CraftCampfire extends CraftBlockEntityState<TileEntityCampfire> imp
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftCampfire(CraftCampfire state) { protected CraftCampfire(CraftCampfire state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -54,6 +55,11 @@ public class CraftCampfire extends CraftBlockEntityState<TileEntityCampfire> imp
@Override @Override
public CraftCampfire copy() { public CraftCampfire copy() {
return new CraftCampfire(this); return new CraftCampfire(this, null);
}
@Override
public CraftCampfire copy(Location location) {
return new CraftCampfire(this, location);
} }
} }

View file

@ -5,6 +5,7 @@ import net.minecraft.world.level.block.BlockChest;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.entity.TileEntityChest; import net.minecraft.world.level.block.entity.TileEntityChest;
import net.minecraft.world.level.block.state.IBlockData; import net.minecraft.world.level.block.state.IBlockData;
import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Chest; import org.bukkit.block.Chest;
@ -19,8 +20,8 @@ public class CraftChest extends CraftLootable<TileEntityChest> implements Chest
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftChest(CraftChest state) { protected CraftChest(CraftChest state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -84,6 +85,11 @@ public class CraftChest extends CraftLootable<TileEntityChest> implements Chest
@Override @Override
public CraftChest copy() { public CraftChest copy() {
return new CraftChest(this); return new CraftChest(this, null);
}
@Override
public CraftChest copy(Location location) {
return new CraftChest(this, location);
} }
} }

View file

@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.ChiseledBookShelfBlock; import net.minecraft.world.level.block.ChiseledBookShelfBlock;
import net.minecraft.world.level.block.entity.ChiseledBookShelfBlockEntity; import net.minecraft.world.level.block.entity.ChiseledBookShelfBlockEntity;
import net.minecraft.world.phys.Vec2F; import net.minecraft.world.phys.Vec2F;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.BlockFace; import org.bukkit.block.BlockFace;
import org.bukkit.block.ChiseledBookshelf; import org.bukkit.block.ChiseledBookshelf;
@ -17,8 +18,8 @@ public class CraftChiseledBookshelf extends CraftBlockEntityState<ChiseledBookSh
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftChiseledBookshelf(CraftChiseledBookshelf state) { protected CraftChiseledBookshelf(CraftChiseledBookshelf state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -74,6 +75,11 @@ public class CraftChiseledBookshelf extends CraftBlockEntityState<ChiseledBookSh
@Override @Override
public CraftChiseledBookshelf copy() { public CraftChiseledBookshelf copy() {
return new CraftChiseledBookshelf(this); return new CraftChiseledBookshelf(this, null);
}
@Override
public CraftChiseledBookshelf copy(Location location) {
return new CraftChiseledBookshelf(this, location);
} }
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.TileEntityCommand; import net.minecraft.world.level.block.entity.TileEntityCommand;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.CommandBlock; import org.bukkit.block.CommandBlock;
import org.bukkit.craftbukkit.util.CraftChatMessage; import org.bukkit.craftbukkit.util.CraftChatMessage;
@ -11,8 +12,8 @@ public class CraftCommandBlock extends CraftBlockEntityState<TileEntityCommand>
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftCommandBlock(CraftCommandBlock state) { protected CraftCommandBlock(CraftCommandBlock state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -37,6 +38,11 @@ public class CraftCommandBlock extends CraftBlockEntityState<TileEntityCommand>
@Override @Override
public CraftCommandBlock copy() { public CraftCommandBlock copy() {
return new CraftCommandBlock(this); return new CraftCommandBlock(this, null);
}
@Override
public CraftCommandBlock copy(Location location) {
return new CraftCommandBlock(this, location);
} }
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.TileEntityComparator; import net.minecraft.world.level.block.entity.TileEntityComparator;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Comparator; import org.bukkit.block.Comparator;
@ -10,12 +11,17 @@ public class CraftComparator extends CraftBlockEntityState<TileEntityComparator>
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftComparator(CraftComparator state) { protected CraftComparator(CraftComparator state, Location location) {
super(state); super(state, location);
} }
@Override @Override
public CraftComparator copy() { public CraftComparator copy() {
return new CraftComparator(this); return new CraftComparator(this, null);
}
@Override
public CraftComparator copy(Location location) {
return new CraftComparator(this, location);
} }
} }

View file

@ -6,6 +6,7 @@ import net.minecraft.core.BlockPosition;
import net.minecraft.world.entity.EntityLiving; import net.minecraft.world.entity.EntityLiving;
import net.minecraft.world.level.block.entity.TileEntityConduit; import net.minecraft.world.level.block.entity.TileEntityConduit;
import net.minecraft.world.phys.AxisAlignedBB; import net.minecraft.world.phys.AxisAlignedBB;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.Conduit; import org.bukkit.block.Conduit;
@ -19,13 +20,18 @@ public class CraftConduit extends CraftBlockEntityState<TileEntityConduit> imple
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftConduit(CraftConduit state) { protected CraftConduit(CraftConduit state, Location location) {
super(state); super(state, location);
} }
@Override @Override
public CraftConduit copy() { public CraftConduit copy() {
return new CraftConduit(this); return new CraftConduit(this, null);
}
@Override
public CraftConduit copy(Location location) {
return new CraftConduit(this, location);
} }
@Override @Override

View file

@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.block;
import net.minecraft.world.ChestLock; import net.minecraft.world.ChestLock;
import net.minecraft.world.level.block.entity.TileEntityContainer; import net.minecraft.world.level.block.entity.TileEntityContainer;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Container; import org.bukkit.block.Container;
import org.bukkit.craftbukkit.util.CraftChatMessage; import org.bukkit.craftbukkit.util.CraftChatMessage;
@ -12,8 +13,8 @@ public abstract class CraftContainer<T extends TileEntityContainer> extends Craf
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftContainer(CraftContainer<T> state) { protected CraftContainer(CraftContainer<T> state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -53,4 +54,7 @@ public abstract class CraftContainer<T extends TileEntityContainer> extends Craf
@Override @Override
public abstract CraftContainer<T> copy(); public abstract CraftContainer<T> copy();
@Override
public abstract CraftContainer<T> copy(Location location);
} }

View file

@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.block;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import net.minecraft.world.level.block.entity.CrafterBlockEntity; import net.minecraft.world.level.block.entity.CrafterBlockEntity;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Crafter; import org.bukkit.block.Crafter;
import org.bukkit.craftbukkit.inventory.CraftInventory; import org.bukkit.craftbukkit.inventory.CraftInventory;
@ -13,8 +14,8 @@ public class CraftCrafter extends CraftLootable<CrafterBlockEntity> implements C
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftCrafter(CraftCrafter state) { protected CraftCrafter(CraftCrafter state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -33,7 +34,12 @@ public class CraftCrafter extends CraftLootable<CrafterBlockEntity> implements C
@Override @Override
public CraftCrafter copy() { public CraftCrafter copy() {
return new CraftCrafter(this); return new CraftCrafter(this, null);
}
@Override
public CraftCrafter copy(Location location) {
return new CraftCrafter(this, location);
} }
@Override @Override

View file

@ -13,6 +13,7 @@ import net.minecraft.util.random.WeightedEntry.b;
import net.minecraft.world.entity.EntityTypes; import net.minecraft.world.entity.EntityTypes;
import net.minecraft.world.level.MobSpawnerData; import net.minecraft.world.level.MobSpawnerData;
import net.minecraft.world.level.block.entity.TileEntityMobSpawner; import net.minecraft.world.level.block.entity.TileEntityMobSpawner;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.CreatureSpawner; import org.bukkit.block.CreatureSpawner;
import org.bukkit.block.spawner.SpawnRule; import org.bukkit.block.spawner.SpawnRule;
@ -28,8 +29,8 @@ public class CraftCreatureSpawner extends CraftBlockEntityState<TileEntityMobSpa
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftCreatureSpawner(CraftCreatureSpawner state) { protected CraftCreatureSpawner(CraftCreatureSpawner state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -225,6 +226,11 @@ public class CraftCreatureSpawner extends CraftBlockEntityState<TileEntityMobSpa
@Override @Override
public CraftCreatureSpawner copy() { public CraftCreatureSpawner copy() {
return new CraftCreatureSpawner(this); return new CraftCreatureSpawner(this, null);
}
@Override
public CraftCreatureSpawner copy(Location location) {
return new CraftCreatureSpawner(this, location);
} }
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.TileEntityLightDetector; import net.minecraft.world.level.block.entity.TileEntityLightDetector;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.DaylightDetector; import org.bukkit.block.DaylightDetector;
@ -10,12 +11,17 @@ public class CraftDaylightDetector extends CraftBlockEntityState<TileEntityLight
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftDaylightDetector(CraftDaylightDetector state) { protected CraftDaylightDetector(CraftDaylightDetector state, Location location) {
super(state); super(state, location);
} }
@Override @Override
public CraftDaylightDetector copy() { public CraftDaylightDetector copy() {
return new CraftDaylightDetector(this); return new CraftDaylightDetector(this, null);
}
@Override
public CraftDaylightDetector copy(Location location) {
return new CraftDaylightDetector(this, location);
} }
} }

View file

@ -8,6 +8,7 @@ import java.util.stream.Collectors;
import net.minecraft.world.item.Item; import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items; import net.minecraft.world.item.Items;
import net.minecraft.world.level.block.entity.DecoratedPotBlockEntity; import net.minecraft.world.level.block.entity.DecoratedPotBlockEntity;
import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.Tag; import org.bukkit.Tag;
import org.bukkit.World; import org.bukkit.World;
@ -22,8 +23,8 @@ public class CraftDecoratedPot extends CraftBlockEntityState<DecoratedPotBlockEn
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftDecoratedPot(CraftDecoratedPot state) { protected CraftDecoratedPot(CraftDecoratedPot state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -92,6 +93,11 @@ public class CraftDecoratedPot extends CraftBlockEntityState<DecoratedPotBlockEn
@Override @Override
public CraftDecoratedPot copy() { public CraftDecoratedPot copy() {
return new CraftDecoratedPot(this); return new CraftDecoratedPot(this, null);
}
@Override
public CraftDecoratedPot copy(Location location) {
return new CraftDecoratedPot(this, location);
} }
} }

View file

@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.BlockDispenser; import net.minecraft.world.level.block.BlockDispenser;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.entity.TileEntityDispenser; import net.minecraft.world.level.block.entity.TileEntityDispenser;
import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -19,8 +20,8 @@ public class CraftDispenser extends CraftLootable<TileEntityDispenser> implement
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftDispenser(CraftDispenser state) { protected CraftDispenser(CraftDispenser state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -65,6 +66,11 @@ public class CraftDispenser extends CraftLootable<TileEntityDispenser> implement
@Override @Override
public CraftDispenser copy() { public CraftDispenser copy() {
return new CraftDispenser(this); return new CraftDispenser(this, null);
}
@Override
public CraftDispenser copy(Location location) {
return new CraftDispenser(this, location);
} }
} }

View file

@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.BlockDropper; import net.minecraft.world.level.block.BlockDropper;
import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.entity.TileEntityDropper; import net.minecraft.world.level.block.entity.TileEntityDropper;
import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
@ -17,8 +18,8 @@ public class CraftDropper extends CraftLootable<TileEntityDropper> implements Dr
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftDropper(CraftDropper state) { protected CraftDropper(CraftDropper state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -49,6 +50,11 @@ public class CraftDropper extends CraftLootable<TileEntityDropper> implements Dr
@Override @Override
public CraftDropper copy() { public CraftDropper copy() {
return new CraftDropper(this); return new CraftDropper(this, null);
}
@Override
public CraftDropper copy(Location location) {
return new CraftDropper(this, location);
} }
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.TileEntityEnchantTable; import net.minecraft.world.level.block.entity.TileEntityEnchantTable;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.EnchantingTable; import org.bukkit.block.EnchantingTable;
import org.bukkit.craftbukkit.util.CraftChatMessage; import org.bukkit.craftbukkit.util.CraftChatMessage;
@ -11,8 +12,8 @@ public class CraftEnchantingTable extends CraftBlockEntityState<TileEntityEnchan
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftEnchantingTable(CraftEnchantingTable state) { protected CraftEnchantingTable(CraftEnchantingTable state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -37,6 +38,11 @@ public class CraftEnchantingTable extends CraftBlockEntityState<TileEntityEnchan
@Override @Override
public CraftEnchantingTable copy() { public CraftEnchantingTable copy() {
return new CraftEnchantingTable(this); return new CraftEnchantingTable(this, null);
}
@Override
public CraftEnchantingTable copy(Location location) {
return new CraftEnchantingTable(this, location);
} }
} }

View file

@ -14,8 +14,8 @@ public class CraftEndGateway extends CraftBlockEntityState<TileEntityEndGateway>
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftEndGateway(CraftEndGateway state) { protected CraftEndGateway(CraftEndGateway state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -66,6 +66,11 @@ public class CraftEndGateway extends CraftBlockEntityState<TileEntityEndGateway>
@Override @Override
public CraftEndGateway copy() { public CraftEndGateway copy() {
return new CraftEndGateway(this); return new CraftEndGateway(this, null);
}
@Override
public CraftEndGateway copy(Location location) {
return new CraftEndGateway(this, location);
} }
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.TileEntityEnderPortal; import net.minecraft.world.level.block.entity.TileEntityEnderPortal;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
public class CraftEndPortal extends CraftBlockEntityState<TileEntityEnderPortal> { public class CraftEndPortal extends CraftBlockEntityState<TileEntityEnderPortal> {
@ -9,12 +10,17 @@ public class CraftEndPortal extends CraftBlockEntityState<TileEntityEnderPortal>
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftEndPortal(CraftEndPortal state) { protected CraftEndPortal(CraftEndPortal state, Location location) {
super(state); super(state, location);
} }
@Override @Override
public CraftEndPortal copy() { public CraftEndPortal copy() {
return new CraftEndPortal(this); return new CraftEndPortal(this, null);
}
@Override
public CraftEndPortal copy(Location location) {
return new CraftEndPortal(this, location);
} }
} }

View file

@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.TileEntityEnderChest; import net.minecraft.world.level.block.entity.TileEntityEnderChest;
import net.minecraft.world.level.block.state.IBlockData; import net.minecraft.world.level.block.state.IBlockData;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.EnderChest; import org.bukkit.block.EnderChest;
@ -11,8 +12,8 @@ public class CraftEnderChest extends CraftBlockEntityState<TileEntityEnderChest>
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftEnderChest(CraftEnderChest state) { protected CraftEnderChest(CraftEnderChest state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -43,6 +44,11 @@ public class CraftEnderChest extends CraftBlockEntityState<TileEntityEnderChest>
@Override @Override
public CraftEnderChest copy() { public CraftEnderChest copy() {
return new CraftEnderChest(this); return new CraftEnderChest(this, null);
}
@Override
public CraftEnderChest copy(Location location) {
return new CraftEnderChest(this, location);
} }
} }

View file

@ -6,6 +6,7 @@ import net.minecraft.resources.MinecraftKey;
import net.minecraft.world.level.block.BlockFurnace; import net.minecraft.world.level.block.BlockFurnace;
import net.minecraft.world.level.block.entity.TileEntityFurnace; import net.minecraft.world.level.block.entity.TileEntityFurnace;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Furnace; import org.bukkit.block.Furnace;
import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace; import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace;
@ -20,8 +21,8 @@ public abstract class CraftFurnace<T extends TileEntityFurnace> extends CraftCon
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftFurnace(CraftFurnace<T> state) { protected CraftFurnace(CraftFurnace<T> state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -85,4 +86,7 @@ public abstract class CraftFurnace<T extends TileEntityFurnace> extends CraftCon
@Override @Override
public abstract CraftFurnace<T> copy(); public abstract CraftFurnace<T> copy();
@Override
public abstract CraftFurnace<T> copy(Location location);
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.TileEntityFurnaceFurnace; import net.minecraft.world.level.block.entity.TileEntityFurnaceFurnace;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
public class CraftFurnaceFurnace extends CraftFurnace<TileEntityFurnaceFurnace> { public class CraftFurnaceFurnace extends CraftFurnace<TileEntityFurnaceFurnace> {
@ -9,12 +10,17 @@ public class CraftFurnaceFurnace extends CraftFurnace<TileEntityFurnaceFurnace>
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftFurnaceFurnace(CraftFurnaceFurnace state) { protected CraftFurnaceFurnace(CraftFurnaceFurnace state, Location location) {
super(state); super(state, location);
} }
@Override @Override
public CraftFurnaceFurnace copy() { public CraftFurnaceFurnace copy() {
return new CraftFurnaceFurnace(this); return new CraftFurnaceFurnace(this, null);
}
@Override
public CraftFurnaceFurnace copy(Location location) {
return new CraftFurnaceFurnace(this, location);
} }
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.HangingSignBlockEntity; import net.minecraft.world.level.block.entity.HangingSignBlockEntity;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.HangingSign; import org.bukkit.block.HangingSign;
@ -10,12 +11,17 @@ public class CraftHangingSign extends CraftSign<HangingSignBlockEntity> implemen
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftHangingSign(CraftHangingSign state) { protected CraftHangingSign(CraftHangingSign state, Location location) {
super(state); super(state, location);
} }
@Override @Override
public CraftHangingSign copy() { public CraftHangingSign copy() {
return new CraftHangingSign(this); return new CraftHangingSign(this, null);
}
@Override
public CraftHangingSign copy(Location location) {
return new CraftHangingSign(this, location);
} }
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.TileEntityHopper; import net.minecraft.world.level.block.entity.TileEntityHopper;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Hopper; import org.bukkit.block.Hopper;
import org.bukkit.craftbukkit.inventory.CraftInventory; import org.bukkit.craftbukkit.inventory.CraftInventory;
@ -12,8 +13,8 @@ public class CraftHopper extends CraftLootable<TileEntityHopper> implements Hopp
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftHopper(CraftHopper state) { protected CraftHopper(CraftHopper state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -32,6 +33,11 @@ public class CraftHopper extends CraftLootable<TileEntityHopper> implements Hopp
@Override @Override
public CraftHopper copy() { public CraftHopper copy() {
return new CraftHopper(this); return new CraftHopper(this, null);
}
@Override
public CraftHopper copy(Location location) {
return new CraftHopper(this, location);
} }
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.TileEntityJigsaw; import net.minecraft.world.level.block.entity.TileEntityJigsaw;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Jigsaw; import org.bukkit.block.Jigsaw;
@ -10,12 +11,17 @@ public class CraftJigsaw extends CraftBlockEntityState<TileEntityJigsaw> impleme
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftJigsaw(CraftJigsaw state) { protected CraftJigsaw(CraftJigsaw state, Location location) {
super(state); super(state, location);
} }
@Override @Override
public CraftJigsaw copy() { public CraftJigsaw copy() {
return new CraftJigsaw(this); return new CraftJigsaw(this, null);
}
@Override
public CraftJigsaw copy(Location location) {
return new CraftJigsaw(this, location);
} }
} }

View file

@ -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.TileEntity;
import net.minecraft.world.level.block.entity.TileEntityJukeBox; import net.minecraft.world.level.block.entity.TileEntityJukeBox;
import org.bukkit.Effect; import org.bukkit.Effect;
import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Jukebox; import org.bukkit.block.Jukebox;
@ -20,8 +21,8 @@ public class CraftJukebox extends CraftBlockEntityState<TileEntityJukeBox> imple
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftJukebox(CraftJukebox state) { protected CraftJukebox(CraftJukebox state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -154,6 +155,11 @@ public class CraftJukebox extends CraftBlockEntityState<TileEntityJukeBox> imple
@Override @Override
public CraftJukebox copy() { public CraftJukebox copy() {
return new CraftJukebox(this); return new CraftJukebox(this, null);
}
@Override
public CraftJukebox copy(Location location) {
return new CraftJukebox(this, location);
} }
} }

View file

@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.BlockLectern; import net.minecraft.world.level.block.BlockLectern;
import net.minecraft.world.level.block.entity.TileEntityLectern; import net.minecraft.world.level.block.entity.TileEntityLectern;
import org.bukkit.Location;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Lectern; import org.bukkit.block.Lectern;
@ -14,8 +15,8 @@ public class CraftLectern extends CraftBlockEntityState<TileEntityLectern> imple
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftLectern(CraftLectern state) { protected CraftLectern(CraftLectern state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -55,6 +56,11 @@ public class CraftLectern extends CraftBlockEntityState<TileEntityLectern> imple
@Override @Override
public CraftLectern copy() { public CraftLectern copy() {
return new CraftLectern(this); return new CraftLectern(this, null);
}
@Override
public CraftLectern copy(Location location) {
return new CraftLectern(this, location);
} }
} }

View file

@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.block;
import net.minecraft.resources.MinecraftKey; import net.minecraft.resources.MinecraftKey;
import net.minecraft.world.level.block.entity.TileEntityLootable; import net.minecraft.world.level.block.entity.TileEntityLootable;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Nameable; import org.bukkit.Nameable;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.craftbukkit.util.CraftNamespacedKey; import org.bukkit.craftbukkit.util.CraftNamespacedKey;
@ -15,8 +16,8 @@ public abstract class CraftLootable<T extends TileEntityLootable> extends CraftC
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftLootable(CraftLootable<T> state) { protected CraftLootable(CraftLootable<T> state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -60,4 +61,7 @@ public abstract class CraftLootable<T extends TileEntityLootable> extends CraftC
@Override @Override
public abstract CraftLootable<T> copy(); public abstract CraftLootable<T> copy();
@Override
public abstract CraftLootable<T> copy(Location location);
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.piston.TileEntityPiston; import net.minecraft.world.level.block.piston.TileEntityPiston;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
public class CraftMovingPiston extends CraftBlockEntityState<TileEntityPiston> { public class CraftMovingPiston extends CraftBlockEntityState<TileEntityPiston> {
@ -9,12 +10,17 @@ public class CraftMovingPiston extends CraftBlockEntityState<TileEntityPiston> {
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftMovingPiston(CraftMovingPiston state) { protected CraftMovingPiston(CraftMovingPiston state, Location location) {
super(state); super(state, location);
} }
@Override @Override
public CraftMovingPiston copy() { public CraftMovingPiston copy() {
return new CraftMovingPiston(this); return new CraftMovingPiston(this, null);
}
@Override
public CraftMovingPiston copy(Location location) {
return new CraftMovingPiston(this, location);
} }
} }

View file

@ -3,6 +3,7 @@ package org.bukkit.craftbukkit.block;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import net.minecraft.core.BlockPosition; import net.minecraft.core.BlockPosition;
import net.minecraft.world.level.block.entity.SculkCatalystBlockEntity; import net.minecraft.world.level.block.entity.SculkCatalystBlockEntity;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Block; import org.bukkit.block.Block;
import org.bukkit.block.SculkCatalyst; import org.bukkit.block.SculkCatalyst;
@ -13,8 +14,8 @@ public class CraftSculkCatalyst extends CraftBlockEntityState<SculkCatalystBlock
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftSculkCatalyst(CraftSculkCatalyst state) { protected CraftSculkCatalyst(CraftSculkCatalyst state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -30,6 +31,11 @@ public class CraftSculkCatalyst extends CraftBlockEntityState<SculkCatalystBlock
@Override @Override
public CraftSculkCatalyst copy() { public CraftSculkCatalyst copy() {
return new CraftSculkCatalyst(this); return new CraftSculkCatalyst(this, null);
}
@Override
public CraftSculkCatalyst copy(Location location) {
return new CraftSculkCatalyst(this, location);
} }
} }

View file

@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.block;
import com.google.common.base.Preconditions; import com.google.common.base.Preconditions;
import net.minecraft.world.level.block.entity.SculkSensorBlockEntity; import net.minecraft.world.level.block.entity.SculkSensorBlockEntity;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.SculkSensor; import org.bukkit.block.SculkSensor;
@ -11,8 +12,8 @@ public class CraftSculkSensor<T extends SculkSensorBlockEntity> extends CraftBlo
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftSculkSensor(CraftSculkSensor<T> state) { protected CraftSculkSensor(CraftSculkSensor<T> state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -28,6 +29,11 @@ public class CraftSculkSensor<T extends SculkSensorBlockEntity> extends CraftBlo
@Override @Override
public CraftSculkSensor<T> copy() { public CraftSculkSensor<T> copy() {
return new CraftSculkSensor<>(this); return new CraftSculkSensor<>(this, null);
}
@Override
public CraftSculkSensor<T> copy(Location location) {
return new CraftSculkSensor<>(this, location);
} }
} }

View file

@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.block;
import net.minecraft.server.level.EntityPlayer; import net.minecraft.server.level.EntityPlayer;
import net.minecraft.world.level.block.entity.SculkShriekerBlockEntity; import net.minecraft.world.level.block.entity.SculkShriekerBlockEntity;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.SculkShrieker; import org.bukkit.block.SculkShrieker;
import org.bukkit.craftbukkit.entity.CraftPlayer; import org.bukkit.craftbukkit.entity.CraftPlayer;
@ -13,8 +14,8 @@ public class CraftSculkShrieker extends CraftBlockEntityState<SculkShriekerBlock
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftSculkShrieker(CraftSculkShrieker state) { protected CraftSculkShrieker(CraftSculkShrieker state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -37,6 +38,11 @@ public class CraftSculkShrieker extends CraftBlockEntityState<SculkShriekerBlock
@Override @Override
public CraftSculkShrieker copy() { public CraftSculkShrieker copy() {
return new CraftSculkShrieker(this); return new CraftSculkShrieker(this, null);
}
@Override
public CraftSculkShrieker copy(Location location) {
return new CraftSculkShrieker(this, location);
} }
} }

View file

@ -6,6 +6,7 @@ import net.minecraft.world.item.EnumColor;
import net.minecraft.world.level.block.BlockShulkerBox; import net.minecraft.world.level.block.BlockShulkerBox;
import net.minecraft.world.level.block.entity.TileEntityShulkerBox; import net.minecraft.world.level.block.entity.TileEntityShulkerBox;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.ShulkerBox; import org.bukkit.block.ShulkerBox;
import org.bukkit.craftbukkit.inventory.CraftInventory; import org.bukkit.craftbukkit.inventory.CraftInventory;
@ -17,8 +18,8 @@ public class CraftShulkerBox extends CraftLootable<TileEntityShulkerBox> impleme
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftShulkerBox(CraftShulkerBox state) { protected CraftShulkerBox(CraftShulkerBox state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -66,6 +67,11 @@ public class CraftShulkerBox extends CraftLootable<TileEntityShulkerBox> impleme
@Override @Override
public CraftShulkerBox copy() { public CraftShulkerBox copy() {
return new CraftShulkerBox(this); return new CraftShulkerBox(this, null);
}
@Override
public CraftShulkerBox copy(Location location) {
return new CraftShulkerBox(this, location);
} }
} }

View file

@ -6,6 +6,7 @@ import net.minecraft.network.chat.IChatBaseComponent;
import net.minecraft.world.level.block.entity.TileEntitySign; import net.minecraft.world.level.block.entity.TileEntitySign;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.DyeColor; import org.bukkit.DyeColor;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Sign; import org.bukkit.block.Sign;
import org.bukkit.block.sign.Side; import org.bukkit.block.sign.Side;
@ -29,8 +30,8 @@ public class CraftSign<T extends TileEntitySign> extends CraftBlockEntityState<T
this.back = new CraftSignSide(this.getSnapshot().getBackText()); this.back = new CraftSignSide(this.getSnapshot().getBackText());
} }
protected CraftSign(CraftSign<T> state) { protected CraftSign(CraftSign<T> state, Location location) {
super(state); super(state, location);
this.front = new CraftSignSide(this.getSnapshot().getFrontText()); this.front = new CraftSignSide(this.getSnapshot().getFrontText());
this.back = new CraftSignSide(this.getSnapshot().getBackText()); this.back = new CraftSignSide(this.getSnapshot().getBackText());
} }
@ -136,7 +137,12 @@ public class CraftSign<T extends TileEntitySign> extends CraftBlockEntityState<T
@Override @Override
public CraftSign<T> copy() { public CraftSign<T> copy() {
return new CraftSign<T>(this); return new CraftSign<T>(this, null);
}
@Override
public CraftSign<T> copy(Location location) {
return new CraftSign<T>(this, location);
} }
public static void openSign(Sign sign, Player player, Side side) { public static void openSign(Sign sign, Player player, Side side) {

View file

@ -7,6 +7,7 @@ import net.minecraft.resources.MinecraftKey;
import net.minecraft.server.MinecraftServer; import net.minecraft.server.MinecraftServer;
import net.minecraft.world.level.block.entity.TileEntitySkull; import net.minecraft.world.level.block.entity.TileEntitySkull;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.NamespacedKey; import org.bukkit.NamespacedKey;
import org.bukkit.OfflinePlayer; import org.bukkit.OfflinePlayer;
import org.bukkit.SkullType; import org.bukkit.SkullType;
@ -31,8 +32,8 @@ public class CraftSkull extends CraftBlockEntityState<TileEntitySkull> implement
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftSkull(CraftSkull state) { protected CraftSkull(CraftSkull state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -206,6 +207,11 @@ public class CraftSkull extends CraftBlockEntityState<TileEntitySkull> implement
@Override @Override
public CraftSkull copy() { public CraftSkull copy() {
return new CraftSkull(this); return new CraftSkull(this, null);
}
@Override
public CraftSkull copy(Location location) {
return new CraftSkull(this, location);
} }
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.TileEntitySmoker; import net.minecraft.world.level.block.entity.TileEntitySmoker;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Smoker; import org.bukkit.block.Smoker;
@ -10,12 +11,17 @@ public class CraftSmoker extends CraftFurnace<TileEntitySmoker> implements Smoke
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftSmoker(CraftSmoker state) { protected CraftSmoker(CraftSmoker state, Location location) {
super(state); super(state, location);
} }
@Override @Override
public CraftSmoker copy() { public CraftSmoker copy() {
return new CraftSmoker(this); return new CraftSmoker(this, null);
}
@Override
public CraftSmoker copy(Location location) {
return new CraftSmoker(this, location);
} }
} }

View file

@ -5,6 +5,7 @@ import net.minecraft.world.level.block.EnumBlockMirror;
import net.minecraft.world.level.block.EnumBlockRotation; import net.minecraft.world.level.block.EnumBlockRotation;
import net.minecraft.world.level.block.entity.TileEntityStructure; import net.minecraft.world.level.block.entity.TileEntityStructure;
import net.minecraft.world.level.block.state.properties.BlockPropertyStructureMode; import net.minecraft.world.level.block.state.properties.BlockPropertyStructureMode;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.Structure; import org.bukkit.block.Structure;
import org.bukkit.block.structure.Mirror; import org.bukkit.block.structure.Mirror;
@ -23,8 +24,8 @@ public class CraftStructureBlock extends CraftBlockEntityState<TileEntityStructu
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftStructureBlock(CraftStructureBlock state) { protected CraftStructureBlock(CraftStructureBlock state, Location location) {
super(state); super(state, location);
} }
@Override @Override
@ -199,7 +200,12 @@ public class CraftStructureBlock extends CraftBlockEntityState<TileEntityStructu
@Override @Override
public CraftStructureBlock copy() { public CraftStructureBlock copy() {
return new CraftStructureBlock(this); return new CraftStructureBlock(this, null);
}
@Override
public CraftStructureBlock copy(Location location) {
return new CraftStructureBlock(this, location);
} }
private static boolean isBetween(int num, int min, int max) { private static boolean isBetween(int num, int min, int max) {

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.BrushableBlockEntity; import net.minecraft.world.level.block.entity.BrushableBlockEntity;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.SuspiciousSand; import org.bukkit.block.SuspiciousSand;
@ -10,12 +11,17 @@ public class CraftSuspiciousSand extends CraftBrushableBlock implements Suspicio
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftSuspiciousSand(CraftSuspiciousSand state) { protected CraftSuspiciousSand(CraftSuspiciousSand state, Location location) {
super(state); super(state, location);
} }
@Override @Override
public CraftSuspiciousSand copy() { public CraftSuspiciousSand copy() {
return new CraftSuspiciousSand(this); return new CraftSuspiciousSand(this, null);
}
@Override
public CraftSuspiciousSand copy(Location location) {
return new CraftSuspiciousSand(this, location);
} }
} }

View file

@ -1,6 +1,7 @@
package org.bukkit.craftbukkit.block; package org.bukkit.craftbukkit.block;
import net.minecraft.world.level.block.entity.TrialSpawnerBlockEntity; import net.minecraft.world.level.block.entity.TrialSpawnerBlockEntity;
import org.bukkit.Location;
import org.bukkit.World; import org.bukkit.World;
import org.bukkit.block.TrialSpawner; import org.bukkit.block.TrialSpawner;
@ -10,12 +11,17 @@ public class CraftTrialSpawner extends CraftBlockEntityState<TrialSpawnerBlockEn
super(world, tileEntity); super(world, tileEntity);
} }
protected CraftTrialSpawner(CraftTrialSpawner state) { protected CraftTrialSpawner(CraftTrialSpawner state, Location location) {
super(state); super(state, location);
} }
@Override @Override
public CraftTrialSpawner copy() { public CraftTrialSpawner copy() {
return new CraftTrialSpawner(this); return new CraftTrialSpawner(this, null);
}
@Override
public CraftTrialSpawner copy(Location location) {
return new CraftTrialSpawner(this, location);
} }
} }