Update to Minecraft 1.14-pre5

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2019-04-23 12:00:00 +10:00
parent 0e98365784
commit a0f2b74c8d
560 changed files with 10642 additions and 10867 deletions

View File

@@ -0,0 +1,33 @@
package org.bukkit.craftbukkit.block;
import net.minecraft.server.TileEntityBarrel;
import org.bukkit.Material;
import org.bukkit.block.Barrel;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.inventory.CraftInventory;
import org.bukkit.inventory.Inventory;
public class CraftBarrel extends CraftLootable<TileEntityBarrel> implements Barrel {
public CraftBarrel(Block block) {
super(block, TileEntityBarrel.class);
}
public CraftBarrel(Material material, TileEntityBarrel te) {
super(material, te);
}
@Override
public Inventory getSnapshotInventory() {
return new CraftInventory(this.getSnapshot());
}
@Override
public Inventory getInventory() {
if (!this.isPlaced()) {
return this.getSnapshotInventory();
}
return new CraftInventory(this.getTileEntity());
}
}

View File

@@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.block;
import java.util.ArrayList;
import java.util.Collection;
import net.minecraft.server.ChestLock;
import net.minecraft.server.EntityHuman;
import net.minecraft.server.MobEffectList;
import net.minecraft.server.TileEntity;
@@ -9,14 +10,12 @@ import net.minecraft.server.TileEntityBeacon;
import org.bukkit.Material;
import org.bukkit.block.Beacon;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.inventory.CraftInventoryBeacon;
import org.bukkit.craftbukkit.util.CraftChatMessage;
import org.bukkit.entity.LivingEntity;
import org.bukkit.inventory.BeaconInventory;
import org.bukkit.potion.PotionEffect;
import org.bukkit.potion.PotionEffectType;
public class CraftBeacon extends CraftContainer<TileEntityBeacon> implements Beacon {
public class CraftBeacon extends CraftBlockEntityState<TileEntityBeacon> implements Beacon {
public CraftBeacon(final Block block) {
super(block, TileEntityBeacon.class);
@@ -26,20 +25,6 @@ public class CraftBeacon extends CraftContainer<TileEntityBeacon> implements Bea
super(material, te);
}
@Override
public BeaconInventory getSnapshotInventory() {
return new CraftInventoryBeacon(this.getSnapshot());
}
@Override
public BeaconInventory getInventory() {
if (!this.isPlaced()) {
return this.getSnapshotInventory();
}
return new CraftInventoryBeacon(this.getTileEntity());
}
@Override
public Collection<LivingEntity> getEntitiesInRange() {
TileEntity tileEntity = this.getTileEntityFromWorld();
@@ -88,11 +73,26 @@ public class CraftBeacon extends CraftContainer<TileEntityBeacon> implements Bea
@Override
public String getCustomName() {
TileEntityBeacon beacon = this.getSnapshot();
return beacon.hasCustomName() ? CraftChatMessage.fromComponent(beacon.getCustomName()) : null;
return beacon.customName != null ? CraftChatMessage.fromComponent(beacon.customName) : null;
}
@Override
public void setCustomName(String name) {
this.getSnapshot().setCustomName(CraftChatMessage.fromStringOrNull(name));
}
@Override
public boolean isLocked() {
return !this.getSnapshot().chestLock.key.isEmpty();
}
@Override
public String getLock() {
return this.getSnapshot().chestLock.key;
}
@Override
public void setLock(String key) {
this.getSnapshot().chestLock = (key == null) ? ChestLock.a : new ChestLock(key);
}
}

View File

@@ -0,0 +1,16 @@
package org.bukkit.craftbukkit.block;
import net.minecraft.server.TileEntityBell;
import org.bukkit.Material;
import org.bukkit.block.Block;
public class CraftBell extends CraftBlockEntityState<TileEntityBell> {
public CraftBell(Block block) {
super(block, TileEntityBell.class);
}
public CraftBell(Material material, TileEntityBell te) {
super(material, te);
}
}

View File

@@ -0,0 +1,17 @@
package org.bukkit.craftbukkit.block;
import net.minecraft.server.TileEntityBlastFurnace;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.BlastFurnace;
public class CraftBlastFurnace extends CraftFurnace implements BlastFurnace {
public CraftBlastFurnace(Block block) {
super(block, TileEntityBlastFurnace.class);
}
public CraftBlastFurnace(Material material, TileEntityBlastFurnace te) {
super(material, te);
}
}

View File

@@ -5,6 +5,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.stream.Collectors;
import net.minecraft.server.*;
@@ -40,7 +41,7 @@ public class CraftBlock implements Block {
public CraftBlock(GeneratorAccess world, BlockPosition position) {
this.world = world;
this.position = position.h();
this.position = position.immutableCopy();
}
public static CraftBlock at(GeneratorAccess world, BlockPosition position) {
@@ -158,7 +159,12 @@ public class CraftBlock implements Block {
public boolean setTypeAndData(final IBlockData blockData, final boolean applyPhysics) {
// SPIGOT-611: need to do this to prevent glitchiness. Easier to handle this here (like /setblock) than to fix weirdness in tile entity cleanup
if (!blockData.isAir() && blockData.getBlock() instanceof BlockTileEntity && blockData.getBlock() != getNMSBlock()) {
world.setTypeAndData(position, Blocks.AIR.getBlockData(), 0);
// SPIGOT-4612: faster - just clear tile
if (world instanceof net.minecraft.server.World) {
((net.minecraft.server.World) world).removeTileEntity(position);
} else {
world.setTypeAndData(position, Blocks.AIR.getBlockData(), 0);
}
}
if (applyPhysics) {
@@ -278,14 +284,24 @@ public class CraftBlock implements Block {
Material material = getType();
switch (material) {
case SIGN:
case WALL_SIGN:
case ACACIA_SIGN:
case ACACIA_WALL_SIGN:
case BIRCH_SIGN:
case BIRCH_WALL_SIGN:
case DARK_OAK_SIGN:
case DARK_OAK_WALL_SIGN:
case JUNGLE_SIGN:
case JUNGLE_WALL_SIGN:
case OAK_SIGN:
case OAK_WALL_SIGN:
case SPRUCE_SIGN:
case SPRUCE_WALL_SIGN:
return new CraftSign(this);
case CHEST:
case TRAPPED_CHEST:
return new CraftChest(this);
case FURNACE:
return new CraftFurnace(this);
return new CraftFurnaceFurnace(this);
case DISPENSER:
return new CraftDispenser(this);
case DROPPER:
@@ -399,6 +415,22 @@ public class CraftBlock implements Block {
return new CraftBed(this);
case CONDUIT:
return new CraftConduit(this);
case BARRIER:
return new CraftBarrel(this);
case BARREL:
return new CraftBarrel(this);
case BELL:
return new CraftBell(this);
case BLAST_FURNACE:
return new CraftBlastFurnace(this);
case CAMPFIRE:
return new CraftCampfire(this);
case JIGSAW:
return new CraftJigsaw(this);
case LECTERN:
return new CraftLectern(this);
case SMOKER:
return new CraftSmoker(this);
default:
TileEntity tileEntity = world.getTileEntity(position);
if (tileEntity != null) {
@@ -512,80 +544,30 @@ public class CraftBlock implements Block {
return PistonMoveReaction.getById(getNMS().getPushReaction().ordinal());
}
private boolean itemCausesDrops(ItemStack item) {
net.minecraft.server.Block block = this.getNMSBlock();
net.minecraft.server.Item itemType = CraftMagicNumbers.getItem(item.getType());
return block != null && (block.getBlockData().getMaterial().isAlwaysDestroyable() || (itemType != null && itemType.canDestroySpecialBlock(block.getBlockData())));
public boolean breakNaturally() {
return breakNaturally(new ItemStack(Material.AIR));
}
public boolean breakNaturally() {
public boolean breakNaturally(ItemStack item) {
// Order matters here, need to drop before setting to air so skulls can get their data
net.minecraft.server.Block block = this.getNMSBlock();
boolean result = false;
if (block != null && block != Blocks.AIR) {
block.dropNaturally(getNMS(), world.getMinecraftWorld(), position, 1.0F, 0);
net.minecraft.server.Block.dropItems(getNMS(), world.getMinecraftWorld(), position, world.getTileEntity(position), null, CraftItemStack.asNMSCopy(item));
result = true;
}
setType(Material.AIR);
return result;
}
public boolean breakNaturally(ItemStack item) {
if (itemCausesDrops(item)) {
return breakNaturally();
} else {
return setTypeAndData(Blocks.AIR.getBlockData(), true);
}
return setTypeAndData(Blocks.AIR.getBlockData(), true) && result;
}
public Collection<ItemStack> getDrops() {
List<ItemStack> drops = new ArrayList<ItemStack>();
net.minecraft.server.Block block = this.getNMSBlock();
if (block != Blocks.AIR) {
IBlockData data = getData0();
// based on nms.Block.dropNaturally
int count = block.getDropCount(data, 0, world.getMinecraftWorld(), position, world.getMinecraftWorld().random);
for (int i = 0; i < count; ++i) {
Item item = block.getDropType(data, world.getMinecraftWorld(), position, 0).getItem();
if (item != Items.AIR) {
// Skulls are special, their data is based on the tile entity
if (block instanceof BlockSkullAbstract) {
net.minecraft.server.ItemStack nmsStack = block.a((IBlockAccess) world, position, data);
TileEntitySkull tileentityskull = (TileEntitySkull) world.getTileEntity(position);
if ((block == Blocks.PLAYER_HEAD || block == Blocks.PLAYER_WALL_HEAD) && tileentityskull.getGameProfile() != null) {
NBTTagCompound nbttagcompound = new NBTTagCompound();
GameProfileSerializer.serialize(nbttagcompound, tileentityskull.getGameProfile());
nmsStack.getOrCreateTag().set("SkullOwner", nbttagcompound);
}
drops.add(CraftItemStack.asBukkitCopy(nmsStack));
// We don't want to drop cocoa blocks, we want to drop cocoa beans.
} else if (Blocks.COCOA == block) {
int age = (Integer) data.get(BlockCocoa.AGE);
int dropAmount = (age >= 2 ? 3 : 1);
for (int j = 0; j < dropAmount; ++j) {
drops.add(new ItemStack(Material.COCOA_BEANS, 1));
}
} else {
drops.add(new ItemStack(org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(item), 1));
}
}
}
}
return drops;
return getDrops(new ItemStack(Material.AIR));
}
public Collection<ItemStack> getDrops(ItemStack item) {
if (itemCausesDrops(item)) {
return getDrops();
} else {
return Collections.emptyList();
}
return net.minecraft.server.Block.getDrops(getNMS(), (WorldServer) world.getMinecraftWorld(), position, world.getTileEntity(position), null, CraftItemStack.asNMSCopy(item))
.stream().map(CraftItemStack::asBukkitCopy).collect(Collectors.toList());
}
public void setMetadata(String metadataKey, MetadataValue newMetadataValue) {
@@ -628,25 +610,7 @@ public class CraftBlock implements Block {
Vec3D startPos = new Vec3D(start.getX(), start.getY(), start.getZ());
Vec3D endPos = new Vec3D(start.getX() + dir.getX(), start.getY() + dir.getY(), start.getZ() + dir.getZ());
// Similar to to nms.World#rayTrace:
IBlockData blockData = world.getType(position);
Fluid fluid = world.getFluid(position);
boolean collidableBlock = blockData.getBlock().isCollidable(blockData);
boolean collideWithFluid = CraftFluidCollisionMode.toNMS(fluidCollisionMode).predicate.test(fluid);
if (!collidableBlock && !collideWithFluid) {
return null;
}
MovingObjectPosition nmsHitResult = null;
if (collidableBlock) {
nmsHitResult = net.minecraft.server.Block.rayTrace(blockData, world.getMinecraftWorld(), position, startPos, endPos);
}
if (nmsHitResult == null && collideWithFluid) {
nmsHitResult = VoxelShapes.create(0.0D, 0.0D, 0.0D, 1.0D, (double) fluid.getHeight(), 1.0D).rayTrace(startPos, endPos, position);
}
MovingObjectPosition nmsHitResult = world.rayTrace(new RayTrace(startPos, endPos, RayTrace.BlockCollisionOption.OUTLINE, CraftFluidCollisionMode.toNMS(fluidCollisionMode), null));
return CraftRayTraceResult.fromNMS(this.getWorld(), nmsHitResult);
}

View File

@@ -34,41 +34,21 @@ public class CraftBrewingStand extends CraftContainer<TileEntityBrewingStand> im
@Override
public int getBrewingTime() {
return this.getSnapshot().getProperty(0);
return this.getSnapshot().brewTime;
}
@Override
public void setBrewingTime(int brewTime) {
this.getSnapshot().setProperty(0, brewTime);
this.getSnapshot().brewTime = brewTime;
}
@Override
public int getFuelLevel() {
return this.getSnapshot().getProperty(1);
return this.getSnapshot().fuelLevel;
}
@Override
public void setFuelLevel(int level) {
this.getSnapshot().setProperty(1, level);
}
@Override
public String getCustomName() {
TileEntityBrewingStand brewingStand = this.getSnapshot();
return brewingStand.hasCustomName() ? CraftChatMessage.fromComponent(brewingStand.getCustomName()) : null;
}
@Override
public void setCustomName(String name) {
this.getSnapshot().setCustomName(CraftChatMessage.fromStringOrNull(name));
}
@Override
public void applyTo(TileEntityBrewingStand brewingStand) {
super.applyTo(brewingStand);
if (!this.getSnapshot().hasCustomName()) {
brewingStand.setCustomName(null);
}
this.getSnapshot().fuelLevel = level;
}
}

View File

@@ -0,0 +1,55 @@
package org.bukkit.craftbukkit.block;
import net.minecraft.server.TileEntityCampfire;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.Campfire;
import org.bukkit.craftbukkit.inventory.CraftItemStack;
import org.bukkit.inventory.ItemStack;
public class CraftCampfire extends CraftBlockEntityState<TileEntityCampfire> implements Campfire {
public CraftCampfire(Block block) {
super(block, TileEntityCampfire.class);
}
public CraftCampfire(Material material, TileEntityCampfire te) {
super(material, te);
}
@Override
public int getSize() {
return getSnapshot().getItems().size();
}
@Override
public ItemStack getItem(int index) {
net.minecraft.server.ItemStack item = getSnapshot().getItems().get(index);
return item.isEmpty() ? null : CraftItemStack.asCraftMirror(item);
}
@Override
public void setItem(int index, ItemStack item) {
getSnapshot().getItems().set(index, CraftItemStack.asNMSCopy(item));
}
@Override
public int getCookTime(int index) {
return getSnapshot().cookingTimes[index];
}
@Override
public void setCookTime(int index, int cookTime) {
getSnapshot().cookingTimes[index] = cookTime;
}
@Override
public int getCookTimeTotal(int index) {
return getSnapshot().cookingTotalTimes[index];
}
@Override
public void setCookTimeTotal(int index, int cookTimeTotal) {
getSnapshot().cookingTotalTimes[index] = cookTimeTotal;
}
}

View File

@@ -49,7 +49,7 @@ public class CraftChest extends CraftLootable<TileEntityChest> implements Chest
CraftWorld world = (CraftWorld) this.getWorld();
BlockChest blockChest = (BlockChest) (this.getType() == Material.CHEST ? Blocks.CHEST : Blocks.TRAPPED_CHEST);
ITileInventory nms = blockChest.getInventory(data, world.getHandle(), this.getPosition(), true);
ITileInventory nms = blockChest.getInventory(data, world.getHandle(), this.getPosition());
if (nms instanceof InventoryLargeChest) {
inventory = new CraftInventoryDoubleChest((InventoryLargeChest) nms);

View File

@@ -5,6 +5,7 @@ import net.minecraft.server.TileEntityContainer;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.Container;
import org.bukkit.craftbukkit.util.CraftChatMessage;
public abstract class CraftContainer<T extends TileEntityContainer> extends CraftBlockEntityState<T> implements Container {
@@ -18,16 +19,36 @@ public abstract class CraftContainer<T extends TileEntityContainer> extends Craf
@Override
public boolean isLocked() {
return this.getSnapshot().isLocked();
return !this.getSnapshot().chestLock.key.isEmpty();
}
@Override
public String getLock() {
return this.getSnapshot().getLock().getKey();
return this.getSnapshot().chestLock.key;
}
@Override
public void setLock(String key) {
this.getSnapshot().setLock(key == null ? ChestLock.a : new ChestLock(key));
this.getSnapshot().chestLock = (key == null) ? ChestLock.a : new ChestLock(key);
}
@Override
public String getCustomName() {
T container = this.getSnapshot();
return container.customName != null ? CraftChatMessage.fromComponent(container.getCustomName()) : null;
}
@Override
public void setCustomName(String name) {
this.getSnapshot().setCustomName(CraftChatMessage.fromStringOrNull(name));
}
@Override
public void applyTo(T container) {
super.applyTo(container);
if (this.getSnapshot().customName == null) {
container.setCustomName(null);
}
}
}

View File

@@ -32,7 +32,7 @@ public class CraftCreatureSpawner extends CraftBlockEntityState<TileEntityMobSpa
throw new IllegalArgumentException("Can't spawn EntityType " + entityType + " from mobspawners!");
}
this.getSnapshot().getSpawner().setMobName(EntityTypes.a(entityType.getName()));
this.getSnapshot().getSpawner().setMobName(EntityTypes.a(entityType.getName()).get());
}
@Override

View File

@@ -6,16 +6,15 @@ import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.Furnace;
import org.bukkit.craftbukkit.inventory.CraftInventoryFurnace;
import org.bukkit.craftbukkit.util.CraftChatMessage;
import org.bukkit.inventory.FurnaceInventory;
public class CraftFurnace extends CraftContainer<TileEntityFurnace> implements Furnace {
public class CraftFurnace<T extends TileEntityFurnace> extends CraftContainer<T> implements Furnace {
public CraftFurnace(final Block block) {
super(block, TileEntityFurnace.class);
public CraftFurnace(Block block, Class<T> tileEntityClass) {
super(block, tileEntityClass);
}
public CraftFurnace(final Material material, final TileEntityFurnace te) {
public CraftFurnace(final Material material, final T te) {
super(material, te);
}
@@ -35,53 +34,33 @@ public class CraftFurnace extends CraftContainer<TileEntityFurnace> implements F
@Override
public short getBurnTime() {
return (short) this.getSnapshot().getProperty(0);
return (short) this.getSnapshot().burnTime;
}
@Override
public void setBurnTime(short burnTime) {
this.getSnapshot().setProperty(0, burnTime);
this.getSnapshot().burnTime = burnTime;
// SPIGOT-844: Allow lighting and relighting using this API
this.data = this.data.set(BlockFurnace.LIT, burnTime > 0);
}
@Override
public short getCookTime() {
return (short) this.getSnapshot().getProperty(2);
return (short) this.getSnapshot().cookTime;
}
@Override
public void setCookTime(short cookTime) {
this.getSnapshot().setProperty(2, cookTime);
this.getSnapshot().cookTime = cookTime;
}
@Override
public int getCookTimeTotal() {
return this.getSnapshot().getProperty(3);
return this.getSnapshot().cookTimeTotal;
}
@Override
public void setCookTimeTotal(int cookTimeTotal) {
this.getSnapshot().setProperty(3, cookTimeTotal);
}
@Override
public String getCustomName() {
TileEntityFurnace furnace = this.getSnapshot();
return furnace.hasCustomName() ? CraftChatMessage.fromComponent(furnace.getCustomName()) : null;
}
@Override
public void setCustomName(String name) {
this.getSnapshot().setCustomName(CraftChatMessage.fromStringOrNull(name));
}
@Override
public void applyTo(TileEntityFurnace furnace) {
super.applyTo(furnace);
if (!this.getSnapshot().hasCustomName()) {
furnace.setCustomName(null);
}
this.getSnapshot().cookTimeTotal = cookTimeTotal;
}
}

View File

@@ -0,0 +1,16 @@
package org.bukkit.craftbukkit.block;
import net.minecraft.server.TileEntityFurnaceFurnace;
import org.bukkit.Material;
import org.bukkit.block.Block;
public class CraftFurnaceFurnace extends CraftFurnace {
public CraftFurnaceFurnace(Block block) {
super(block, TileEntityFurnaceFurnace.class);
}
public CraftFurnaceFurnace(Material material, TileEntityFurnaceFurnace te) {
super(material, te);
}
}

View File

@@ -0,0 +1,17 @@
package org.bukkit.craftbukkit.block;
import net.minecraft.server.TileEntityJigsaw;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.Jigsaw;
public class CraftJigsaw extends CraftBlockEntityState<TileEntityJigsaw> implements Jigsaw {
public CraftJigsaw(Block block) {
super(block, TileEntityJigsaw.class);
}
public CraftJigsaw(Material material, TileEntityJigsaw te) {
super(material, te);
}
}

View File

@@ -0,0 +1,43 @@
package org.bukkit.craftbukkit.block;
import net.minecraft.server.TileEntityLectern;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.Lectern;
import org.bukkit.craftbukkit.inventory.CraftInventory;
import org.bukkit.inventory.Inventory;
public class CraftLectern extends CraftBlockEntityState<TileEntityLectern> implements Lectern {
public CraftLectern(Block block) {
super(block, TileEntityLectern.class);
}
public CraftLectern(Material material, TileEntityLectern te) {
super(material, te);
}
@Override
public int getPage() {
return getSnapshot().getPage();
}
@Override
public void setPage(int page) {
getSnapshot().setPage(page);
}
@Override
public Inventory getSnapshotInventory() {
return new CraftInventory(this.getSnapshot().inventory);
}
@Override
public Inventory getInventory() {
if (!this.isPlaced()) {
return this.getSnapshotInventory();
}
return new CraftInventory(this.getTileEntity().inventory);
}
}

View File

@@ -6,7 +6,6 @@ import org.bukkit.Bukkit;
import org.bukkit.Material;
import org.bukkit.Nameable;
import org.bukkit.block.Block;
import org.bukkit.craftbukkit.util.CraftChatMessage;
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
import org.bukkit.loot.LootTable;
import org.bukkit.loot.Lootable;
@@ -21,36 +20,22 @@ public abstract class CraftLootable<T extends TileEntityLootable> extends CraftC
super(material, tileEntity);
}
@Override
public String getCustomName() {
T lootable = this.getSnapshot();
return lootable.hasCustomName() ? CraftChatMessage.fromComponent(lootable.getCustomName()) : null;
}
@Override
public void setCustomName(String name) {
this.getSnapshot().setCustomName(CraftChatMessage.fromStringOrNull(name));
}
@Override
public void applyTo(T lootable) {
super.applyTo(lootable);
if (!this.getSnapshot().hasCustomName()) {
lootable.setCustomName(null);
}
if (this.getSnapshot().getLootTable() == null) {
if (this.getSnapshot().lootTable == null) {
lootable.setLootTable((MinecraftKey) null, 0L);
}
}
@Override
public LootTable getLootTable() {
if (getSnapshot().getLootTable() == null) {
if (getSnapshot().lootTable == null) {
return null;
}
MinecraftKey key = getSnapshot().getLootTable();
MinecraftKey key = getSnapshot().lootTable;
return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key));
}
@@ -61,7 +46,7 @@ public abstract class CraftLootable<T extends TileEntityLootable> extends CraftC
@Override
public long getSeed() {
return getSnapshotNBT().getLong("LootTableSeed"); // returns OL if an error occurred
return getSnapshot().lootTableSeed;
}
@Override

View File

@@ -34,7 +34,7 @@ public class CraftSkull extends CraftBlockEntityState<TileEntitySkull> implement
public void load(TileEntitySkull skull) {
super.load(skull);
profile = skull.getGameProfile();
profile = skull.gameProfile;
}
static int getSkullType(SkullType type) {

View File

@@ -0,0 +1,17 @@
package org.bukkit.craftbukkit.block;
import net.minecraft.server.TileEntitySmoker;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.Smoker;
public class CraftSmoker extends CraftFurnace implements Smoker {
public CraftSmoker(Block block) {
super(block, TileEntitySmoker.class);
}
public CraftSmoker(Material material, TileEntitySmoker te) {
super(material, te);
}
}

View File

@@ -275,6 +275,10 @@ public class CraftBlockData implements BlockData {
return stateString.toString();
}
public String toStates() {
return ((BlockDataAbstract) state).getStateMap().entrySet().stream().map(BlockDataAbstract.STATE_TO_VALUE).collect(Collectors.joining(",")).toString();
}
@Override
public boolean equals(Object obj) {
return obj instanceof CraftBlockData && state.equals(((CraftBlockData) obj).state);
@@ -331,7 +335,7 @@ public class CraftBlockData implements BlockData {
private static IBlockState<?> getState(Class<? extends Block> block, String name, boolean optional) {
IBlockState<?> state = null;
for (Block instance : (Iterable<Block>) IRegistry.BLOCK) { // Eclipse fail
for (Block instance : IRegistry.BLOCK) {
if (instance.getClass() == block) {
if (state == null) {
state = instance.getStates().a(name);
@@ -374,14 +378,19 @@ public class CraftBlockData implements BlockData {
static {
//<editor-fold desc="CraftBlockData Registration" defaultstate="collapsed">
register(net.minecraft.server.BlockAnvil.class, org.bukkit.craftbukkit.block.impl.CraftAnvil::new);
register(net.minecraft.server.BlockBamboo.class, org.bukkit.craftbukkit.block.impl.CraftBamboo::new);
register(net.minecraft.server.BlockBanner.class, org.bukkit.craftbukkit.block.impl.CraftBanner::new);
register(net.minecraft.server.BlockBannerWall.class, org.bukkit.craftbukkit.block.impl.CraftBannerWall::new);
register(net.minecraft.server.BlockBarrel.class, org.bukkit.craftbukkit.block.impl.CraftBarrel::new);
register(net.minecraft.server.BlockBed.class, org.bukkit.craftbukkit.block.impl.CraftBed::new);
register(net.minecraft.server.BlockBeetroot.class, org.bukkit.craftbukkit.block.impl.CraftBeetroot::new);
register(net.minecraft.server.BlockBell.class, org.bukkit.craftbukkit.block.impl.CraftBell::new);
register(net.minecraft.server.BlockBlastFurnace.class, org.bukkit.craftbukkit.block.impl.CraftBlastFurnace::new);
register(net.minecraft.server.BlockBrewingStand.class, org.bukkit.craftbukkit.block.impl.CraftBrewingStand::new);
register(net.minecraft.server.BlockBubbleColumn.class, org.bukkit.craftbukkit.block.impl.CraftBubbleColumn::new);
register(net.minecraft.server.BlockCactus.class, org.bukkit.craftbukkit.block.impl.CraftCactus::new);
register(net.minecraft.server.BlockCake.class, org.bukkit.craftbukkit.block.impl.CraftCake::new);
register(net.minecraft.server.BlockCampfire.class, org.bukkit.craftbukkit.block.impl.CraftCampfire::new);
register(net.minecraft.server.BlockCarrots.class, org.bukkit.craftbukkit.block.impl.CraftCarrots::new);
register(net.minecraft.server.BlockCauldron.class, org.bukkit.craftbukkit.block.impl.CraftCauldron::new);
register(net.minecraft.server.BlockChest.class, org.bukkit.craftbukkit.block.impl.CraftChest::new);
@@ -391,6 +400,7 @@ public class CraftBlockData implements BlockData {
register(net.minecraft.server.BlockCobbleWall.class, org.bukkit.craftbukkit.block.impl.CraftCobbleWall::new);
register(net.minecraft.server.BlockCocoa.class, org.bukkit.craftbukkit.block.impl.CraftCocoa::new);
register(net.minecraft.server.BlockCommand.class, org.bukkit.craftbukkit.block.impl.CraftCommand::new);
register(net.minecraft.server.BlockComposter.class, org.bukkit.craftbukkit.block.impl.CraftComposter::new);
register(net.minecraft.server.BlockConduit.class, org.bukkit.craftbukkit.block.impl.CraftConduit::new);
register(net.minecraft.server.BlockCoralDead.class, org.bukkit.craftbukkit.block.impl.CraftCoralDead::new);
register(net.minecraft.server.BlockCoralFan.class, org.bukkit.craftbukkit.block.impl.CraftCoralFan::new);
@@ -412,21 +422,25 @@ public class CraftBlockData implements BlockData {
register(net.minecraft.server.BlockFire.class, org.bukkit.craftbukkit.block.impl.CraftFire::new);
register(net.minecraft.server.BlockFloorSign.class, org.bukkit.craftbukkit.block.impl.CraftFloorSign::new);
register(net.minecraft.server.BlockFluids.class, org.bukkit.craftbukkit.block.impl.CraftFluids::new);
register(net.minecraft.server.BlockFurnace.class, org.bukkit.craftbukkit.block.impl.CraftFurnace::new);
register(net.minecraft.server.BlockGlassPane.class, org.bukkit.craftbukkit.block.impl.CraftGlassPane::new);
register(net.minecraft.server.BlockFurnaceFurace.class, org.bukkit.craftbukkit.block.impl.CraftFurnaceFurace::new);
register(net.minecraft.server.BlockGlazedTerracotta.class, org.bukkit.craftbukkit.block.impl.CraftGlazedTerracotta::new);
register(net.minecraft.server.BlockGrass.class, org.bukkit.craftbukkit.block.impl.CraftGrass::new);
register(net.minecraft.server.BlockGrindstone.class, org.bukkit.craftbukkit.block.impl.CraftGrindstone::new);
register(net.minecraft.server.BlockHay.class, org.bukkit.craftbukkit.block.impl.CraftHay::new);
register(net.minecraft.server.BlockHopper.class, org.bukkit.craftbukkit.block.impl.CraftHopper::new);
register(net.minecraft.server.BlockHugeMushroom.class, org.bukkit.craftbukkit.block.impl.CraftHugeMushroom::new);
register(net.minecraft.server.BlockIceFrost.class, org.bukkit.craftbukkit.block.impl.CraftIceFrost::new);
register(net.minecraft.server.BlockIronBars.class, org.bukkit.craftbukkit.block.impl.CraftIronBars::new);
register(net.minecraft.server.BlockJigsaw.class, org.bukkit.craftbukkit.block.impl.CraftJigsaw::new);
register(net.minecraft.server.BlockJukeBox.class, org.bukkit.craftbukkit.block.impl.CraftJukeBox::new);
register(net.minecraft.server.BlockKelp.class, org.bukkit.craftbukkit.block.impl.CraftKelp::new);
register(net.minecraft.server.BlockLadder.class, org.bukkit.craftbukkit.block.impl.CraftLadder::new);
register(net.minecraft.server.BlockLantern.class, org.bukkit.craftbukkit.block.impl.CraftLantern::new);
register(net.minecraft.server.BlockLeaves.class, org.bukkit.craftbukkit.block.impl.CraftLeaves::new);
register(net.minecraft.server.BlockLectern.class, org.bukkit.craftbukkit.block.impl.CraftLectern::new);
register(net.minecraft.server.BlockLever.class, org.bukkit.craftbukkit.block.impl.CraftLever::new);
register(net.minecraft.server.BlockLogAbstract.class, org.bukkit.craftbukkit.block.impl.CraftLogAbstract::new);
register(net.minecraft.server.BlockLoom.class, org.bukkit.craftbukkit.block.impl.CraftLoom::new);
register(net.minecraft.server.BlockMinecartDetector.class, org.bukkit.craftbukkit.block.impl.CraftMinecartDetector::new);
register(net.minecraft.server.BlockMinecartTrack.class, org.bukkit.craftbukkit.block.impl.CraftMinecartTrack::new);
register(net.minecraft.server.BlockMycel.class, org.bukkit.craftbukkit.block.impl.CraftMycel::new);
@@ -452,12 +466,14 @@ public class CraftBlockData implements BlockData {
register(net.minecraft.server.BlockRepeater.class, org.bukkit.craftbukkit.block.impl.CraftRepeater::new);
register(net.minecraft.server.BlockRotatable.class, org.bukkit.craftbukkit.block.impl.CraftRotatable::new);
register(net.minecraft.server.BlockSapling.class, org.bukkit.craftbukkit.block.impl.CraftSapling::new);
register(net.minecraft.server.BlockScaffolding.class, org.bukkit.craftbukkit.block.impl.CraftScaffolding::new);
register(net.minecraft.server.BlockSeaPickle.class, org.bukkit.craftbukkit.block.impl.CraftSeaPickle::new);
register(net.minecraft.server.BlockShulkerBox.class, org.bukkit.craftbukkit.block.impl.CraftShulkerBox::new);
register(net.minecraft.server.BlockSkull.class, org.bukkit.craftbukkit.block.impl.CraftSkull::new);
register(net.minecraft.server.BlockSkullPlayer.class, org.bukkit.craftbukkit.block.impl.CraftSkullPlayer::new);
register(net.minecraft.server.BlockSkullPlayerWall.class, org.bukkit.craftbukkit.block.impl.CraftSkullPlayerWall::new);
register(net.minecraft.server.BlockSkullWall.class, org.bukkit.craftbukkit.block.impl.CraftSkullWall::new);
register(net.minecraft.server.BlockSmoker.class, org.bukkit.craftbukkit.block.impl.CraftSmoker::new);
register(net.minecraft.server.BlockSnow.class, org.bukkit.craftbukkit.block.impl.CraftSnow::new);
register(net.minecraft.server.BlockSoil.class, org.bukkit.craftbukkit.block.impl.CraftSoil::new);
register(net.minecraft.server.BlockStainedGlassPane.class, org.bukkit.craftbukkit.block.impl.CraftStainedGlassPane::new);
@@ -466,10 +482,12 @@ public class CraftBlockData implements BlockData {
register(net.minecraft.server.BlockStemAttached.class, org.bukkit.craftbukkit.block.impl.CraftStemAttached::new);
register(net.minecraft.server.BlockStepAbstract.class, org.bukkit.craftbukkit.block.impl.CraftStepAbstract::new);
register(net.minecraft.server.BlockStoneButton.class, org.bukkit.craftbukkit.block.impl.CraftStoneButton::new);
register(net.minecraft.server.BlockStonecutter.class, org.bukkit.craftbukkit.block.impl.CraftStonecutter::new);
register(net.minecraft.server.BlockStructure.class, org.bukkit.craftbukkit.block.impl.CraftStructure::new);
register(net.minecraft.server.BlockSweetBerryBush.class, org.bukkit.craftbukkit.block.impl.CraftSweetBerryBush::new);
register(net.minecraft.server.BlockTNT.class, org.bukkit.craftbukkit.block.impl.CraftTNT::new);
register(net.minecraft.server.BlockTallPlant.class, org.bukkit.craftbukkit.block.impl.CraftTallPlant::new);
register(net.minecraft.server.BlockTallPlantFlower.class, org.bukkit.craftbukkit.block.impl.CraftTallPlantFlower::new);
register(net.minecraft.server.BlockTallPlantShearable.class, org.bukkit.craftbukkit.block.impl.CraftTallPlantShearable::new);
register(net.minecraft.server.BlockTallSeaGrass.class, org.bukkit.craftbukkit.block.impl.CraftTallSeaGrass::new);
register(net.minecraft.server.BlockTorchWall.class, org.bukkit.craftbukkit.block.impl.CraftTorchWall::new);
register(net.minecraft.server.BlockTrapdoor.class, org.bukkit.craftbukkit.block.impl.CraftTrapdoor::new);

View File

@@ -0,0 +1,19 @@
package org.bukkit.craftbukkit.block.data.type;
import org.bukkit.block.data.type.Bamboo;
import org.bukkit.craftbukkit.block.data.CraftBlockData;
public abstract class CraftBamboo extends CraftBlockData implements Bamboo {
private static final net.minecraft.server.BlockStateEnum<?> LEAVES = getEnum("leaves");
@Override
public Leaves getLeaves() {
return get(LEAVES, Leaves.class);
}
@Override
public void setLeaves(Leaves leaves) {
set(LEAVES, leaves);
}
}

View File

@@ -0,0 +1,19 @@
package org.bukkit.craftbukkit.block.data.type;
import org.bukkit.block.data.type.Campfire;
import org.bukkit.craftbukkit.block.data.CraftBlockData;
public abstract class CraftCampfire extends CraftBlockData implements Campfire {
private static final net.minecraft.server.BlockStateBoolean SIGNAL_FIRE = getBoolean("signal_fire");
@Override
public boolean isSignalFire() {
return get(SIGNAL_FIRE);
}
@Override
public void setSignalFire(boolean signalFire) {
set(SIGNAL_FIRE, signalFire);
}
}

View File

@@ -0,0 +1,19 @@
package org.bukkit.craftbukkit.block.data.type;
import org.bukkit.block.data.type.Lantern;
import org.bukkit.craftbukkit.block.data.CraftBlockData;
public abstract class CraftLantern extends CraftBlockData implements Lantern {
private static final net.minecraft.server.BlockStateBoolean HANGING = getBoolean("hanging");
@Override
public boolean isHanging() {
return get(HANGING);
}
@Override
public void setHanging(boolean hanging) {
set(HANGING, hanging);
}
}

View File

@@ -0,0 +1,14 @@
package org.bukkit.craftbukkit.block.data.type;
import org.bukkit.block.data.type.Lectern;
import org.bukkit.craftbukkit.block.data.CraftBlockData;
public abstract class CraftLectern extends CraftBlockData implements Lectern {
private static final net.minecraft.server.BlockStateBoolean HAS_BOOK = getBoolean("has_book");
@Override
public boolean hasBook() {
return get(HAS_BOOK);
}
}

View File

@@ -0,0 +1,35 @@
package org.bukkit.craftbukkit.block.data.type;
import org.bukkit.block.data.type.Scaffolding;
import org.bukkit.craftbukkit.block.data.CraftBlockData;
public abstract class CraftScaffolding extends CraftBlockData implements Scaffolding {
private static final net.minecraft.server.BlockStateBoolean BOTTOM = getBoolean("bottom");
private static final net.minecraft.server.BlockStateInteger DISTANCE = getInteger("distance");
@Override
public boolean isBottom() {
return get(BOTTOM);
}
@Override
public void setBottom(boolean bottom) {
set(BOTTOM, bottom);
}
@Override
public int getDistance() {
return get(DISTANCE);
}
@Override
public void setDistance(int distance) {
set(DISTANCE, distance);
}
@Override
public int getMaximumDistance() {
return getMax(DISTANCE);
}
}

View File

@@ -0,0 +1,67 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftBamboo extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Bamboo, org.bukkit.block.data.Ageable, org.bukkit.block.data.type.Sapling {
public CraftBamboo() {
super();
}
public CraftBamboo(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.type.CraftBamboo
private static final net.minecraft.server.BlockStateEnum<?> LEAVES = getEnum(net.minecraft.server.BlockBamboo.class, "leaves");
@Override
public Leaves getLeaves() {
return get(LEAVES, Leaves.class);
}
@Override
public void setLeaves(Leaves leaves) {
set(LEAVES, leaves);
}
// org.bukkit.craftbukkit.block.data.CraftAgeable
private static final net.minecraft.server.BlockStateInteger AGE = getInteger(net.minecraft.server.BlockBamboo.class, "age");
@Override
public int getAge() {
return get(AGE);
}
@Override
public void setAge(int age) {
set(AGE, age);
}
@Override
public int getMaximumAge() {
return getMax(AGE);
}
// org.bukkit.craftbukkit.block.data.type.CraftSapling
private static final net.minecraft.server.BlockStateInteger STAGE = getInteger(net.minecraft.server.BlockBamboo.class, "stage");
@Override
public int getStage() {
return get(STAGE);
}
@Override
public void setStage(int stage) {
set(STAGE, stage);
}
@Override
public int getMaximumStage() {
return getMax(STAGE);
}
}

View File

@@ -0,0 +1,34 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftBarrel extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional {
public CraftBarrel() {
super();
}
public CraftBarrel(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.CraftDirectional
private static final net.minecraft.server.BlockStateEnum<?> FACING = getEnum(net.minecraft.server.BlockBarrel.class, "facing");
@Override
public org.bukkit.block.BlockFace getFacing() {
return get(FACING, org.bukkit.block.BlockFace.class);
}
@Override
public void setFacing(org.bukkit.block.BlockFace facing) {
set(FACING, facing);
}
@Override
public java.util.Set<org.bukkit.block.BlockFace> getFaces() {
return getValues(FACING, org.bukkit.block.BlockFace.class);
}
}

View File

@@ -0,0 +1,34 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftBell extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Bell, org.bukkit.block.data.Directional {
public CraftBell() {
super();
}
public CraftBell(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.CraftDirectional
private static final net.minecraft.server.BlockStateEnum<?> FACING = getEnum(net.minecraft.server.BlockBell.class, "facing");
@Override
public org.bukkit.block.BlockFace getFacing() {
return get(FACING, org.bukkit.block.BlockFace.class);
}
@Override
public void setFacing(org.bukkit.block.BlockFace facing) {
set(FACING, facing);
}
@Override
public java.util.Set<org.bukkit.block.BlockFace> getFaces() {
return getValues(FACING, org.bukkit.block.BlockFace.class);
}
}

View File

@@ -0,0 +1,48 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftBlastFurnace extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Furnace, org.bukkit.block.data.Directional, org.bukkit.block.data.Lightable {
public CraftBlastFurnace() {
super();
}
public CraftBlastFurnace(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.CraftDirectional
private static final net.minecraft.server.BlockStateEnum<?> FACING = getEnum(net.minecraft.server.BlockBlastFurnace.class, "facing");
@Override
public org.bukkit.block.BlockFace getFacing() {
return get(FACING, org.bukkit.block.BlockFace.class);
}
@Override
public void setFacing(org.bukkit.block.BlockFace facing) {
set(FACING, facing);
}
@Override
public java.util.Set<org.bukkit.block.BlockFace> getFaces() {
return getValues(FACING, org.bukkit.block.BlockFace.class);
}
// org.bukkit.craftbukkit.block.data.CraftLightable
private static final net.minecraft.server.BlockStateBoolean LIT = getBoolean(net.minecraft.server.BlockBlastFurnace.class, "lit");
@Override
public boolean isLit() {
return get(LIT);
}
@Override
public void setLit(boolean lit) {
set(LIT, lit);
}
}

View File

@@ -0,0 +1,57 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftCampfire extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Campfire, org.bukkit.block.data.Lightable, org.bukkit.block.data.Waterlogged {
public CraftCampfire() {
super();
}
public CraftCampfire(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.type.CraftCampfire
private static final net.minecraft.server.BlockStateBoolean SIGNAL_FIRE = getBoolean(net.minecraft.server.BlockCampfire.class, "signal_fire");
@Override
public boolean isSignalFire() {
return get(SIGNAL_FIRE);
}
@Override
public void setSignalFire(boolean signalFire) {
set(SIGNAL_FIRE, signalFire);
}
// org.bukkit.craftbukkit.block.data.CraftLightable
private static final net.minecraft.server.BlockStateBoolean LIT = getBoolean(net.minecraft.server.BlockCampfire.class, "lit");
@Override
public boolean isLit() {
return get(LIT);
}
@Override
public void setLit(boolean lit) {
set(LIT, lit);
}
// org.bukkit.craftbukkit.block.data.CraftWaterlogged
private static final net.minecraft.server.BlockStateBoolean WATERLOGGED = getBoolean(net.minecraft.server.BlockCampfire.class, "waterlogged");
@Override
public boolean isWaterlogged() {
return get(WATERLOGGED);
}
@Override
public void setWaterlogged(boolean waterlogged) {
set(WATERLOGGED, waterlogged);
}
}

View File

@@ -0,0 +1,34 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftComposter extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Levelled {
public CraftComposter() {
super();
}
public CraftComposter(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.CraftLevelled
private static final net.minecraft.server.BlockStateInteger LEVEL = getInteger(net.minecraft.server.BlockComposter.class, "level");
@Override
public int getLevel() {
return get(LEVEL);
}
@Override
public void setLevel(int level) {
set(LEVEL, level);
}
@Override
public int getMaximumLevel() {
return getMax(LEVEL);
}
}

View File

@@ -0,0 +1,48 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftFurnaceFurace extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Furnace, org.bukkit.block.data.Directional, org.bukkit.block.data.Lightable {
public CraftFurnaceFurace() {
super();
}
public CraftFurnaceFurace(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.CraftDirectional
private static final net.minecraft.server.BlockStateEnum<?> FACING = getEnum(net.minecraft.server.BlockFurnaceFurace.class, "facing");
@Override
public org.bukkit.block.BlockFace getFacing() {
return get(FACING, org.bukkit.block.BlockFace.class);
}
@Override
public void setFacing(org.bukkit.block.BlockFace facing) {
set(FACING, facing);
}
@Override
public java.util.Set<org.bukkit.block.BlockFace> getFaces() {
return getValues(FACING, org.bukkit.block.BlockFace.class);
}
// org.bukkit.craftbukkit.block.data.CraftLightable
private static final net.minecraft.server.BlockStateBoolean LIT = getBoolean(net.minecraft.server.BlockFurnaceFurace.class, "lit");
@Override
public boolean isLit() {
return get(LIT);
}
@Override
public void setLit(boolean lit) {
set(LIT, lit);
}
}

View File

@@ -1,71 +0,0 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftGlassPane extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.GlassPane, org.bukkit.block.data.MultipleFacing, org.bukkit.block.data.Waterlogged {
public CraftGlassPane() {
super();
}
public CraftGlassPane(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.CraftMultipleFacing
private static final net.minecraft.server.BlockStateBoolean[] FACES = new net.minecraft.server.BlockStateBoolean[]{
getBoolean(net.minecraft.server.BlockGlassPane.class, "north", true), getBoolean(net.minecraft.server.BlockGlassPane.class, "east", true), getBoolean(net.minecraft.server.BlockGlassPane.class, "south", true), getBoolean(net.minecraft.server.BlockGlassPane.class, "west", true), getBoolean(net.minecraft.server.BlockGlassPane.class, "up", true), getBoolean(net.minecraft.server.BlockGlassPane.class, "down", true)
};
@Override
public boolean hasFace(org.bukkit.block.BlockFace face) {
return get(FACES[face.ordinal()]);
}
@Override
public void setFace(org.bukkit.block.BlockFace face, boolean has) {
set(FACES[face.ordinal()], has);
}
@Override
public java.util.Set<org.bukkit.block.BlockFace> getFaces() {
com.google.common.collect.ImmutableSet.Builder<org.bukkit.block.BlockFace> faces = com.google.common.collect.ImmutableSet.builder();
for (int i = 0; i < FACES.length; i++) {
if (FACES[i] != null && get(FACES[i])) {
faces.add(org.bukkit.block.BlockFace.values()[i]);
}
}
return faces.build();
}
@Override
public java.util.Set<org.bukkit.block.BlockFace> getAllowedFaces() {
com.google.common.collect.ImmutableSet.Builder<org.bukkit.block.BlockFace> faces = com.google.common.collect.ImmutableSet.builder();
for (int i = 0; i < FACES.length; i++) {
if (FACES[i] != null) {
faces.add(org.bukkit.block.BlockFace.values()[i]);
}
}
return faces.build();
}
// org.bukkit.craftbukkit.block.data.CraftWaterlogged
private static final net.minecraft.server.BlockStateBoolean WATERLOGGED = getBoolean(net.minecraft.server.BlockGlassPane.class, "waterlogged");
@Override
public boolean isWaterlogged() {
return get(WATERLOGGED);
}
@Override
public void setWaterlogged(boolean waterlogged) {
set(WATERLOGGED, waterlogged);
}
}

View File

@@ -0,0 +1,34 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftGrindstone extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional {
public CraftGrindstone() {
super();
}
public CraftGrindstone(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.CraftDirectional
private static final net.minecraft.server.BlockStateEnum<?> FACING = getEnum(net.minecraft.server.BlockGrindstone.class, "facing");
@Override
public org.bukkit.block.BlockFace getFacing() {
return get(FACING, org.bukkit.block.BlockFace.class);
}
@Override
public void setFacing(org.bukkit.block.BlockFace facing) {
set(FACING, facing);
}
@Override
public java.util.Set<org.bukkit.block.BlockFace> getFaces() {
return getValues(FACING, org.bukkit.block.BlockFace.class);
}
}

View File

@@ -0,0 +1,34 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftJigsaw extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional {
public CraftJigsaw() {
super();
}
public CraftJigsaw(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.CraftDirectional
private static final net.minecraft.server.BlockStateEnum<?> FACING = getEnum(net.minecraft.server.BlockJigsaw.class, "facing");
@Override
public org.bukkit.block.BlockFace getFacing() {
return get(FACING, org.bukkit.block.BlockFace.class);
}
@Override
public void setFacing(org.bukkit.block.BlockFace facing) {
set(FACING, facing);
}
@Override
public java.util.Set<org.bukkit.block.BlockFace> getFaces() {
return getValues(FACING, org.bukkit.block.BlockFace.class);
}
}

View File

@@ -0,0 +1,29 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftLantern extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Lantern {
public CraftLantern() {
super();
}
public CraftLantern(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.type.CraftLantern
private static final net.minecraft.server.BlockStateBoolean HANGING = getBoolean(net.minecraft.server.BlockLantern.class, "hanging");
@Override
public boolean isHanging() {
return get(HANGING);
}
@Override
public void setHanging(boolean hanging) {
set(HANGING, hanging);
}
}

View File

@@ -0,0 +1,57 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftLectern extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Lectern, org.bukkit.block.data.Directional, org.bukkit.block.data.Powerable {
public CraftLectern() {
super();
}
public CraftLectern(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.type.CraftLectern
private static final net.minecraft.server.BlockStateBoolean HAS_BOOK = getBoolean(net.minecraft.server.BlockLectern.class, "has_book");
@Override
public boolean hasBook() {
return get(HAS_BOOK);
}
// org.bukkit.craftbukkit.block.data.CraftDirectional
private static final net.minecraft.server.BlockStateEnum<?> FACING = getEnum(net.minecraft.server.BlockLectern.class, "facing");
@Override
public org.bukkit.block.BlockFace getFacing() {
return get(FACING, org.bukkit.block.BlockFace.class);
}
@Override
public void setFacing(org.bukkit.block.BlockFace facing) {
set(FACING, facing);
}
@Override
public java.util.Set<org.bukkit.block.BlockFace> getFaces() {
return getValues(FACING, org.bukkit.block.BlockFace.class);
}
// org.bukkit.craftbukkit.block.data.CraftPowerable
private static final net.minecraft.server.BlockStateBoolean POWERED = getBoolean(net.minecraft.server.BlockLectern.class, "powered");
@Override
public boolean isPowered() {
return get(POWERED);
}
@Override
public void setPowered(boolean powered) {
set(POWERED, powered);
}
}

View File

@@ -0,0 +1,34 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftLoom extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional {
public CraftLoom() {
super();
}
public CraftLoom(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.CraftDirectional
private static final net.minecraft.server.BlockStateEnum<?> FACING = getEnum(net.minecraft.server.BlockLoom.class, "facing");
@Override
public org.bukkit.block.BlockFace getFacing() {
return get(FACING, org.bukkit.block.BlockFace.class);
}
@Override
public void setFacing(org.bukkit.block.BlockFace facing) {
set(FACING, facing);
}
@Override
public java.util.Set<org.bukkit.block.BlockFace> getFaces() {
return getValues(FACING, org.bukkit.block.BlockFace.class);
}
}

View File

@@ -0,0 +1,59 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftScaffolding extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Scaffolding, org.bukkit.block.data.Waterlogged {
public CraftScaffolding() {
super();
}
public CraftScaffolding(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.type.CraftScaffolding
private static final net.minecraft.server.BlockStateBoolean BOTTOM = getBoolean(net.minecraft.server.BlockScaffolding.class, "bottom");
private static final net.minecraft.server.BlockStateInteger DISTANCE = getInteger(net.minecraft.server.BlockScaffolding.class, "distance");
@Override
public boolean isBottom() {
return get(BOTTOM);
}
@Override
public void setBottom(boolean bottom) {
set(BOTTOM, bottom);
}
@Override
public int getDistance() {
return get(DISTANCE);
}
@Override
public void setDistance(int distance) {
set(DISTANCE, distance);
}
@Override
public int getMaximumDistance() {
return getMax(DISTANCE);
}
// org.bukkit.craftbukkit.block.data.CraftWaterlogged
private static final net.minecraft.server.BlockStateBoolean WATERLOGGED = getBoolean(net.minecraft.server.BlockScaffolding.class, "waterlogged");
@Override
public boolean isWaterlogged() {
return get(WATERLOGGED);
}
@Override
public void setWaterlogged(boolean waterlogged) {
set(WATERLOGGED, waterlogged);
}
}

View File

@@ -3,19 +3,19 @@
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftFurnace extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Furnace, org.bukkit.block.data.Directional, org.bukkit.block.data.Lightable {
public final class CraftSmoker extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.Furnace, org.bukkit.block.data.Directional, org.bukkit.block.data.Lightable {
public CraftFurnace() {
public CraftSmoker() {
super();
}
public CraftFurnace(net.minecraft.server.IBlockData state) {
public CraftSmoker(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.CraftDirectional
private static final net.minecraft.server.BlockStateEnum<?> FACING = getEnum(net.minecraft.server.BlockFurnace.class, "facing");
private static final net.minecraft.server.BlockStateEnum<?> FACING = getEnum(net.minecraft.server.BlockSmoker.class, "facing");
@Override
public org.bukkit.block.BlockFace getFacing() {
@@ -34,7 +34,7 @@ public final class CraftFurnace extends org.bukkit.craftbukkit.block.data.CraftB
// org.bukkit.craftbukkit.block.data.CraftLightable
private static final net.minecraft.server.BlockStateBoolean LIT = getBoolean(net.minecraft.server.BlockFurnace.class, "lit");
private static final net.minecraft.server.BlockStateBoolean LIT = getBoolean(net.minecraft.server.BlockSmoker.class, "lit");
@Override
public boolean isLit() {

View File

@@ -0,0 +1,34 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftStonecutter extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional {
public CraftStonecutter() {
super();
}
public CraftStonecutter(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.CraftDirectional
private static final net.minecraft.server.BlockStateEnum<?> FACING = getEnum(net.minecraft.server.BlockStonecutter.class, "facing");
@Override
public org.bukkit.block.BlockFace getFacing() {
return get(FACING, org.bukkit.block.BlockFace.class);
}
@Override
public void setFacing(org.bukkit.block.BlockFace facing) {
set(FACING, facing);
}
@Override
public java.util.Set<org.bukkit.block.BlockFace> getFaces() {
return getValues(FACING, org.bukkit.block.BlockFace.class);
}
}

View File

@@ -0,0 +1,34 @@
/**
* Automatically generated file, changes will be lost.
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftSweetBerryBush extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Ageable {
public CraftSweetBerryBush() {
super();
}
public CraftSweetBerryBush(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.CraftAgeable
private static final net.minecraft.server.BlockStateInteger AGE = getInteger(net.minecraft.server.BlockSweetBerryBush.class, "age");
@Override
public int getAge() {
return get(AGE);
}
@Override
public void setAge(int age) {
set(AGE, age);
}
@Override
public int getMaximumAge() {
return getMax(AGE);
}
}

View File

@@ -3,19 +3,19 @@
*/
package org.bukkit.craftbukkit.block.impl;
public final class CraftTallPlantShearable extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Bisected {
public final class CraftTallPlant extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Bisected {
public CraftTallPlantShearable() {
public CraftTallPlant() {
super();
}
public CraftTallPlantShearable(net.minecraft.server.IBlockData state) {
public CraftTallPlant(net.minecraft.server.IBlockData state) {
super(state);
}
// org.bukkit.craftbukkit.block.data.CraftBisected
private static final net.minecraft.server.BlockStateEnum<?> HALF = getEnum(net.minecraft.server.BlockTallPlantShearable.class, "half");
private static final net.minecraft.server.BlockStateEnum<?> HALF = getEnum(net.minecraft.server.BlockTallPlant.class, "half");
@Override
public Half getHalf() {