@@ -416,7 +416,7 @@ public class CraftBlock implements Block {
|
||||
return null;
|
||||
}
|
||||
|
||||
return Biome.valueOf(BiomeBase.REGISTRY_ID.b(base).getKey().toUpperCase(java.util.Locale.ENGLISH));
|
||||
return Biome.valueOf(IRegistry.BIOME.getKey(base).getKey().toUpperCase(java.util.Locale.ENGLISH));
|
||||
}
|
||||
|
||||
public static BiomeBase biomeToBiomeBase(Biome bio) {
|
||||
@@ -424,7 +424,7 @@ public class CraftBlock implements Block {
|
||||
return null;
|
||||
}
|
||||
|
||||
return BiomeBase.REGISTRY_ID.get(new MinecraftKey(bio.name().toLowerCase(java.util.Locale.ENGLISH)));
|
||||
return IRegistry.BIOME.get(new MinecraftKey(bio.name().toLowerCase(java.util.Locale.ENGLISH)));
|
||||
}
|
||||
|
||||
public double getTemperature() {
|
||||
@@ -479,12 +479,12 @@ public class CraftBlock implements Block {
|
||||
int x = getX();
|
||||
int y = getY();
|
||||
int z = getZ();
|
||||
if ((face == BlockFace.DOWN || face == BlockFace.SELF) && world.isBlockFacePowered(new BlockPosition(x, y - 1, z), EnumDirection.DOWN)) power = wire.getPower(world, new BlockPosition(x, y - 1, z), power);
|
||||
if ((face == BlockFace.UP || face == BlockFace.SELF) && world.isBlockFacePowered(new BlockPosition(x, y + 1, z), EnumDirection.UP)) power = wire.getPower(world, new BlockPosition(x, y + 1, z), power);
|
||||
if ((face == BlockFace.EAST || face == BlockFace.SELF) && world.isBlockFacePowered(new BlockPosition(x + 1, y, z), EnumDirection.EAST)) power = wire.getPower(world, new BlockPosition(x + 1, y, z), power);
|
||||
if ((face == BlockFace.WEST || face == BlockFace.SELF) && world.isBlockFacePowered(new BlockPosition(x - 1, y, z), EnumDirection.WEST)) power = wire.getPower(world, new BlockPosition(x - 1, y, z), power);
|
||||
if ((face == BlockFace.NORTH || face == BlockFace.SELF) && world.isBlockFacePowered(new BlockPosition(x, y, z - 1), EnumDirection.NORTH)) power = wire.getPower(world, new BlockPosition(x, y, z - 1), power);
|
||||
if ((face == BlockFace.SOUTH || face == BlockFace.SELF) && world.isBlockFacePowered(new BlockPosition(x, y, z + 1), EnumDirection.SOUTH)) power = wire.getPower(world, new BlockPosition(x, y, z - 1), power);
|
||||
if ((face == BlockFace.DOWN || face == BlockFace.SELF) && world.isBlockFacePowered(new BlockPosition(x, y - 1, z), EnumDirection.DOWN)) power = wire.getPower(power, world.getType(new BlockPosition(x, y - 1, z)));
|
||||
if ((face == BlockFace.UP || face == BlockFace.SELF) && world.isBlockFacePowered(new BlockPosition(x, y + 1, z), EnumDirection.UP)) power = wire.getPower(power, world.getType(new BlockPosition(x, y + 1, z)));
|
||||
if ((face == BlockFace.EAST || face == BlockFace.SELF) && world.isBlockFacePowered(new BlockPosition(x + 1, y, z), EnumDirection.EAST)) power = wire.getPower(power, world.getType(new BlockPosition(x + 1, y, z)));
|
||||
if ((face == BlockFace.WEST || face == BlockFace.SELF) && world.isBlockFacePowered(new BlockPosition(x - 1, y, z), EnumDirection.WEST)) power = wire.getPower(power, world.getType(new BlockPosition(x - 1, y, z)));
|
||||
if ((face == BlockFace.NORTH || face == BlockFace.SELF) && world.isBlockFacePowered(new BlockPosition(x, y, z - 1), EnumDirection.NORTH)) power = wire.getPower(power, world.getType(new BlockPosition(x, y, z - 1)));
|
||||
if ((face == BlockFace.SOUTH || face == BlockFace.SELF) && world.isBlockFacePowered(new BlockPosition(x, y, z + 1), EnumDirection.SOUTH)) power = wire.getPower(power, world.getType(new BlockPosition(x, y, z + 1)));
|
||||
return power > 0 ? power : (face == BlockFace.SELF ? isBlockIndirectlyPowered() : isBlockFaceIndirectlyPowered(face)) ? 15 : 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,18 +39,18 @@ public abstract class CraftLootable<T extends TileEntityLootable> extends CraftC
|
||||
if (!this.getSnapshot().hasCustomName()) {
|
||||
lootable.setCustomName(null);
|
||||
}
|
||||
if (this.getSnapshot().Q_() == null) {
|
||||
lootable.a((MinecraftKey) null, 0L); // PAIL rename setLootTable
|
||||
if (this.getSnapshot().getLootTable()== null) {
|
||||
lootable.setLootTable((MinecraftKey) null, 0L);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public LootTable getLootTable() {
|
||||
if (getSnapshot().Q_() == null) {
|
||||
if (getSnapshot().getLootTable() == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
MinecraftKey key = getSnapshot().Q_();
|
||||
MinecraftKey key = getSnapshot().getLootTable();
|
||||
return Bukkit.getLootTable(CraftNamespacedKey.fromMinecraft(key));
|
||||
}
|
||||
|
||||
@@ -71,6 +71,6 @@ public abstract class CraftLootable<T extends TileEntityLootable> extends CraftC
|
||||
|
||||
private void setLootTable(LootTable table, long seed) {
|
||||
MinecraftKey key = (table == null) ? null : CraftNamespacedKey.toMinecraft(table.getKey());
|
||||
getSnapshot().a(key, seed); // PAIL setLootTable
|
||||
getSnapshot().setLootTable(key, seed);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.server.EnumDirection;
|
||||
import net.minecraft.server.IBlockData;
|
||||
import net.minecraft.server.IBlockState;
|
||||
import net.minecraft.server.INamable;
|
||||
import net.minecraft.server.IRegistry;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
@@ -310,7 +311,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>) Block.REGISTRY) { // Eclipse fail
|
||||
for (Block instance : (Iterable<Block>) IRegistry.BLOCK) { // Eclipse fail
|
||||
if (instance.getClass() == block) {
|
||||
if (state == null) {
|
||||
state = instance.getStates().a(name);
|
||||
@@ -369,10 +370,13 @@ 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.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);
|
||||
register(net.minecraft.server.BlockCoralFanAbstract.class, org.bukkit.craftbukkit.block.impl.CraftCoralFanAbstract::new);
|
||||
register(net.minecraft.server.BlockCoralFanWall.class, org.bukkit.craftbukkit.block.impl.CraftCoralFanWall::new);
|
||||
register(net.minecraft.server.BlockCoralFanWallAbstract.class, org.bukkit.craftbukkit.block.impl.CraftCoralFanWallAbstract::new);
|
||||
register(net.minecraft.server.BlockCoralPlant.class, org.bukkit.craftbukkit.block.impl.CraftCoralPlant::new);
|
||||
register(net.minecraft.server.BlockCrops.class, org.bukkit.craftbukkit.block.impl.CraftCrops::new);
|
||||
register(net.minecraft.server.BlockDaylightDetector.class, org.bukkit.craftbukkit.block.impl.CraftDaylightDetector::new);
|
||||
register(net.minecraft.server.BlockDirtSnow.class, org.bukkit.craftbukkit.block.impl.CraftDirtSnow::new);
|
||||
@@ -442,6 +446,7 @@ public class CraftBlockData implements BlockData {
|
||||
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.BlockStructure.class, org.bukkit.craftbukkit.block.impl.CraftStructure::new);
|
||||
register(net.minecraft.server.BlockTNT.class, org.bukkit.craftbukkit.block.impl.CraftTNT::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);
|
||||
@@ -473,7 +478,7 @@ public class CraftBlockData implements BlockData {
|
||||
try {
|
||||
// Material provided, force that material in
|
||||
if (block != null) {
|
||||
data = Block.REGISTRY.b(block) + data;
|
||||
data = IRegistry.BLOCK.getKey(block) + data;
|
||||
}
|
||||
|
||||
StringReader reader = new StringReader(data);
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package org.bukkit.craftbukkit.block.data.type;
|
||||
|
||||
import org.bukkit.block.data.type.TNT;
|
||||
import org.bukkit.craftbukkit.block.data.CraftBlockData;
|
||||
|
||||
public abstract class CraftTNT extends CraftBlockData implements TNT {
|
||||
|
||||
private static final net.minecraft.server.BlockStateBoolean UNSTABLE = getBoolean("unstable");
|
||||
|
||||
@Override
|
||||
public boolean isUnstable() {
|
||||
return get(UNSTABLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUnstable(boolean unstable) {
|
||||
set(UNSTABLE, unstable);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Automatically generated file, changes will be lost.
|
||||
*/
|
||||
package org.bukkit.craftbukkit.block.impl;
|
||||
|
||||
public final class CraftConduit extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Waterlogged {
|
||||
|
||||
public CraftConduit() {
|
||||
super();
|
||||
}
|
||||
|
||||
public CraftConduit(net.minecraft.server.IBlockData state) {
|
||||
super(state);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftWaterlogged
|
||||
|
||||
private static final net.minecraft.server.BlockStateBoolean WATERLOGGED = getBoolean(net.minecraft.server.BlockConduit.class, "waterlogged");
|
||||
|
||||
@Override
|
||||
public boolean isWaterlogged() {
|
||||
return get(WATERLOGGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWaterlogged(boolean waterlogged) {
|
||||
set(WATERLOGGED, waterlogged);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Automatically generated file, changes will be lost.
|
||||
*/
|
||||
package org.bukkit.craftbukkit.block.impl;
|
||||
|
||||
public final class CraftCoralDead extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Waterlogged {
|
||||
|
||||
public CraftCoralDead() {
|
||||
super();
|
||||
}
|
||||
|
||||
public CraftCoralDead(net.minecraft.server.IBlockData state) {
|
||||
super(state);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftWaterlogged
|
||||
|
||||
private static final net.minecraft.server.BlockStateBoolean WATERLOGGED = getBoolean(net.minecraft.server.BlockCoralDead.class, "waterlogged");
|
||||
|
||||
@Override
|
||||
public boolean isWaterlogged() {
|
||||
return get(WATERLOGGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWaterlogged(boolean waterlogged) {
|
||||
set(WATERLOGGED, waterlogged);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Automatically generated file, changes will be lost.
|
||||
*/
|
||||
package org.bukkit.craftbukkit.block.impl;
|
||||
|
||||
public final class CraftCoralPlant extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.Waterlogged {
|
||||
|
||||
public CraftCoralPlant() {
|
||||
super();
|
||||
}
|
||||
|
||||
public CraftCoralPlant(net.minecraft.server.IBlockData state) {
|
||||
super(state);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.CraftWaterlogged
|
||||
|
||||
private static final net.minecraft.server.BlockStateBoolean WATERLOGGED = getBoolean(net.minecraft.server.BlockCoralPlant.class, "waterlogged");
|
||||
|
||||
@Override
|
||||
public boolean isWaterlogged() {
|
||||
return get(WATERLOGGED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setWaterlogged(boolean waterlogged) {
|
||||
set(WATERLOGGED, waterlogged);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Automatically generated file, changes will be lost.
|
||||
*/
|
||||
package org.bukkit.craftbukkit.block.impl;
|
||||
|
||||
public final class CraftTNT extends org.bukkit.craftbukkit.block.data.CraftBlockData implements org.bukkit.block.data.type.TNT {
|
||||
|
||||
public CraftTNT() {
|
||||
super();
|
||||
}
|
||||
|
||||
public CraftTNT(net.minecraft.server.IBlockData state) {
|
||||
super(state);
|
||||
}
|
||||
|
||||
// org.bukkit.craftbukkit.block.data.type.CraftTNT
|
||||
|
||||
private static final net.minecraft.server.BlockStateBoolean UNSTABLE = getBoolean(net.minecraft.server.BlockTNT.class, "unstable");
|
||||
|
||||
@Override
|
||||
public boolean isUnstable() {
|
||||
return get(UNSTABLE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setUnstable(boolean unstable) {
|
||||
set(UNSTABLE, unstable);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user