@@ -460,7 +460,7 @@ public class CraftBlock implements Block {
|
||||
|
||||
@Override
|
||||
public boolean isLiquid() {
|
||||
return getNMS().getMaterial().isLiquid();
|
||||
return getNMS().liquid();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,13 +11,14 @@ import javax.annotation.Nullable;
|
||||
import net.minecraft.core.BlockPosition;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.level.GeneratorAccess;
|
||||
import net.minecraft.world.level.block.entity.BrushableBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.CalibratedSculkSensorBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.ChiseledBookShelfBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.DecoratedPotBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.HangingSignBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.SculkCatalystBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.SculkSensorBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.SculkShriekerBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.SuspiciousSandBlockEntity;
|
||||
import net.minecraft.world.level.block.entity.TileEntity;
|
||||
import net.minecraft.world.level.block.entity.TileEntityBanner;
|
||||
import net.minecraft.world.level.block.entity.TileEntityBarrel;
|
||||
@@ -323,12 +324,14 @@ public final class CraftBlockStates {
|
||||
register(Material.LECTERN, CraftLectern.class, CraftLectern::new, TileEntityLectern::new);
|
||||
register(Material.MOVING_PISTON, CraftMovingPiston.class, CraftMovingPiston::new, TileEntityPiston::new);
|
||||
register(Material.SCULK_CATALYST, CraftSculkCatalyst.class, CraftSculkCatalyst::new, SculkCatalystBlockEntity::new);
|
||||
register(Material.CALIBRATED_SCULK_SENSOR, CraftCalibratedSculkSensor.class, CraftCalibratedSculkSensor::new, CalibratedSculkSensorBlockEntity::new);
|
||||
register(Material.SCULK_SENSOR, CraftSculkSensor.class, CraftSculkSensor::new, SculkSensorBlockEntity::new);
|
||||
register(Material.SCULK_SHRIEKER, CraftSculkShrieker.class, CraftSculkShrieker::new, SculkShriekerBlockEntity::new);
|
||||
register(Material.SMOKER, CraftSmoker.class, CraftSmoker::new, TileEntitySmoker::new);
|
||||
register(Material.SPAWNER, CraftCreatureSpawner.class, CraftCreatureSpawner::new, TileEntityMobSpawner::new);
|
||||
register(Material.STRUCTURE_BLOCK, CraftStructureBlock.class, CraftStructureBlock::new, TileEntityStructure::new);
|
||||
register(Material.SUSPICIOUS_SAND, CraftSuspiciousSand.class, CraftSuspiciousSand::new, SuspiciousSandBlockEntity::new);
|
||||
register(Material.SUSPICIOUS_SAND, CraftSuspiciousSand.class, CraftSuspiciousSand::new, BrushableBlockEntity::new);
|
||||
register(Material.SUSPICIOUS_GRAVEL, CraftBrushableBlock.class, CraftBrushableBlock::new, BrushableBlockEntity::new);
|
||||
register(Material.TRAPPED_CHEST, CraftChest.class, CraftChest::new, TileEntityChestTrapped::new);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import net.minecraft.resources.MinecraftKey;
|
||||
import net.minecraft.world.level.block.entity.BrushableBlockEntity;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.BrushableBlock;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.loot.LootTable;
|
||||
|
||||
public class CraftBrushableBlock extends CraftBlockEntityState<BrushableBlockEntity> implements BrushableBlock {
|
||||
|
||||
public CraftBrushableBlock(World world, BrushableBlockEntity tileEntity) {
|
||||
super(world, tileEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItem() {
|
||||
return CraftItemStack.asBukkitCopy(getSnapshot().getItem());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItem(ItemStack item) {
|
||||
getSnapshot().item = CraftItemStack.asNMSCopy(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyTo(BrushableBlockEntity lootable) {
|
||||
super.applyTo(lootable);
|
||||
|
||||
if (this.getSnapshot().lootTable == null) {
|
||||
lootable.setLootTable((MinecraftKey) null, 0L);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LootTable getLootTable() {
|
||||
if (getSnapshot().lootTable == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MinecraftKey key = getSnapshot().lootTable;
|
||||
return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLootTable(LootTable table) {
|
||||
setLootTable(table, getSeed());
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSeed() {
|
||||
return getSnapshot().lootTableSeed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSeed(long seed) {
|
||||
setLootTable(getLootTable(), seed);
|
||||
}
|
||||
|
||||
private void setLootTable(LootTable table, long seed) {
|
||||
MinecraftKey key = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey());
|
||||
getSnapshot().setLootTable(key, seed);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import net.minecraft.world.level.block.entity.CalibratedSculkSensorBlockEntity;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.CalibratedSculkSensor;
|
||||
|
||||
public class CraftCalibratedSculkSensor extends CraftSculkSensor<CalibratedSculkSensorBlockEntity> implements CalibratedSculkSensor {
|
||||
|
||||
public CraftCalibratedSculkSensor(World world, CalibratedSculkSensorBlockEntity tileEntity) {
|
||||
super(world, tileEntity);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import net.minecraft.world.level.block.entity.DecoratedPotBlockEntity;
|
||||
@@ -17,22 +16,6 @@ public class CraftDecoratedPot extends CraftBlockEntityState<DecoratedPotBlockEn
|
||||
|
||||
@Override
|
||||
public List<Material> getShards() {
|
||||
return getSnapshot().getShards().stream().map(CraftMagicNumbers::getMaterial).collect(Collectors.toUnmodifiableList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addShard(Material material) {
|
||||
Preconditions.checkArgument(material != null && material.isItem(), "Material must be an item");
|
||||
|
||||
getSnapshot().getShards().add(CraftMagicNumbers.getItem(material));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setShards(List<Material> shard) {
|
||||
getSnapshot().getShards().clear();
|
||||
|
||||
for (Material material : shard) {
|
||||
addShard(material);
|
||||
}
|
||||
return getSnapshot().getDecorations().sorted().map(CraftMagicNumbers::getMaterial).collect(Collectors.toUnmodifiableList());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,9 +5,9 @@ import net.minecraft.world.level.block.entity.SculkSensorBlockEntity;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.SculkSensor;
|
||||
|
||||
public class CraftSculkSensor extends CraftBlockEntityState<SculkSensorBlockEntity> implements SculkSensor {
|
||||
public class CraftSculkSensor<T extends SculkSensorBlockEntity> extends CraftBlockEntityState<T> implements SculkSensor {
|
||||
|
||||
public CraftSculkSensor(World world, SculkSensorBlockEntity tileEntity) {
|
||||
public CraftSculkSensor(World world, T tileEntity) {
|
||||
super(world, tileEntity);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,10 +17,12 @@ import org.jetbrains.annotations.NotNull;
|
||||
public class CraftSign<T extends TileEntitySign> extends CraftBlockEntityState<T> implements Sign {
|
||||
|
||||
private final CraftSignSide front;
|
||||
private final CraftSignSide back;
|
||||
|
||||
public CraftSign(World world, T tileEntity) {
|
||||
super(world, tileEntity);
|
||||
this.front = new CraftSignSide(this.getSnapshot());
|
||||
this.front = new CraftSignSide(this.getSnapshot().getFrontText());
|
||||
this.back = new CraftSignSide(this.getSnapshot().getBackText());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -40,12 +42,12 @@ public class CraftSign<T extends TileEntitySign> extends CraftBlockEntityState<T
|
||||
|
||||
@Override
|
||||
public boolean isEditable() {
|
||||
return getSnapshot().isEditable;
|
||||
return !getSnapshot().isWaxed() && getSnapshot().playerWhoMayEdit != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEditable(boolean editable) {
|
||||
getSnapshot().isEditable = editable;
|
||||
getSnapshot().setWaxed(!editable);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -63,7 +65,14 @@ public class CraftSign<T extends TileEntitySign> extends CraftBlockEntityState<T
|
||||
public SignSide getSide(Side side) {
|
||||
Preconditions.checkArgument(side != null, "side == null");
|
||||
|
||||
return front;
|
||||
switch (side) {
|
||||
case FRONT:
|
||||
return front;
|
||||
case BACK:
|
||||
return back;
|
||||
default:
|
||||
throw new IllegalArgumentException();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,6 +88,7 @@ public class CraftSign<T extends TileEntitySign> extends CraftBlockEntityState<T
|
||||
@Override
|
||||
public void applyTo(T sign) {
|
||||
front.applyLegacyStringToSignSide();
|
||||
back.applyLegacyStringToSignSide();
|
||||
|
||||
super.applyTo(sign);
|
||||
}
|
||||
@@ -89,9 +99,8 @@ public class CraftSign<T extends TileEntitySign> extends CraftBlockEntityState<T
|
||||
Preconditions.checkArgument(sign.getWorld() == player.getWorld(), "Sign must be in same world as Player");
|
||||
|
||||
TileEntitySign handle = ((CraftSign<?>) sign).getTileEntity();
|
||||
handle.isEditable = true;
|
||||
|
||||
((CraftPlayer) player).getHandle().openTextEdit(handle);
|
||||
((CraftPlayer) player).getHandle().openTextEdit(handle, true);
|
||||
}
|
||||
|
||||
public static IChatBaseComponent[] sanitizeLines(String[] lines) {
|
||||
|
||||
@@ -1,67 +1,12 @@
|
||||
package org.bukkit.craftbukkit.block;
|
||||
|
||||
import net.minecraft.resources.MinecraftKey;
|
||||
import net.minecraft.world.level.block.entity.SuspiciousSandBlockEntity;
|
||||
import org.bukkit.Bukkit;
|
||||
import net.minecraft.world.level.block.entity.BrushableBlockEntity;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.SuspiciousSand;
|
||||
import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
import org.bukkit.craftbukkit.util.CraftNamespacedKey;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.loot.LootTable;
|
||||
|
||||
public class CraftSuspiciousSand extends CraftBlockEntityState<SuspiciousSandBlockEntity> implements SuspiciousSand {
|
||||
public class CraftSuspiciousSand extends CraftBrushableBlock implements SuspiciousSand {
|
||||
|
||||
public CraftSuspiciousSand(World world, SuspiciousSandBlockEntity tileEntity) {
|
||||
public CraftSuspiciousSand(World world, BrushableBlockEntity tileEntity) {
|
||||
super(world, tileEntity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getItem() {
|
||||
return CraftItemStack.asBukkitCopy(getSnapshot().getItem());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setItem(ItemStack item) {
|
||||
getSnapshot().item = CraftItemStack.asNMSCopy(item);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyTo(SuspiciousSandBlockEntity lootable) {
|
||||
super.applyTo(lootable);
|
||||
|
||||
if (this.getSnapshot().lootTable == null) {
|
||||
lootable.setLootTable((MinecraftKey) null, 0L);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LootTable getLootTable() {
|
||||
if (getSnapshot().lootTable == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MinecraftKey key = getSnapshot().lootTable;
|
||||
return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLootTable(LootTable table) {
|
||||
setLootTable(table, getSeed());
|
||||
}
|
||||
|
||||
@Override
|
||||
public long getSeed() {
|
||||
return getSnapshot().lootTableSeed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSeed(long seed) {
|
||||
setLootTable(getLootTable(), seed);
|
||||
}
|
||||
|
||||
private void setLootTable(LootTable table, long seed) {
|
||||
MinecraftKey key = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey());
|
||||
getSnapshot().setLootTable(key, seed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -480,6 +480,8 @@ public class CraftBlockData implements BlockData {
|
||||
register(net.minecraft.world.level.block.BlockWeepingVines.class, org.bukkit.craftbukkit.block.impl.CraftWeepingVines::new);
|
||||
register(net.minecraft.world.level.block.BlockWitherSkull.class, org.bukkit.craftbukkit.block.impl.CraftWitherSkull::new);
|
||||
register(net.minecraft.world.level.block.BlockWitherSkullWall.class, org.bukkit.craftbukkit.block.impl.CraftWitherSkullWall::new);
|
||||
register(net.minecraft.world.level.block.BrushableBlock.class, org.bukkit.craftbukkit.block.impl.CraftBrushable::new);
|
||||
register(net.minecraft.world.level.block.CalibratedSculkSensorBlock.class, org.bukkit.craftbukkit.block.impl.CraftCalibratedSculkSensor::new);
|
||||
register(net.minecraft.world.level.block.CandleBlock.class, org.bukkit.craftbukkit.block.impl.CraftCandle::new);
|
||||
register(net.minecraft.world.level.block.CandleCakeBlock.class, org.bukkit.craftbukkit.block.impl.CraftCandleCake::new);
|
||||
register(net.minecraft.world.level.block.CaveVinesBlock.class, org.bukkit.craftbukkit.block.impl.CraftCaveVines::new);
|
||||
@@ -488,6 +490,7 @@ public class CraftBlockData implements BlockData {
|
||||
register(net.minecraft.world.level.block.CherryLeavesBlock.class, org.bukkit.craftbukkit.block.impl.CraftCherryLeaves::new);
|
||||
register(net.minecraft.world.level.block.ChiseledBookShelfBlock.class, org.bukkit.craftbukkit.block.impl.CraftChiseledBookShelf::new);
|
||||
register(net.minecraft.world.level.block.DecoratedPotBlock.class, org.bukkit.craftbukkit.block.impl.CraftDecoratedPot::new);
|
||||
register(net.minecraft.world.level.block.EquipableCarvedPumpkinBlock.class, org.bukkit.craftbukkit.block.impl.CraftEquipableCarvedPumpkin::new);
|
||||
register(net.minecraft.world.level.block.GlowLichenBlock.class, org.bukkit.craftbukkit.block.impl.CraftGlowLichen::new);
|
||||
register(net.minecraft.world.level.block.HangingRootsBlock.class, org.bukkit.craftbukkit.block.impl.CraftHangingRoots::new);
|
||||
register(net.minecraft.world.level.block.InfestedRotatedPillarBlock.class, org.bukkit.craftbukkit.block.impl.CraftInfestedRotatedPillar::new);
|
||||
@@ -499,6 +502,7 @@ public class CraftBlockData implements BlockData {
|
||||
register(net.minecraft.world.level.block.MangroveRootsBlock.class, org.bukkit.craftbukkit.block.impl.CraftMangroveRoots::new);
|
||||
register(net.minecraft.world.level.block.PiglinWallSkullBlock.class, org.bukkit.craftbukkit.block.impl.CraftPiglinWallSkull::new);
|
||||
register(net.minecraft.world.level.block.PinkPetalsBlock.class, org.bukkit.craftbukkit.block.impl.CraftPinkPetals::new);
|
||||
register(net.minecraft.world.level.block.PitcherCropBlock.class, org.bukkit.craftbukkit.block.impl.CraftPitcherCrop::new);
|
||||
register(net.minecraft.world.level.block.PointedDripstoneBlock.class, org.bukkit.craftbukkit.block.impl.CraftPointedDripstone::new);
|
||||
register(net.minecraft.world.level.block.PowderSnowCauldronBlock.class, org.bukkit.craftbukkit.block.impl.CraftPowderSnowCauldron::new);
|
||||
register(net.minecraft.world.level.block.SculkCatalystBlock.class, org.bukkit.craftbukkit.block.impl.CraftSculkCatalyst::new);
|
||||
@@ -506,7 +510,7 @@ public class CraftBlockData implements BlockData {
|
||||
register(net.minecraft.world.level.block.SculkShriekerBlock.class, org.bukkit.craftbukkit.block.impl.CraftSculkShrieker::new);
|
||||
register(net.minecraft.world.level.block.SculkVeinBlock.class, org.bukkit.craftbukkit.block.impl.CraftSculkVein::new);
|
||||
register(net.minecraft.world.level.block.SmallDripleafBlock.class, org.bukkit.craftbukkit.block.impl.CraftSmallDripleaf::new);
|
||||
register(net.minecraft.world.level.block.SuspiciousSandBlock.class, org.bukkit.craftbukkit.block.impl.CraftSuspiciousSand::new);
|
||||
register(net.minecraft.world.level.block.SnifferEggBlock.class, org.bukkit.craftbukkit.block.impl.CraftSnifferEgg::new);
|
||||
register(net.minecraft.world.level.block.TallSeagrassBlock.class, org.bukkit.craftbukkit.block.impl.CraftTallSeagrass::new);
|
||||
register(net.minecraft.world.level.block.TorchflowerCropBlock.class, org.bukkit.craftbukkit.block.impl.CraftTorchflowerCrop::new);
|
||||
register(net.minecraft.world.level.block.WallHangingSignBlock.class, org.bukkit.craftbukkit.block.impl.CraftWallHangingSign::new);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.bukkit.craftbukkit.block.data;
|
||||
|
||||
import org.bukkit.block.data.Brushable;
|
||||
|
||||
public abstract class CraftBrushable extends CraftBlockData implements Brushable {
|
||||
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateInteger DUSTED = getInteger("dusted");
|
||||
|
||||
@Override
|
||||
public int getDusted() {
|
||||
return get(DUSTED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDusted(int dusted) {
|
||||
set(DUSTED, dusted);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaximumDusted() {
|
||||
return getMax(DUSTED);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package org.bukkit.craftbukkit.block.data;
|
||||
|
||||
import org.bukkit.block.data.Hatchable;
|
||||
|
||||
public abstract class CraftHatchable extends CraftBlockData implements Hatchable {
|
||||
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateInteger HATCH = getInteger("hatch");
|
||||
|
||||
@Override
|
||||
public int getHatch() {
|
||||
return get(HATCH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHatch(int hatch) {
|
||||
set(HATCH, hatch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaximumHatch() {
|
||||
return getMax(HATCH);
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
package org.bukkit.craftbukkit.block.data.type;
|
||||
|
||||
import org.bukkit.block.data.type.SuspiciousSand;
|
||||
import org.bukkit.block.data.Brushable;
|
||||
import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||
|
||||
public abstract class CraftSuspiciousSand extends CraftBlockData implements SuspiciousSand {
|
||||
public abstract class CraftBrushable extends CraftBlockData implements Brushable {
|
||||
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateInteger DUSTED = getInteger("dusted");
|
||||
|
||||
@@ -6,7 +6,6 @@ import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||
public abstract class CraftTurtleEgg extends CraftBlockData implements TurtleEgg {
|
||||
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateInteger EGGS = getInteger("eggs");
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateInteger HATCH = getInteger("hatch");
|
||||
|
||||
@Override
|
||||
public int getEggs() {
|
||||
@@ -27,19 +26,4 @@ public abstract class CraftTurtleEgg extends CraftBlockData implements TurtleEgg
|
||||
public int getMaximumEggs() {
|
||||
return getMax(EGGS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHatch() {
|
||||
return get(HATCH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHatch(int hatch) {
|
||||
set(HATCH, hatch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaximumHatch() {
|
||||
return getMax(HATCH);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,19 +3,19 @@
|
||||
*/
|
||||
package org.bukkit.craftbukkit.block.impl;
|
||||
|
||||
public final class CraftSuspiciousSand extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.SuspiciousSand {
|
||||
public final class CraftBrushable extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Brushable {
|
||||
|
||||
public CraftSuspiciousSand() {
|
||||
public CraftBrushable() {
|
||||
super();
|
||||
}
|
||||
|
||||
public CraftSuspiciousSand(net.minecraft.world.level.block.state.IBlockData state) {
|
||||
public CraftBrushable(net.minecraft.world.level.block.state.IBlockData state) {
|
||||
super(state);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.type.CraftSuspiciousSand
|
||||
// org.bukkit.craftbukkit.block.data.CraftBrushable
|
||||
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateInteger DUSTED = getInteger(net.minecraft.world.level.block.SuspiciousSandBlock.class, "dusted");
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateInteger DUSTED = getInteger(net.minecraft.world.level.block.BrushableBlock.class, "dusted");
|
||||
|
||||
@Override
|
||||
public int getDusted() {
|
||||
@@ -0,0 +1,81 @@
|
||||
/**
|
||||
* Automatically generated file, changes will be lost.
|
||||
*/
|
||||
package org.bukkit.craftbukkit.block.impl;
|
||||
|
||||
public final class CraftCalibratedSculkSensor extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.CalibratedSculkSensor, org.bukkit.block.data.Directional, org.bukkit.block.data.type.SculkSensor, org.bukkit.block.data.AnaloguePowerable, org.bukkit.block.data.Waterlogged {
|
||||
|
||||
public CraftCalibratedSculkSensor() {
|
||||
super();
|
||||
}
|
||||
|
||||
public CraftCalibratedSculkSensor(net.minecraft.world.level.block.state.IBlockData state) {
|
||||
super(state);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftDirectional
|
||||
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateEnum<?> FACING = getEnum(net.minecraft.world.level.block.CalibratedSculkSensorBlock.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.type.CraftSculkSensor
|
||||
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateEnum<?> PHASE = getEnum(net.minecraft.world.level.block.CalibratedSculkSensorBlock.class, "sculk_sensor_phase");
|
||||
|
||||
@Override
|
||||
public org.bukkit.block.data.type.SculkSensor.Phase getPhase() {
|
||||
return get(PHASE, org.bukkit.block.data.type.SculkSensor.Phase.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPhase(org.bukkit.block.data.type.SculkSensor.Phase phase) {
|
||||
set(PHASE, phase);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftAnaloguePowerable
|
||||
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateInteger POWER = getInteger(net.minecraft.world.level.block.CalibratedSculkSensorBlock.class, "power");
|
||||
|
||||
@Override
|
||||
public int getPower() {
|
||||
return get(POWER);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setPower(int power) {
|
||||
set(POWER, power);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaximumPower() {
|
||||
return getMax(POWER);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftWaterlogged
|
||||
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateBoolean WATERLOGGED = getBoolean(net.minecraft.world.level.block.CalibratedSculkSensorBlock.class, "waterlogged");
|
||||
|
||||
@Override
|
||||
public boolean isWaterlogged() {
|
||||
return get(WATERLOGGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWaterlogged(boolean waterlogged) {
|
||||
set(WATERLOGGED, waterlogged);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Automatically generated file, changes will be lost.
|
||||
*/
|
||||
package org.bukkit.craftbukkit.block.impl;
|
||||
|
||||
public final class CraftEquipableCarvedPumpkin extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Directional {
|
||||
|
||||
public CraftEquipableCarvedPumpkin() {
|
||||
super();
|
||||
}
|
||||
|
||||
public CraftEquipableCarvedPumpkin(net.minecraft.world.level.block.state.IBlockData state) {
|
||||
super(state);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftDirectional
|
||||
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateEnum<?> FACING = getEnum(net.minecraft.world.level.block.EquipableCarvedPumpkinBlock.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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Automatically generated file, changes will be lost.
|
||||
*/
|
||||
package org.bukkit.craftbukkit.block.impl;
|
||||
|
||||
public final class CraftPitcherCrop extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.PitcherCrop, org.bukkit.block.data.Ageable, org.bukkit.block.data.Bisected {
|
||||
|
||||
public CraftPitcherCrop() {
|
||||
super();
|
||||
}
|
||||
|
||||
public CraftPitcherCrop(net.minecraft.world.level.block.state.IBlockData state) {
|
||||
super(state);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftAgeable
|
||||
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateInteger AGE = getInteger(net.minecraft.world.level.block.PitcherCropBlock.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.CraftBisected
|
||||
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateEnum<?> HALF = getEnum(net.minecraft.world.level.block.PitcherCropBlock.class, "half");
|
||||
|
||||
@Override
|
||||
public org.bukkit.block.data.Bisected.Half getHalf() {
|
||||
return get(HALF, org.bukkit.block.data.Bisected.Half.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHalf(org.bukkit.block.data.Bisected.Half half) {
|
||||
set(HALF, half);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Automatically generated file, changes will be lost.
|
||||
*/
|
||||
package org.bukkit.craftbukkit.block.impl;
|
||||
|
||||
public final class CraftSnifferEgg extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Hatchable {
|
||||
|
||||
public CraftSnifferEgg() {
|
||||
super();
|
||||
}
|
||||
|
||||
public CraftSnifferEgg(net.minecraft.world.level.block.state.IBlockData state) {
|
||||
super(state);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftHatchable
|
||||
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateInteger HATCH = getInteger(net.minecraft.world.level.block.SnifferEggBlock.class, "hatch");
|
||||
|
||||
@Override
|
||||
public int getHatch() {
|
||||
return get(HATCH);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setHatch(int hatch) {
|
||||
set(HATCH, hatch);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaximumHatch() {
|
||||
return getMax(HATCH);
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
package org.bukkit.craftbukkit.block.impl;
|
||||
|
||||
public final class CraftTurtleEgg extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.TurtleEgg {
|
||||
public final class CraftTurtleEgg extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.TurtleEgg, org.bukkit.block.data.Hatchable {
|
||||
|
||||
public CraftTurtleEgg() {
|
||||
super();
|
||||
@@ -16,7 +16,6 @@ public final class CraftTurtleEgg extends org.bukkit.craftbukkit.block.data.Craf
|
||||
// org.bukkit.craftbukkit.block.data.type.CraftTurtleEgg
|
||||
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateInteger EGGS = getInteger(net.minecraft.world.level.block.BlockTurtleEgg.class, "eggs");
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateInteger HATCH = getInteger(net.minecraft.world.level.block.BlockTurtleEgg.class, "hatch");
|
||||
|
||||
@Override
|
||||
public int getEggs() {
|
||||
@@ -38,6 +37,10 @@ public final class CraftTurtleEgg extends org.bukkit.craftbukkit.block.data.Craf
|
||||
return getMax(EGGS);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftHatchable
|
||||
|
||||
private static final net.minecraft.world.level.block.state.properties.BlockStateInteger HATCH = getInteger(net.minecraft.world.level.block.BlockTurtleEgg.class, "hatch");
|
||||
|
||||
@Override
|
||||
public int getHatch() {
|
||||
return get(HATCH);
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package org.bukkit.craftbukkit.block.sign;
|
||||
|
||||
import net.minecraft.network.chat.IChatBaseComponent;
|
||||
import net.minecraft.world.item.EnumColor;
|
||||
import net.minecraft.world.level.block.entity.TileEntitySign;
|
||||
import net.minecraft.world.level.block.entity.SignText;
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.block.sign.SignSide;
|
||||
import org.bukkit.craftbukkit.block.CraftSign;
|
||||
@@ -14,9 +15,9 @@ public class CraftSignSide implements SignSide {
|
||||
// Lazily initialized only if requested:
|
||||
private String[] originalLines = null;
|
||||
private String[] lines = null;
|
||||
private final TileEntitySign signText;
|
||||
private final SignText signText;
|
||||
|
||||
public CraftSignSide(TileEntitySign signText) {
|
||||
public CraftSignSide(SignText signText) {
|
||||
this.signText = signText;
|
||||
}
|
||||
|
||||
@@ -25,8 +26,9 @@ public class CraftSignSide implements SignSide {
|
||||
public String[] getLines() {
|
||||
if (lines == null) {
|
||||
// Lazy initialization:
|
||||
lines = new String[signText.messages.length];
|
||||
System.arraycopy(CraftSign.revertComponents(signText.messages), 0, lines, 0, lines.length);
|
||||
IChatBaseComponent[] messages = signText.getMessages(false);
|
||||
lines = new String[messages.length];
|
||||
System.arraycopy(CraftSign.revertComponents(messages), 0, lines, 0, lines.length);
|
||||
originalLines = new String[lines.length];
|
||||
System.arraycopy(lines, 0, originalLines, 0, originalLines.length);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user