Compare commits
7 commits
1e104d5db8
...
244220f78c
Author | SHA1 | Date | |
---|---|---|---|
244220f78c | |||
6ef8caddbe | |||
a1a15dcdf6 | |||
a4a488523b | |||
3db0dca073 | |||
2919d99126 | |||
30a78ad279 |
152 changed files with 1571 additions and 3209 deletions
|
@ -1926,11 +1926,11 @@ public class Client implements IThreadListener {
|
|||
}
|
||||
|
||||
StringBuilder str = new StringBuilder(
|
||||
"Schaue auf: " + BlockRegistry.getNameFromBlock(block.getBlock()) + "\n" +
|
||||
"Schaue auf: " + BlockRegistry.getName(block.getBlock()) + "\n" +
|
||||
String.format("Position: %d %d %d", pos.getX(), pos.getY(), pos.getZ())
|
||||
);
|
||||
for(Entry<Property, Comparable> entry : block.getProperties().entrySet()) {
|
||||
str.append("\n" + (block.getSavedProperties().contains(entry.getKey()) ? TextColor.NEON : TextColor.LGRAY) + entry.getKey().getName() + TextColor.RESET + ": " + (entry.getValue() instanceof Boolean bool ? (bool ? TextColor.GREEN : TextColor.RED) + "" + entry.getValue() + TextColor.RESET : entry.getValue()));
|
||||
str.append("\n" + (block.getBlock().getSavedProperties().contains(entry.getKey()) ? TextColor.NEON : TextColor.LGRAY) + entry.getKey().getName() + TextColor.RESET + ": " + (entry.getValue() instanceof Boolean bool ? (bool ? TextColor.GREEN : TextColor.RED) + "" + entry.getValue() + TextColor.RESET : entry.getValue()));
|
||||
}
|
||||
|
||||
return str.toString();
|
||||
|
@ -1954,7 +1954,7 @@ public class Client implements IThreadListener {
|
|||
(((EntityLiving)entity).deathTime != 0 ? "Tod: " + ((EntityLiving)entity).deathTime + "t, " : "") + "Rüstung: " + ((EntityLiving)entity).getTotalArmorValue() + ", Pfeile: " + ((EntityLiving)entity).getArrowCountInEntity()
|
||||
: "Rüstung: n/a, Pfeile: n/a") + "\n" +
|
||||
(held != null ?
|
||||
"Gegens.: " + ItemRegistry.getNameFromItem(held.getItem()) + " x" + held.size : "Gegens.: n/a") + "\n" +
|
||||
"Gegens.: " + ItemRegistry.getName(held.getItem()) + " x" + held.size : "Gegens.: n/a") + "\n" +
|
||||
"Eigens.: " + (entity.dead ? "D" : "") + (entity.noClip ? "N" : "") + (entity.onGround ? "G" : "")
|
||||
+ (entity.canBeCollidedWith() ? "C" : "") + (entity.canBePushed() ? "P" : "")
|
||||
+ (entity.isBurning() ? "B" : "") + (entity.isPlayer() ? "S" : "")
|
||||
|
|
|
@ -517,7 +517,7 @@ public class ClientPlayer implements IClientPlayer
|
|||
}
|
||||
else
|
||||
{
|
||||
player.inventory.mainInventory[player.inventory.currentItem] = new ItemStack(ItemRegistry.getItemById(i));
|
||||
player.inventory.mainInventory[player.inventory.currentItem] = new ItemStack(ItemRegistry.byId(i));
|
||||
}
|
||||
|
||||
player.setPositionAndRotation(x, y, z, yaw, pitch);
|
||||
|
@ -1165,7 +1165,7 @@ public class ClientPlayer implements IClientPlayer
|
|||
}
|
||||
else
|
||||
{
|
||||
Block block = BlockRegistry.getRegisteredBlock(id);
|
||||
Block block = BlockRegistry.byName(id);
|
||||
if(block instanceof BlockWorkbench bench) {
|
||||
this.gm.displayGuiScreen(new GuiCrafting(player.inventory, player.worldObj, bench));
|
||||
}
|
||||
|
@ -1377,7 +1377,8 @@ public class ClientPlayer implements IClientPlayer
|
|||
public void handleBlockAction(SPacketBlockAction packetIn)
|
||||
{
|
||||
NetHandler.checkThread(packetIn, this, this.gm, this.world);
|
||||
this.gm.world.addBlockEvent(packetIn.getBlockPosition(), packetIn.getBlockType(), packetIn.getData1(), packetIn.getData2());
|
||||
if(packetIn.getBlockType() != null)
|
||||
this.gm.world.addBlockEvent(packetIn.getBlockPosition(), packetIn.getBlockType(), packetIn.getData1(), packetIn.getData2());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -409,7 +409,7 @@ public class BlockRenderer
|
|||
{
|
||||
TextureMap texturemap = Client.CLIENT.getTextureMapBlocks();
|
||||
for(Pair<BlockStaticLiquid, BlockDynamicLiquid> liquid : BlockLiquid.LIQUIDS) {
|
||||
String name = BlockRegistry.getNameFromBlock(liquid.first());
|
||||
String name = BlockRegistry.getName(liquid.first());
|
||||
TextureAtlasSprite[] sprites = new TextureAtlasSprite[] {texturemap.getAtlasSprite("blocks/" + name + "_still"), texturemap.getAtlasSprite("blocks/" + name + "_flow")};
|
||||
this.fluids.put(liquid.second(), sprites);
|
||||
this.fluids.put(liquid.first(), sprites);
|
||||
|
|
|
@ -24,7 +24,7 @@ public class ItemModelMesher {
|
|||
|
||||
public IBakedModel getItemModel(ItemStack stack) {
|
||||
Item item = stack.getItem();
|
||||
IBakedModel model = this.models.get(ItemRegistry.getIdFromItem(item));
|
||||
IBakedModel model = this.models.get(ItemRegistry.getId(item));
|
||||
if(model == null)
|
||||
model = this.manager.getMissingModel();
|
||||
return model;
|
||||
|
@ -36,8 +36,8 @@ public class ItemModelMesher {
|
|||
|
||||
public void rebuildCache() {
|
||||
this.models.clear();
|
||||
for(Item item : ItemRegistry.REGISTRY) {
|
||||
this.models.put(ItemRegistry.getIdFromItem(item), this.manager.getModel("item/" + ItemRegistry.getNameFromItem(item).toString()));
|
||||
for(Item item : ItemRegistry.items()) {
|
||||
this.models.put(ItemRegistry.getId(item), this.manager.getModel("item/" + ItemRegistry.getName(item).toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ public abstract class ModelBakery
|
|||
|
||||
static {
|
||||
for(Pair<BlockStaticLiquid, BlockDynamicLiquid> liquid : BlockLiquid.LIQUIDS) {
|
||||
String name = BlockRegistry.getNameFromBlock(liquid.first());
|
||||
String name = BlockRegistry.getName(liquid.first());
|
||||
BUILTINS.add("blocks/" + name + "_flow");
|
||||
BUILTINS.add("blocks/" + name + "_still");
|
||||
}
|
||||
|
@ -57,15 +57,15 @@ public abstract class ModelBakery
|
|||
models.put(MISSING, (ModelBlock)new ModelBlock(null).add().all());
|
||||
variants.add(MISSING);
|
||||
for(Entry<State, String> entry : map.entrySet()) {
|
||||
ModelBlock model = (ModelBlock)entry.getKey().getBlock().getModel(ModelBlock.PROVIDER, BlockRegistry.getNameFromBlock(entry.getKey().getBlock())
|
||||
ModelBlock model = (ModelBlock)entry.getKey().getBlock().getModel(ModelBlock.PROVIDER, BlockRegistry.getName(entry.getKey().getBlock())
|
||||
.toString(), entry.getKey());
|
||||
models.put(entry.getValue(), model);
|
||||
variants.add(entry.getValue());
|
||||
}
|
||||
for (Item item : ItemRegistry.REGISTRY)
|
||||
for (Item item : ItemRegistry.items())
|
||||
{
|
||||
String loc = "item/" + ItemRegistry.getNameFromItem(item);
|
||||
models.put(loc, (ModelBlock)item.getModel(ModelBlock.PROVIDER, ItemRegistry.getNameFromItem(item)));
|
||||
String loc = "item/" + ItemRegistry.getName(item);
|
||||
models.put(loc, (ModelBlock)item.getModel(ModelBlock.PROVIDER, ItemRegistry.getName(item)));
|
||||
itemLocations.add(loc);
|
||||
String[] extra = item.getSprites();
|
||||
if(extra != null) {
|
||||
|
|
|
@ -26,7 +26,7 @@ public class ModelManager
|
|||
public ModelManager(TextureMap textures)
|
||||
{
|
||||
this.texMap = textures;
|
||||
for(Block block : BlockRegistry.REGISTRY) {
|
||||
for(Block block : BlockRegistry.blocks()) {
|
||||
if(block.getRenderType() != 3) {
|
||||
this.builtin.add(block);
|
||||
// Log.info("Builtin: " + BlockRegistry.getNameFromBlock(block));
|
||||
|
@ -113,7 +113,7 @@ public class ModelManager
|
|||
|
||||
public Map<State, String> getMap() {
|
||||
Map<State, String> map = Maps.<State, String>newIdentityHashMap();
|
||||
for(Block block : BlockRegistry.REGISTRY) {
|
||||
for(Block block : BlockRegistry.blocks()) {
|
||||
if(!this.builtin.contains(block)) {
|
||||
StateMap mapper = this.mappers.get(block);
|
||||
if(mapper == null)
|
||||
|
|
|
@ -30,7 +30,7 @@ public class MultiStateMap extends StateMap
|
|||
|
||||
if (this.name == null)
|
||||
{
|
||||
s = BlockRegistry.getNameFromBlock(state.getBlock());
|
||||
s = BlockRegistry.getName(state.getBlock());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -8,6 +8,6 @@ public class SingleStateMap extends StateMap
|
|||
{
|
||||
protected String getResourceLocation(State state)
|
||||
{
|
||||
return BlockRegistry.getNameFromBlock(state.getBlock()).toString() + '#' + this.getPropertyString(state.getProperties());
|
||||
return BlockRegistry.getName(state.getBlock()).toString() + '#' + this.getPropertyString(state.getProperties());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,6 @@ public class RenderDynamite extends RenderItemEntity<EntityDynamite> {
|
|||
|
||||
public ItemStack getStack(EntityDynamite entityIn)
|
||||
{
|
||||
return new ItemStack(ItemRegistry.getRegisteredItem("dynamite" + (entityIn.explosionSize <= 0 || entityIn.explosionSize >= 8 ? "" : "_" + entityIn.explosionSize)));
|
||||
return new ItemStack(ItemRegistry.byName("dynamite" + (entityIn.explosionSize <= 0 || entityIn.explosionSize >= 8 ? "" : "_" + entityIn.explosionSize)));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ public class RenderTntPrimed extends Render<EntityTnt>
|
|||
float f2 = (1.0F - ((float)entity.fuse - partialTicks + 1.0F) / 100.0F) * 0.8F;
|
||||
this.bindEntityTexture(entity);
|
||||
GL11.glTranslatef(-0.5F, -0.5F, 0.5F);
|
||||
Block tnt = BlockRegistry.getRegisteredBlock("tnt" + (entity.explosionSize <= 0 || entity.explosionSize >= 8 ? "" : "_" + entity.explosionSize));
|
||||
Block tnt = BlockRegistry.byName("tnt" + (entity.explosionSize <= 0 || entity.explosionSize >= 8 ? "" : "_" + entity.explosionSize));
|
||||
blockrendererdispatcher.renderBlockBrightness(tnt.getState(), entity.getBrightness(partialTicks));
|
||||
GL11.glTranslatef(0.0F, 0.0F, 1.0F);
|
||||
|
||||
|
|
|
@ -18,8 +18,8 @@ public class EntityBlockDustFX extends EntityDiggingFX
|
|||
{
|
||||
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
|
||||
{
|
||||
State iblockstate = BlockRegistry.getStateById(p_178902_15_[0]);
|
||||
return iblockstate.getBlock().getRenderType() == -1 ? null : (new EntityBlockDustFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, iblockstate)).calculateColor();
|
||||
State iblockstate = BlockRegistry.byId(p_178902_15_[0]);
|
||||
return iblockstate == null || iblockstate.getBlock().getRenderType() == -1 ? null : (new EntityBlockDustFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, iblockstate)).calculateColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@ public class EntityBreakingFX extends EntityFX
|
|||
{
|
||||
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
|
||||
{
|
||||
return new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, ItemRegistry.getItemById(p_178902_15_[0]));
|
||||
return new EntityBreakingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, ItemRegistry.byId(p_178902_15_[0]));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -118,7 +118,8 @@ public class EntityDiggingFX extends EntityFX
|
|||
{
|
||||
public EntityFX getEntityFX(int particleID, World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn, int... p_178902_15_)
|
||||
{
|
||||
return (new EntityDiggingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, BlockRegistry.getStateById(p_178902_15_[0]))).calculateColor();
|
||||
State state = BlockRegistry.byId(p_178902_15_[0]);
|
||||
return state == null ? null : (new EntityDiggingFX(worldIn, xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn, state)).calculateColor();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ public class TextureMap extends Texture
|
|||
Map<String, Object> map = Maps.newHashMap();
|
||||
Map<TextureAnimation, Class<? extends TextureTicked>> anim = Maps.newHashMap();
|
||||
RenderRegistry.registerAnimations(anim);
|
||||
for(Block block : BlockRegistry.REGISTRY) {
|
||||
for(Block block : BlockRegistry.blocks()) {
|
||||
block.getAnimatedTextures(map);
|
||||
}
|
||||
for(Entry<String, Object> entry : map.entrySet()) {
|
||||
|
|
|
@ -10,6 +10,7 @@ import client.Client;
|
|||
import client.renderer.GlState;
|
||||
import client.renderer.model.ModelBanner;
|
||||
import client.renderer.texture.LayeredColorMaskTexture;
|
||||
import common.block.tile.BlockBannerStanding;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
import common.color.DyeColor;
|
||||
|
@ -17,6 +18,7 @@ import common.init.Blocks;
|
|||
import common.tileentity.TileEntityBanner;
|
||||
import common.util.BlockPos;
|
||||
import common.util.ExtMath;
|
||||
import common.world.State;
|
||||
|
||||
public class TileEntityBannerRenderer extends TileEntitySpecialRenderer<TileEntityBanner>
|
||||
{
|
||||
|
@ -28,7 +30,12 @@ public class TileEntityBannerRenderer extends TileEntitySpecialRenderer<TileEnti
|
|||
{
|
||||
boolean flag = te.getWorld() != null;
|
||||
boolean flag1 = !flag || te.getBlockType() == Blocks.banner;
|
||||
int i = flag ? te.getBlockMetadata() : 0;
|
||||
int i = 0;
|
||||
if(flag) {
|
||||
State state = te.getBlockState();
|
||||
if(state.getBlock() == Blocks.banner)
|
||||
i = state.getValue(BlockBannerStanding.ROTATION);
|
||||
}
|
||||
// long j = flag ? te.getWorld().getTime() : 0L;
|
||||
double j = flag ? (double)(System.nanoTime() / 1000L) / 50000.0 /* te.getWorld().getTime() */ : (double)partialTicks;
|
||||
GL11.glPushMatrix();
|
||||
|
|
|
@ -5,9 +5,9 @@ import org.lwjgl.opengl.GL11;
|
|||
import client.renderer.GlState;
|
||||
import client.renderer.model.ModelChest;
|
||||
import client.renderer.model.ModelLargeChest;
|
||||
import common.block.Block;
|
||||
import common.block.tech.BlockChest;
|
||||
import common.tileentity.TileEntityChest;
|
||||
import common.world.State;
|
||||
|
||||
|
||||
public class TileEntityChestRenderer extends TileEntitySpecialRenderer<TileEntityChest>
|
||||
|
@ -44,21 +44,19 @@ public class TileEntityChestRenderer extends TileEntitySpecialRenderer<TileEntit
|
|||
GlState.enableDepth();
|
||||
GlState.depthFunc(GL11.GL_LEQUAL);
|
||||
GlState.depthMask(true);
|
||||
int i;
|
||||
int i = 0;
|
||||
|
||||
if (!te.hasWorldObj())
|
||||
if (te.hasWorldObj())
|
||||
{
|
||||
i = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
Block block = te.getBlockType();
|
||||
i = te.getBlockMetadata();
|
||||
|
||||
if (block instanceof BlockChest && i == 0)
|
||||
{
|
||||
((BlockChest)block).checkForSurroundingChests(te.getWorld(), te.getPos(), te.getWorld().getState(te.getPos()));
|
||||
i = te.getBlockMetadata();
|
||||
State state = te.getBlockState();
|
||||
if(state.getBlock() instanceof BlockChest) {
|
||||
i = state.getValue(BlockChest.FACING).getIndex();
|
||||
|
||||
if (i == 0)
|
||||
{
|
||||
((BlockChest)state.getBlock()).checkForSurroundingChests(te.getWorld(), te.getPos(), te.getWorld().getState(te.getPos()));
|
||||
i = state.getValue(BlockChest.FACING).getIndex();
|
||||
}
|
||||
}
|
||||
|
||||
te.checkForAdjacentChests();
|
||||
|
|
|
@ -6,8 +6,11 @@ import client.renderer.Drawing;
|
|||
import client.renderer.GlState;
|
||||
import client.renderer.model.ModelSign;
|
||||
import common.block.Block;
|
||||
import common.block.tile.BlockStandingSign;
|
||||
import common.block.tile.BlockWallSign;
|
||||
import common.init.Blocks;
|
||||
import common.tileentity.TileEntitySign;
|
||||
import common.world.State;
|
||||
|
||||
|
||||
public class TileEntitySignRenderer extends TileEntitySpecialRenderer<TileEntitySign>
|
||||
|
@ -23,16 +26,17 @@ public class TileEntitySignRenderer extends TileEntitySpecialRenderer<TileEntity
|
|||
GL11.glPushMatrix();
|
||||
float f = 0.6666667F;
|
||||
|
||||
State state = te.getBlockState();
|
||||
if (block == Blocks.sign)
|
||||
{
|
||||
GL11.glTranslatef((float)x + 0.5F, (float)y + 0.75F * f, (float)z + 0.5F);
|
||||
float f1 = (float)(te.getBlockMetadata() * 360) / 16.0F;
|
||||
float f1 = state.getBlock() == Blocks.sign ? (float)(state.getValue(BlockStandingSign.ROTATION) * 360) / 16.0F : 0.0F;
|
||||
GL11.glRotatef(-f1, 0.0F, 1.0F, 0.0F);
|
||||
this.model.signStick.showModel = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
int k = te.getBlockMetadata();
|
||||
int k = state.getBlock() == Blocks.wall_sign ? state.getValue(BlockWallSign.FACING).getIndex() : 0;
|
||||
float f2 = 0.0F;
|
||||
|
||||
if (k == 2)
|
||||
|
|
|
@ -50,7 +50,7 @@ public class PlayerController {
|
|||
return false;
|
||||
}
|
||||
else {
|
||||
world.playAuxSFX(2001, pos, BlockRegistry.getStateId(state));
|
||||
world.playAuxSFX(2001, pos, BlockRegistry.getId(state));
|
||||
boolean flag = world.setBlockToAir(pos);
|
||||
|
||||
if(flag) {
|
||||
|
|
|
@ -29,7 +29,7 @@ public class ChunkEmpty extends ChunkClient {
|
|||
private final Block dummyBlock;
|
||||
|
||||
static {
|
||||
for(Block block : BlockRegistry.REGISTRY) {
|
||||
for(Block block : BlockRegistry.blocks()) {
|
||||
STATES.addAll(block.getValidStates());
|
||||
}
|
||||
XSTRETCH = ExtMath.ceilf(ExtMath.sqrtf((float)STATES.size()));
|
||||
|
|
|
@ -7,7 +7,6 @@ import client.Client;
|
|||
import client.renderer.particle.EntityFX;
|
||||
import client.renderer.particle.EntityFirework;
|
||||
import common.biome.Biome;
|
||||
import common.block.Block;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Sets;
|
||||
import common.dimension.Dimension;
|
||||
|
@ -637,14 +636,14 @@ public class WorldClient extends AWorldClient
|
|||
return;
|
||||
|
||||
case 2001:
|
||||
Block block = BlockRegistry.getBlockById(data & 4095);
|
||||
State state = BlockRegistry.byId(data);
|
||||
|
||||
if (block != Blocks.air)
|
||||
if (state != null && state.getBlock() != Blocks.air)
|
||||
{
|
||||
this.gm.getSoundManager().playSound(new PositionedSound(block.sound.getBreakSound(), 1.0F, /* block.sound.getFrequency() * 0.8F, */ (float)blockPosIn.getX() + 0.5F, (float)blockPosIn.getY() + 0.5F, (float)blockPosIn.getZ() + 0.5F));
|
||||
this.gm.getSoundManager().playSound(new PositionedSound(state.getBlock().sound.getBreakSound(), 1.0F, /* block.sound.getFrequency() * 0.8F, */ (float)blockPosIn.getX() + 0.5F, (float)blockPosIn.getY() + 0.5F, (float)blockPosIn.getZ() + 0.5F));
|
||||
}
|
||||
|
||||
this.gm.effectRenderer.addBlockDestroyEffects(blockPosIn, block.getStateFromMeta(data >> 12 & 255));
|
||||
if(state != null)
|
||||
this.gm.effectRenderer.addBlockDestroyEffects(blockPosIn, state);
|
||||
break;
|
||||
|
||||
case 2002:
|
||||
|
@ -654,7 +653,7 @@ public class WorldClient extends AWorldClient
|
|||
|
||||
for (int i1 = 0; i1 < 8; ++i1)
|
||||
{
|
||||
this.spawnEntityFX(ParticleType.ITEM_CRACK, ParticleType.ITEM_CRACK.getShouldIgnoreRange(), d13, d14, d16, this.rand.gaussian() * 0.15D, this.rand.doublev() * 0.2D, this.rand.gaussian() * 0.15D, new int[] {ItemRegistry.getIdFromItem(Items.potion)});
|
||||
this.spawnEntityFX(ParticleType.ITEM_CRACK, ParticleType.ITEM_CRACK.getShouldIgnoreRange(), d13, d14, d16, this.rand.gaussian() * 0.15D, this.rand.doublev() * 0.2D, this.rand.gaussian() * 0.15D, new int[] {ItemRegistry.getId(Items.potion)});
|
||||
}
|
||||
|
||||
ParticleType enumparticletypes = ParticleType.WATER_SPLASH;
|
||||
|
|
|
@ -102,7 +102,7 @@ public class EntityAIEatGrass extends EntityAIBase
|
|||
{
|
||||
if (Vars.mobGrief)
|
||||
{
|
||||
this.entityWorld.playAuxSFX(2001, blockpos1, BlockRegistry.getIdFromBlock(Blocks.grass));
|
||||
this.entityWorld.playAuxSFX(2001, blockpos1, BlockRegistry.getId(Blocks.grass.getState()));
|
||||
this.entityWorld.setState(blockpos1, Blocks.dirt.getState(), 2);
|
||||
}
|
||||
|
||||
|
|
|
@ -12,10 +12,10 @@ public interface IBiome {
|
|||
public IBiome getBiome(Biome base) {
|
||||
return new IBiome() {
|
||||
public State getFiller() {
|
||||
return BlockRegistry.getRegisteredBlock("air").getState();
|
||||
return BlockRegistry.byName("air").getState();
|
||||
}
|
||||
public State getTop() {
|
||||
return BlockRegistry.getRegisteredBlock("air").getState();
|
||||
return BlockRegistry.byName("air").getState();
|
||||
}
|
||||
public void growGrass(AWorldServer worldIn, BlockPos pos, State state, Random rand) {
|
||||
}
|
||||
|
|
|
@ -9,6 +9,8 @@ import java.util.Iterator;
|
|||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Set;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.function.Function;
|
||||
|
||||
import common.block.artificial.BlockSlab;
|
||||
|
@ -17,6 +19,7 @@ import common.collect.ImmutableMap;
|
|||
import common.collect.Iterables;
|
||||
import common.collect.Lists;
|
||||
import common.collect.Maps;
|
||||
import common.collect.Sets;
|
||||
import common.collect.UnmodifiableIterator;
|
||||
import common.enchantment.EnchantmentHelper;
|
||||
import common.entity.Entity;
|
||||
|
@ -43,6 +46,7 @@ import common.util.Facing;
|
|||
import common.util.HitPosition;
|
||||
import common.util.Vec3;
|
||||
import common.util.HitPosition.ObjectType;
|
||||
import common.util.Pair;
|
||||
import common.vars.Vars;
|
||||
import common.world.Explosion;
|
||||
import common.world.IBlockAccess;
|
||||
|
@ -158,7 +162,9 @@ public class Block {
|
|||
}
|
||||
|
||||
private final ImmutableList<Property> properties;
|
||||
private final ImmutableList<Property> savedProps;
|
||||
private final ImmutableList<State> states;
|
||||
private final ImmutableList<State> saved;
|
||||
protected final Material material;
|
||||
protected final boolean translucent;
|
||||
|
||||
|
@ -253,6 +259,26 @@ public class Block {
|
|||
return ImmutableList.copyOf(properties);
|
||||
}
|
||||
|
||||
private static ImmutableList<Property> getPropertyList(Property[] properties, Property[] unsaved) {
|
||||
List<Property> list = unsaved.length == 0 ? Lists.newArrayList(properties) : Lists.newArrayList();
|
||||
if(unsaved.length > 0) {
|
||||
for(Property prop : properties) {
|
||||
for(int z = 0; z < unsaved.length; z++) {
|
||||
if(unsaved[z] == prop)
|
||||
break;
|
||||
else if(z == unsaved.length - 1)
|
||||
list.add(prop);
|
||||
}
|
||||
}
|
||||
}
|
||||
Collections.sort(list, new Comparator<Property>() {
|
||||
public int compare(Property p1, Property p2) {
|
||||
return p1.getName().compareTo(p2.getName());
|
||||
}
|
||||
});
|
||||
return ImmutableList.copyOf(list);
|
||||
}
|
||||
|
||||
private static ImmutableList<State> getStateList(List<Property> properties, Block block) {
|
||||
Map<Map<Property, Comparable>, State> map = Maps.<Map<Property, Comparable>, State>newLinkedHashMap();
|
||||
List<State> list = Lists.<State>newArrayList();
|
||||
|
@ -267,6 +293,24 @@ public class Block {
|
|||
}
|
||||
return ImmutableList.<State>copyOf(list);
|
||||
}
|
||||
|
||||
private static ImmutableList<State> getStateList(ImmutableList<Property> saved, ImmutableList<State> states) {
|
||||
Set<List<Pair<Property, Comparable>>> uniq = Sets.newHashSet();
|
||||
List<State> list = Lists.<State>newArrayList();
|
||||
for(State state : states) {
|
||||
List<Pair<Property, Comparable>> props = Lists.newArrayList();
|
||||
for(Entry<Property, Comparable> entry : state.getProperties().entrySet()) {
|
||||
if(saved.contains(entry.getKey()))
|
||||
props.add(new Pair(entry.getKey(), entry.getValue()));
|
||||
}
|
||||
if(!uniq.contains(props)) {
|
||||
uniq.add(props);
|
||||
list.add(state);
|
||||
}
|
||||
}
|
||||
uniq.clear();
|
||||
return ImmutableList.<State>copyOf(list);
|
||||
}
|
||||
|
||||
public Block(Material material) {
|
||||
this.miningLevel = (material == Material.SOLID || material == Material.HEAVY) ? 0 : -1;
|
||||
|
@ -283,6 +327,8 @@ public class Block {
|
|||
this.properties = getPropertyList(this.getProperties());
|
||||
this.states = getStateList(this.properties, this);
|
||||
this.setDefaultState(this.getBaseState());
|
||||
this.savedProps = getPropertyList(this.getProperties(), this.getUnsavedProperties());
|
||||
this.saved = getStateList(this.savedProps, this.states);
|
||||
}
|
||||
|
||||
public Block setStepSound(SoundType sound) {
|
||||
|
@ -397,25 +443,16 @@ public class Block {
|
|||
return this.states;
|
||||
}
|
||||
|
||||
public ImmutableList<State> getSavedStates() {
|
||||
return this.saved;
|
||||
}
|
||||
|
||||
public final State getBaseState() {
|
||||
return this.states.get(0);
|
||||
}
|
||||
|
||||
public Collection<Property> getPropertyMap() {
|
||||
return this.properties;
|
||||
}
|
||||
|
||||
public State getStateFromMeta(int meta) {
|
||||
return this.getState();
|
||||
}
|
||||
|
||||
public int getMetaFromState(State state) {
|
||||
if(state != null && !state.getPropertyNames().isEmpty()) {
|
||||
throw new IllegalArgumentException("Don\'t know how to convert " + state + " back into data...");
|
||||
}
|
||||
else {
|
||||
return 0;
|
||||
}
|
||||
public Collection<Property> getSavedProperties() {
|
||||
return this.savedProps;
|
||||
}
|
||||
|
||||
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos) {
|
||||
|
@ -951,6 +988,10 @@ public class Block {
|
|||
return new Property[0];
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[0];
|
||||
}
|
||||
|
||||
protected final void setDefaultState(State state) {
|
||||
this.defaultState = state;
|
||||
}
|
||||
|
@ -1030,7 +1071,7 @@ public class Block {
|
|||
if(item == null)
|
||||
return null;
|
||||
if(item.getBlock() != this)
|
||||
throw new IllegalArgumentException("Gegenstand für Block " + BlockRegistry.getNameFromBlock(this) + " stimmt nicht überein");
|
||||
throw new IllegalArgumentException("Gegenstand für Block " + BlockRegistry.getName(this) + " stimmt nicht überein");
|
||||
this.item = item;
|
||||
return item;
|
||||
}
|
||||
|
|
|
@ -113,7 +113,7 @@ public class BlockBed extends Block implements Rotatable {
|
|||
}
|
||||
|
||||
public Item getItemDropped(State state, Random rand, int fortune) {
|
||||
return state.getValue(PART) == BlockBed.EnumPartType.HEAD ? null : ItemRegistry.getRegisteredItem(this.color.getName() + "_bed");
|
||||
return state.getValue(PART) == BlockBed.EnumPartType.HEAD ? null : ItemRegistry.byName(this.color.getName() + "_bed");
|
||||
}
|
||||
|
||||
private void setBedBounds() {
|
||||
|
@ -169,7 +169,7 @@ public class BlockBed extends Block implements Rotatable {
|
|||
}
|
||||
|
||||
public Item getItem(World worldIn, BlockPos pos) {
|
||||
return ItemRegistry.getRegisteredItem(this.color.getName() + "_bed");
|
||||
return ItemRegistry.byName(this.color.getName() + "_bed");
|
||||
}
|
||||
|
||||
// public void onBlockHarvested(World worldIn, BlockPos pos, State state, EntityNPC player) {
|
||||
|
@ -180,15 +180,6 @@ public class BlockBed extends Block implements Rotatable {
|
|||
// }
|
||||
// }
|
||||
|
||||
public State getStateFromMeta(int meta) {
|
||||
return this.getState().withProperty(PART, (meta & 8) > 0 ? BlockBed.EnumPartType.HEAD : BlockBed.EnumPartType.FOOT)
|
||||
.withProperty(FACING, Facing.getHorizontal(meta));
|
||||
}
|
||||
|
||||
public int getMetaFromState(State state) {
|
||||
return ((Facing)state.getValue(FACING)).getHorizontalIndex() | (state.getValue(PART) == BlockBed.EnumPartType.HEAD ? 8 : 0);
|
||||
}
|
||||
|
||||
protected Property[] getProperties() {
|
||||
return new Property[] {FACING, PART};
|
||||
}
|
||||
|
|
|
@ -214,22 +214,6 @@ public class BlockCake extends Block
|
|||
return BlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(BITES, Integer.valueOf(meta > 6 ? 0 : meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(BITES)).intValue();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {BITES};
|
||||
|
|
|
@ -7,8 +7,6 @@ import common.block.Rotatable;
|
|||
import common.block.Material;
|
||||
import common.collect.Lists;
|
||||
import common.entity.npc.EntityNPC;
|
||||
import common.init.Blocks;
|
||||
import common.init.Items;
|
||||
import common.item.Item;
|
||||
import common.item.block.ItemDoor;
|
||||
import common.model.BlockLayer;
|
||||
|
@ -63,7 +61,7 @@ public class BlockDoor extends Block implements Rotatable
|
|||
|
||||
public boolean isPassable(IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return isOpen(combineMetadata(worldIn, pos));
|
||||
return worldIn.getState(pos).getValue(OPEN);
|
||||
}
|
||||
|
||||
public boolean isFullCube()
|
||||
|
@ -84,17 +82,13 @@ public class BlockDoor extends Block implements Rotatable
|
|||
}
|
||||
|
||||
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
this.setBoundBasedOnMeta(combineMetadata(worldIn, pos));
|
||||
}
|
||||
|
||||
private void setBoundBasedOnMeta(int combinedMeta)
|
||||
{
|
||||
float f = 0.1875F;
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 2.0F, 1.0F);
|
||||
Facing enumfacing = getFacing(combinedMeta);
|
||||
boolean flag = isOpen(combinedMeta);
|
||||
boolean flag1 = isHingeLeft(combinedMeta);
|
||||
State state = worldIn.getState(pos);
|
||||
Facing enumfacing = state.getValue(FACING);
|
||||
boolean flag = state.getValue(OPEN);
|
||||
boolean flag1 = state.getValue(HINGE) == BlockDoor.EnumHingePosition.RIGHT;
|
||||
|
||||
if (flag)
|
||||
{
|
||||
|
@ -278,7 +272,7 @@ public class BlockDoor extends Block implements Rotatable
|
|||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
{
|
||||
return state.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER ? null : this.getDoorItem();
|
||||
return state.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER ? null : this.getItem();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -300,30 +294,9 @@ public class BlockDoor extends Block implements Rotatable
|
|||
return 1;
|
||||
}
|
||||
|
||||
public static int combineMetadata(IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos);
|
||||
int i = iblockstate.getBlock().getMetaFromState(iblockstate);
|
||||
boolean flag = isTop(i);
|
||||
State iblockstate1 = worldIn.getState(pos.down());
|
||||
int j = iblockstate1.getBlock().getMetaFromState(iblockstate1);
|
||||
int k = flag ? j : i;
|
||||
State iblockstate2 = worldIn.getState(pos.up());
|
||||
int l = iblockstate2.getBlock().getMetaFromState(iblockstate2);
|
||||
int i1 = flag ? i : l;
|
||||
boolean flag1 = (i1 & 1) != 0;
|
||||
boolean flag2 = (i1 & 2) != 0;
|
||||
return removeHalfBit(k) | (flag ? 8 : 0) | (flag1 ? 16 : 0) | (flag2 ? 32 : 0);
|
||||
}
|
||||
|
||||
public Item getItem(World worldIn, BlockPos pos)
|
||||
{
|
||||
return this.getDoorItem();
|
||||
}
|
||||
|
||||
private Item getDoorItem()
|
||||
{
|
||||
return this == Blocks.iron_door ? Items.iron_door : (this == Blocks.spruce_door ? Items.spruce_door : (this == Blocks.birch_door ? Items.birch_door : (this == Blocks.jungle_door ? Items.jungle_door : (this == Blocks.acacia_door ? Items.acacia_door : (this == Blocks.dark_oak_door ? Items.dark_oak_door : (this == Blocks.cherry_door ? Items.cherry_door : (this == Blocks.maple_door ? Items.maple_door : Items.oak_door)))))));
|
||||
return this.getItem();
|
||||
}
|
||||
|
||||
// public void onBlockHarvested(World worldIn, BlockPos pos, State state, EntityNPC player)
|
||||
|
@ -341,109 +314,9 @@ public class BlockDoor extends Block implements Rotatable
|
|||
return BlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
|
||||
* metadata, such as fence connections.
|
||||
*/
|
||||
public State getActualState(State state, IWorldAccess worldIn, BlockPos pos)
|
||||
{
|
||||
if (state.getValue(HALF) == BlockDoor.EnumDoorHalf.LOWER)
|
||||
{
|
||||
State iblockstate = worldIn.getState(pos.up());
|
||||
|
||||
if (iblockstate.getBlock() == this)
|
||||
{
|
||||
state = state.withProperty(HINGE, iblockstate.getValue(HINGE)).withProperty(POWERED, iblockstate.getValue(POWERED));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
State iblockstate1 = worldIn.getState(pos.down());
|
||||
|
||||
if (iblockstate1.getBlock() == this)
|
||||
{
|
||||
state = state.withProperty(FACING, iblockstate1.getValue(FACING)).withProperty(OPEN, iblockstate1.getValue(OPEN));
|
||||
}
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return (meta & 8) > 0 ? this.getState().withProperty(HALF, BlockDoor.EnumDoorHalf.UPPER).withProperty(HINGE, (meta & 1) > 0 ? BlockDoor.EnumHingePosition.RIGHT : BlockDoor.EnumHingePosition.LEFT).withProperty(POWERED, Boolean.valueOf((meta & 2) > 0)) : this.getState().withProperty(HALF, BlockDoor.EnumDoorHalf.LOWER).withProperty(FACING, Facing.getHorizontal(meta & 3).rotateYCCW()).withProperty(OPEN, Boolean.valueOf((meta & 4) > 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
if (state.getValue(HALF) == BlockDoor.EnumDoorHalf.UPPER)
|
||||
{
|
||||
i = i | 8;
|
||||
|
||||
if (state.getValue(HINGE) == BlockDoor.EnumHingePosition.RIGHT)
|
||||
{
|
||||
i |= 1;
|
||||
}
|
||||
|
||||
if (((Boolean)state.getValue(POWERED)).booleanValue())
|
||||
{
|
||||
i |= 2;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
i = i | ((Facing)state.getValue(FACING)).rotateY().getHorizontalIndex();
|
||||
|
||||
if (((Boolean)state.getValue(OPEN)).booleanValue())
|
||||
{
|
||||
i |= 4;
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected static int removeHalfBit(int meta)
|
||||
{
|
||||
return meta & 7;
|
||||
}
|
||||
|
||||
public static boolean isOpen(IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return isOpen(combineMetadata(worldIn, pos));
|
||||
}
|
||||
|
||||
public static Facing getFacing(IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return getFacing(combineMetadata(worldIn, pos));
|
||||
}
|
||||
|
||||
public static Facing getFacing(int combinedMeta)
|
||||
{
|
||||
return Facing.getHorizontal(combinedMeta & 3).rotateYCCW();
|
||||
}
|
||||
|
||||
protected static boolean isOpen(int combinedMeta)
|
||||
{
|
||||
return (combinedMeta & 4) != 0;
|
||||
}
|
||||
|
||||
protected static boolean isTop(int meta)
|
||||
{
|
||||
return (meta & 8) != 0;
|
||||
}
|
||||
|
||||
protected static boolean isHingeLeft(int combinedMeta)
|
||||
{
|
||||
return (combinedMeta & 16) != 0;
|
||||
return worldIn.getState(pos).getValue(FACING);
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
|
|
|
@ -181,14 +181,6 @@ public class BlockFence extends Block
|
|||
return worldIn.client ? true : ItemLead.attachToFence(playerIn, worldIn, pos);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
|
||||
* metadata, such as fence connections.
|
||||
|
@ -385,4 +377,8 @@ public class BlockFence extends Block
|
|||
protected Item getItemToRegister() {
|
||||
return new ItemFence(this);
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {NORTH, SOUTH, WEST, EAST};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -171,35 +171,6 @@ public class BlockFenceGate extends Block implements Rotatable
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(FACING, Facing.getHorizontal(meta)).withProperty(OPEN, Boolean.valueOf((meta & 4) != 0)).withProperty(POWERED, Boolean.valueOf((meta & 8) != 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | ((Facing)state.getValue(FACING)).getHorizontalIndex();
|
||||
|
||||
if (((Boolean)state.getValue(POWERED)).booleanValue())
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
if (((Boolean)state.getValue(OPEN)).booleanValue())
|
||||
{
|
||||
i |= 4;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING, OPEN, POWERED, IN_WALL};
|
||||
|
@ -409,4 +380,8 @@ public class BlockFenceGate extends Block implements Rotatable
|
|||
public Property<?>[] getIgnoredProperties() {
|
||||
return new Property[] {POWERED};
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {IN_WALL};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ public class BlockFlowerPot extends Block
|
|||
}
|
||||
else
|
||||
{
|
||||
worldIn.setState(pos, BlockRegistry.getRegisteredBlock("flowerpot_" + BlockRegistry.getNameFromBlock(block)).getState(), 2);
|
||||
worldIn.setState(pos, BlockRegistry.byName("flowerpot_" + BlockRegistry.getName(block)).getState(), 2);
|
||||
// tileentityflowerpot.setFlowerPotData(itemstack.getItem(), itemstack.getMetadata());
|
||||
// tileentityflowerpot.markDirty();
|
||||
// worldIn.markBlockForUpdate(pos);
|
||||
|
@ -231,7 +231,7 @@ public class BlockFlowerPot extends Block
|
|||
else if(this.content == Blocks.cactus)
|
||||
return flower_pot_cactus;
|
||||
else {
|
||||
String plant = BlockRegistry.getNameFromBlock(this.content);
|
||||
String plant = BlockRegistry.getName(this.content);
|
||||
return provider.getModel("flower_pot")
|
||||
.add(5, 0, 5, 6, 6, 11)
|
||||
.d().uv(5, 5, 6, 11)
|
||||
|
|
|
@ -21,46 +21,6 @@ public class BlockHay extends BlockRotatedPillar
|
|||
this.setFlammable(60, 20);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
Facing.Axis enumfacing$axis = Facing.Axis.Y;
|
||||
int i = meta & 12;
|
||||
|
||||
if (i == 4)
|
||||
{
|
||||
enumfacing$axis = Facing.Axis.X;
|
||||
}
|
||||
else if (i == 8)
|
||||
{
|
||||
enumfacing$axis = Facing.Axis.Z;
|
||||
}
|
||||
|
||||
return this.getState().withProperty(AXIS, enumfacing$axis);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
Facing.Axis enumfacing$axis = (Facing.Axis)state.getValue(AXIS);
|
||||
|
||||
if (enumfacing$axis == Facing.Axis.X)
|
||||
{
|
||||
i |= 4;
|
||||
}
|
||||
else if (enumfacing$axis == Facing.Axis.Z)
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {AXIS};
|
||||
|
|
|
@ -136,29 +136,6 @@ public class BlockLadder extends Block implements Rotatable
|
|||
return BlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
Facing enumfacing = Facing.getFront(meta);
|
||||
|
||||
if (enumfacing.getAxis() == Facing.Axis.Y)
|
||||
{
|
||||
enumfacing = Facing.NORTH;
|
||||
}
|
||||
|
||||
return this.getState().withProperty(FACING, enumfacing);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Facing)state.getValue(FACING)).getIndex();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING};
|
||||
|
|
|
@ -195,14 +195,6 @@ public class BlockPane extends Block
|
|||
return BlockLayer.CUTOUT_MIPPED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {NORTH, EAST, WEST, SOUTH};
|
||||
|
@ -504,4 +496,8 @@ public class BlockPane extends Block
|
|||
protected Item getItemToRegister() {
|
||||
return this.canDrop ? super.getItemToRegister() : new ItemBlock(this, "glass", false);
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {NORTH, SOUTH, WEST, EAST};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,6 @@ import common.rng.Random;
|
|||
import common.util.BlockPos;
|
||||
import common.util.BoundingBox;
|
||||
import common.util.Facing;
|
||||
import common.util.Facing.Axis;
|
||||
import common.world.IWorldAccess;
|
||||
import common.world.AWorldClient;
|
||||
import common.world.State;
|
||||
|
@ -260,23 +259,6 @@ public class BlockPortal extends Block
|
|||
return this.getRenderColor(worldIn.getState(pos));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(AXIS, (meta & 8) == 8 ? Facing.Axis.Z : Facing.Axis.X)
|
||||
.withProperty(DIM, meta & 7);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return (state.getValue(AXIS) == Axis.Z ? 8 : 0) | state.getValue(DIM);
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {AXIS, DIM};
|
||||
|
|
|
@ -107,30 +107,6 @@ public class BlockPortalFrame extends Block implements Rotatable
|
|||
return ((Boolean)worldIn.getState(pos).getValue(ORB)).booleanValue() ? 15 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(ORB, Boolean.valueOf((meta & 4) != 0)).withProperty(FACING, Facing.getHorizontal(meta & 3));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | ((Facing)state.getValue(FACING)).getHorizontalIndex();
|
||||
|
||||
if (((Boolean)state.getValue(ORB)).booleanValue())
|
||||
{
|
||||
i |= 4;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING, ORB};
|
||||
|
|
|
@ -33,39 +33,6 @@ public class BlockQuartzPillar extends BlockRotatedPillar
|
|||
{
|
||||
return this.getState().withProperty(AXIS, facing.getAxis());
|
||||
}
|
||||
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
State state = this.getState();
|
||||
switch (meta & 3)
|
||||
{
|
||||
default:
|
||||
state = state.withProperty(AXIS, Facing.Axis.Y);
|
||||
break;
|
||||
case 1:
|
||||
state = state.withProperty(AXIS, Facing.Axis.X);
|
||||
break;
|
||||
case 2:
|
||||
state = state.withProperty(AXIS, Facing.Axis.Z);
|
||||
break;
|
||||
}
|
||||
return state;
|
||||
}
|
||||
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int meta = 0;
|
||||
switch (state.getValue(AXIS))
|
||||
{
|
||||
case X:
|
||||
meta = 1;
|
||||
break;
|
||||
case Z:
|
||||
meta = 2;
|
||||
break;
|
||||
}
|
||||
return meta;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
|
|
|
@ -34,14 +34,6 @@ public class BlockSkull extends Block implements Rotatable {
|
|||
return this.getState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
|
||||
}
|
||||
|
||||
public State getStateFromMeta(int meta) {
|
||||
return this.getState().withProperty(FACING, Facing.getHorizontal(meta));
|
||||
}
|
||||
|
||||
public int getMetaFromState(State state) {
|
||||
return state.getValue(FACING).getHorizontalIndex();
|
||||
}
|
||||
|
||||
protected Property[] getProperties() {
|
||||
return new Property[] {FACING};
|
||||
}
|
||||
|
|
|
@ -55,22 +55,6 @@ public class BlockSlab extends Block implements Directional
|
|||
this.textureSide = side;
|
||||
SLABS.add(this);
|
||||
}
|
||||
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
meta = meta & 7;
|
||||
return this.getState().withProperty(DOUBLE, meta >= 6).withProperty(SEAMLESS, meta == 7)
|
||||
.withProperty(FACING, (meta == 0 || meta >= 6) ? Facing.DOWN :
|
||||
(meta == 1 ? Facing.UP : Facing.getHorizontal(meta - 2)));
|
||||
}
|
||||
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
if(state.getValue(DOUBLE))
|
||||
return state.getValue(SEAMLESS) ? 7 : 6;
|
||||
Facing dir = state.getValue(FACING);
|
||||
return dir == Facing.DOWN ? 0 : (dir == Facing.UP ? 1 : (dir.getHorizontalIndex() + 2));
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
|
|
|
@ -736,32 +736,6 @@ public class BlockStairs extends Block implements Rotatable
|
|||
return movingobjectposition1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
State iblockstate = this.getState().withProperty(HALF, (meta & 4) > 0 ? BlockStairs.EnumHalf.TOP : BlockStairs.EnumHalf.BOTTOM);
|
||||
iblockstate = iblockstate.withProperty(FACING, Facing.getFront(5 - (meta & 3)));
|
||||
return iblockstate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
if (state.getValue(HALF) == BlockStairs.EnumHalf.TOP)
|
||||
{
|
||||
i |= 4;
|
||||
}
|
||||
|
||||
i = i | 5 - ((Facing)state.getValue(FACING)).getIndex();
|
||||
return i;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the actual Block state of this Block at the given position. This applies properties not visible in the
|
||||
* metadata, such as fence connections.
|
||||
|
@ -814,7 +788,7 @@ public class BlockStairs extends Block implements Rotatable
|
|||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
String primary = this.modelBlock.getModel(provider, BlockRegistry.getNameFromBlock(this.modelBlock).toString(), this.modelState)
|
||||
String primary = this.modelBlock.getModel(provider, BlockRegistry.getName(this.modelBlock).toString(), this.modelState)
|
||||
.getPrimary();
|
||||
return provider.getModel(primary)
|
||||
.stairs(state.getValue(HALF) == EnumHalf.TOP, state.getValue(SHAPE) == EnumShape.INNER_RIGHT ||
|
||||
|
@ -833,6 +807,10 @@ public class BlockStairs extends Block implements Rotatable
|
|||
return true;
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {SHAPE};
|
||||
}
|
||||
|
||||
public static enum EnumHalf implements Identifyable
|
||||
{
|
||||
TOP("top"),
|
||||
|
|
|
@ -257,35 +257,6 @@ public class BlockTrapDoor extends Block implements Rotatable
|
|||
return BlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(FACING, getFacing(meta)).withProperty(OPEN, Boolean.valueOf((meta & 4) != 0)).withProperty(HALF, (meta & 8) == 0 ? BlockTrapDoor.DoorHalf.BOTTOM : BlockTrapDoor.DoorHalf.TOP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | getMetaForFacing((Facing)state.getValue(FACING));
|
||||
|
||||
if (((Boolean)state.getValue(OPEN)).booleanValue())
|
||||
{
|
||||
i |= 4;
|
||||
}
|
||||
|
||||
if (state.getValue(HALF) == BlockTrapDoor.DoorHalf.TOP)
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING, OPEN, HALF};
|
||||
|
|
|
@ -142,10 +142,6 @@ public class BlockWall extends Block
|
|||
return state.withProperty(UP, Boolean.valueOf(worldIn.getState(pos.up()).getBlock() != Blocks.air)).withProperty(NORTH, Boolean.valueOf(this.canConnectTo(worldIn, pos.north()))).withProperty(EAST, Boolean.valueOf(this.canConnectTo(worldIn, pos.east()))).withProperty(SOUTH, Boolean.valueOf(this.canConnectTo(worldIn, pos.south()))).withProperty(WEST, Boolean.valueOf(this.canConnectTo(worldIn, pos.west())));
|
||||
}
|
||||
|
||||
public int getMetaFromState(State state) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {UP, NORTH, EAST, WEST, SOUTH};
|
||||
|
@ -299,4 +295,8 @@ public class BlockWall extends Block
|
|||
protected Item getItemToRegister() {
|
||||
return new ItemWall(this);
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {NORTH, SOUTH, UP, WEST, EAST};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -145,22 +145,6 @@ public class BlockCactus extends Block
|
|||
return BlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(AGE, Integer.valueOf(meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(AGE)).intValue();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {AGE};
|
||||
|
|
|
@ -200,25 +200,6 @@ public class BlockCocoa extends Block implements Rotatable, IGrowable
|
|||
return BlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(FACING, Facing.getHorizontal(meta)).withProperty(AGE, Integer.valueOf((meta & 12) == 12 ? 0 : ((meta & 12) >> 2)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | ((Facing)state.getValue(FACING)).getHorizontalIndex();
|
||||
i = i | ((Integer)state.getValue(AGE)).intValue() << 2;
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING, AGE};
|
||||
|
|
|
@ -202,22 +202,6 @@ public class BlockCrops extends BlockBush implements IGrowable
|
|||
this.grow(worldIn, pos, state);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(AGE, Integer.valueOf(meta > 7 ? 0 : meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(AGE)).intValue();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {AGE};
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package common.block.foliage;
|
||||
|
||||
import common.block.Block;
|
||||
import common.block.Rotatable;
|
||||
import common.block.Material;
|
||||
import common.block.SoundType;
|
||||
import common.color.Colorizer;
|
||||
|
@ -20,7 +19,6 @@ import common.properties.PropertyEnum;
|
|||
import common.rng.Random;
|
||||
import common.tileentity.TileEntity;
|
||||
import common.util.BlockPos;
|
||||
import common.util.Facing;
|
||||
import common.util.Identifyable;
|
||||
import common.util.Facing.Axis;
|
||||
import common.vars.Vars;
|
||||
|
@ -29,7 +27,7 @@ import common.world.State;
|
|||
import common.world.World;
|
||||
import common.world.AWorldServer;
|
||||
|
||||
public class BlockDoublePlant extends BlockBush implements Rotatable, IGrowable
|
||||
public class BlockDoublePlant extends BlockBush implements IGrowable
|
||||
{
|
||||
public static final PropertyEnum<BlockDoublePlant.EnumBlockHalf> HALF = PropertyEnum.<BlockDoublePlant.EnumBlockHalf>create("half", BlockDoublePlant.EnumBlockHalf.class);
|
||||
public static final BlockDoublePlant[] PLANTS = new BlockDoublePlant[EnumPlantType.values().length];
|
||||
|
@ -44,7 +42,7 @@ public class BlockDoublePlant extends BlockBush implements Rotatable, IGrowable
|
|||
{
|
||||
super(Material.BUSH);
|
||||
this.type = type;
|
||||
this.setDefaultState(this.getBaseState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER).withProperty(FACING, Facing.NORTH));
|
||||
this.setDefaultState(this.getBaseState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER));
|
||||
this.setHardness(0.0F);
|
||||
this.setStepSound(SoundType.GRASS);
|
||||
this.setFlammable(60, 100);
|
||||
|
@ -258,25 +256,9 @@ public class BlockDoublePlant extends BlockBush implements Rotatable, IGrowable
|
|||
spawnAsEntity(worldIn, pos, new ItemStack(this.getItem()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return (meta & 8) > 0 ? this.getState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.UPPER) : this.getState().withProperty(HALF, BlockDoublePlant.EnumBlockHalf.LOWER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return state.getValue(HALF) == BlockDoublePlant.EnumBlockHalf.UPPER ? 8 | ((Facing)state.getValue(FACING)).getHorizontalIndex() : 0;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {HALF, FACING};
|
||||
return new Property[] {HALF};
|
||||
}
|
||||
|
||||
public Model getModel(ModelProvider provider, String name, State state) {
|
||||
|
@ -295,10 +277,6 @@ public class BlockDoublePlant extends BlockBush implements Rotatable, IGrowable
|
|||
return provider.getModel(this.type.getName() + "_" + (state.getValue(HALF) == EnumBlockHalf.UPPER
|
||||
? "top" : "bottom")).cross();
|
||||
}
|
||||
|
||||
public Property<?>[] getIgnoredProperties() {
|
||||
return new Property[] {FACING};
|
||||
}
|
||||
|
||||
protected Item getItemToRegister() {
|
||||
return new ItemDoublePlant(this);
|
||||
|
|
|
@ -156,22 +156,6 @@ public class BlockFarmland extends Block
|
|||
return Items.dirt;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(MOISTURE, Integer.valueOf(meta & 7));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(MOISTURE)).intValue();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {MOISTURE};
|
||||
|
|
|
@ -124,14 +124,6 @@ public class BlockGrass extends Block implements IGrowable
|
|||
return BlockLayer.CUTOUT_MIPPED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {SNOWY};
|
||||
|
@ -148,4 +140,8 @@ public class BlockGrass extends Block implements IGrowable
|
|||
protected Item getItemToRegister() {
|
||||
return new ItemColored(this);
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {SNOWY};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -79,22 +79,6 @@ public class BlockHugeMushroom extends Block
|
|||
return this.getState();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(VARIANT, BlockHugeMushroom.EnumType.byMetadata(meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((BlockHugeMushroom.EnumType)state.getValue(VARIANT)).getMetadata();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {VARIANT};
|
||||
|
|
|
@ -246,7 +246,7 @@ public class BlockLeaves extends BlockLeavesBase
|
|||
*/
|
||||
public Item getItemDropped(State state, Random rand, int fortune)
|
||||
{
|
||||
return ItemRegistry.getRegisteredItem(this.type.getName() + "_sapling");
|
||||
return ItemRegistry.byName(this.type.getName() + "_sapling");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -287,7 +287,7 @@ public class BlockLeaves extends BlockLeavesBase
|
|||
}
|
||||
|
||||
if(this.type.getItem() != null && worldIn.rand.chance(i)) // np
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(ItemRegistry.getRegisteredItem(this.type.getItem())));
|
||||
spawnAsEntity(worldIn, pos, new ItemStack(ItemRegistry.byName(this.type.getItem())));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -304,20 +304,6 @@ public class BlockLeaves extends BlockLeavesBase
|
|||
== null ? Colorizer.getFoliageColor(worldIn, pos) : this.type.getTintType().getColor());
|
||||
}
|
||||
|
||||
public State getStateFromMeta(int meta) {
|
||||
return this.getState().withProperty(DECAY, Boolean.valueOf((meta & 8) == 0));
|
||||
}
|
||||
|
||||
public int getMetaFromState(State state) {
|
||||
int i = 0;
|
||||
|
||||
if(!((Boolean)state.getValue(DECAY)).booleanValue()) {
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties() {
|
||||
return new Property[] {DECAY};
|
||||
}
|
||||
|
|
|
@ -81,21 +81,6 @@ public class BlockLilyPad extends BlockBush implements Rotatable
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// public int getMetaFromState(IBlockState state)
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(FACING, Facing.getHorizontal(meta));
|
||||
}
|
||||
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Facing)state.getValue(FACING)).getHorizontalIndex();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
|
|
|
@ -66,46 +66,6 @@ public class BlockLog extends BlockRotatedPillar
|
|||
.e().rot(90);
|
||||
}
|
||||
}
|
||||
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
State state = this.getState();
|
||||
|
||||
switch (meta & 3)
|
||||
{
|
||||
default:
|
||||
state = state.withProperty(AXIS, Facing.Axis.Y);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
state = state.withProperty(AXIS, Facing.Axis.X);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
state = state.withProperty(AXIS, Facing.Axis.Z);
|
||||
break;
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int meta = 0;
|
||||
|
||||
switch ((Facing.Axis)state.getValue(AXIS))
|
||||
{
|
||||
case X:
|
||||
meta = 1;
|
||||
break;
|
||||
|
||||
case Z:
|
||||
meta = 2;
|
||||
break;
|
||||
}
|
||||
|
||||
return meta;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
|
|
|
@ -87,14 +87,6 @@ public class BlockMycelium extends Block
|
|||
return Blocks.dirt.getItemDropped(Blocks.dirt.getState(), rand, fortune);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {SNOWY};
|
||||
|
@ -106,4 +98,8 @@ public class BlockMycelium extends Block
|
|||
else
|
||||
return provider.getModel("mycelium_side").add().nswe().d("dirt").u("mycelium_top");
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {SNOWY};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,14 +29,6 @@ public class BlockPumpkin extends Block implements Rotatable {
|
|||
return this.getState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
|
||||
}
|
||||
|
||||
public State getStateFromMeta(int meta) {
|
||||
return this.getState().withProperty(FACING, Facing.getHorizontal(meta));
|
||||
}
|
||||
|
||||
public int getMetaFromState(State state) {
|
||||
return state.getValue(FACING).getHorizontalIndex();
|
||||
}
|
||||
|
||||
protected Property[] getProperties() {
|
||||
return new Property[] {FACING};
|
||||
}
|
||||
|
|
|
@ -165,22 +165,6 @@ public class BlockReed extends Block
|
|||
return BlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(AGE, Integer.valueOf(meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(AGE)).intValue();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {AGE};
|
||||
|
|
|
@ -114,25 +114,6 @@ public class BlockSapling extends BlockBush implements IGrowable
|
|||
this.grow(worldIn, pos, state, rand);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState() /* .withProperty(TYPE, BlockPlanks.EnumType.byMetadata(meta & 7)) */ .withProperty(STAGE, meta & 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
// int i = 0;
|
||||
// i = i | ((BlockPlanks.EnumType)state.getValue(TYPE)).getMetadata();
|
||||
// i = i | ((Integer)state.getValue(STAGE)).intValue() << 3;
|
||||
return state.getValue(STAGE);
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {STAGE};
|
||||
|
|
|
@ -213,22 +213,6 @@ public class BlockStem extends BlockBush implements DirectionalUp, IGrowable
|
|||
this.growStem(worldIn, pos, state);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(AGE, Integer.valueOf(meta > 7 ? 0 : meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(AGE)).intValue();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {AGE, FACING};
|
||||
|
@ -324,4 +308,8 @@ public class BlockStem extends BlockBush implements DirectionalUp, IGrowable
|
|||
protected Item getItemToRegister() {
|
||||
return new ItemSeeds(this, Blocks.farmland).setDisplay(this.itemName).setMaxAmount(256);
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {FACING};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,11 +36,6 @@ public class BlockTianSoil extends Block
|
|||
return Blocks.tian.getItemDropped(Blocks.tian.getState(), rand, fortune);
|
||||
}
|
||||
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {SNOWY};
|
||||
|
@ -52,4 +47,8 @@ public class BlockTianSoil extends Block
|
|||
else
|
||||
return provider.getModel("tian_soil_side").add().nswe().d("tian").u("tian_soil_top");
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {SNOWY};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -441,44 +441,6 @@ public class BlockVine extends Block
|
|||
return BlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(SOUTH, Boolean.valueOf((meta & 1) > 0)).withProperty(WEST, Boolean.valueOf((meta & 2) > 0)).withProperty(NORTH, Boolean.valueOf((meta & 4) > 0)).withProperty(EAST, Boolean.valueOf((meta & 8) > 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
if (((Boolean)state.getValue(SOUTH)).booleanValue())
|
||||
{
|
||||
i |= 1;
|
||||
}
|
||||
|
||||
if (((Boolean)state.getValue(WEST)).booleanValue())
|
||||
{
|
||||
i |= 2;
|
||||
}
|
||||
|
||||
if (((Boolean)state.getValue(NORTH)).booleanValue())
|
||||
{
|
||||
i |= 4;
|
||||
}
|
||||
|
||||
if (((Boolean)state.getValue(EAST)).booleanValue())
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {UP, NORTH, EAST, SOUTH, WEST};
|
||||
|
@ -597,4 +559,8 @@ public class BlockVine extends Block
|
|||
protected Item getItemToRegister() {
|
||||
return new ItemColored(this, "");
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {UP};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,22 +108,6 @@ public class BlockWart extends BlockBush
|
|||
return Items.soul_wart;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(AGE, Integer.valueOf(meta > 3 ? 0 : meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(AGE)).intValue();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {AGE};
|
||||
|
|
|
@ -315,12 +315,12 @@ public class BlockDynamicLiquid extends BlockLiquid
|
|||
}
|
||||
|
||||
public void getAnimatedTextures(Map<String, Object> map) {
|
||||
map.put(BlockRegistry.getNameFromBlock(this.staticBlock) + "_flow", this.animation);
|
||||
map.put(BlockRegistry.getName(this.staticBlock) + "_flow", this.animation);
|
||||
}
|
||||
|
||||
public String getFallbackTexture() {
|
||||
if(this.cachedTexture == null)
|
||||
this.cachedTexture = BlockRegistry.getNameFromBlock(this.staticBlock) + "_still";
|
||||
this.cachedTexture = BlockRegistry.getName(this.staticBlock) + "_still";
|
||||
return this.cachedTexture;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -378,22 +378,6 @@ public abstract class BlockLiquid extends Block
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(LEVEL, Integer.valueOf(meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(LEVEL)).intValue();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {LEVEL};
|
||||
|
|
|
@ -114,12 +114,12 @@ public class BlockStaticLiquid extends BlockLiquid
|
|||
}
|
||||
|
||||
public void getAnimatedTextures(Map<String, Object> map) {
|
||||
map.put(BlockRegistry.getNameFromBlock(this) + "_still", this.animation);
|
||||
map.put(BlockRegistry.getName(this) + "_still", this.animation);
|
||||
}
|
||||
|
||||
public String getFallbackTexture() {
|
||||
if(this.cachedTexture == null)
|
||||
this.cachedTexture = BlockRegistry.getNameFromBlock(this) + "_still";
|
||||
this.cachedTexture = BlockRegistry.getName(this) + "_still";
|
||||
return this.cachedTexture;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -437,22 +437,6 @@ public class BlockFire extends Block
|
|||
return BlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(AGE, Integer.valueOf(meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(AGE)).intValue();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {AGE, NORTH, EAST, SOUTH, WEST, UPPER, FLIP, ALT};
|
||||
|
@ -1156,4 +1140,8 @@ public class BlockFire extends Block
|
|||
protected Item getItemToRegister() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {NORTH, SOUTH, UPPER, FLIP, WEST, EAST, ALT};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public class BlockOre extends Block
|
|||
public int quantityDroppedWithBonus(int fortune, Random random)
|
||||
{
|
||||
if (fortune > 0 &&
|
||||
this.getItem() != this.getItemDropped((State)this.getValidStates().iterator().next(), random, fortune))
|
||||
this.getItem() != this.getItemDropped(this.getState(), random, fortune))
|
||||
{
|
||||
int i = random.zrange(fortune + 2) - 1;
|
||||
|
||||
|
|
|
@ -29,10 +29,6 @@ public class BlockPodzol extends Block {
|
|||
return state.withProperty(SNOWY, Boolean.valueOf(block == Blocks.snow || block == Blocks.snow_layer));
|
||||
}
|
||||
|
||||
public int getMetaFromState(State state) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
protected Property[] getProperties() {
|
||||
return new Property[] {SNOWY};
|
||||
}
|
||||
|
@ -45,4 +41,8 @@ public class BlockPodzol extends Block {
|
|||
return state.getValue(SNOWY) ? provider.getModel("grass_side_snowed").add().nswe().d("dirt").u("grass_top")
|
||||
: provider.getModel("dirt_podzol_side").add().nswe().d("dirt").u("dirt_podzol_top");
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {SNOWY};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -151,14 +151,6 @@ public class BlockSnow extends Block
|
|||
return side == Facing.UP ? true : super.shouldSideBeRendered(worldIn, pos, side);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(LAYERS, Integer.valueOf((meta & 7) + 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether this Block can be replaced directly by other blocks (true for e.g. tall grass)
|
||||
*/
|
||||
|
@ -167,14 +159,6 @@ public class BlockSnow extends Block
|
|||
return ((Integer)worldIn.getState(pos).getValue(LAYERS)).intValue() == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(LAYERS)).intValue() - 1;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {LAYERS};
|
||||
|
|
|
@ -121,24 +121,6 @@ public class BlockAnvil extends BlockFalling implements Rotatable
|
|||
return this.getState().withProperty(FACING, Facing.SOUTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(FACING, Facing.getHorizontal(meta & 3));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | ((Facing)state.getValue(FACING)).getHorizontalIndex();
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING};
|
||||
|
|
|
@ -501,39 +501,6 @@ public class BlockBrewingStand extends BlockContainer
|
|||
return BlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
State iblockstate = this.getState();
|
||||
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
iblockstate = iblockstate.withProperty(HAS_BOTTLE[i], Boolean.valueOf((meta & 1 << i) > 0));
|
||||
}
|
||||
|
||||
return iblockstate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
for (int j = 0; j < 3; ++j)
|
||||
{
|
||||
if (((Boolean)state.getValue(HAS_BOTTLE[j])).booleanValue())
|
||||
{
|
||||
i |= 1 << j;
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {HAS_BOTTLE[0], HAS_BOTTLE[1], HAS_BOTTLE[2]};
|
||||
|
|
|
@ -316,85 +316,6 @@ public class BlockButton extends Block implements Directional
|
|||
worldIn.notifyNeighborsOfStateChange(pos.offset(facing.getOpposite()), this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
Facing enumfacing;
|
||||
|
||||
switch (meta & 7)
|
||||
{
|
||||
case 0:
|
||||
enumfacing = Facing.DOWN;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
enumfacing = Facing.EAST;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
enumfacing = Facing.WEST;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
enumfacing = Facing.SOUTH;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
enumfacing = Facing.NORTH;
|
||||
break;
|
||||
|
||||
case 5:
|
||||
default:
|
||||
enumfacing = Facing.UP;
|
||||
}
|
||||
|
||||
return this.getState().withProperty(FACING, enumfacing).withProperty(POWERED, Boolean.valueOf((meta & 8) > 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i;
|
||||
|
||||
switch ((Facing)state.getValue(FACING))
|
||||
{
|
||||
case EAST:
|
||||
i = 1;
|
||||
break;
|
||||
|
||||
case WEST:
|
||||
i = 2;
|
||||
break;
|
||||
|
||||
case SOUTH:
|
||||
i = 3;
|
||||
break;
|
||||
|
||||
case NORTH:
|
||||
i = 4;
|
||||
break;
|
||||
|
||||
case UP:
|
||||
default:
|
||||
i = 5;
|
||||
break;
|
||||
|
||||
case DOWN:
|
||||
i = 0;
|
||||
}
|
||||
|
||||
if (((Boolean)state.getValue(POWERED)).booleanValue())
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING, POWERED};
|
||||
|
|
|
@ -643,22 +643,6 @@ public class BlockCauldron extends Block
|
|||
return ((Integer)worldIn.getState(pos).getValue(LEVEL)).intValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(LEVEL, Integer.valueOf(meta > 3 ? 0 : meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(LEVEL)).intValue();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {LEVEL};
|
||||
|
|
|
@ -604,29 +604,6 @@ public class BlockChest extends BlockContainer implements Rotatable
|
|||
return Container.calcRedstoneFromInventory(this.getLockableContainer(worldIn, pos));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
Facing enumfacing = Facing.getFront(meta);
|
||||
|
||||
if (enumfacing.getAxis() == Facing.Axis.Y)
|
||||
{
|
||||
enumfacing = Facing.NORTH;
|
||||
}
|
||||
|
||||
return this.getState().withProperty(FACING, enumfacing);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Facing)state.getValue(FACING)).getIndex();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING};
|
||||
|
|
|
@ -156,22 +156,6 @@ public class BlockDaylightDetector extends BlockContainer
|
|||
return new TileEntityDaylightDetector();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(POWER, Integer.valueOf(meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(POWER)).intValue();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {POWER};
|
||||
|
|
|
@ -274,30 +274,6 @@ public class BlockDispenser extends BlockContainer implements Directional
|
|||
return this.getState().withProperty(FACING, Facing.SOUTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(FACING, getFacing(meta)).withProperty(TRIGGERED, Boolean.valueOf((meta & 8) > 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | ((Facing)state.getValue(FACING)).getIndex();
|
||||
|
||||
if (((Boolean)state.getValue(TRIGGERED)).booleanValue())
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING, TRIGGERED};
|
||||
|
|
|
@ -247,29 +247,6 @@ public class BlockFurnace extends BlockContainer implements Rotatable
|
|||
return this.getState().withProperty(FACING, Facing.SOUTH);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
Facing enumfacing = Facing.getFront(meta);
|
||||
|
||||
if (enumfacing.getAxis() == Facing.Axis.Y)
|
||||
{
|
||||
enumfacing = Facing.NORTH;
|
||||
}
|
||||
|
||||
return this.getState().withProperty(FACING, enumfacing);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Facing)state.getValue(FACING)).getIndex();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING};
|
||||
|
|
|
@ -271,30 +271,6 @@ public class BlockHopper extends BlockContainer implements DirectionalDown
|
|||
return BlockLayer.CUTOUT_MIPPED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(FACING, getFacing(((meta & 7) == 1 || (meta & 7) > 5) ? 0 : meta)).withProperty(ENABLED, Boolean.valueOf(isEnabled(meta)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | ((Facing)state.getValue(FACING)).getIndex();
|
||||
|
||||
if (!((Boolean)state.getValue(ENABLED)).booleanValue())
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING, ENABLED};
|
||||
|
|
|
@ -113,30 +113,30 @@ public class BlockLever extends Block
|
|||
}
|
||||
}
|
||||
|
||||
public static int getMetadataForFacing(Facing facing)
|
||||
public static EnumOrientation getMetadataForFacing(Facing facing)
|
||||
{
|
||||
switch (facing)
|
||||
{
|
||||
case DOWN:
|
||||
return 0;
|
||||
return EnumOrientation.DOWN_X;
|
||||
|
||||
case UP:
|
||||
return 5;
|
||||
return EnumOrientation.UP_Z;
|
||||
|
||||
case NORTH:
|
||||
return 4;
|
||||
return EnumOrientation.NORTH;
|
||||
|
||||
case SOUTH:
|
||||
return 3;
|
||||
return EnumOrientation.SOUTH;
|
||||
|
||||
case WEST:
|
||||
return 2;
|
||||
return EnumOrientation.WEST;
|
||||
|
||||
case EAST:
|
||||
return 1;
|
||||
return EnumOrientation.EAST;
|
||||
|
||||
default:
|
||||
return -1;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -249,30 +249,6 @@ public class BlockLever extends Block
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(FACING, BlockLever.EnumOrientation.byMetadata(meta & 7)).withProperty(POWERED, Boolean.valueOf((meta & 8) > 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | ((BlockLever.EnumOrientation)state.getValue(FACING)).getMetadata();
|
||||
|
||||
if (((Boolean)state.getValue(POWERED)).booleanValue())
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING, POWERED};
|
||||
|
|
|
@ -85,14 +85,6 @@ public abstract class BlockMachine extends Block implements Rotatable, ITileEnti
|
|||
return this.getState().withProperty(FACING, placer.getHorizontalFacing());
|
||||
}
|
||||
|
||||
public State getStateFromMeta(int meta) {
|
||||
return this.getState().withProperty(FACING, Facing.getHorizontal(meta));
|
||||
}
|
||||
|
||||
public int getMetaFromState(State state) {
|
||||
return ((Facing)state.getValue(FACING)).getHorizontalIndex();
|
||||
}
|
||||
|
||||
protected Property[] getProperties() {
|
||||
return new Property[] {FACING};
|
||||
}
|
||||
|
|
|
@ -404,7 +404,7 @@ public class BlockPistonBase extends Block implements Directional
|
|||
}
|
||||
|
||||
worldIn.setState(pos, Blocks.piston_extension.getState().withProperty(BlockPistonMoving.FACING, enumfacing).withProperty(BlockPistonMoving.TYPE, this.isSticky ? BlockPistonHead.EnumPistonType.STICKY : BlockPistonHead.EnumPistonType.DEFAULT), 3);
|
||||
worldIn.setTileEntity(pos, BlockPistonMoving.newTileEntity(this.getStateFromMeta(eventParam), enumfacing, false, true));
|
||||
worldIn.setTileEntity(pos, BlockPistonMoving.newTileEntity(this.getState().withProperty(FACING, getFacing(eventParam)).withProperty(EXTENDED, (eventParam & 8) > 0), enumfacing, false, true));
|
||||
|
||||
if (this.isSticky)
|
||||
{
|
||||
|
@ -679,30 +679,6 @@ public class BlockPistonBase extends Block implements Directional
|
|||
return this.getState().withProperty(FACING, Facing.UP);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(FACING, getFacing(meta)).withProperty(EXTENDED, Boolean.valueOf((meta & 8) > 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | ((Facing)state.getValue(FACING)).getIndex();
|
||||
|
||||
if (((Boolean)state.getValue(EXTENDED)).booleanValue())
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING, EXTENDED};
|
||||
|
|
|
@ -230,30 +230,6 @@ public class BlockPistonHead extends Block implements Directional
|
|||
return worldIn.getState(pos).getValue(TYPE) == BlockPistonHead.EnumPistonType.STICKY ? Items.sticky_piston : Items.piston;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(FACING, getFacing(meta)).withProperty(TYPE, (meta & 8) > 0 ? BlockPistonHead.EnumPistonType.STICKY : BlockPistonHead.EnumPistonType.DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | ((Facing)state.getValue(FACING)).getIndex();
|
||||
|
||||
if (state.getValue(TYPE) == BlockPistonHead.EnumPistonType.STICKY)
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING, TYPE, SHORT};
|
||||
|
@ -300,6 +276,10 @@ public class BlockPistonHead extends Block implements Directional
|
|||
return null;
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {SHORT};
|
||||
}
|
||||
|
||||
public static enum EnumPistonType implements Identifyable
|
||||
{
|
||||
DEFAULT("normal"),
|
||||
|
|
|
@ -282,30 +282,6 @@ public class BlockPistonMoving extends BlockContainer
|
|||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(FACING, BlockPistonHead.getFacing(meta)).withProperty(TYPE, (meta & 8) > 0 ? BlockPistonHead.EnumPistonType.STICKY : BlockPistonHead.EnumPistonType.DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | ((Facing)state.getValue(FACING)).getIndex();
|
||||
|
||||
if (state.getValue(TYPE) == BlockPistonHead.EnumPistonType.STICKY)
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING, TYPE};
|
||||
|
|
|
@ -67,22 +67,6 @@ public class BlockPressurePlate extends BlockBasePressurePlate
|
|||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(POWERED, Boolean.valueOf(meta == 1));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Boolean)state.getValue(POWERED)).booleanValue() ? 1 : 0;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {POWERED};
|
||||
|
|
|
@ -54,22 +54,6 @@ public class BlockPressurePlateWeighted extends BlockBasePressurePlate
|
|||
return 10;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(POWER, Integer.valueOf(meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(POWER)).intValue();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {POWER};
|
||||
|
|
|
@ -30,22 +30,6 @@ public class BlockRail extends BlockRailBase
|
|||
return SHAPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.byMetadata(meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((BlockRailBase.EnumRailDirection)state.getValue(SHAPE)).getMetadata();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {SHAPE};
|
||||
|
|
|
@ -176,30 +176,6 @@ public class BlockRailDetector extends BlockRailBase
|
|||
return new BoundingBox((double)((float)pos.getX() + 0.2F), (double)pos.getY(), (double)((float)pos.getZ() + 0.2F), (double)((float)(pos.getX() + 1) - 0.2F), (double)((float)(pos.getY() + 1) - 0.2F), (double)((float)(pos.getZ() + 1) - 0.2F));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.byMetadata((meta & 7) > 5 ? 0 : (meta & 7))).withProperty(POWERED, Boolean.valueOf((meta & 8) > 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | ((BlockRailBase.EnumRailDirection)state.getValue(SHAPE)).getMetadata();
|
||||
|
||||
if (((Boolean)state.getValue(POWERED)).booleanValue())
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {SHAPE, POWERED};
|
||||
|
|
|
@ -163,30 +163,6 @@ public class BlockRailPowered extends BlockRailBase
|
|||
return SHAPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.byMetadata((meta & 7) > 5 ? 0 : (meta & 7))).withProperty(POWERED, Boolean.valueOf((meta & 8) > 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | ((BlockRailBase.EnumRailDirection)state.getValue(SHAPE)).getMetadata();
|
||||
|
||||
if (((Boolean)state.getValue(POWERED)).booleanValue())
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {SHAPE, POWERED};
|
||||
|
|
|
@ -274,35 +274,6 @@ public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITile
|
|||
return new TileEntityComparator();
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(FACING, Facing.getHorizontal(meta)).withProperty(POWERED, Boolean.valueOf((meta & 8) > 0)).withProperty(MODE, (meta & 4) > 0 ? BlockRedstoneComparator.Mode.SUBTRACT : BlockRedstoneComparator.Mode.COMPARE);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | ((Facing)state.getValue(FACING)).getHorizontalIndex();
|
||||
|
||||
if (((Boolean)state.getValue(POWERED)).booleanValue())
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
if (state.getValue(MODE) == BlockRedstoneComparator.Mode.SUBTRACT)
|
||||
{
|
||||
i |= 4;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING, MODE, POWERED};
|
||||
|
|
|
@ -136,25 +136,6 @@ public class BlockRedstoneRepeater extends BlockRedstoneDiode
|
|||
this.notifyNeighbors(worldIn, pos, state);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(FACING, Facing.getHorizontal(meta)).withProperty(LOCKED, Boolean.valueOf(false)).withProperty(DELAY, Integer.valueOf(1 + (meta >> 2)));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | ((Facing)state.getValue(FACING)).getHorizontalIndex();
|
||||
i = i | ((Integer)state.getValue(DELAY)).intValue() - 1 << 2;
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING, DELAY, LOCKED};
|
||||
|
@ -574,4 +555,8 @@ public class BlockRedstoneRepeater extends BlockRedstoneDiode
|
|||
protected Item getItemToRegister() {
|
||||
return this.isRepeaterPowered ? null : new ItemSmallBlock(this).setDisplay("Redstone-Verstärker").setTab(CheatTab.TECHNOLOGY);
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {LOCKED};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -803,22 +803,6 @@ public class BlockRedstoneWire extends Block
|
|||
return BlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(POWER, Integer.valueOf(meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(POWER)).intValue();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {NORTH, EAST, SOUTH, WEST, POWER};
|
||||
|
@ -1033,6 +1017,10 @@ public class BlockRedstoneWire extends Block
|
|||
return new ItemRedstone(Blocks.redstone).setDisplay("Redstone").setPotionEffect(PotionHelper.redstoneEffect).setMaxAmount(256);
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {EAST, NORTH, SOUTH, WEST};
|
||||
}
|
||||
|
||||
public static enum EnumAttachPosition implements Identifyable
|
||||
{
|
||||
UP("up"),
|
||||
|
|
|
@ -158,22 +158,6 @@ public class BlockTNT extends Block
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(EXPLODE, Boolean.valueOf((meta & 1) > 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Boolean)state.getValue(EXPLODE)).booleanValue() ? 1 : 0;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {EXPLODE};
|
||||
|
|
|
@ -244,73 +244,6 @@ public class BlockTorch extends Block implements DirectionalUp
|
|||
return BlockLayer.CUTOUT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
State iblockstate = this.getState();
|
||||
|
||||
switch (meta)
|
||||
{
|
||||
case 1:
|
||||
iblockstate = iblockstate.withProperty(FACING, Facing.EAST);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
iblockstate = iblockstate.withProperty(FACING, Facing.WEST);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
iblockstate = iblockstate.withProperty(FACING, Facing.SOUTH);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
iblockstate = iblockstate.withProperty(FACING, Facing.NORTH);
|
||||
break;
|
||||
|
||||
case 5:
|
||||
default:
|
||||
iblockstate = iblockstate.withProperty(FACING, Facing.UP);
|
||||
}
|
||||
|
||||
return iblockstate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
switch ((Facing)state.getValue(FACING))
|
||||
{
|
||||
case EAST:
|
||||
i = i | 1;
|
||||
break;
|
||||
|
||||
case WEST:
|
||||
i = i | 2;
|
||||
break;
|
||||
|
||||
case SOUTH:
|
||||
i = i | 3;
|
||||
break;
|
||||
|
||||
case NORTH:
|
||||
i = i | 4;
|
||||
break;
|
||||
|
||||
case DOWN:
|
||||
case UP:
|
||||
default:
|
||||
i = i | 5;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING};
|
||||
|
|
|
@ -264,44 +264,6 @@ public class BlockTripWire extends Block
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(POWERED, Boolean.valueOf((meta & 1) > 0)).withProperty(SUSPENDED, Boolean.valueOf((meta & 2) > 0)).withProperty(ATTACHED, Boolean.valueOf((meta & 4) > 0)).withProperty(DISARMED, Boolean.valueOf((meta & 8) > 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
if (((Boolean)state.getValue(POWERED)).booleanValue())
|
||||
{
|
||||
i |= 1;
|
||||
}
|
||||
|
||||
if (((Boolean)state.getValue(SUSPENDED)).booleanValue())
|
||||
{
|
||||
i |= 2;
|
||||
}
|
||||
|
||||
if (((Boolean)state.getValue(ATTACHED)).booleanValue())
|
||||
{
|
||||
i |= 4;
|
||||
}
|
||||
|
||||
if (((Boolean)state.getValue(DISARMED)).booleanValue())
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {POWERED, SUSPENDED, ATTACHED, DISARMED, NORTH, EAST, WEST, SOUTH};
|
||||
|
@ -702,4 +664,8 @@ public class BlockTripWire extends Block
|
|||
protected Item getItemToRegister() {
|
||||
return new ItemSmallBlock(this).setDisplay("Faden").setTab(CheatTab.TECHNOLOGY).setMaxAmount(1024);
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {NORTH, SOUTH, WEST, EAST};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -342,35 +342,6 @@ public class BlockTripWireHook extends Block implements Rotatable
|
|||
return BlockLayer.CUTOUT_MIPPED;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(FACING, Facing.getHorizontal(meta & 3)).withProperty(POWERED, Boolean.valueOf((meta & 8) > 0)).withProperty(ATTACHED, Boolean.valueOf((meta & 4) > 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
int i = 0;
|
||||
i = i | ((Facing)state.getValue(FACING)).getHorizontalIndex();
|
||||
|
||||
if (((Boolean)state.getValue(POWERED)).booleanValue())
|
||||
{
|
||||
i |= 8;
|
||||
}
|
||||
|
||||
if (((Boolean)state.getValue(ATTACHED)).booleanValue())
|
||||
{
|
||||
i |= 4;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING, POWERED, ATTACHED, SUSPENDED};
|
||||
|
@ -594,4 +565,8 @@ public class BlockTripWireHook extends Block implements Rotatable
|
|||
protected Item getItemToRegister() {
|
||||
return new ItemBlock(this, "tripwire_hook", false);
|
||||
}
|
||||
|
||||
public Property[] getUnsavedProperties() {
|
||||
return new Property[] {SUSPENDED};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -131,29 +131,6 @@ public class BlockWarpChest extends Block implements Rotatable
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
Facing enumfacing = Facing.getFront(meta);
|
||||
|
||||
if (enumfacing.getAxis() == Facing.Axis.Y)
|
||||
{
|
||||
enumfacing = Facing.NORTH;
|
||||
}
|
||||
|
||||
return this.getState().withProperty(FACING, enumfacing);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Facing)state.getValue(FACING)).getIndex();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING};
|
||||
|
|
|
@ -75,7 +75,7 @@ public class BlockWorkbench extends Block
|
|||
|
||||
public String getGuiID()
|
||||
{
|
||||
return BlockRegistry.getNameFromBlock(this.block);
|
||||
return BlockRegistry.getName(this.block);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,6 @@ import common.init.Items;
|
|||
import common.item.Item;
|
||||
import common.item.ItemStack;
|
||||
import common.model.Transforms;
|
||||
import common.properties.PropertyInteger;
|
||||
import common.rng.Random;
|
||||
import common.tags.TagObject;
|
||||
import common.tileentity.TileEntity;
|
||||
|
@ -21,8 +20,6 @@ import common.world.World;
|
|||
|
||||
public class BlockBanner extends BlockContainer implements Rotatable
|
||||
{
|
||||
public static final PropertyInteger ROTATION = PropertyInteger.create("rotation", 0, 15);
|
||||
|
||||
public BlockBanner()
|
||||
{
|
||||
super(Material.WOOD);
|
||||
|
|
|
@ -59,23 +59,6 @@ public class BlockBannerHanging extends BlockBanner
|
|||
super.onNeighborBlockChange(worldIn, pos, state, neighborBlock);
|
||||
}
|
||||
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
Facing enumfacing = Facing.getFront(meta);
|
||||
|
||||
if (enumfacing.getAxis() == Facing.Axis.Y)
|
||||
{
|
||||
enumfacing = Facing.NORTH;
|
||||
}
|
||||
|
||||
return this.getState().withProperty(FACING, enumfacing);
|
||||
}
|
||||
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Facing)state.getValue(FACING)).getIndex();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING};
|
||||
|
|
|
@ -4,12 +4,15 @@ import common.block.Block;
|
|||
import common.item.Item;
|
||||
import common.item.block.ItemBanner;
|
||||
import common.properties.Property;
|
||||
import common.properties.PropertyInteger;
|
||||
import common.util.BlockPos;
|
||||
import common.world.State;
|
||||
import common.world.World;
|
||||
|
||||
public class BlockBannerStanding extends BlockBanner
|
||||
{
|
||||
public static final PropertyInteger ROTATION = PropertyInteger.create("rotation", 0, 15);
|
||||
|
||||
public BlockBannerStanding()
|
||||
{
|
||||
this.setDefaultState(this.getBaseState().withProperty(ROTATION, Integer.valueOf(0)));
|
||||
|
@ -26,16 +29,6 @@ public class BlockBannerStanding extends BlockBanner
|
|||
super.onNeighborBlockChange(worldIn, pos, state, neighborBlock);
|
||||
}
|
||||
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(ROTATION, Integer.valueOf(meta));
|
||||
}
|
||||
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(ROTATION)).intValue();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {ROTATION};
|
||||
|
|
|
@ -32,22 +32,6 @@ public class BlockStandingSign extends BlockSign
|
|||
super.onNeighborBlockChange(worldIn, pos, state, neighborBlock);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
return this.getState().withProperty(ROTATION, Integer.valueOf(meta));
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Integer)state.getValue(ROTATION)).intValue();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {ROTATION};
|
||||
|
|
|
@ -63,29 +63,6 @@ public class BlockWallSign extends BlockSign implements Rotatable
|
|||
super.onNeighborBlockChange(worldIn, pos, state, neighborBlock);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the given metadata into a BlockState for this Block
|
||||
*/
|
||||
public State getStateFromMeta(int meta)
|
||||
{
|
||||
Facing enumfacing = Facing.getFront(meta);
|
||||
|
||||
if (enumfacing.getAxis() == Facing.Axis.Y)
|
||||
{
|
||||
enumfacing = Facing.NORTH;
|
||||
}
|
||||
|
||||
return this.getState().withProperty(FACING, enumfacing);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the BlockState into the correct metadata value
|
||||
*/
|
||||
public int getMetaFromState(State state)
|
||||
{
|
||||
return ((Facing)state.getValue(FACING)).getIndex();
|
||||
}
|
||||
|
||||
protected Property[] getProperties()
|
||||
{
|
||||
return new Property[] {FACING};
|
||||
|
|
|
@ -223,7 +223,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
|
|||
|
||||
public static void writeState(TagObject tag, String name, State state) {
|
||||
if(state != null)
|
||||
tag.setString(name, state.getId());
|
||||
tag.setString(name, BlockRegistry.getName(state));
|
||||
}
|
||||
|
||||
public static void writeState(TagObject tag, State state) {
|
||||
|
@ -231,7 +231,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
|
|||
}
|
||||
|
||||
public static State readState(TagObject tag, String name, State def) {
|
||||
return tag.hasString(name) ? State.getState(tag.getString(name), def) : def;
|
||||
return tag.hasString(name) ? BlockRegistry.byName(tag.getString(name), def) : def;
|
||||
}
|
||||
|
||||
public static State readState(TagObject tag, State def) {
|
||||
|
@ -523,7 +523,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
|
|||
public final Dimension addMetalOres(MetalType ... metals) {
|
||||
for(MetalType metal : metals) {
|
||||
int count = METAL_COUNTS[metal.rarity];
|
||||
this.ores.add(new Ore(BlockRegistry.getRegisteredBlock(metal.name + "_ore").getState(),
|
||||
this.ores.add(new Ore(BlockRegistry.byName(metal.name + "_ore").getState(),
|
||||
count < 0 ? 0 : count, count < 0 ? (-count) : 0, METAL_SIZES[metal.rarity], METAL_OFFSETS[metal.rarity], METAL_HEIGHTS[metal.rarity], false));
|
||||
}
|
||||
return this;
|
||||
|
@ -939,7 +939,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
|
|||
String[] list = tag.getStringArray("Layers");
|
||||
this.layers = new State[list.length];
|
||||
for(int z = 0; z < this.layers.length; z++) {
|
||||
this.layers[z] = State.getState(list[z], Blocks.air.getState());
|
||||
this.layers[z] = BlockRegistry.byName(list[z], Blocks.air.getState());
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -1177,7 +1177,7 @@ public abstract class Dimension extends Nameable implements Comparable<Dimension
|
|||
if(this.layers != null) {
|
||||
String[] list = new String[this.layers.length];
|
||||
for(int z = 0; z < this.layers.length; z++) {
|
||||
list[z] = this.layers[z].getId();
|
||||
list[z] = BlockRegistry.getName(this.layers[z]);
|
||||
}
|
||||
tag.setStringArray("Layers", list);
|
||||
}
|
||||
|
|
|
@ -1040,7 +1040,7 @@ public abstract class Entity
|
|||
|
||||
if (block.getRenderType() != -1)
|
||||
{
|
||||
this.worldObj.spawnParticle(ParticleType.BLOCK_CRACK, this.posX + ((double)this.rand.floatv() - 0.5D) * (double)this.width, this.getEntityBoundingBox().minY + 0.1D, this.posZ + ((double)this.rand.floatv() - 0.5D) * (double)this.width, -this.motionX * 4.0D, 1.5D, -this.motionZ * 4.0D, BlockRegistry.getStateId(iblockstate));
|
||||
this.worldObj.spawnParticle(ParticleType.BLOCK_CRACK, this.posX + ((double)this.rand.floatv() - 0.5D) * (double)this.width, this.getEntityBoundingBox().minY + 0.1D, this.posZ + ((double)this.rand.floatv() - 0.5D) * (double)this.width, -this.motionX * 4.0D, 1.5D, -this.motionZ * 4.0D, BlockRegistry.getId(iblockstate));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2615,7 +2615,7 @@ public abstract class Entity
|
|||
String id = EntityRegistry.getEntityString(this);
|
||||
if(!EntityRegistry.SPAWN_EGGS.containsKey(id))
|
||||
return null;
|
||||
return ItemRegistry.getRegisteredItem(id.toLowerCase() + "_spawner");
|
||||
return ItemRegistry.byName(id.toLowerCase() + "_spawner");
|
||||
}
|
||||
|
||||
public Position getPos() {
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue