fixes, burning out torches, remove some redstone

This commit is contained in:
Sen 2025-07-15 03:24:57 +02:00
parent 13b6a4e280
commit dabef4a3fd
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
94 changed files with 1902 additions and 4450 deletions

View file

@ -137,7 +137,7 @@ public class GuiCreateDimension extends Gui {
addFlatPreset("Wüste", Biome.DESERT, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(), 52, Blocks.sandstone.getState()) addFlatPreset("Wüste", Biome.DESERT, false, Blocks.stone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(), 52, Blocks.sandstone.getState())
.enableVillages().enableScattered(); .enableVillages().enableScattered();
addFlatPreset("Redstonewelt", Biome.DESERT, false, Blocks.sandstone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(), addFlatPreset("Sandsteinwelt", Biome.DESERT, false, Blocks.sandstone.getState(), Blocks.bedrock.getState(), 3, Blocks.stone.getState(),
52, Blocks.sandstone.getState()); 52, Blocks.sandstone.getState());
addPreset("Leer", "ClearGenerator:1b"); addPreset("Leer", "ClearGenerator:1b");

View file

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 264 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 609 B

After

Width:  |  Height:  |  Size: 609 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 682 B

After

Width:  |  Height:  |  Size: 616 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 682 B

After

Width:  |  Height:  |  Size: 682 B

Before After
Before After

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 616 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 159 B

After

Width:  |  Height:  |  Size: 4.5 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 155 B

View file

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 166 B

After

Width:  |  Height:  |  Size: 166 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 968 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 620 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View file

@ -1,33 +0,0 @@
package common.block.artificial;
import common.block.Block;
import common.block.Material;
import common.util.BlockPos;
import common.util.Facing;
import common.world.IWorldAccess;
import common.world.State;
public class BlockCompressedPowered extends Block
{
public BlockCompressedPowered(Material p_i46386_1_)
{
super(p_i46386_1_);
}
/**
* Can this block provide power. Only wire currently seems to have this change based on its state.
*/
public boolean canProvidePower()
{
return true;
}
public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
{
return 15;
}
public boolean isMagnetic() {
return true;
}
}

View file

@ -9,6 +9,7 @@ import common.collect.Lists;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.item.Item; import common.item.Item;
import common.item.block.ItemDoor; import common.item.block.ItemDoor;
import common.item.tool.ItemKey;
import common.model.BlockLayer; import common.model.BlockLayer;
import common.model.Model; import common.model.Model;
import common.model.ModelProvider; import common.model.ModelProvider;
@ -55,17 +56,25 @@ public class BlockDoor extends Block implements Rotatable {
public static final PropertyBool OPEN = PropertyBool.create("open"); public static final PropertyBool OPEN = PropertyBool.create("open");
public static final PropertyEnum<EnumHingePosition> HINGE = PropertyEnum.<EnumHingePosition>create("hinge", EnumHingePosition.class); public static final PropertyEnum<EnumHingePosition> HINGE = PropertyEnum.<EnumHingePosition>create("hinge", EnumHingePosition.class);
public static final PropertyBool POWERED = PropertyBool.create("powered");
public static final PropertyEnum<EnumDoorHalf> HALF = PropertyEnum.<EnumDoorHalf>create("half", EnumDoorHalf.class); public static final PropertyEnum<EnumDoorHalf> HALF = PropertyEnum.<EnumDoorHalf>create("half", EnumDoorHalf.class);
public static final List<BlockDoor> DOORS = Lists.newArrayList(); public static final List<BlockDoor> DOORS = Lists.newArrayList();
private ItemKey keyItem;
public BlockDoor(Material material) { public BlockDoor(Material material) {
super(material); super(material);
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(OPEN, false) this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(OPEN, false)
.withProperty(HINGE, EnumHingePosition.LEFT).withProperty(POWERED, false) .withProperty(HINGE, EnumHingePosition.LEFT).withProperty(HALF, EnumDoorHalf.LOWER));
.withProperty(HALF, EnumDoorHalf.LOWER));
DOORS.add(this); DOORS.add(this);
} }
public void setKeyItem(ItemKey key) {
this.keyItem = key;
}
public ItemKey getKeyItem() {
return this.keyItem;
}
public boolean isOpaqueCube() { public boolean isOpaqueCube() {
return false; return false;
@ -146,7 +155,7 @@ public class BlockDoor extends Block implements Rotatable {
} }
public boolean onBlockActivated(World world, BlockPos pos, State state, EntityNPC player, Facing side, float hitX, float hitY, float hitZ) { public boolean onBlockActivated(World world, BlockPos pos, State state, EntityNPC player, Facing side, float hitX, float hitY, float hitZ) {
if(this.material == Material.SOLID) if(this.keyItem != null && (player.getHeldItem() == null || player.getHeldItem().getItem() != this.keyItem))
return true; return true;
BlockPos lower = state.getValue(HALF) == EnumDoorHalf.LOWER ? pos : pos.down(); BlockPos lower = state.getValue(HALF) == EnumDoorHalf.LOWER ? pos : pos.down();
BlockPos upper = state.getValue(HALF) == EnumDoorHalf.UPPER ? pos : pos.up(); BlockPos upper = state.getValue(HALF) == EnumDoorHalf.UPPER ? pos : pos.up();
@ -214,21 +223,6 @@ public class BlockDoor extends Block implements Rotatable {
this.dropBlockAsItem(world, pos, state, 0); this.dropBlockAsItem(world, pos, state, 0);
} }
} }
else {
boolean power = world.isBlockPowered(pos) || world.isBlockPowered(upper);
if((power || neighbor.canProvidePower()) && neighbor != this) {
world.setState(pos, state.withProperty(POWERED, power), 2);
world.setState(upper, top.withProperty(POWERED, power), 2);
if((power != state.getValue(OPEN)) || (power != top.getValue(OPEN))) {
world.setState(pos, state.withProperty(OPEN, power), 2);
world.setState(upper, top.withProperty(OPEN, power), 2);
world.markBlockRangeForRenderUpdate(pos, upper);
world.playAuxSFX(power ? 1003 : 1006, pos, 0);
}
}
}
} }
} }
@ -262,7 +256,7 @@ public class BlockDoor extends Block implements Rotatable {
} }
protected Property[] getProperties() { protected Property[] getProperties() {
return new Property[] {HALF, FACING, OPEN, HINGE, POWERED}; return new Property[] {HALF, FACING, OPEN, HINGE};
} }
private static ModelRotation getRotation(Facing rot, int offset) { private static ModelRotation getRotation(Facing rot, int offset) {
@ -290,10 +284,6 @@ public class BlockDoor extends Block implements Rotatable {
} }
} }
public Property<?>[] getIgnoredProperties() {
return new Property[] {POWERED};
}
protected Item getItemToRegister() { protected Item getItemToRegister() {
return new ItemDoor(this); return new ItemDoor(this);
} }

View file

@ -25,17 +25,16 @@ import common.world.World;
public class BlockFenceGate extends Block implements Rotatable public class BlockFenceGate extends Block implements Rotatable
{ {
public static final PropertyBool OPEN = PropertyBool.create("open"); public static final PropertyBool OPEN = PropertyBool.create("open");
public static final PropertyBool POWERED = PropertyBool.create("powered");
public static final PropertyBool IN_WALL = PropertyBool.create("in_wall"); public static final PropertyBool IN_WALL = PropertyBool.create("in_wall");
private final String texture; private final String texture;
public BlockFenceGate(WoodType p_i46394_1_) public BlockFenceGate(WoodType type)
{ {
super(Material.WOOD); // , p_i46394_1_.getMapColor()); super(Material.WOOD);
this.setDefaultState(this.getBaseState().withProperty(OPEN, Boolean.valueOf(false)).withProperty(POWERED, Boolean.valueOf(false)).withProperty(IN_WALL, Boolean.valueOf(false))); this.setDefaultState(this.getBaseState().withProperty(OPEN, Boolean.valueOf(false)).withProperty(IN_WALL, Boolean.valueOf(false)));
this.setTab(CheatTab.WOOD); this.setTab(CheatTab.WOOD);
this.texture = p_i46394_1_.getName() + "_planks"; this.texture = type.getName() + "_planks";
} }
/** /**
@ -110,7 +109,7 @@ public class BlockFenceGate extends Block implements Rotatable
*/ */
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
{ {
return this.getState().withProperty(FACING, placer.getHorizontalFacing()).withProperty(OPEN, Boolean.valueOf(false)).withProperty(POWERED, Boolean.valueOf(false)).withProperty(IN_WALL, Boolean.valueOf(false)); return this.getState().withProperty(FACING, placer.getHorizontalFacing()).withProperty(OPEN, Boolean.valueOf(false)).withProperty(IN_WALL, Boolean.valueOf(false));
} }
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
@ -137,35 +136,6 @@ public class BlockFenceGate extends Block implements Rotatable
return true; return true;
} }
/**
* Called when a neighboring block changes.
*/
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
{
if (!worldIn.client)
{
boolean flag = worldIn.isBlockPowered(pos);
if (flag || neighborBlock.canProvidePower())
{
if (flag && !((Boolean)state.getValue(OPEN)).booleanValue() && !((Boolean)state.getValue(POWERED)).booleanValue())
{
worldIn.setState(pos, state.withProperty(OPEN, Boolean.valueOf(true)).withProperty(POWERED, Boolean.valueOf(true)), 2);
worldIn.playAuxSFX(1003, pos, 0);
}
else if (!flag && ((Boolean)state.getValue(OPEN)).booleanValue() && ((Boolean)state.getValue(POWERED)).booleanValue())
{
worldIn.setState(pos, state.withProperty(OPEN, Boolean.valueOf(false)).withProperty(POWERED, Boolean.valueOf(false)), 2);
worldIn.playAuxSFX(1006, pos, 0);
}
else if (flag != ((Boolean)state.getValue(POWERED)).booleanValue())
{
worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(flag)), 2);
}
}
}
}
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side) public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
{ {
return true; return true;
@ -173,7 +143,7 @@ public class BlockFenceGate extends Block implements Rotatable
protected Property[] getProperties() protected Property[] getProperties()
{ {
return new Property[] {FACING, OPEN, POWERED, IN_WALL}; return new Property[] {FACING, OPEN, IN_WALL};
} }
public Transforms getTransform() { public Transforms getTransform() {
@ -377,10 +347,6 @@ public class BlockFenceGate extends Block implements Rotatable
.rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite())); .rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite()));
} }
public Property<?>[] getIgnoredProperties() {
return new Property[] {POWERED};
}
public Property[] getUnsavedProperties() { public Property[] getUnsavedProperties() {
return new Property[] {IN_WALL}; return new Property[] {IN_WALL};
} }

View file

@ -0,0 +1,16 @@
package common.block.artificial;
import common.block.Block;
import common.block.Material;
public class BlockMagnetic extends Block
{
public BlockMagnetic(Material material)
{
super(material);
}
public boolean isMagnetic() {
return true;
}
}

View file

@ -5,8 +5,8 @@ import common.block.Rotatable;
import common.block.Material; import common.block.Material;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving; import common.entity.types.EntityLiving;
import common.init.Blocks;
import common.item.CheatTab; import common.item.CheatTab;
import common.item.tool.ItemKey;
import common.model.BlockLayer; import common.model.BlockLayer;
import common.model.Model; import common.model.Model;
import common.model.ModelProvider; import common.model.ModelProvider;
@ -30,6 +30,8 @@ public class BlockTrapDoor extends Block implements Rotatable
{ {
public static final PropertyBool OPEN = PropertyBool.create("open"); public static final PropertyBool OPEN = PropertyBool.create("open");
public static final PropertyEnum<BlockTrapDoor.DoorHalf> HALF = PropertyEnum.<BlockTrapDoor.DoorHalf>create("half", BlockTrapDoor.DoorHalf.class); public static final PropertyEnum<BlockTrapDoor.DoorHalf> HALF = PropertyEnum.<BlockTrapDoor.DoorHalf>create("half", BlockTrapDoor.DoorHalf.class);
private ItemKey keyItem;
public BlockTrapDoor(Material materialIn) public BlockTrapDoor(Material materialIn)
{ {
@ -40,6 +42,14 @@ public class BlockTrapDoor extends Block implements Rotatable
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
this.setTab(materialIn == Material.WOOD ? CheatTab.WOOD : CheatTab.TECHNOLOGY); this.setTab(materialIn == Material.WOOD ? CheatTab.WOOD : CheatTab.TECHNOLOGY);
} }
public void setKeyItem(ItemKey key) {
this.keyItem = key;
}
public ItemKey getKeyItem() {
return this.keyItem;
}
/** /**
* Used to determine ambient occlusion and culling when rebuilding chunks for render * Used to determine ambient occlusion and culling when rebuilding chunks for render
@ -128,51 +138,14 @@ public class BlockTrapDoor extends Block implements Rotatable
} }
} }
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC player, Facing side, float hitX, float hitY, float hitZ)
{ {
if (this.material == Material.SOLID) if(this.keyItem != null && (player.getHeldItem() == null || player.getHeldItem().getItem() != this.keyItem))
{ return true;
return true; state = state.cycleProperty(OPEN);
} worldIn.setState(pos, state, 2);
else worldIn.playAuxSFX(player, ((Boolean)state.getValue(OPEN)).booleanValue() ? 1003 : 1006, pos, 0);
{ return true;
state = state.cycleProperty(OPEN);
worldIn.setState(pos, state, 2);
worldIn.playAuxSFX(playerIn, ((Boolean)state.getValue(OPEN)).booleanValue() ? 1003 : 1006, pos, 0);
return true;
}
}
/**
* Called when a neighboring block changes.
*/
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
{
if (!worldIn.client)
{
BlockPos blockpos = pos.offset(((Facing)state.getValue(FACING)).getOpposite());
if (!isValidSupportBlock(worldIn.getState(blockpos).getBlock()))
{
worldIn.setBlockToAir(pos);
this.dropBlockAsItem(worldIn, pos, state, 0);
}
else
{
boolean flag = worldIn.isBlockPowered(pos);
if (flag || neighborBlock.canProvidePower())
{
boolean flag1 = ((Boolean)state.getValue(OPEN)).booleanValue();
if (flag1 != flag)
{
worldIn.setState(pos, state.withProperty(OPEN, Boolean.valueOf(flag)), 2);
worldIn.playAuxSFX(flag ? 1003 : 1006, pos, 0);
}
}
}
}
} }
/** /**
@ -197,61 +170,14 @@ public class BlockTrapDoor extends Block implements Rotatable
iblockstate = iblockstate.withProperty(FACING, facing).withProperty(OPEN, Boolean.valueOf(false)); iblockstate = iblockstate.withProperty(FACING, facing).withProperty(OPEN, Boolean.valueOf(false));
iblockstate = iblockstate.withProperty(HALF, hitY > 0.5F ? BlockTrapDoor.DoorHalf.TOP : BlockTrapDoor.DoorHalf.BOTTOM); iblockstate = iblockstate.withProperty(HALF, hitY > 0.5F ? BlockTrapDoor.DoorHalf.TOP : BlockTrapDoor.DoorHalf.BOTTOM);
} }
else {
iblockstate = iblockstate.withProperty(FACING, placer.getHorizontalFacing()).withProperty(OPEN, Boolean.valueOf(false));
iblockstate = iblockstate.withProperty(HALF, facing == Facing.DOWN ? BlockTrapDoor.DoorHalf.TOP : BlockTrapDoor.DoorHalf.BOTTOM);
}
return iblockstate; return iblockstate;
} }
/**
* Check whether this Block can be placed on the given side
*/
public boolean canPlaceBlockOnSide(World worldIn, BlockPos pos, Facing side)
{
return !side.getAxis().isVertical() && isValidSupportBlock(worldIn.getState(pos.offset(side.getOpposite())).getBlock());
}
protected static Facing getFacing(int meta)
{
switch (meta & 3)
{
case 0:
return Facing.NORTH;
case 1:
return Facing.SOUTH;
case 2:
return Facing.WEST;
case 3:
default:
return Facing.EAST;
}
}
protected static int getMetaForFacing(Facing facing)
{
switch (facing)
{
case NORTH:
return 0;
case SOUTH:
return 1;
case WEST:
return 2;
case EAST:
default:
return 3;
}
}
private static boolean isValidSupportBlock(Block blockIn)
{
return blockIn.getMaterial().isOpaque() && blockIn.isFullCube() || blockIn == Blocks.glass || blockIn instanceof BlockStainedGlass || blockIn == Blocks.glowstone || blockIn instanceof BlockSlab || blockIn instanceof BlockStairs;
}
public BlockLayer getBlockLayer() public BlockLayer getBlockLayer()
{ {
return BlockLayer.CUTOUT; return BlockLayer.CUTOUT;

View file

@ -1,200 +0,0 @@
package common.block.natural;
import common.block.Block;
import common.block.Material;
import common.entity.Entity;
import common.entity.npc.EntityNPC;
import common.init.Blocks;
import common.init.Items;
import common.item.Item;
import common.item.ItemStack;
import common.model.Model;
import common.model.ModelProvider;
import common.rng.Random;
import common.util.BlockPos;
import common.util.Facing;
import common.util.ParticleType;
import common.world.AWorldClient;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
public class BlockRedstoneOre extends Block
{
private final boolean isOn;
public BlockRedstoneOre(boolean isOn)
{
super(Material.SOLID);
if (isOn)
{
this.setTickRandomly();
}
this.isOn = isOn;
}
/**
* How many world ticks before ticking
*/
public int tickRate(World worldIn, BlockPos pos)
{
return 30;
}
public void onBlockClicked(World worldIn, BlockPos pos, EntityNPC playerIn)
{
this.activate(worldIn, pos);
super.onBlockClicked(worldIn, pos, playerIn);
}
/**
* Triggered whenever an entity collides with this block (enters into the block)
*/
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, Entity entityIn)
{
this.activate(worldIn, pos);
super.onEntityCollidedWithBlock(worldIn, pos, entityIn);
}
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
{
this.activate(worldIn, pos);
return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ);
}
private void activate(World worldIn, BlockPos pos)
{
this.spawnParticles(worldIn, pos);
if (this == Blocks.redstone_ore)
{
worldIn.setState(pos, Blocks.lit_redstone_ore.getState());
}
}
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{
if (this == Blocks.lit_redstone_ore)
{
worldIn.setState(pos, Blocks.redstone_ore.getState());
}
}
/**
* Get the Item that this Block should drop when harvested.
*/
public Item getItemDropped(State state, Random rand, int fortune)
{
return Items.redstone;
}
/**
* Get the quantity dropped based on the given fortune level
*/
public int quantityDroppedWithBonus(int fortune, Random random)
{
return this.quantityDropped(random) + random.zrange(fortune + 1);
}
/**
* Returns the quantity of items to drop on block destruction.
*/
public int quantityDropped(Random random)
{
return random.range(4, 5);
}
/**
* Spawns this Block's drops into the World as EntityItems.
*/
public void dropBlockAsItemWithChance(World worldIn, BlockPos pos, State state, float chance, int fortune)
{
super.dropBlockAsItemWithChance(worldIn, pos, state, chance, fortune);
if (this.getItemDropped(state, worldIn.rand, fortune) != this.getItem())
{
int i = worldIn.rand.roll(5);
this.dropXpOnBlockBreak(worldIn, pos, i);
}
}
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{
if (this.isOn)
{
this.spawnParticles(worldIn, pos);
}
}
private void spawnParticles(World worldIn, BlockPos pos)
{
Random random = worldIn.rand;
double d0 = 0.0625D;
for (int i = 0; i < 6; ++i)
{
double d1 = (double)((float)pos.getX() + random.floatv());
double d2 = (double)((float)pos.getY() + random.floatv());
double d3 = (double)((float)pos.getZ() + random.floatv());
if (i == 0 && !worldIn.getState(pos.up()).getBlock().isOpaqueCube())
{
d2 = (double)pos.getY() + d0 + 1.0D;
}
if (i == 1 && !worldIn.getState(pos.down()).getBlock().isOpaqueCube())
{
d2 = (double)pos.getY() - d0;
}
if (i == 2 && !worldIn.getState(pos.south()).getBlock().isOpaqueCube())
{
d3 = (double)pos.getZ() + d0 + 1.0D;
}
if (i == 3 && !worldIn.getState(pos.north()).getBlock().isOpaqueCube())
{
d3 = (double)pos.getZ() - d0;
}
if (i == 4 && !worldIn.getState(pos.east()).getBlock().isOpaqueCube())
{
d1 = (double)pos.getX() + d0 + 1.0D;
}
if (i == 5 && !worldIn.getState(pos.west()).getBlock().isOpaqueCube())
{
d1 = (double)pos.getX() - d0;
}
if (d1 < (double)pos.getX() || d1 > (double)(pos.getX() + 1) || d2 < 0.0D || d2 > (double)(pos.getY() + 1) || d3 < (double)pos.getZ() || d3 > (double)(pos.getZ() + 1))
{
worldIn.spawnParticle(ParticleType.DUST, d1, d2, d3, 0xff0000);
}
}
}
public ItemStack createStackedBlock(State state)
{
return new ItemStack(Items.redstone_ore);
}
public boolean isXrayVisible()
{
return true;
}
public boolean isMagnetic() {
return true;
}
public Model getModel(ModelProvider provider, String name, State state) {
return provider.getModel("redstone_ore").add().all();
}
protected Item getItemToRegister() {
return this.isOn ? null : super.getItemToRegister();
}
}

View file

@ -36,7 +36,7 @@ public abstract class BlockBasePressurePlate extends Block
protected void setBlockBoundsBasedOnState0(State state) protected void setBlockBoundsBasedOnState0(State state)
{ {
boolean flag = this.getRedstoneStrength(state) > 0; boolean flag = this.getSignalStrength(state) > 0;
float f = 0.0625F; float f = 0.0625F;
if (flag) if (flag)
@ -121,7 +121,7 @@ public abstract class BlockBasePressurePlate extends Block
{ {
// if (!worldIn.client) // if (!worldIn.client)
// { // {
int i = this.getRedstoneStrength(state); int i = this.getSignalStrength(state);
if (i > 0) if (i > 0)
{ {
@ -137,7 +137,7 @@ public abstract class BlockBasePressurePlate extends Block
{ {
if (!worldIn.client) if (!worldIn.client)
{ {
int i = this.getRedstoneStrength(state); int i = this.getSignalStrength(state);
if (i == 0) if (i == 0)
{ {
@ -149,15 +149,15 @@ public abstract class BlockBasePressurePlate extends Block
/** /**
* Updates the pressure plate when stepped on * Updates the pressure plate when stepped on
*/ */
protected void updateState(World worldIn, BlockPos pos, State state, int oldRedstoneStrength) protected void updateState(World worldIn, BlockPos pos, State state, int oldSignal)
{ {
int i = this.computeRedstoneStrength(worldIn, pos); int i = this.computeSignalStrength(worldIn, pos);
boolean flag = oldRedstoneStrength > 0; boolean flag = oldSignal > 0;
boolean flag1 = i > 0; boolean flag1 = i > 0;
if (oldRedstoneStrength != i) if (oldSignal != i)
{ {
state = this.setRedstoneStrength(state, i); state = this.setSignalStrength(state, i);
worldIn.setState(pos, state, 2); worldIn.setState(pos, state, 2);
this.updateNeighbors(worldIn, pos); this.updateNeighbors(worldIn, pos);
worldIn.markBlockRangeForRenderUpdate(pos, pos); worldIn.markBlockRangeForRenderUpdate(pos, pos);
@ -189,7 +189,7 @@ public abstract class BlockBasePressurePlate extends Block
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
if (this.getRedstoneStrength(state) > 0) if (this.getSignalStrength(state) > 0)
{ {
this.updateNeighbors(worldIn, pos); this.updateNeighbors(worldIn, pos);
} }
@ -208,12 +208,12 @@ public abstract class BlockBasePressurePlate extends Block
public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side) public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
{ {
return this.getRedstoneStrength(state); return this.getSignalStrength(state);
} }
public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side) public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
{ {
return side == Facing.UP ? this.getRedstoneStrength(state) : 0; return side == Facing.UP ? this.getSignalStrength(state) : 0;
} }
/** /**
@ -241,7 +241,7 @@ public abstract class BlockBasePressurePlate extends Block
} }
public Model getModel(ModelProvider provider, String name, State state) { public Model getModel(ModelProvider provider, String name, State state) {
if(this.getRedstoneStrength(state) > 0) if(this.getSignalStrength(state) > 0)
return provider.getModel(this.getTexture()) return provider.getModel(this.getTexture())
.add(1, 0, 1, 15, 0.5f, 15) .add(1, 0, 1, 15, 0.5f, 15)
.d().uv(1, 1, 15, 15) .d().uv(1, 1, 15, 15)
@ -267,9 +267,9 @@ public abstract class BlockBasePressurePlate extends Block
public abstract String getTexture(); public abstract String getTexture();
protected abstract int computeRedstoneStrength(World worldIn, BlockPos pos); protected abstract int computeSignalStrength(World worldIn, BlockPos pos);
protected abstract int getRedstoneStrength(State state); protected abstract int getSignalStrength(State state);
protected abstract State setRedstoneStrength(State state, int strength); protected abstract State setSignalStrength(State state, int strength);
} }

View file

@ -475,7 +475,7 @@ public class BlockBrewingStand extends BlockContainer
public int getSignal(World worldIn, BlockPos pos, int input) public int getSignal(World worldIn, BlockPos pos, int input)
{ {
return Container.calcRedstone(worldIn.getTileEntity(pos)); return Container.calcSignal(worldIn.getTileEntity(pos));
} }
public BlockLayer getBlockLayer() public BlockLayer getBlockLayer()

View file

@ -553,7 +553,6 @@ public class BlockCauldron extends Block
public void setWaterLevel(World worldIn, BlockPos pos, State state, int level) public void setWaterLevel(World worldIn, BlockPos pos, State state, int level)
{ {
worldIn.setState(pos, state.withProperty(LEVEL, Integer.valueOf(ExtMath.clampi(level, 0, 3))), 2); worldIn.setState(pos, state.withProperty(LEVEL, Integer.valueOf(ExtMath.clampi(level, 0, 3))), 2);
worldIn.updateComparatorOutputLevel(pos, this);
} }
/** /**

View file

@ -12,7 +12,6 @@ import common.entity.Entity;
import common.entity.animal.EntityCat; import common.entity.animal.EntityCat;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving; import common.entity.types.EntityLiving;
import common.init.Items;
import common.init.SoundEvent; import common.init.SoundEvent;
import common.inventory.Container; import common.inventory.Container;
import common.inventory.IInventory; import common.inventory.IInventory;
@ -21,6 +20,7 @@ import common.item.CheatTab;
import common.item.Item; import common.item.Item;
import common.item.ItemStack; import common.item.ItemStack;
import common.item.block.ItemChest; import common.item.block.ItemChest;
import common.item.tool.ItemKey;
import common.packet.SPacketSoundEffect; import common.packet.SPacketSoundEffect;
import common.properties.Property; import common.properties.Property;
import common.tileentity.TileEntity; import common.tileentity.TileEntity;
@ -157,7 +157,6 @@ public class BlockChest extends BlockContainer implements Rotatable
if (tileentity instanceof IInventory) if (tileentity instanceof IInventory)
{ {
InventoryHelper.dropInventoryItems(worldIn, pos, (IInventory)tileentity); InventoryHelper.dropInventoryItems(worldIn, pos, (IInventory)tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
} }
super.onBlockRemoved(worldIn, pos, state); super.onBlockRemoved(worldIn, pos, state);
@ -176,7 +175,7 @@ public class BlockChest extends BlockContainer implements Rotatable
if (chest != null) if (chest != null)
{ {
ItemStack stack = Vars.locking ? playerIn.getHeldItem() : null; ItemStack stack = Vars.locking ? playerIn.getHeldItem() : null;
if(stack != null && stack.getItem() == Items.key) { if(stack != null && stack.getItem() instanceof ItemKey) {
if(chest.getLockCode() != null) { if(chest.getLockCode() != null) {
if(stack.hasDisplayName() && stack.getDisplayName().equals(chest.getLockCode())) { if(stack.hasDisplayName() && stack.getDisplayName().equals(chest.getLockCode())) {
chest.setLockCode(null); chest.setLockCode(null);
@ -246,7 +245,7 @@ public class BlockChest extends BlockContainer implements Rotatable
public int getSignal(World worldIn, BlockPos pos, int input) public int getSignal(World worldIn, BlockPos pos, int input)
{ {
return Container.calcRedstoneFromInventory(this.getChest(worldIn, pos)); return Container.calcSignalFrom(this.getChest(worldIn, pos));
} }
protected Property[] getProperties() protected Property[] getProperties()

View file

@ -1,6 +1,5 @@
package common.block.tech; package common.block.tech;
import common.block.Block;
import common.block.BlockContainer; import common.block.BlockContainer;
import common.block.Directional; import common.block.Directional;
import common.block.Material; import common.block.Material;
@ -15,7 +14,6 @@ import common.model.Model;
import common.model.ModelProvider; import common.model.ModelProvider;
import common.model.ModelRotation; import common.model.ModelRotation;
import common.properties.Property; import common.properties.Property;
import common.properties.PropertyBool;
import common.rng.Random; import common.rng.Random;
import common.tileentity.TileEntity; import common.tileentity.TileEntity;
import common.tileentity.TileEntityDispenser; import common.tileentity.TileEntityDispenser;
@ -28,8 +26,6 @@ import common.world.AWorldServer;
public class BlockDispenser extends BlockContainer implements Directional public class BlockDispenser extends BlockContainer implements Directional
{ {
public static final PropertyBool TRIGGERED = PropertyBool.create("triggered");
protected Random rand = new Random(); protected Random rand = new Random();
public static void dispense(World world, double speed, Facing facing, Vec3 position, ItemStack stack) public static void dispense(World world, double speed, Facing facing, Vec3 position, ItemStack stack)
@ -45,7 +41,7 @@ public class BlockDispenser extends BlockContainer implements Directional
public BlockDispenser() public BlockDispenser()
{ {
super(Material.SOLID); super(Material.SOLID);
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(TRIGGERED, Boolean.valueOf(false))); this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH));
this.setTab(CheatTab.TECHNOLOGY); this.setTab(CheatTab.TECHNOLOGY);
} }
@ -94,7 +90,7 @@ public class BlockDispenser extends BlockContainer implements Directional
} }
} }
worldIn.setState(pos, state.withProperty(FACING, enumfacing).withProperty(TRIGGERED, Boolean.valueOf(false)), 2); worldIn.setState(pos, state.withProperty(FACING, enumfacing), 2);
} }
} }
@ -126,67 +122,6 @@ public class BlockDispenser extends BlockContainer implements Directional
} }
} }
protected void dispense(World worldIn, BlockPos pos)
{
TileEntity te = worldIn.getTileEntity(pos);
if (te instanceof TileEntityDispenser tileentitydispenser)
{
int i = tileentitydispenser.getDispenseSlot();
if (i < 0)
{
worldIn.playAuxSFX(1001, pos, 0);
}
else
{
ItemStack itemstack = tileentitydispenser.getStackInSlot(i);
if(itemstack != null) {
ItemStack itemstack1 = this.dispenseStack(itemstack, worldIn, pos);
tileentitydispenser.setInventorySlotContents(i, itemstack1.isEmpty() ? null : itemstack1);
}
}
}
}
protected ItemStack dispenseStack(ItemStack stack, World world, BlockPos pos)
{
Facing facing = world.getState(pos).getValue(FACING);
ItemStack nstack = stack.getItem().dispenseStack(world, world.getTileEntity(pos), getDispensePosition(pos, facing), pos, facing, stack);
int id = stack.getItem().getDispenseSoundId();
if(id != 0)
world.playAuxSFX(id, pos, 0);
world.playAuxSFX(2000, pos, facing.getFrontOffsetX() + 1 + (facing.getFrontOffsetZ() + 1) * 3);
return nstack;
}
/**
* Called when a neighboring block changes.
*/
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
{
boolean flag = worldIn.isBlockPowered(pos) || worldIn.isBlockPowered(pos.up());
boolean flag1 = ((Boolean)state.getValue(TRIGGERED)).booleanValue();
if (flag && !flag1)
{
worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos));
worldIn.setState(pos, state.withProperty(TRIGGERED, Boolean.valueOf(true)), 4);
}
else if (!flag && flag1)
{
worldIn.setState(pos, state.withProperty(TRIGGERED, Boolean.valueOf(false)), 4);
}
}
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{
// if (!worldIn.client)
// {
this.dispense(worldIn, pos);
// }
}
/** /**
* Returns a new instance of a block's tile entity class. Called on placing the block. * Returns a new instance of a block's tile entity class. Called on placing the block.
*/ */
@ -201,7 +136,7 @@ public class BlockDispenser extends BlockContainer implements Directional
*/ */
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer) public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
{ {
return this.getState().withProperty(FACING, BlockPistonBase.getFacingFromEntity(worldIn, pos, placer)).withProperty(TRIGGERED, Boolean.valueOf(false)); return this.getState().withProperty(FACING, BlockPistonBase.getFacingFromEntity(worldIn, pos, placer));
} }
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
@ -211,7 +146,6 @@ public class BlockDispenser extends BlockContainer implements Directional
if (tileentity instanceof TileEntityDispenser) if (tileentity instanceof TileEntityDispenser)
{ {
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityDispenser)tileentity); InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityDispenser)tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
} }
super.onBlockRemoved(worldIn, pos, state); super.onBlockRemoved(worldIn, pos, state);
@ -225,11 +159,6 @@ public class BlockDispenser extends BlockContainer implements Directional
return new Vec3(d0, d1, d2); return new Vec3(d0, d1, d2);
} }
public static Facing getFacing(int meta)
{
return Facing.getFront(meta & 7);
}
public boolean hasSignalProcessing() public boolean hasSignalProcessing()
{ {
return true; return true;
@ -237,7 +166,7 @@ public class BlockDispenser extends BlockContainer implements Directional
public int getSignal(World worldIn, BlockPos pos, int input) public int getSignal(World worldIn, BlockPos pos, int input)
{ {
return Container.calcRedstone(worldIn.getTileEntity(pos)); return Container.calcSignal(worldIn.getTileEntity(pos));
} }
/** /**
@ -258,7 +187,7 @@ public class BlockDispenser extends BlockContainer implements Directional
protected Property[] getProperties() protected Property[] getProperties()
{ {
return new Property[] {FACING, TRIGGERED}; return new Property[] {FACING};
} }
public boolean isMagnetic() { public boolean isMagnetic() {
@ -273,8 +202,4 @@ public class BlockDispenser extends BlockContainer implements Directional
return provider.getModel(name + "_front_horizontal").add().du("furnace_top").n() return provider.getModel(name + "_front_horizontal").add().du("furnace_top").n()
.s("furnace_side").we("furnace_side").rotate(ModelRotation.getNorthRot(state.getValue(FACING))); .s("furnace_side").we("furnace_side").rotate(ModelRotation.getNorthRot(state.getValue(FACING)));
} }
public Property<?>[] getIgnoredProperties() {
return new Property[] {TRIGGERED};
}
} }

View file

@ -1,88 +1,12 @@
package common.block.tech; package common.block.tech;
import common.inventory.IInventory;
import common.item.ItemStack;
import common.tileentity.TileEntity; import common.tileentity.TileEntity;
import common.tileentity.TileEntityDispenser;
import common.tileentity.TileEntityDropper; import common.tileentity.TileEntityDropper;
import common.tileentity.TileEntityHopper;
import common.util.BlockPos;
import common.util.Facing;
import common.world.World;
public class BlockDropper extends BlockDispenser public class BlockDropper extends BlockDispenser
{ {
protected ItemStack dispenseStack(ItemStack stack, World world, BlockPos pos)
{
Facing facing = world.getState(pos).getValue(FACING);
dispense(world, 6.0, facing, getDispensePosition(pos, facing), stack.split(1));
world.playAuxSFX(1000, pos, 0);
world.playAuxSFX(2000, pos, facing.getFrontOffsetX() + 1 + (facing.getFrontOffsetZ() + 1) * 3);
return stack;
}
/**
* Returns a new instance of a block's tile entity class. Called on placing the block.
*/
public TileEntity createNewTileEntity() public TileEntity createNewTileEntity()
{ {
return new TileEntityDropper(); return new TileEntityDropper();
} }
protected void dispense(World worldIn, BlockPos pos)
{
TileEntity te = worldIn.getTileEntity(pos);
if (te instanceof TileEntityDispenser tileentitydispenser)
{
int i = tileentitydispenser.getDispenseSlot();
if (i < 0)
{
worldIn.playAuxSFX(1001, pos, 0);
}
else
{
ItemStack itemstack = tileentitydispenser.getStackInSlot(i);
if (itemstack != null)
{
Facing enumfacing = (Facing)worldIn.getState(pos).getValue(FACING);
BlockPos blockpos = pos.offset(enumfacing);
IInventory iinventory = TileEntityHopper.getInventoryAtPosition(worldIn, (double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ());
ItemStack itemstack1;
if (iinventory == null)
{
itemstack1 = this.dispenseStack(itemstack, worldIn, pos);
if (itemstack1 != null && itemstack1.isEmpty())
{
itemstack1 = null;
}
}
else
{
itemstack1 = TileEntityHopper.putStackInInventoryAllSlots(iinventory, itemstack.copy().split(1), enumfacing.getOpposite());
if (itemstack1 == null)
{
itemstack1 = itemstack.copy();
if (itemstack1.decrSize())
{
itemstack1 = null;
}
}
else
{
itemstack1 = itemstack.copy();
}
}
tileentitydispenser.setInventorySlotContents(i, itemstack1);
}
}
}
}
} }

View file

@ -190,7 +190,6 @@ public class BlockFurnace extends BlockContainer implements Rotatable
if (tileentity instanceof TileEntityFurnace) if (tileentity instanceof TileEntityFurnace)
{ {
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityFurnace)tileentity); InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityFurnace)tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
} }
} }
@ -204,7 +203,7 @@ public class BlockFurnace extends BlockContainer implements Rotatable
public int getSignal(World worldIn, BlockPos pos, int input) public int getSignal(World worldIn, BlockPos pos, int input)
{ {
return Container.calcRedstone(worldIn.getTileEntity(pos)); return Container.calcSignal(worldIn.getTileEntity(pos));
} }
public Item getItem(World worldIn, BlockPos pos) public Item getItem(World worldIn, BlockPos pos)

View file

@ -1,7 +1,6 @@
package common.block.tech; package common.block.tech;
import java.util.List; import java.util.List;
import common.block.Block;
import common.block.BlockContainer; import common.block.BlockContainer;
import common.block.DirectionalDown; import common.block.DirectionalDown;
import common.block.Material; import common.block.Material;
@ -18,7 +17,6 @@ import common.model.Model;
import common.model.ModelProvider; import common.model.ModelProvider;
import common.model.ModelRotation; import common.model.ModelRotation;
import common.properties.Property; import common.properties.Property;
import common.properties.PropertyBool;
import common.tileentity.TileEntity; import common.tileentity.TileEntity;
import common.tileentity.TileEntityHopper; import common.tileentity.TileEntityHopper;
import common.util.BlockPos; import common.util.BlockPos;
@ -83,12 +81,10 @@ public class BlockHopper extends BlockContainer implements DirectionalDown
.e().uv(6, 12, 10, 16).noCull() .e().uv(6, 12, 10, 16).noCull()
; ;
public static final PropertyBool ENABLED = PropertyBool.create("enabled");
public BlockHopper() public BlockHopper()
{ {
super(Material.SOLID); super(Material.SOLID);
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.DOWN).withProperty(ENABLED, Boolean.valueOf(true))); this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.DOWN));
this.setTab(CheatTab.TECHNOLOGY); this.setTab(CheatTab.TECHNOLOGY);
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
} }
@ -130,7 +126,7 @@ public class BlockHopper extends BlockContainer implements DirectionalDown
enumfacing = Facing.DOWN; enumfacing = Facing.DOWN;
} }
return this.getState().withProperty(FACING, enumfacing).withProperty(ENABLED, Boolean.valueOf(true)); return this.getState().withProperty(FACING, enumfacing);
} }
/** /**
@ -141,11 +137,6 @@ public class BlockHopper extends BlockContainer implements DirectionalDown
return new TileEntityHopper(); return new TileEntityHopper();
} }
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{
this.updateState(worldIn, pos, state);
}
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
{ {
if (worldIn.client) if (worldIn.client)
@ -166,24 +157,6 @@ public class BlockHopper extends BlockContainer implements DirectionalDown
} }
} }
/**
* Called when a neighboring block changes.
*/
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
{
this.updateState(worldIn, pos, state);
}
private void updateState(World worldIn, BlockPos pos, State state)
{
boolean flag = !worldIn.isBlockPowered(pos);
if (flag != ((Boolean)state.getValue(ENABLED)).booleanValue())
{
worldIn.setState(pos, state.withProperty(ENABLED, Boolean.valueOf(flag)), 4);
}
}
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{ {
TileEntity tileentity = worldIn.getTileEntity(pos); TileEntity tileentity = worldIn.getTileEntity(pos);
@ -191,7 +164,6 @@ public class BlockHopper extends BlockContainer implements DirectionalDown
if (tileentity instanceof TileEntityHopper) if (tileentity instanceof TileEntityHopper)
{ {
InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityHopper)tileentity); InventoryHelper.dropInventoryItems(worldIn, pos, (TileEntityHopper)tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
} }
super.onBlockRemoved(worldIn, pos, state); super.onBlockRemoved(worldIn, pos, state);
@ -223,20 +195,6 @@ public class BlockHopper extends BlockContainer implements DirectionalDown
return true; return true;
} }
public static Facing getFacing(int meta)
{
return Facing.getFront(meta & 7);
}
/**
* Get's the hopper's active status from the 8-bit of the metadata. Note that the metadata stores whether the block
* is powered, so this returns true when that bit is 0.
*/
public static boolean isEnabled(int meta)
{
return (meta & 8) != 8;
}
public boolean hasSignalProcessing() public boolean hasSignalProcessing()
{ {
return true; return true;
@ -244,7 +202,7 @@ public class BlockHopper extends BlockContainer implements DirectionalDown
public int getSignal(World worldIn, BlockPos pos, int input) public int getSignal(World worldIn, BlockPos pos, int input)
{ {
return Container.calcRedstone(worldIn.getTileEntity(pos)); return Container.calcSignal(worldIn.getTileEntity(pos));
} }
public BlockLayer getBlockLayer() public BlockLayer getBlockLayer()
@ -254,7 +212,7 @@ public class BlockHopper extends BlockContainer implements DirectionalDown
protected Property[] getProperties() protected Property[] getProperties()
{ {
return new Property[] {FACING, ENABLED}; return new Property[] {FACING};
} }
public boolean isMagnetic() { public boolean isMagnetic() {
@ -314,10 +272,6 @@ public class BlockHopper extends BlockContainer implements DirectionalDown
.e().uv(0, 8, 4, 12).noCull() .e().uv(0, 8, 4, 12).noCull()
.rotate(ModelRotation.getNorthRot(state.getValue(FACING))); .rotate(ModelRotation.getNorthRot(state.getValue(FACING)));
} }
public Property<?>[] getIgnoredProperties() {
return new Property[] {ENABLED};
}
protected Item getItemToRegister() { protected Item getItemToRegister() {
return new ItemBlock(this, "hopper", true); return new ItemBlock(this, "hopper", true);

View file

@ -0,0 +1,125 @@
package common.block.tech;
import common.entity.npc.EntityNPC;
import common.init.SoundEvent;
import common.item.CheatTab;
import common.item.Item;
import common.item.ItemStack;
import common.properties.Property;
import common.properties.PropertyInteger;
import common.rng.Random;
import common.util.BlockPos;
import common.util.Facing;
import common.util.ParticleType;
import common.vars.Vars;
import common.world.AWorldClient;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
public class BlockLitTorch extends BlockTorch {
public static final PropertyInteger FUEL = PropertyInteger.create("fuel", 0, 7);
private BlockUnlitTorch unlit;
public BlockLitTorch(BlockUnlitTorch unlit) {
this.unlit = unlit;
unlit.setLitTorch(this);
this.setTab(CheatTab.TECHNOLOGY);
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.UP).withProperty(FUEL, 7));
this.setTickRandomly();
}
public void extinguish(AWorldServer worldIn, BlockPos pos, State state, Random rand) {
worldIn.setState(pos, this.unlit.getState().withProperty(FACING, state.getValue(FACING)), 3);
worldIn.playSound(SoundEvent.FIZZ, (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F),
0.5F);
for(int i = 0; i < 5; ++i) {
double d0 = (double)pos.getX() + rand.doublev() * 0.6D + 0.2D;
double d1 = (double)pos.getY() + rand.doublev() * 0.6D + 0.2D;
double d2 = (double)pos.getZ() + rand.doublev() * 0.6D + 0.2D;
worldIn.spawnParticles(ParticleType.SMOKE, d0, d1, d2);
}
}
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand) {
if(Vars.torchBurnout > 0 && rand.chance(Vars.torchBurnout)) {
int fuel = state.getValue(FUEL);
if(fuel <= 0) {
this.extinguish(worldIn, pos, state, rand);
}
else {
worldIn.setState(pos, state.withProperty(FUEL, fuel - 1), 2);
}
}
}
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand) {
if(this.unlit.getParticleColor() == 0xffffffff) {
Facing enumfacing = (Facing)state.getValue(FACING);
double d0 = (double)pos.getX() + 0.5D;
double d1 = (double)pos.getY() + 0.7D;
double d2 = (double)pos.getZ() + 0.5D;
double d3 = 0.22D;
double d4 = 0.27D;
if (enumfacing.getAxis().isHorizontal())
{
Facing enumfacing1 = enumfacing.getOpposite();
worldIn.spawnParticle(ParticleType.SMOKE, d0 + d4 * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * (double)enumfacing1.getFrontOffsetZ());
worldIn.spawnParticle(ParticleType.FLAME, d0 + d4 * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * (double)enumfacing1.getFrontOffsetZ());
}
else
{
worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2);
worldIn.spawnParticle(ParticleType.FLAME, d0, d1, d2);
}
}
else {
double d0 = (double)pos.getX() + 0.5D + (rand.doublev() - 0.5D) * 0.2D;
double d1 = (double)pos.getY() + 0.7D + (rand.doublev() - 0.5D) * 0.2D;
double d2 = (double)pos.getZ() + 0.5D + (rand.doublev() - 0.5D) * 0.2D;
Facing enumfacing = (Facing)state.getValue(FACING);
if(enumfacing.getAxis().isHorizontal()) {
Facing enumfacing1 = enumfacing.getOpposite();
double d3 = 0.27D;
d0 += 0.27D * (double)enumfacing1.getFrontOffsetX();
d1 += 0.22D;
d2 += 0.27D * (double)enumfacing1.getFrontOffsetZ();
}
worldIn.spawnParticle(ParticleType.DUST, d0, d1, d2, this.unlit.getParticleColor());
}
}
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) {
if(!worldIn.client)
this.extinguish((AWorldServer)worldIn, pos, state, worldIn.rand);
return true;
}
protected Property[] getProperties() {
return new Property[] {FACING, FUEL};
}
public Property[] getIgnoredProperties() {
return new Property[] {FUEL};
}
protected Item getItemToRegister() {
return null;
}
public Item getItemDropped(State state, Random rand, int fortune) {
return this.unlit.getItem();
}
public Item getItem(World worldIn, BlockPos pos) {
return this.unlit.getItem();
}
public ItemStack createStackedBlock(State state) {
return new ItemStack(this.unlit.getItem());
}
}

View file

@ -57,7 +57,6 @@ public abstract class BlockMachine extends Block implements Rotatable, ITileEnti
TileEntity tileentity = worldIn.getTileEntity(pos); TileEntity tileentity = worldIn.getTileEntity(pos);
if(tileentity instanceof Device) { if(tileentity instanceof Device) {
InventoryHelper.dropInventoryItems(worldIn, pos, (Device)tileentity); InventoryHelper.dropInventoryItems(worldIn, pos, (Device)tileentity);
worldIn.updateComparatorOutputLevel(pos, this);
} }
super.onBlockRemoved(worldIn, pos, state); super.onBlockRemoved(worldIn, pos, state);
worldIn.removeTileEntity(pos); worldIn.removeTileEntity(pos);
@ -68,7 +67,7 @@ public abstract class BlockMachine extends Block implements Rotatable, ITileEnti
} }
public int getSignal(World worldIn, BlockPos pos, int input) { public int getSignal(World worldIn, BlockPos pos, int input) {
return Container.calcRedstone(worldIn.getTileEntity(pos)); return Container.calcSignal(worldIn.getTileEntity(pos));
} }
public boolean onBlockEventReceived(World worldIn, BlockPos pos, State state, int eventID, int eventParam) { public boolean onBlockEventReceived(World worldIn, BlockPos pos, State state, int eventID, int eventParam) {

View file

@ -15,7 +15,6 @@ import common.util.BlockPos;
import common.world.Explosion; import common.world.Explosion;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.AWorldServer;
public class BlockNuke extends Block public class BlockNuke extends Block
{ {
@ -24,26 +23,6 @@ public class BlockNuke extends Block
super(Material.EXPLOSIVE); super(Material.EXPLOSIVE);
this.setTab(CheatTab.TECHNOLOGY); this.setTab(CheatTab.TECHNOLOGY);
} }
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{
super.onBlockAdded(worldIn, pos, state);
if (worldIn.isBlockPowered(pos))
{
this.explode(worldIn, pos);
worldIn.setBlockToAir(pos);
}
}
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
{
if (worldIn.isBlockPowered(pos))
{
this.explode(worldIn, pos);
worldIn.setBlockToAir(pos);
}
}
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn, State prevState) public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn, State prevState)
{ {

View file

@ -333,32 +333,32 @@ public class BlockPistonBase extends Block implements Directional
private boolean shouldBeExtended(World worldIn, BlockPos pos, Facing facing) private boolean shouldBeExtended(World worldIn, BlockPos pos, Facing facing)
{ {
for (Facing enumfacing : Facing.values()) // for (Facing enumfacing : Facing.values())
{ // {
if (enumfacing != facing && worldIn.isSidePowered(pos.offset(enumfacing), enumfacing)) // if (enumfacing != facing && worldIn.isSidePowered(pos.offset(enumfacing), enumfacing))
{ // {
return true; // return true;
} // }
} // }
//
// if (worldIn.isSidePowered(pos, Facing.DOWN))
// {
// return true;
// }
// else
// {
// BlockPos blockpos = pos.up();
//
// for (Facing enumfacing1 : Facing.values())
// {
// if (enumfacing1 != Facing.DOWN && worldIn.isSidePowered(blockpos.offset(enumfacing1), enumfacing1))
// {
// return true;
// }
// }
if (worldIn.isSidePowered(pos, Facing.DOWN)) return false; // TODO: piston control
{ // }
return true;
}
else
{
BlockPos blockpos = pos.up();
for (Facing enumfacing1 : Facing.values())
{
if (enumfacing1 != Facing.DOWN && worldIn.isSidePowered(blockpos.offset(enumfacing1), enumfacing1))
{
return true;
}
}
return false;
}
} }
/** /**

View file

@ -24,17 +24,17 @@ public class BlockPressurePlate extends BlockBasePressurePlate
this.sensitivity = sensitivityIn; this.sensitivity = sensitivityIn;
} }
protected int getRedstoneStrength(State state) protected int getSignalStrength(State state)
{ {
return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0; return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0;
} }
protected State setRedstoneStrength(State state, int strength) protected State setSignalStrength(State state, int strength)
{ {
return state.withProperty(POWERED, Boolean.valueOf(strength > 0)); return state.withProperty(POWERED, Boolean.valueOf(strength > 0));
} }
protected int computeRedstoneStrength(World worldIn, BlockPos pos) protected int computeSignalStrength(World worldIn, BlockPos pos)
{ {
BoundingBox axisalignedbb = this.getSensitiveAABB(pos); BoundingBox axisalignedbb = this.getSensitiveAABB(pos);
List <? extends Entity > list; List <? extends Entity > list;

View file

@ -21,7 +21,7 @@ public class BlockPressurePlateWeighted extends BlockBasePressurePlate
this.field_150068_a = p_i46380_2_; this.field_150068_a = p_i46380_2_;
} }
protected int computeRedstoneStrength(World worldIn, BlockPos pos) protected int computeSignalStrength(World worldIn, BlockPos pos)
{ {
int i = Math.min(worldIn.getEntitiesWithinAABB(Entity.class, this.getSensitiveAABB(pos)).size(), this.field_150068_a); int i = Math.min(worldIn.getEntitiesWithinAABB(Entity.class, this.getSensitiveAABB(pos)).size(), this.field_150068_a);
@ -36,12 +36,12 @@ public class BlockPressurePlateWeighted extends BlockBasePressurePlate
} }
} }
protected int getRedstoneStrength(State state) protected int getSignalStrength(State state)
{ {
return ((Integer)state.getValue(POWER)).intValue(); return ((Integer)state.getValue(POWER)).intValue();
} }
protected State setRedstoneStrength(State state, int strength) protected State setSignalStrength(State state, int strength)
{ {
return state.withProperty(POWER, Integer.valueOf(strength)); return state.withProperty(POWER, Integer.valueOf(strength));
} }

View file

@ -1,37 +1,710 @@
package common.block.tech; package common.block.tech;
import java.util.List;
import common.block.Block; import common.block.Block;
import common.block.Material;
import common.collect.Lists;
import common.init.Blocks;
import common.item.CheatTab;
import common.model.BlockLayer;
import common.model.Model;
import common.model.ModelProvider;
import common.model.ModelRotation;
import common.properties.Property; import common.properties.Property;
import common.properties.PropertyEnum; import common.properties.PropertyEnum;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.DirectionVec;
import common.util.Facing;
import common.util.HitPosition;
import common.util.Identifyable;
import common.util.Vec3;
import common.world.IWorldAccess;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.AWorldServer;
public class BlockRail extends BlockRailBase public class BlockRail extends Block
{ {
public static final PropertyEnum<BlockRailBase.EnumRailDirection> SHAPE = PropertyEnum.<BlockRailBase.EnumRailDirection>create("shape", BlockRailBase.EnumRailDirection.class); public static final PropertyEnum<BlockRail.EnumRailDirection> SHAPE = PropertyEnum.<BlockRail.EnumRailDirection>create("shape", BlockRail.EnumRailDirection.class);
public static boolean isRailBlock(World worldIn, BlockPos pos)
{
return isRailBlock(worldIn.getState(pos));
}
public static boolean isRailBlock(State state)
{
Block block = state.getBlock();
return block == Blocks.rail;
}
public BlockRail() public BlockRail()
{ {
super(false); super(Material.SMALL);
this.setDefaultState(this.getBaseState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH)); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
this.setTab(CheatTab.TECHNOLOGY);
this.setFlatItemTexture();
this.setDefaultState(this.getBaseState().withProperty(SHAPE, BlockRail.EnumRailDirection.NORTH_SOUTH));
}
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
{
return null;
}
/**
* Used to determine ambient occlusion and culling when rebuilding chunks for render
*/
public boolean isOpaqueCube()
{
return false;
}
/**
* Ray traces through the blocks collision from start vector to end vector returning a ray trace hit.
*/
public HitPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end)
{
this.setBlockBoundsBasedOnState(worldIn, pos);
return super.collisionRayTrace(worldIn, pos, start, end);
}
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
{
State iblockstate = worldIn.getState(pos);
BlockRail.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() == this ? (BlockRail.EnumRailDirection)iblockstate.getValue(SHAPE) : null;
if (blockrailbase$enumraildirection != null && blockrailbase$enumraildirection.isAscending())
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F);
}
else
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
}
}
public boolean isFullCube()
{
return false;
}
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
{
return worldIn.isBlockSolid(pos.down());
}
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{
if (!worldIn.client)
{
this.applyState(worldIn, pos, state, true);
}
}
/**
* Called when a neighboring block changes.
*/
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
{
if (!worldIn.client)
{
BlockRail.EnumRailDirection blockrailbase$enumraildirection = (BlockRail.EnumRailDirection)state.getValue(SHAPE);
boolean flag = false;
if (!worldIn.isBlockSolid(pos.down()))
{
flag = true;
}
if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.ASCENDING_EAST && !worldIn.isBlockSolid(pos.east()))
{
flag = true;
}
else if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.ASCENDING_WEST && !worldIn.isBlockSolid(pos.west()))
{
flag = true;
}
else if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.ASCENDING_NORTH && !worldIn.isBlockSolid(pos.north()))
{
flag = true;
}
else if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.ASCENDING_SOUTH && !worldIn.isBlockSolid(pos.south()))
{
flag = true;
}
if (flag)
{
this.dropBlockAsItem(worldIn, pos, state, 0);
worldIn.setBlockToAir(pos);
}
else
{
this.onNeighborChangedInternal(worldIn, pos, state, neighborBlock);
}
}
}
protected State applyState(World worldIn, BlockPos pos, State state, boolean force)
{
return worldIn.client ? state : (new BlockRail.Rail(worldIn, pos, state)).setDirection(false /* TODO: switching */, force).getBlockState();
}
public int getMobilityFlag()
{
return 0;
}
public BlockLayer getBlockLayer()
{
return BlockLayer.CUTOUT;
}
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{
super.onBlockRemoved(worldIn, pos, state);
if (((BlockRail.EnumRailDirection)state.getValue(SHAPE)).isAscending())
{
worldIn.notifyNeighborsOfStateChange(pos.up(), this);
}
}
public boolean isMagnetic() {
return true;
}
public Model getModel(ModelProvider provider, String name, State state) {
EnumRailDirection dir = state.getValue(SHAPE);
switch(dir) {
case NORTH_SOUTH:
case EAST_WEST:
default:
return provider.getModel(name)
.add(0, 1, 0, 16, 1, 16)
.d().uv(0, 16, 16, 0).noCull()
.u().uv(0, 0, 16, 16).noCull()
.rotate(dir == EnumRailDirection.EAST_WEST ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0);
case NORTH_EAST:
case NORTH_WEST:
case SOUTH_EAST:
case SOUTH_WEST:
return provider.getModel(name + "_turned")
.add(0, 1, 0, 16, 1, 16)
.d().uv(0, 16, 16, 0).noCull()
.u().uv(0, 0, 16, 16).noCull()
.rotate(dir == EnumRailDirection.SOUTH_WEST ? ModelRotation.X0_Y90 : (dir == EnumRailDirection.NORTH_WEST ?
ModelRotation.X0_Y180 : (dir == EnumRailDirection.NORTH_EAST ? ModelRotation.X0_Y270 : ModelRotation.X0_Y0)));
case ASCENDING_NORTH:
case ASCENDING_EAST:
return provider.getModel(name)
.add(0, 9, 0, 16, 9, 16).rotate(8, 9, 8, Facing.Axis.X, 45, true)
.d().uv(0, 16, 16, 0).noCull()
.u().uv(0, 0, 16, 16).noCull()
.rotate(dir == EnumRailDirection.ASCENDING_EAST ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0);
case ASCENDING_SOUTH:
case ASCENDING_WEST:
return provider.getModel(name)
.add(0, 9, 0, 16, 9, 16).rotate(8, 9, 8, Facing.Axis.X, -45, true)
.d().uv(0, 16, 16, 0).noCull()
.u().uv(0, 0, 16, 16).noCull()
.rotate(dir == EnumRailDirection.ASCENDING_WEST ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0);
}
} }
protected void onNeighborChangedInternal(World worldIn, BlockPos pos, State state, Block neighborBlock) protected void onNeighborChangedInternal(World worldIn, BlockPos pos, State state, Block neighborBlock)
{ {
if (neighborBlock.canProvidePower() && (new BlockRailBase.Rail(worldIn, pos, state)).countAdjacentRails() == 3) if ((new BlockRail.Rail(worldIn, pos, state)).countAdjacentRails() == 3)
{ {
this.func_176564_a(worldIn, pos, state, false); this.applyState(worldIn, pos, state, false);
} }
} }
public Property<BlockRailBase.EnumRailDirection> getShapeProperty()
{
return SHAPE;
}
protected Property[] getProperties() protected Property[] getProperties()
{ {
return new Property[] {SHAPE}; return new Property[] {SHAPE};
} }
private static enum BaseShape {
STRAIGHT, ASCENDING, TURNED;
}
public static enum EnumRailDirection implements Identifyable, DirectionVec<EnumRailDirection>
{
NORTH_SOUTH("north_south", Facing.SOUTH, BaseShape.STRAIGHT),
EAST_WEST("east_west", Facing.EAST, BaseShape.STRAIGHT),
ASCENDING_EAST("ascending_east", Facing.EAST, BaseShape.ASCENDING),
ASCENDING_WEST("ascending_west", Facing.WEST, BaseShape.ASCENDING),
ASCENDING_NORTH("ascending_north", Facing.NORTH, BaseShape.ASCENDING),
ASCENDING_SOUTH("ascending_south", Facing.DOWN, BaseShape.ASCENDING),
SOUTH_EAST("south_east", Facing.EAST, BaseShape.TURNED),
SOUTH_WEST("south_west", Facing.SOUTH, BaseShape.TURNED),
NORTH_WEST("north_west", Facing.NORTH, BaseShape.TURNED),
NORTH_EAST("north_east", Facing.WEST, BaseShape.TURNED);
private final String name;
private final Facing facing;
private final BaseShape shape;
private EnumRailDirection(String name, Facing facing, BaseShape shape)
{
this.name = name;
this.facing = facing;
this.shape = shape;
}
public String toString()
{
return this.name;
}
public boolean isAscending()
{
return this == ASCENDING_NORTH || this == ASCENDING_EAST || this == ASCENDING_SOUTH || this == ASCENDING_WEST;
}
public String getName()
{
return this.name;
}
public Facing getFacing()
{
return this.facing;
}
public Facing getVector() {
return this.facing;
}
public boolean isAxis() {
return false;
}
public boolean canApply(EnumRailDirection dir) {
return this.shape == dir.shape;
}
}
public class Rail
{
private final World world;
private final BlockPos pos;
private final BlockRail block;
private State state;
private final List<BlockPos> field_150657_g = Lists.<BlockPos>newArrayList();
public Rail(World worldIn, BlockPos pos, State state)
{
this.world = worldIn;
this.pos = pos;
this.state = state;
this.block = (BlockRail)state.getBlock();
BlockRail.EnumRailDirection blockrailbase$enumraildirection = (BlockRail.EnumRailDirection)state.getValue(BlockRail.SHAPE);
this.func_180360_a(blockrailbase$enumraildirection);
}
private void func_180360_a(BlockRail.EnumRailDirection p_180360_1_)
{
this.field_150657_g.clear();
switch (p_180360_1_)
{
case NORTH_SOUTH:
this.field_150657_g.add(this.pos.north());
this.field_150657_g.add(this.pos.south());
break;
case EAST_WEST:
this.field_150657_g.add(this.pos.west());
this.field_150657_g.add(this.pos.east());
break;
case ASCENDING_EAST:
this.field_150657_g.add(this.pos.west());
this.field_150657_g.add(this.pos.east().up());
break;
case ASCENDING_WEST:
this.field_150657_g.add(this.pos.west().up());
this.field_150657_g.add(this.pos.east());
break;
case ASCENDING_NORTH:
this.field_150657_g.add(this.pos.north().up());
this.field_150657_g.add(this.pos.south());
break;
case ASCENDING_SOUTH:
this.field_150657_g.add(this.pos.north());
this.field_150657_g.add(this.pos.south().up());
break;
case SOUTH_EAST:
this.field_150657_g.add(this.pos.east());
this.field_150657_g.add(this.pos.south());
break;
case SOUTH_WEST:
this.field_150657_g.add(this.pos.west());
this.field_150657_g.add(this.pos.south());
break;
case NORTH_WEST:
this.field_150657_g.add(this.pos.west());
this.field_150657_g.add(this.pos.north());
break;
case NORTH_EAST:
this.field_150657_g.add(this.pos.east());
this.field_150657_g.add(this.pos.north());
}
}
private void func_150651_b()
{
for (int i = 0; i < this.field_150657_g.size(); ++i)
{
BlockRail.Rail blockrailbase$rail = this.findRailAt((BlockPos)this.field_150657_g.get(i));
if (blockrailbase$rail != null && blockrailbase$rail.func_150653_a(this))
{
this.field_150657_g.set(i, blockrailbase$rail.pos);
}
else
{
this.field_150657_g.remove(i--);
}
}
}
private boolean hasRailAt(BlockPos pos)
{
return BlockRail.isRailBlock(this.world, pos) || BlockRail.isRailBlock(this.world, pos.up()) || BlockRail.isRailBlock(this.world, pos.down());
}
private BlockRail.Rail findRailAt(BlockPos pos)
{
State iblockstate = this.world.getState(pos);
if (BlockRail.isRailBlock(iblockstate))
{
return BlockRail.this.new Rail(this.world, pos, iblockstate);
}
else
{
BlockPos lvt_2_1_ = pos.up();
iblockstate = this.world.getState(lvt_2_1_);
if (BlockRail.isRailBlock(iblockstate))
{
return BlockRail.this.new Rail(this.world, lvt_2_1_, iblockstate);
}
else
{
lvt_2_1_ = pos.down();
iblockstate = this.world.getState(lvt_2_1_);
return BlockRail.isRailBlock(iblockstate) ? BlockRail.this.new Rail(this.world, lvt_2_1_, iblockstate) : null;
}
}
}
private boolean func_150653_a(BlockRail.Rail p_150653_1_)
{
return this.func_180363_c(p_150653_1_.pos);
}
private boolean func_180363_c(BlockPos p_180363_1_)
{
for (int i = 0; i < this.field_150657_g.size(); ++i)
{
BlockPos blockpos = (BlockPos)this.field_150657_g.get(i);
if (blockpos.getX() == p_180363_1_.getX() && blockpos.getZ() == p_180363_1_.getZ())
{
return true;
}
}
return false;
}
protected int countAdjacentRails()
{
int i = 0;
for (Facing enumfacing : Facing.Plane.HORIZONTAL)
{
if (this.hasRailAt(this.pos.offset(enumfacing)))
{
++i;
}
}
return i;
}
private boolean func_150649_b(BlockRail.Rail rail)
{
return this.func_150653_a(rail) || this.field_150657_g.size() != 2;
}
private void func_150645_c(BlockRail.Rail p_150645_1_)
{
this.field_150657_g.add(p_150645_1_.pos);
BlockPos blockpos = this.pos.north();
BlockPos blockpos1 = this.pos.south();
BlockPos blockpos2 = this.pos.west();
BlockPos blockpos3 = this.pos.east();
boolean flag = this.func_180363_c(blockpos);
boolean flag1 = this.func_180363_c(blockpos1);
boolean flag2 = this.func_180363_c(blockpos2);
boolean flag3 = this.func_180363_c(blockpos3);
BlockRail.EnumRailDirection blockrailbase$enumraildirection = null;
if (flag || flag1)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_SOUTH;
}
if (flag2 || flag3)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.EAST_WEST;
}
if (flag1 && flag3 && !flag && !flag2)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_EAST;
}
if (flag1 && flag2 && !flag && !flag3)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_WEST;
}
if (flag && flag2 && !flag1 && !flag3)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_WEST;
}
if (flag && flag3 && !flag1 && !flag2)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_EAST;
}
if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.NORTH_SOUTH)
{
if (BlockRail.isRailBlock(this.world, blockpos.up()))
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_NORTH;
}
if (BlockRail.isRailBlock(this.world, blockpos1.up()))
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_SOUTH;
}
}
if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.EAST_WEST)
{
if (BlockRail.isRailBlock(this.world, blockpos3.up()))
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_EAST;
}
if (BlockRail.isRailBlock(this.world, blockpos2.up()))
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_WEST;
}
}
if (blockrailbase$enumraildirection == null)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_SOUTH;
}
this.state = this.state.withProperty(BlockRail.SHAPE, blockrailbase$enumraildirection);
this.world.setState(this.pos, this.state, 3);
}
private boolean func_180361_d(BlockPos p_180361_1_)
{
BlockRail.Rail blockrailbase$rail = this.findRailAt(p_180361_1_);
if (blockrailbase$rail == null)
{
return false;
}
else
{
blockrailbase$rail.func_150651_b();
return blockrailbase$rail.func_150649_b(this);
}
}
public BlockRail.Rail setDirection(boolean switched, boolean force)
{
BlockPos blockpos = this.pos.north();
BlockPos blockpos1 = this.pos.south();
BlockPos blockpos2 = this.pos.west();
BlockPos blockpos3 = this.pos.east();
boolean flag = this.func_180361_d(blockpos);
boolean flag1 = this.func_180361_d(blockpos1);
boolean flag2 = this.func_180361_d(blockpos2);
boolean flag3 = this.func_180361_d(blockpos3);
BlockRail.EnumRailDirection blockrailbase$enumraildirection = null;
if ((flag || flag1) && !flag2 && !flag3)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_SOUTH;
}
if ((flag2 || flag3) && !flag && !flag1)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.EAST_WEST;
}
if (flag1 && flag3 && !flag && !flag2)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_EAST;
}
if (flag1 && flag2 && !flag && !flag3)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_WEST;
}
if (flag && flag2 && !flag1 && !flag3)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_WEST;
}
if (flag && flag3 && !flag1 && !flag2)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_EAST;
}
if (blockrailbase$enumraildirection == null)
{
if (flag || flag1)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_SOUTH;
}
if (flag2 || flag3)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.EAST_WEST;
}
if (switched)
{
if (flag1 && flag3)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_EAST;
}
if (flag2 && flag1)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_WEST;
}
if (flag3 && flag)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_EAST;
}
if (flag && flag2)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_WEST;
}
}
else
{
if (flag && flag2)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_WEST;
}
if (flag3 && flag)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_EAST;
}
if (flag2 && flag1)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_WEST;
}
if (flag1 && flag3)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.SOUTH_EAST;
}
}
}
if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.NORTH_SOUTH)
{
if (BlockRail.isRailBlock(this.world, blockpos.up()))
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_NORTH;
}
if (BlockRail.isRailBlock(this.world, blockpos1.up()))
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_SOUTH;
}
}
if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.EAST_WEST)
{
if (BlockRail.isRailBlock(this.world, blockpos3.up()))
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_EAST;
}
if (BlockRail.isRailBlock(this.world, blockpos2.up()))
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.ASCENDING_WEST;
}
}
if (blockrailbase$enumraildirection == null)
{
blockrailbase$enumraildirection = BlockRail.EnumRailDirection.NORTH_SOUTH;
}
this.func_180360_a(blockrailbase$enumraildirection);
this.state = this.state.withProperty(BlockRail.SHAPE, blockrailbase$enumraildirection);
if (force || this.world.getState(this.pos) != this.state)
{
this.world.setState(this.pos, this.state, 3);
for (int i = 0; i < this.field_150657_g.size(); ++i)
{
BlockRail.Rail blockrailbase$rail = this.findRailAt((BlockPos)this.field_150657_g.get(i));
if (blockrailbase$rail != null)
{
blockrailbase$rail.func_150651_b();
if (blockrailbase$rail.func_150649_b(this))
{
blockrailbase$rail.func_150645_c(this);
}
}
}
}
return this;
}
public State getBlockState()
{
return this.state;
}
}
} }

View file

@ -1,724 +0,0 @@
package common.block.tech;
import java.util.List;
import common.block.Block;
import common.block.Material;
import common.collect.Lists;
import common.init.Blocks;
import common.item.CheatTab;
import common.model.BlockLayer;
import common.model.Model;
import common.model.ModelProvider;
import common.model.ModelRotation;
import common.properties.Property;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.DirectionVec;
import common.util.Facing;
import common.util.HitPosition;
import common.util.Identifyable;
import common.util.Vec3;
import common.world.IWorldAccess;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
public abstract class BlockRailBase extends Block
{
protected final boolean isPowered;
public static boolean isRailBlock(World worldIn, BlockPos pos)
{
return isRailBlock(worldIn.getState(pos));
}
public static boolean isRailBlock(State state)
{
Block block = state.getBlock();
return block == Blocks.rail || block == Blocks.golden_rail || block == Blocks.detector_rail || block == Blocks.activator_rail;
}
public BlockRailBase(boolean isPowered)
{
super(Material.SMALL);
this.isPowered = isPowered;
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
this.setTab(CheatTab.TECHNOLOGY);
this.setFlatItemTexture();
}
public BoundingBox getCollisionBoundingBox(World worldIn, BlockPos pos, State state)
{
return null;
}
/**
* Used to determine ambient occlusion and culling when rebuilding chunks for render
*/
public boolean isOpaqueCube()
{
return false;
}
/**
* Ray traces through the blocks collision from start vector to end vector returning a ray trace hit.
*/
public HitPosition collisionRayTrace(World worldIn, BlockPos pos, Vec3 start, Vec3 end)
{
this.setBlockBoundsBasedOnState(worldIn, pos);
return super.collisionRayTrace(worldIn, pos, start, end);
}
public void setBlockBoundsBasedOnState(IWorldAccess worldIn, BlockPos pos)
{
State iblockstate = worldIn.getState(pos);
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() == this ? (BlockRailBase.EnumRailDirection)iblockstate.getValue(this.getShapeProperty()) : null;
if (blockrailbase$enumraildirection != null && blockrailbase$enumraildirection.isAscending())
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.625F, 1.0F);
}
else
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
}
}
public boolean isFullCube()
{
return false;
}
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
{
return worldIn.isBlockSolid(pos.down());
}
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{
if (!worldIn.client)
{
state = this.func_176564_a(worldIn, pos, state, true);
if (this.isPowered)
{
this.onNeighborBlockChange(worldIn, pos, state, this);
}
}
}
/**
* Called when a neighboring block changes.
*/
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
{
if (!worldIn.client)
{
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)state.getValue(this.getShapeProperty());
boolean flag = false;
if (!worldIn.isBlockSolid(pos.down()))
{
flag = true;
}
if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_EAST && !worldIn.isBlockSolid(pos.east()))
{
flag = true;
}
else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_WEST && !worldIn.isBlockSolid(pos.west()))
{
flag = true;
}
else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_NORTH && !worldIn.isBlockSolid(pos.north()))
{
flag = true;
}
else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.ASCENDING_SOUTH && !worldIn.isBlockSolid(pos.south()))
{
flag = true;
}
if (flag)
{
this.dropBlockAsItem(worldIn, pos, state, 0);
worldIn.setBlockToAir(pos);
}
else
{
this.onNeighborChangedInternal(worldIn, pos, state, neighborBlock);
}
}
}
protected void onNeighborChangedInternal(World worldIn, BlockPos pos, State state, Block neighborBlock)
{
}
protected State func_176564_a(World worldIn, BlockPos p_176564_2_, State p_176564_3_, boolean p_176564_4_)
{
return worldIn.client ? p_176564_3_ : (new BlockRailBase.Rail(worldIn, p_176564_2_, p_176564_3_)).func_180364_a(worldIn.isBlockPowered(p_176564_2_), p_176564_4_).getBlockState();
}
public int getMobilityFlag()
{
return 0;
}
public BlockLayer getBlockLayer()
{
return BlockLayer.CUTOUT;
}
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{
super.onBlockRemoved(worldIn, pos, state);
if (((BlockRailBase.EnumRailDirection)state.getValue(this.getShapeProperty())).isAscending())
{
worldIn.notifyNeighborsOfStateChange(pos.up(), this);
}
if (this.isPowered)
{
worldIn.notifyNeighborsOfStateChange(pos, this);
worldIn.notifyNeighborsOfStateChange(pos.down(), this);
}
}
public boolean isMagnetic() {
return true;
}
public Model getModel(ModelProvider provider, String name, State state) {
EnumRailDirection dir = state.getValue(this.getShapeProperty());
switch(dir) {
case NORTH_SOUTH:
case EAST_WEST:
default:
return provider.getModel(name)
.add(0, 1, 0, 16, 1, 16)
.d().uv(0, 16, 16, 0).noCull()
.u().uv(0, 0, 16, 16).noCull()
.rotate(dir == EnumRailDirection.EAST_WEST ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0);
case NORTH_EAST:
case NORTH_WEST:
case SOUTH_EAST:
case SOUTH_WEST:
return provider.getModel(name + "_turned")
.add(0, 1, 0, 16, 1, 16)
.d().uv(0, 16, 16, 0).noCull()
.u().uv(0, 0, 16, 16).noCull()
.rotate(dir == EnumRailDirection.SOUTH_WEST ? ModelRotation.X0_Y90 : (dir == EnumRailDirection.NORTH_WEST ?
ModelRotation.X0_Y180 : (dir == EnumRailDirection.NORTH_EAST ? ModelRotation.X0_Y270 : ModelRotation.X0_Y0)));
case ASCENDING_NORTH:
case ASCENDING_EAST:
return provider.getModel(name)
.add(0, 9, 0, 16, 9, 16).rotate(8, 9, 8, Facing.Axis.X, 45, true)
.d().uv(0, 16, 16, 0).noCull()
.u().uv(0, 0, 16, 16).noCull()
.rotate(dir == EnumRailDirection.ASCENDING_EAST ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0);
case ASCENDING_SOUTH:
case ASCENDING_WEST:
return provider.getModel(name)
.add(0, 9, 0, 16, 9, 16).rotate(8, 9, 8, Facing.Axis.X, -45, true)
.d().uv(0, 16, 16, 0).noCull()
.u().uv(0, 0, 16, 16).noCull()
.rotate(dir == EnumRailDirection.ASCENDING_WEST ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0);
}
}
public abstract Property<BlockRailBase.EnumRailDirection> getShapeProperty();
private static enum BaseShape {
STRAIGHT, ASCENDING, TURNED;
}
public static enum EnumRailDirection implements Identifyable, DirectionVec<EnumRailDirection>
{
NORTH_SOUTH("north_south", Facing.SOUTH, BaseShape.STRAIGHT),
EAST_WEST("east_west", Facing.EAST, BaseShape.STRAIGHT),
ASCENDING_EAST("ascending_east", Facing.EAST, BaseShape.ASCENDING),
ASCENDING_WEST("ascending_west", Facing.WEST, BaseShape.ASCENDING),
ASCENDING_NORTH("ascending_north", Facing.NORTH, BaseShape.ASCENDING),
ASCENDING_SOUTH("ascending_south", Facing.DOWN, BaseShape.ASCENDING),
SOUTH_EAST("south_east", Facing.EAST, BaseShape.TURNED),
SOUTH_WEST("south_west", Facing.SOUTH, BaseShape.TURNED),
NORTH_WEST("north_west", Facing.NORTH, BaseShape.TURNED),
NORTH_EAST("north_east", Facing.WEST, BaseShape.TURNED);
private final String name;
private final Facing facing;
private final BaseShape shape;
private EnumRailDirection(String name, Facing facing, BaseShape shape)
{
this.name = name;
this.facing = facing;
this.shape = shape;
}
public String toString()
{
return this.name;
}
public boolean isAscending()
{
return this == ASCENDING_NORTH || this == ASCENDING_EAST || this == ASCENDING_SOUTH || this == ASCENDING_WEST;
}
public String getName()
{
return this.name;
}
public Facing getFacing()
{
return this.facing;
}
public Facing getVector() {
return this.facing;
}
public boolean isAxis() {
return false;
}
public boolean canApply(EnumRailDirection dir) {
return this.shape == dir.shape;
}
}
public class Rail
{
private final World world;
private final BlockPos pos;
private final BlockRailBase block;
private State state;
private final boolean isPowered;
private final List<BlockPos> field_150657_g = Lists.<BlockPos>newArrayList();
public Rail(World worldIn, BlockPos pos, State state)
{
this.world = worldIn;
this.pos = pos;
this.state = state;
this.block = (BlockRailBase)state.getBlock();
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)state.getValue(BlockRailBase.this.getShapeProperty());
this.isPowered = this.block.isPowered;
this.func_180360_a(blockrailbase$enumraildirection);
}
private void func_180360_a(BlockRailBase.EnumRailDirection p_180360_1_)
{
this.field_150657_g.clear();
switch (p_180360_1_)
{
case NORTH_SOUTH:
this.field_150657_g.add(this.pos.north());
this.field_150657_g.add(this.pos.south());
break;
case EAST_WEST:
this.field_150657_g.add(this.pos.west());
this.field_150657_g.add(this.pos.east());
break;
case ASCENDING_EAST:
this.field_150657_g.add(this.pos.west());
this.field_150657_g.add(this.pos.east().up());
break;
case ASCENDING_WEST:
this.field_150657_g.add(this.pos.west().up());
this.field_150657_g.add(this.pos.east());
break;
case ASCENDING_NORTH:
this.field_150657_g.add(this.pos.north().up());
this.field_150657_g.add(this.pos.south());
break;
case ASCENDING_SOUTH:
this.field_150657_g.add(this.pos.north());
this.field_150657_g.add(this.pos.south().up());
break;
case SOUTH_EAST:
this.field_150657_g.add(this.pos.east());
this.field_150657_g.add(this.pos.south());
break;
case SOUTH_WEST:
this.field_150657_g.add(this.pos.west());
this.field_150657_g.add(this.pos.south());
break;
case NORTH_WEST:
this.field_150657_g.add(this.pos.west());
this.field_150657_g.add(this.pos.north());
break;
case NORTH_EAST:
this.field_150657_g.add(this.pos.east());
this.field_150657_g.add(this.pos.north());
}
}
private void func_150651_b()
{
for (int i = 0; i < this.field_150657_g.size(); ++i)
{
BlockRailBase.Rail blockrailbase$rail = this.findRailAt((BlockPos)this.field_150657_g.get(i));
if (blockrailbase$rail != null && blockrailbase$rail.func_150653_a(this))
{
this.field_150657_g.set(i, blockrailbase$rail.pos);
}
else
{
this.field_150657_g.remove(i--);
}
}
}
private boolean hasRailAt(BlockPos pos)
{
return BlockRailBase.isRailBlock(this.world, pos) || BlockRailBase.isRailBlock(this.world, pos.up()) || BlockRailBase.isRailBlock(this.world, pos.down());
}
private BlockRailBase.Rail findRailAt(BlockPos pos)
{
State iblockstate = this.world.getState(pos);
if (BlockRailBase.isRailBlock(iblockstate))
{
return BlockRailBase.this.new Rail(this.world, pos, iblockstate);
}
else
{
BlockPos lvt_2_1_ = pos.up();
iblockstate = this.world.getState(lvt_2_1_);
if (BlockRailBase.isRailBlock(iblockstate))
{
return BlockRailBase.this.new Rail(this.world, lvt_2_1_, iblockstate);
}
else
{
lvt_2_1_ = pos.down();
iblockstate = this.world.getState(lvt_2_1_);
return BlockRailBase.isRailBlock(iblockstate) ? BlockRailBase.this.new Rail(this.world, lvt_2_1_, iblockstate) : null;
}
}
}
private boolean func_150653_a(BlockRailBase.Rail p_150653_1_)
{
return this.func_180363_c(p_150653_1_.pos);
}
private boolean func_180363_c(BlockPos p_180363_1_)
{
for (int i = 0; i < this.field_150657_g.size(); ++i)
{
BlockPos blockpos = (BlockPos)this.field_150657_g.get(i);
if (blockpos.getX() == p_180363_1_.getX() && blockpos.getZ() == p_180363_1_.getZ())
{
return true;
}
}
return false;
}
protected int countAdjacentRails()
{
int i = 0;
for (Facing enumfacing : Facing.Plane.HORIZONTAL)
{
if (this.hasRailAt(this.pos.offset(enumfacing)))
{
++i;
}
}
return i;
}
private boolean func_150649_b(BlockRailBase.Rail rail)
{
return this.func_150653_a(rail) || this.field_150657_g.size() != 2;
}
private void func_150645_c(BlockRailBase.Rail p_150645_1_)
{
this.field_150657_g.add(p_150645_1_.pos);
BlockPos blockpos = this.pos.north();
BlockPos blockpos1 = this.pos.south();
BlockPos blockpos2 = this.pos.west();
BlockPos blockpos3 = this.pos.east();
boolean flag = this.func_180363_c(blockpos);
boolean flag1 = this.func_180363_c(blockpos1);
boolean flag2 = this.func_180363_c(blockpos2);
boolean flag3 = this.func_180363_c(blockpos3);
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = null;
if (flag || flag1)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
}
if (flag2 || flag3)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST;
}
if (!this.isPowered)
{
if (flag1 && flag3 && !flag && !flag2)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST;
}
if (flag1 && flag2 && !flag && !flag3)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST;
}
if (flag && flag2 && !flag1 && !flag3)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST;
}
if (flag && flag3 && !flag1 && !flag2)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST;
}
}
if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
{
if (BlockRailBase.isRailBlock(this.world, blockpos.up()))
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_NORTH;
}
if (BlockRailBase.isRailBlock(this.world, blockpos1.up()))
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_SOUTH;
}
}
if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
{
if (BlockRailBase.isRailBlock(this.world, blockpos3.up()))
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_EAST;
}
if (BlockRailBase.isRailBlock(this.world, blockpos2.up()))
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_WEST;
}
}
if (blockrailbase$enumraildirection == null)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
}
this.state = this.state.withProperty(this.block.getShapeProperty(), blockrailbase$enumraildirection);
this.world.setState(this.pos, this.state, 3);
}
private boolean func_180361_d(BlockPos p_180361_1_)
{
BlockRailBase.Rail blockrailbase$rail = this.findRailAt(p_180361_1_);
if (blockrailbase$rail == null)
{
return false;
}
else
{
blockrailbase$rail.func_150651_b();
return blockrailbase$rail.func_150649_b(this);
}
}
public BlockRailBase.Rail func_180364_a(boolean p_180364_1_, boolean p_180364_2_)
{
BlockPos blockpos = this.pos.north();
BlockPos blockpos1 = this.pos.south();
BlockPos blockpos2 = this.pos.west();
BlockPos blockpos3 = this.pos.east();
boolean flag = this.func_180361_d(blockpos);
boolean flag1 = this.func_180361_d(blockpos1);
boolean flag2 = this.func_180361_d(blockpos2);
boolean flag3 = this.func_180361_d(blockpos3);
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = null;
if ((flag || flag1) && !flag2 && !flag3)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
}
if ((flag2 || flag3) && !flag && !flag1)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST;
}
if (!this.isPowered)
{
if (flag1 && flag3 && !flag && !flag2)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST;
}
if (flag1 && flag2 && !flag && !flag3)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST;
}
if (flag && flag2 && !flag1 && !flag3)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST;
}
if (flag && flag3 && !flag1 && !flag2)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST;
}
}
if (blockrailbase$enumraildirection == null)
{
if (flag || flag1)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
}
if (flag2 || flag3)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST;
}
if (!this.isPowered)
{
if (p_180364_1_)
{
if (flag1 && flag3)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST;
}
if (flag2 && flag1)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST;
}
if (flag3 && flag)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST;
}
if (flag && flag2)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST;
}
}
else
{
if (flag && flag2)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_WEST;
}
if (flag3 && flag)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_EAST;
}
if (flag2 && flag1)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_WEST;
}
if (flag1 && flag3)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.SOUTH_EAST;
}
}
}
}
if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH)
{
if (BlockRailBase.isRailBlock(this.world, blockpos.up()))
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_NORTH;
}
if (BlockRailBase.isRailBlock(this.world, blockpos1.up()))
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_SOUTH;
}
}
if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST)
{
if (BlockRailBase.isRailBlock(this.world, blockpos3.up()))
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_EAST;
}
if (BlockRailBase.isRailBlock(this.world, blockpos2.up()))
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.ASCENDING_WEST;
}
}
if (blockrailbase$enumraildirection == null)
{
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
}
this.func_180360_a(blockrailbase$enumraildirection);
this.state = this.state.withProperty(this.block.getShapeProperty(), blockrailbase$enumraildirection);
if (p_180364_2_ || this.world.getState(this.pos) != this.state)
{
this.world.setState(this.pos, this.state, 3);
for (int i = 0; i < this.field_150657_g.size(); ++i)
{
BlockRailBase.Rail blockrailbase$rail = this.findRailAt((BlockPos)this.field_150657_g.get(i));
if (blockrailbase$rail != null)
{
blockrailbase$rail.func_150651_b();
if (blockrailbase$rail.func_150649_b(this))
{
blockrailbase$rail.func_150645_c(this);
}
}
}
}
return this;
}
public State getBlockState()
{
return this.state;
}
}
}

View file

@ -1,187 +0,0 @@
package common.block.tech;
import java.util.List;
import java.util.function.Predicate;
import common.entity.Entity;
import common.entity.item.EntityCart;
import common.inventory.Container;
import common.inventory.IInventory;
import common.model.Model;
import common.model.ModelProvider;
import common.properties.Property;
import common.properties.PropertyBool;
import common.properties.PropertyEnum;
import common.rng.Random;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.Facing;
import common.world.IWorldAccess;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
public class BlockRailDetector extends BlockRailBase
{
public static final PropertyEnum<BlockRailBase.EnumRailDirection> SHAPE = PropertyEnum.<BlockRailBase.EnumRailDirection>create("shape", EnumRailDirection.class, EnumRailDirection.NORTH_SOUTH, EnumRailDirection.EAST_WEST, EnumRailDirection.ASCENDING_EAST, EnumRailDirection.ASCENDING_WEST, EnumRailDirection.ASCENDING_NORTH, EnumRailDirection.ASCENDING_SOUTH);
public static final PropertyBool POWERED = PropertyBool.create("powered");
public BlockRailDetector()
{
super(true);
this.setDefaultState(this.getBaseState().withProperty(POWERED, Boolean.valueOf(false)).withProperty(SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH));
}
/**
* How many world ticks before ticking
*/
public int tickRate(World worldIn, BlockPos pos)
{
return 20;
}
/**
* Can this block provide power. Only wire currently seems to have this change based on its state.
*/
public boolean canProvidePower()
{
return true;
}
/**
* Called When an Entity Collided with the Block
*/
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, State state, Entity entityIn)
{
if (!worldIn.client)
{
if (!((Boolean)state.getValue(POWERED)).booleanValue())
{
this.updatePoweredState(worldIn, pos, state);
}
}
}
/**
* Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.)
*/
public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random)
{
}
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{
if (/* !worldIn.client && */ ((Boolean)state.getValue(POWERED)).booleanValue())
{
this.updatePoweredState(worldIn, pos, state);
}
}
public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
{
return ((Boolean)state.getValue(POWERED)).booleanValue() ? 15 : 0;
}
public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
{
return !((Boolean)state.getValue(POWERED)).booleanValue() ? 0 : (side == Facing.UP ? 15 : 0);
}
private void updatePoweredState(World worldIn, BlockPos pos, State state)
{
boolean flag = ((Boolean)state.getValue(POWERED)).booleanValue();
boolean flag1 = false;
List<EntityCart> list = this.<EntityCart>findMinecarts(worldIn, pos, EntityCart.class, null);
if (!list.isEmpty())
{
flag1 = true;
}
if (flag1 && !flag)
{
worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 3);
worldIn.notifyNeighborsOfStateChange(pos, this);
worldIn.notifyNeighborsOfStateChange(pos.down(), this);
worldIn.markBlockRangeForRenderUpdate(pos, pos);
}
if (!flag1 && flag)
{
worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 3);
worldIn.notifyNeighborsOfStateChange(pos, this);
worldIn.notifyNeighborsOfStateChange(pos.down(), this);
worldIn.markBlockRangeForRenderUpdate(pos, pos);
}
if (flag1)
{
worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos));
}
worldIn.updateComparatorOutputLevel(pos, this);
}
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{
super.onBlockAdded(worldIn, pos, state);
this.updatePoweredState(worldIn, pos, state);
}
public Property<BlockRailBase.EnumRailDirection> getShapeProperty()
{
return SHAPE;
}
public boolean hasSignalProcessing()
{
return true;
}
public int getSignal(World worldIn, BlockPos pos, int input)
{
if (((Boolean)worldIn.getState(pos).getValue(POWERED)).booleanValue())
{
// List<EntityMinecartCommandBlock> list = this.<EntityMinecartCommandBlock>findMinecarts(worldIn, pos, EntityMinecartCommandBlock.class, null);
//
// if (!list.isEmpty())
// {
// return ((EntityMinecartCommandBlock)list.get(0)).isPowered() ? 15 : 0;
// }
List<EntityCart> list1 = this.<EntityCart>findMinecarts(worldIn, pos, EntityCart.class, new Predicate<EntityCart>() {
public boolean test(EntityCart entity) {
return entity instanceof IInventory && entity.isEntityAlive();
}
});
if (!list1.isEmpty())
{
return Container.calcRedstoneFromInventory((IInventory)list1.get(0));
}
}
return 0;
}
protected <T extends EntityCart> List<T> findMinecarts(World worldIn, BlockPos pos, Class<T> clazz, Predicate<EntityCart> filter)
{
BoundingBox axisalignedbb = this.getDectectionBox(pos);
return filter == null ? worldIn.getEntitiesWithinAABB(clazz, axisalignedbb) : worldIn.getEntitiesWithinAABB(clazz, axisalignedbb, filter);
}
private BoundingBox getDectectionBox(BlockPos pos)
{
float f = 0.2F;
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));
}
protected Property[] getProperties()
{
return new Property[] {SHAPE, POWERED};
}
public Model getModel(ModelProvider provider, String name, State state) {
return super.getModel(provider, name + (state.getValue(POWERED) ? "_powered" : ""), state);
}
}

View file

@ -1,174 +0,0 @@
package common.block.tech;
import common.block.Block;
import common.model.Model;
import common.model.ModelProvider;
import common.properties.Property;
import common.properties.PropertyBool;
import common.properties.PropertyEnum;
import common.util.BlockPos;
import common.world.State;
import common.world.World;
public class BlockRailPowered extends BlockRailBase
{
public static final PropertyEnum<BlockRailBase.EnumRailDirection> SHAPE = PropertyEnum.<BlockRailBase.EnumRailDirection>create("shape", EnumRailDirection.class, EnumRailDirection.NORTH_SOUTH, EnumRailDirection.EAST_WEST, EnumRailDirection.ASCENDING_EAST, EnumRailDirection.ASCENDING_WEST, EnumRailDirection.ASCENDING_NORTH, EnumRailDirection.ASCENDING_SOUTH);
public static final PropertyBool POWERED = PropertyBool.create("powered");
public BlockRailPowered()
{
super(true);
this.setDefaultState(this.getBaseState().withProperty(SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH).withProperty(POWERED, Boolean.valueOf(false)));
}
protected boolean func_176566_a(World worldIn, BlockPos pos, State state, boolean p_176566_4_, int p_176566_5_)
{
if (p_176566_5_ >= 8)
{
return false;
}
else
{
int i = pos.getX();
int j = pos.getY();
int k = pos.getZ();
boolean flag = true;
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)state.getValue(SHAPE);
switch (blockrailbase$enumraildirection)
{
case NORTH_SOUTH:
if (p_176566_4_)
{
++k;
}
else
{
--k;
}
break;
case EAST_WEST:
if (p_176566_4_)
{
--i;
}
else
{
++i;
}
break;
case ASCENDING_EAST:
if (p_176566_4_)
{
--i;
}
else
{
++i;
++j;
flag = false;
}
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST;
break;
case ASCENDING_WEST:
if (p_176566_4_)
{
--i;
++j;
flag = false;
}
else
{
++i;
}
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.EAST_WEST;
break;
case ASCENDING_NORTH:
if (p_176566_4_)
{
++k;
}
else
{
--k;
++j;
flag = false;
}
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
break;
case ASCENDING_SOUTH:
if (p_176566_4_)
{
++k;
++j;
flag = false;
}
else
{
--k;
}
blockrailbase$enumraildirection = BlockRailBase.EnumRailDirection.NORTH_SOUTH;
}
return this.func_176567_a(worldIn, new BlockPos(i, j, k), p_176566_4_, p_176566_5_, blockrailbase$enumraildirection) ? true : flag && this.func_176567_a(worldIn, new BlockPos(i, j - 1, k), p_176566_4_, p_176566_5_, blockrailbase$enumraildirection);
}
}
protected boolean func_176567_a(World worldIn, BlockPos p_176567_2_, boolean p_176567_3_, int distance, BlockRailBase.EnumRailDirection p_176567_5_)
{
State iblockstate = worldIn.getState(p_176567_2_);
if (iblockstate.getBlock() != this)
{
return false;
}
else
{
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)iblockstate.getValue(SHAPE);
return p_176567_5_ != BlockRailBase.EnumRailDirection.EAST_WEST || blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.NORTH_SOUTH && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_NORTH && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_SOUTH ? (p_176567_5_ != BlockRailBase.EnumRailDirection.NORTH_SOUTH || blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.EAST_WEST && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_EAST && blockrailbase$enumraildirection != BlockRailBase.EnumRailDirection.ASCENDING_WEST ? (((Boolean)iblockstate.getValue(POWERED)).booleanValue() ? (worldIn.isBlockPowered(p_176567_2_) ? true : this.func_176566_a(worldIn, p_176567_2_, iblockstate, p_176567_3_, distance + 1)) : false) : false) : false;
}
}
protected void onNeighborChangedInternal(World worldIn, BlockPos pos, State state, Block neighborBlock)
{
boolean flag = ((Boolean)state.getValue(POWERED)).booleanValue();
boolean flag1 = worldIn.isBlockPowered(pos) || this.func_176566_a(worldIn, pos, state, true, 0) || this.func_176566_a(worldIn, pos, state, false, 0);
if (flag1 != flag)
{
worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(flag1)), 3);
worldIn.notifyNeighborsOfStateChange(pos.down(), this);
if (((BlockRailBase.EnumRailDirection)state.getValue(SHAPE)).isAscending())
{
worldIn.notifyNeighborsOfStateChange(pos.up(), this);
}
}
}
public Property<BlockRailBase.EnumRailDirection> getShapeProperty()
{
return SHAPE;
}
protected Property[] getProperties()
{
return new Property[] {SHAPE, POWERED};
}
public Model getModel(ModelProvider provider, String name, State state) {
return super.getModel(provider, name + (state.getValue(POWERED) ? "_powered" : ""), state);
}
}

View file

@ -1,432 +0,0 @@
package common.block.tech;
import common.block.Block;
import common.block.ITileEntityProvider;
import common.entity.npc.EntityNPC;
import common.entity.types.EntityLiving;
import common.init.Blocks;
import common.init.Items;
import common.init.SoundEvent;
import common.item.CheatTab;
import common.item.Item;
import common.item.block.ItemSmallBlock;
import common.model.Model;
import common.model.ModelProvider;
import common.model.ModelRotation;
import common.properties.Property;
import common.properties.PropertyBool;
import common.properties.PropertyEnum;
import common.rng.Random;
import common.tileentity.TileEntity;
import common.tileentity.TileEntityComparator;
import common.util.BlockPos;
import common.util.Facing;
import common.util.Identifyable;
import common.world.IWorldAccess;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITileEntityProvider
{
public static final PropertyBool POWERED = PropertyBool.create("powered");
public static final PropertyEnum<BlockRedstoneComparator.Mode> MODE = PropertyEnum.<BlockRedstoneComparator.Mode>create("mode", BlockRedstoneComparator.Mode.class);
public BlockRedstoneComparator(boolean powered)
{
super(powered);
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(POWERED, Boolean.valueOf(false)).withProperty(MODE, BlockRedstoneComparator.Mode.COMPARE));
this.hasTile = true;
}
// /**
// * Gets the localized name of this block. Used for the statistics page.
// */
// public String getLocalizedName()
// {
// return "Redstone-Komparator";
// }
/**
* Get the Item that this Block should drop when harvested.
*/
public Item getItemDropped(State state, Random rand, int fortune)
{
return Items.comparator;
}
public Item getItem(World worldIn, BlockPos pos)
{
return Items.comparator;
}
protected int getDelay(State state)
{
return 2;
}
protected State getPoweredState(State unpoweredState)
{
Boolean obool = (Boolean)unpoweredState.getValue(POWERED);
BlockRedstoneComparator.Mode blockredstonecomparator$mode = (BlockRedstoneComparator.Mode)unpoweredState.getValue(MODE);
Facing enumfacing = (Facing)unpoweredState.getValue(FACING);
return Blocks.powered_comparator.getState().withProperty(FACING, enumfacing).withProperty(POWERED, obool).withProperty(MODE, blockredstonecomparator$mode);
}
protected State getUnpoweredState(State poweredState)
{
Boolean obool = (Boolean)poweredState.getValue(POWERED);
BlockRedstoneComparator.Mode blockredstonecomparator$mode = (BlockRedstoneComparator.Mode)poweredState.getValue(MODE);
Facing enumfacing = (Facing)poweredState.getValue(FACING);
return Blocks.comparator.getState().withProperty(FACING, enumfacing).withProperty(POWERED, obool).withProperty(MODE, blockredstonecomparator$mode);
}
protected boolean isPowered(State state)
{
return this.isRepeaterPowered || ((Boolean)state.getValue(POWERED)).booleanValue();
}
protected int getActiveSignal(IWorldAccess worldIn, BlockPos pos, State state)
{
TileEntity tileentity = worldIn.getTileEntity(pos);
return tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;
}
private int calculateOutput(World worldIn, BlockPos pos, State state)
{
return state.getValue(MODE) == BlockRedstoneComparator.Mode.SUBTRACT ? Math.max(this.calculateInputStrength(worldIn, pos, state) - this.getPowerOnSides(worldIn, pos, state), 0) : this.calculateInputStrength(worldIn, pos, state);
}
protected boolean shouldBePowered(World worldIn, BlockPos pos, State state)
{
int i = this.calculateInputStrength(worldIn, pos, state);
if (i >= 15)
{
return true;
}
else if (i == 0)
{
return false;
}
else
{
int j = this.getPowerOnSides(worldIn, pos, state);
return j == 0 ? true : i >= j;
}
}
protected int calculateInputStrength(World worldIn, BlockPos pos, State state)
{
int i = super.calculateInputStrength(worldIn, pos, state);
Facing enumfacing = (Facing)state.getValue(FACING);
BlockPos blockpos = pos.offset(enumfacing);
Block block = worldIn.getState(blockpos).getBlock();
if (block.hasSignalProcessing())
{
i = block.getSignal(worldIn, blockpos, 0);
}
else if (i < 15 && block.isNormalCube())
{
blockpos = blockpos.offset(enumfacing);
block = worldIn.getState(blockpos).getBlock();
if (block.hasSignalProcessing())
{
i = block.getSignal(worldIn, blockpos, 0);
}
}
return i;
}
// private EntityFrame findItemFrame(World worldIn, final Facing facing, BlockPos pos)
// {
// List<EntityFrame> list = worldIn.<EntityFrame>getEntitiesWithinAABB(EntityFrame.class, new BoundingBox((double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), (double)(pos.getX() + 1), (double)(pos.getY() + 1), (double)(pos.getZ() + 1)), new Predicate<Entity>()
// {
// public boolean test(Entity p_apply_1_)
// {
// return p_apply_1_ != null && p_apply_1_.getHorizontalFacing() == facing;
// }
// });
// return list.size() == 1 ? (EntityFrame)list.get(0) : null;
// }
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
{
// if (!playerIn.capabilities.allowEdit)
// {
// return false;
// }
// else
// {
state = state.cycleProperty(MODE);
worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.3F);
worldIn.setState(pos, state, 2);
this.onStateChange(worldIn, pos, state);
return true;
// }
}
protected void updateState(World worldIn, BlockPos pos, State state)
{
if (worldIn.client || !((AWorldServer)worldIn).isBlockTickPending(pos, this))
{
int i = this.calculateOutput(worldIn, pos, state);
TileEntity tileentity = worldIn.getTileEntity(pos);
int j = tileentity instanceof TileEntityComparator ? ((TileEntityComparator)tileentity).getOutputSignal() : 0;
if (i != j || this.isPowered(state) != this.shouldBePowered(worldIn, pos, state))
{
if (this.isFacingTowardsRepeater(worldIn, pos, state))
{
if(!worldIn.client)
((AWorldServer)worldIn).updateBlockTick(pos, this, 2, -1);
}
else
{
if(!worldIn.client)
((AWorldServer)worldIn).updateBlockTick(pos, this, 2, 0);
}
}
}
}
private void onStateChange(World worldIn, BlockPos pos, State state)
{
int i = this.calculateOutput(worldIn, pos, state);
TileEntity tileentity = worldIn.getTileEntity(pos);
int j = 0;
if (tileentity instanceof TileEntityComparator)
{
TileEntityComparator tileentitycomparator = (TileEntityComparator)tileentity;
j = tileentitycomparator.getOutputSignal();
tileentitycomparator.setOutputSignal(i);
}
if (j != i || state.getValue(MODE) == BlockRedstoneComparator.Mode.COMPARE)
{
boolean flag1 = this.shouldBePowered(worldIn, pos, state);
boolean flag = this.isPowered(state);
if (flag && !flag1)
{
worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(false)), 2);
}
else if (!flag && flag1)
{
worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 2);
}
this.notifyNeighbors(worldIn, pos, state);
}
}
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{
if (this.isRepeaterPowered)
{
worldIn.setState(pos, this.getUnpoweredState(state).withProperty(POWERED, Boolean.valueOf(true)), 4);
}
this.onStateChange(worldIn, pos, state);
}
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{
super.onBlockAdded(worldIn, pos, state);
worldIn.setTileEntity(pos, this.createNewTileEntity());
}
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{
super.onBlockRemoved(worldIn, pos, state);
worldIn.removeTileEntity(pos);
this.notifyNeighbors(worldIn, pos, state);
}
/**
* Called on both Client and Server when World#addBlockEvent is called
*/
public boolean onBlockEventReceived(World worldIn, BlockPos pos, State state, int eventID, int eventParam)
{
super.onBlockEventReceived(worldIn, pos, state, eventID, eventParam);
TileEntity tileentity = worldIn.getTileEntity(pos);
return tileentity == null ? false : tileentity.receiveClientEvent(eventID, eventParam);
}
/**
* Returns a new instance of a block's tile entity class. Called on placing the block.
*/
public TileEntity createNewTileEntity()
{
return new TileEntityComparator();
}
protected Property[] getProperties()
{
return new Property[] {FACING, MODE, POWERED};
}
/**
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
* IBlockstate
*/
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
{
return this.getState().withProperty(FACING, placer.getHorizontalFacing().getOpposite()).withProperty(POWERED, Boolean.valueOf(false)).withProperty(MODE, BlockRedstoneComparator.Mode.COMPARE);
}
public Model getModel(ModelProvider provider, String name, State state) {
return (state.getValue(POWERED) ? (state.getValue(MODE) == Mode.SUBTRACT ? provider.getModel("comparator_on")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(4, 7, 11, 6, 7, 13)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(4, 2, 10, 6, 8, 14)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(3, 2, 11, 7, 8, 13)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(10, 7, 11, 12, 7, 13)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(10, 2, 10, 12, 8, 14)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(9, 2, 11, 13, 8, 13)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(7, 5, 2, 9, 5, 4)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(7, 2, 1, 9, 6, 5)
.w("redstone_torch").uv(6, 5, 10, 9).noCull()
.e("redstone_torch").uv(6, 5, 10, 9).noCull()
.add(6, 2, 2, 10, 6, 4)
.n("redstone_torch").uv(6, 5, 10, 9).noCull()
.s("redstone_torch").uv(6, 5, 10, 9).noCull() : provider.getModel("comparator_on")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(4, 7, 11, 6, 7, 13)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(4, 2, 10, 6, 8, 14)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(3, 2, 11, 7, 8, 13)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(10, 7, 11, 12, 7, 13)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(10, 2, 10, 12, 8, 14)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(9, 2, 11, 13, 8, 13)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(7, 2, 2, 9, 4, 4)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 8).noCull())
: (state.getValue(MODE) == Mode.SUBTRACT ? provider.getModel("comparator_off")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(4, 2, 11, 6, 7, 13)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.add(10, 2, 11, 12, 7, 13)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.add(7, 5, 2, 9, 5, 4)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(7, 2, 1, 9, 6, 5)
.w("redstone_torch").uv(6, 5, 10, 9).noCull()
.e("redstone_torch").uv(6, 5, 10, 9).noCull()
.add(6, 2, 2, 10, 6, 4)
.n("redstone_torch").uv(6, 5, 10, 9).noCull()
.s("redstone_torch").uv(6, 5, 10, 9).noCull() : provider.getModel("comparator_off")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(4, 2, 11, 6, 7, 13)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.add(10, 2, 11, 12, 7, 13)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.add(7, 2, 2, 9, 4, 4)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()))
.rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite()));
}
protected Item getItemToRegister() {
return this.isRepeaterPowered ? null : new ItemSmallBlock(this).setDisplay("Redstone-Komparator").setTab(CheatTab.TECHNOLOGY);
}
public static enum Mode implements Identifyable
{
COMPARE("compare"),
SUBTRACT("subtract");
private final String name;
private Mode(String name)
{
this.name = name;
}
public String toString()
{
return this.name;
}
public String getName()
{
return this.name;
}
}
}

View file

@ -1,298 +0,0 @@
package common.block.tech;
import common.block.Block;
import common.block.Rotatable;
import common.block.Material;
import common.entity.types.EntityLiving;
import common.init.Blocks;
import common.item.ItemStack;
import common.model.BlockLayer;
import common.rng.Random;
import common.util.BlockPos;
import common.util.Facing;
import common.world.IWorldAccess;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
public abstract class BlockRedstoneDiode extends Block implements Rotatable
{
/** Tells whether the repeater is powered or not */
protected final boolean isRepeaterPowered;
public BlockRedstoneDiode(boolean powered)
{
super(Material.SMALL);
this.isRepeaterPowered = powered;
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.125F, 1.0F);
}
public boolean isFullCube()
{
return false;
}
public boolean canPlaceBlockAt(World worldIn, BlockPos pos)
{
return worldIn.isBlockSolid(pos.down()) ? super.canPlaceBlockAt(worldIn, pos) : false;
}
public boolean canBlockStay(World worldIn, BlockPos pos)
{
return worldIn.isBlockSolid(pos.down());
}
/**
* Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.)
*/
public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random)
{
}
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{
if (!this.isLocked(worldIn, pos, state))
{
boolean flag = this.shouldBePowered(worldIn, pos, state);
if (this.isRepeaterPowered && !flag)
{
worldIn.setState(pos, this.getUnpoweredState(state), 2);
}
else if (!this.isRepeaterPowered)
{
worldIn.setState(pos, this.getPoweredState(state), 2);
if (!flag)
{
worldIn.updateBlockTick(pos, this.getPoweredState(state).getBlock(), this.getTickDelay(state), -1);
}
}
}
}
public boolean shouldSideBeRendered(IWorldAccess worldIn, BlockPos pos, Facing side)
{
return side.getAxis() != Facing.Axis.Y;
}
protected boolean isPowered(State state)
{
return this.isRepeaterPowered;
}
public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
{
return this.getWeakPower(worldIn, pos, state, side);
}
public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
{
return !this.isPowered(state) ? 0 : (state.getValue(FACING) == side ? this.getActiveSignal(worldIn, pos, state) : 0);
}
/**
* Called when a neighboring block changes.
*/
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
{
if (this.canBlockStay(worldIn, pos))
{
this.updateState(worldIn, pos, state);
}
else
{
this.dropBlockAsItem(worldIn, pos, state, 0);
worldIn.setBlockToAir(pos);
for (Facing enumfacing : Facing.values())
{
worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this);
}
}
}
protected void updateState(World worldIn, BlockPos pos, State state)
{
if (!this.isLocked(worldIn, pos, state))
{
boolean flag = this.shouldBePowered(worldIn, pos, state);
if ((this.isRepeaterPowered && !flag || !this.isRepeaterPowered && flag) && (worldIn.client || !((AWorldServer)worldIn).isBlockTickPending(pos, this)))
{
int i = -1;
if (this.isFacingTowardsRepeater(worldIn, pos, state))
{
i = -3;
}
else if (this.isRepeaterPowered)
{
i = -2;
}
if(!worldIn.client)
((AWorldServer)worldIn).updateBlockTick(pos, this, this.getDelay(state), i);
}
}
}
public boolean isLocked(IWorldAccess worldIn, BlockPos pos, State state)
{
return false;
}
protected boolean shouldBePowered(World worldIn, BlockPos pos, State state)
{
return this.calculateInputStrength(worldIn, pos, state) > 0;
}
protected int calculateInputStrength(World worldIn, BlockPos pos, State state)
{
Facing enumfacing = (Facing)state.getValue(FACING);
BlockPos blockpos = pos.offset(enumfacing);
int i = worldIn.getRedstonePower(blockpos, enumfacing);
if (i >= 15)
{
return i;
}
else
{
State iblockstate = worldIn.getState(blockpos);
return Math.max(i, iblockstate.getBlock() == Blocks.redstone ? ((Integer)iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() : 0);
}
}
protected int getPowerOnSides(IWorldAccess worldIn, BlockPos pos, State state)
{
Facing enumfacing = (Facing)state.getValue(FACING);
Facing enumfacing1 = enumfacing.rotateY();
Facing enumfacing2 = enumfacing.rotateYCCW();
return Math.max(this.getPowerOnSide(worldIn, pos.offset(enumfacing1), enumfacing1), this.getPowerOnSide(worldIn, pos.offset(enumfacing2), enumfacing2));
}
protected int getPowerOnSide(IWorldAccess worldIn, BlockPos pos, Facing side)
{
State iblockstate = worldIn.getState(pos);
Block block = iblockstate.getBlock();
return this.canPowerSide(block) ? (block == Blocks.redstone ? ((Integer)iblockstate.getValue(BlockRedstoneWire.POWER)).intValue() : iblockstate.getBlock().getStrongPower(worldIn, pos, iblockstate, side)) : 0;
}
/**
* Can this block provide power. Only wire currently seems to have this change based on its state.
*/
public boolean canProvidePower()
{
return true;
}
/**
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the
* IBlockstate
*/
public State onBlockPlaced(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
{
return this.getState().withProperty(FACING, placer.getHorizontalFacing().getOpposite());
}
/**
* Called by ItemBlocks after a block is set in the world, to allow post-place logic
*/
public void onBlockPlacedBy(World worldIn, BlockPos pos, State state, EntityLiving placer, ItemStack stack)
{
if (this.shouldBePowered(worldIn, pos, state))
{
worldIn.scheduleUpdate(pos, this, 1);
}
}
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{
this.notifyNeighbors(worldIn, pos, state);
}
protected void notifyNeighbors(World worldIn, BlockPos pos, State state)
{
Facing enumfacing = (Facing)state.getValue(FACING);
BlockPos blockpos = pos.offset(enumfacing.getOpposite());
worldIn.notifyBlockOfStateChange(blockpos, this);
worldIn.notifyNeighborsOfStateExcept(blockpos, this, enumfacing);
}
/**
* Called when a player destroys this Block
*/
public void onBlockDestroyedByPlayer(World worldIn, BlockPos pos, State state)
{
if (this.isRepeaterPowered)
{
for (Facing enumfacing : Facing.values())
{
worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this);
}
}
super.onBlockDestroyedByPlayer(worldIn, pos, state);
}
/**
* Used to determine ambient occlusion and culling when rebuilding chunks for render
*/
public boolean isOpaqueCube()
{
return false;
}
protected boolean canPowerSide(Block blockIn)
{
return blockIn.canProvidePower();
}
protected int getActiveSignal(IWorldAccess worldIn, BlockPos pos, State state)
{
return 15;
}
public static boolean isRedstoneRepeaterBlockID(Block blockIn)
{
return Blocks.repeater.isAssociated(blockIn) || Blocks.comparator.isAssociated(blockIn);
}
public boolean isAssociated(Block other)
{
return other == this.getPoweredState(this.getState()).getBlock() || other == this.getUnpoweredState(this.getState()).getBlock();
}
public boolean isFacingTowardsRepeater(World worldIn, BlockPos pos, State state)
{
Facing enumfacing = ((Facing)state.getValue(FACING)).getOpposite();
BlockPos blockpos = pos.offset(enumfacing);
return isRedstoneRepeaterBlockID(worldIn.getState(blockpos).getBlock()) ? worldIn.getState(blockpos).getValue(FACING) != enumfacing : false;
}
protected int getTickDelay(State state)
{
return this.getDelay(state);
}
protected abstract int getDelay(State state);
protected abstract State getPoweredState(State unpoweredState);
protected abstract State getUnpoweredState(State poweredState);
public boolean isAssociatedBlock(Block other)
{
return this.isAssociated(other);
}
public BlockLayer getBlockLayer()
{
return BlockLayer.CUTOUT;
}
public boolean isMagnetic() {
return true;
}
}

View file

@ -1,99 +0,0 @@
package common.block.tech;
import common.block.Block;
import common.block.Material;
import common.init.Blocks;
import common.init.Items;
import common.item.Item;
import common.item.ItemStack;
import common.rng.Random;
import common.util.BlockPos;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
public class BlockRedstoneLight extends Block
{
private final boolean isOn;
public BlockRedstoneLight(boolean isOn)
{
super(Material.LOOSE);
this.isOn = isOn;
if (isOn)
{
this.setLightLevel(1.0F);
}
}
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{
if (!worldIn.client)
{
if (this.isOn && !worldIn.isBlockPowered(pos))
{
worldIn.setState(pos, Blocks.redstone_lamp.getState(), 2);
}
else if (!this.isOn && worldIn.isBlockPowered(pos))
{
worldIn.setState(pos, Blocks.lit_redstone_lamp.getState(), 2);
}
}
}
/**
* Called when a neighboring block changes.
*/
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
{
if (!worldIn.client)
{
if (this.isOn && !worldIn.isBlockPowered(pos))
{
worldIn.scheduleUpdate(pos, this, 4);
}
else if (!this.isOn && worldIn.isBlockPowered(pos))
{
worldIn.setState(pos, Blocks.lit_redstone_lamp.getState(), 2);
}
}
}
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{
// if (!worldIn.client)
// {
if (this.isOn && !worldIn.isBlockPowered(pos))
{
worldIn.setState(pos, Blocks.redstone_lamp.getState(), 2);
}
// }
}
/**
* Get the Item that this Block should drop when harvested.
*/
public Item getItemDropped(State state, Random rand, int fortune)
{
return Items.redstone_lamp;
}
public Item getItem(World worldIn, BlockPos pos)
{
return Items.redstone_lamp;
}
public ItemStack createStackedBlock(State state)
{
return new ItemStack(Items.redstone_lamp);
}
public boolean isMagnetic() {
return true;
}
protected Item getItemToRegister() {
return this.isOn ? null : super.getItemToRegister();
}
}

View file

@ -1,562 +0,0 @@
package common.block.tech;
import common.block.Block;
import common.entity.npc.EntityNPC;
import common.init.Blocks;
import common.init.Items;
import common.item.CheatTab;
import common.item.Item;
import common.item.block.ItemSmallBlock;
import common.model.Model;
import common.model.ModelProvider;
import common.model.ModelRotation;
import common.properties.Property;
import common.properties.PropertyBool;
import common.properties.PropertyInteger;
import common.rng.Random;
import common.util.BlockPos;
import common.util.Facing;
import common.util.ParticleType;
import common.world.IWorldAccess;
import common.world.AWorldClient;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
public class BlockRedstoneRepeater extends BlockRedstoneDiode
{
public static final PropertyBool LOCKED = PropertyBool.create("locked");
public static final PropertyInteger DELAY = PropertyInteger.create("delay", 1, 4);
public BlockRedstoneRepeater(boolean powered)
{
super(powered);
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(DELAY, Integer.valueOf(1)).withProperty(LOCKED, Boolean.valueOf(false)));
}
// /**
// * Gets the localized name of this block. Used for the statistics page.
// */
// public String getLocalizedName()
// {
// return "Redstone-Verstärker";
// }
/**
* 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)
{
return state.withProperty(LOCKED, Boolean.valueOf(this.isLocked(worldIn, pos, state)));
}
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ)
{
// if (!playerIn.capabilities.allowEdit)
// {
// return false;
// }
// else
// {
worldIn.setState(pos, state.cycleProperty(DELAY), 3);
return true;
// }
}
protected int getDelay(State state)
{
return ((Integer)state.getValue(DELAY)).intValue() * 2;
}
protected State getPoweredState(State unpoweredState)
{
Integer integer = (Integer)unpoweredState.getValue(DELAY);
Boolean obool = (Boolean)unpoweredState.getValue(LOCKED);
Facing enumfacing = (Facing)unpoweredState.getValue(FACING);
return Blocks.powered_repeater.getState().withProperty(FACING, enumfacing).withProperty(DELAY, integer).withProperty(LOCKED, obool);
}
protected State getUnpoweredState(State poweredState)
{
Integer integer = (Integer)poweredState.getValue(DELAY);
Boolean obool = (Boolean)poweredState.getValue(LOCKED);
Facing enumfacing = (Facing)poweredState.getValue(FACING);
return Blocks.repeater.getState().withProperty(FACING, enumfacing).withProperty(DELAY, integer).withProperty(LOCKED, obool);
}
/**
* Get the Item that this Block should drop when harvested.
*/
public Item getItemDropped(State state, Random rand, int fortune)
{
return Items.repeater;
}
public Item getItem(World worldIn, BlockPos pos)
{
return Items.repeater;
}
public boolean isLocked(IWorldAccess worldIn, BlockPos pos, State state)
{
return this.getPowerOnSides(worldIn, pos, state) > 0;
}
protected boolean canPowerSide(Block blockIn)
{
return isRedstoneRepeaterBlockID(blockIn);
}
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{
if (this.isRepeaterPowered)
{
Facing enumfacing = (Facing)state.getValue(FACING);
double d0 = (double)((float)pos.getX() + 0.5F) + (double)(rand.floatv() - 0.5F) * 0.2D;
double d1 = (double)((float)pos.getY() + 0.4F) + (double)(rand.floatv() - 0.5F) * 0.2D;
double d2 = (double)((float)pos.getZ() + 0.5F) + (double)(rand.floatv() - 0.5F) * 0.2D;
float f = -5.0F;
if (rand.chance())
{
f = (float)(((Integer)state.getValue(DELAY)).intValue() * 2 - 1);
}
f = f / 16.0F;
double d3 = (double)(f * (float)enumfacing.getFrontOffsetX());
double d4 = (double)(f * (float)enumfacing.getFrontOffsetZ());
worldIn.spawnParticle(ParticleType.DUST, d0 + d3, d1, d2 + d4, 0xff0000);
}
}
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{
super.onBlockRemoved(worldIn, pos, state);
this.notifyNeighbors(worldIn, pos, state);
}
protected Property[] getProperties()
{
return new Property[] {FACING, DELAY, LOCKED};
}
private static Model getModelOff(int delay) {
switch(delay) {
case 1:
default:
return ModelProvider.getModelProvider().getModel("repeater_off")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(7, 2, 6, 9, 7, 8)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.add(7, 2, 2, 9, 7, 4)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull();
case 2:
return ModelProvider.getModelProvider().getModel("repeater_off")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(7, 2, 8, 9, 7, 10)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.add(7, 2, 2, 9, 7, 4)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull();
case 3:
return ModelProvider.getModelProvider().getModel("repeater_off")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(7, 2, 10, 9, 7, 12)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.add(7, 2, 2, 9, 7, 4)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull();
case 4:
return ModelProvider.getModelProvider().getModel("repeater_off")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(7, 2, 12, 9, 7, 14)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.add(7, 2, 2, 9, 7, 4)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull();
}
}
private static Model getModelOn(int delay) {
switch(delay) {
case 1:
default:
return ModelProvider.getModelProvider().getModel("repeater_on")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(7, 7, 6, 9, 7, 8)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(7, 2, 5, 9, 8, 9)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(6, 2, 6, 10, 8, 8)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(7, 7, 2, 9, 7, 4)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(7, 2, 1, 9, 8, 5)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(6, 2, 2, 10, 8, 4)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull();
case 2:
return ModelProvider.getModelProvider().getModel("repeater_on")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(7, 7, 8, 9, 7, 10)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(7, 2, 7, 9, 8, 11)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(6, 2, 8, 10, 8, 10)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(7, 7, 2, 9, 7, 4)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(7, 2, 1, 9, 8, 5)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(6, 2, 2, 10, 8, 4)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull();
case 3:
return ModelProvider.getModelProvider().getModel("repeater_on")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(7, 7, 10, 9, 7, 12)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(7, 2, 9, 9, 8, 13)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(6, 2, 10, 10, 8, 12)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(7, 7, 2, 9, 7, 4)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(7, 2, 1, 9, 8, 5)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(6, 2, 2, 10, 8, 4)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull();
case 4:
return ModelProvider.getModelProvider().getModel("repeater_on")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(7, 7, 12, 9, 7, 14)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(7, 2, 11, 9, 8, 15)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(6, 2, 12, 10, 8, 14)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(7, 7, 2, 9, 7, 4)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(7, 2, 1, 9, 8, 5)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(6, 2, 2, 10, 8, 4)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull();
}
}
private static Model getModelOffLocked(int delay) {
switch(delay) {
case 1:
default:
return ModelProvider.getModelProvider().getModel("repeater_off")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(2, 2, 6, 14, 4, 8)
.d("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.u("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.n("bedrock").uv(2, 7, 14, 9).noCull()
.s("bedrock").uv(2, 7, 14, 9).noCull()
.w("bedrock").uv(6, 7, 8, 9).noCull()
.e("bedrock").uv(6, 7, 8, 9).noCull()
.add(7, 2, 2, 9, 7, 4)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull();
case 2:
return ModelProvider.getModelProvider().getModel("repeater_off")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(2, 2, 8, 14, 4, 10)
.d("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.u("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.n("bedrock").uv(2, 7, 14, 9).noCull()
.s("bedrock").uv(2, 7, 14, 9).noCull()
.w("bedrock").uv(6, 7, 8, 9).noCull()
.e("bedrock").uv(6, 7, 8, 9).noCull()
.add(7, 2, 2, 9, 7, 4)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull();
case 3:
return ModelProvider.getModelProvider().getModel("repeater_off")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(2, 2, 10, 14, 4, 12)
.d("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.u("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.n("bedrock").uv(2, 7, 14, 9).noCull()
.s("bedrock").uv(2, 7, 14, 9).noCull()
.w("bedrock").uv(6, 7, 8, 9).noCull()
.e("bedrock").uv(6, 7, 8, 9).noCull()
.add(7, 2, 2, 9, 7, 4)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull();
case 4:
return ModelProvider.getModelProvider().getModel("repeater_off")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(2, 2, 12, 14, 4, 14)
.d("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.u("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.n("bedrock").uv(2, 7, 14, 9).noCull()
.s("bedrock").uv(2, 7, 14, 9).noCull()
.w("bedrock").uv(6, 7, 8, 9).noCull()
.e("bedrock").uv(6, 7, 8, 9).noCull()
.add(7, 2, 2, 9, 7, 4)
.d("unlit_redstone_torch").uv(7, 13, 9, 15).noCull()
.u("unlit_redstone_torch").uv(7, 6, 9, 8).noCull()
.n("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.s("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.w("unlit_redstone_torch").uv(7, 6, 9, 11).noCull()
.e("unlit_redstone_torch").uv(7, 6, 9, 11).noCull();
}
}
private static Model getModelOnLocked(int delay) {
switch(delay) {
case 1:
default:
return ModelProvider.getModelProvider().getModel("repeater_on")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(2, 2, 6, 14, 4, 8)
.d("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.u("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.n("bedrock").uv(2, 7, 14, 9).noCull()
.s("bedrock").uv(2, 7, 14, 9).noCull()
.w("bedrock").uv(6, 7, 8, 9).noCull()
.e("bedrock").uv(6, 7, 8, 9).noCull()
.add(7, 7, 2, 9, 7, 4)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(7, 2, 1, 9, 8, 5)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(6, 2, 2, 10, 8, 4)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull();
case 2:
return ModelProvider.getModelProvider().getModel("repeater_on")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(2, 2, 8, 14, 4, 10)
.d("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.u("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.n("bedrock").uv(2, 7, 14, 9).noCull()
.s("bedrock").uv(2, 7, 14, 9).noCull()
.w("bedrock").uv(6, 7, 8, 9).noCull()
.e("bedrock").uv(6, 7, 8, 9).noCull()
.add(7, 7, 2, 9, 7, 4)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(7, 2, 1, 9, 8, 5)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(6, 2, 2, 10, 8, 4)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull();
case 3:
return ModelProvider.getModelProvider().getModel("repeater_on")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(2, 2, 10, 14, 4, 12)
.d("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.u("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.n("bedrock").uv(2, 7, 14, 9).noCull()
.s("bedrock").uv(2, 7, 14, 9).noCull()
.w("bedrock").uv(6, 7, 8, 9).noCull()
.e("bedrock").uv(6, 7, 8, 9).noCull()
.add(7, 7, 2, 9, 7, 4)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(7, 2, 1, 9, 8, 5)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(6, 2, 2, 10, 8, 4)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull();
case 4:
return ModelProvider.getModelProvider().getModel("repeater_on")
.add(0, 0, 0, 16, 2, 16)
.d("concrete_plate").uv(0, 0, 16, 16)
.u().uv(0, 0, 16, 16).noCull()
.n("concrete_plate").uv(0, 14, 16, 16)
.s("concrete_plate").uv(0, 14, 16, 16)
.w("concrete_plate").uv(0, 14, 16, 16)
.e("concrete_plate").uv(0, 14, 16, 16)
.add(2, 2, 12, 14, 4, 14)
.d("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.u("bedrock").uv(7, 2, 9, 14).rot(90).noCull()
.n("bedrock").uv(2, 7, 14, 9).noCull()
.s("bedrock").uv(2, 7, 14, 9).noCull()
.w("bedrock").uv(6, 7, 8, 9).noCull()
.e("bedrock").uv(6, 7, 8, 9).noCull()
.add(7, 7, 2, 9, 7, 4)
.u("redstone_torch").uv(7, 6, 9, 8).noCull()
.add(7, 2, 1, 9, 8, 5)
.w("redstone_torch").uv(6, 5, 10, 11).noCull()
.e("redstone_torch").uv(6, 5, 10, 11).noCull()
.add(6, 2, 2, 10, 8, 4)
.n("redstone_torch").uv(6, 5, 10, 11).noCull()
.s("redstone_torch").uv(6, 5, 10, 11).noCull();
}
}
public Model getModel(ModelProvider provider, String name, State state) {
return (this.isRepeaterPowered ? (state.getValue(LOCKED) ? getModelOnLocked(state.getValue(DELAY)) :
getModelOn(state.getValue(DELAY))) : (state.getValue(LOCKED) ? getModelOffLocked(state.getValue(DELAY)) :
getModelOff(state.getValue(DELAY))))
.rotate(ModelRotation.getNorthRot(state.getValue(FACING).getOpposite()));
}
protected Item getItemToRegister() {
return this.isRepeaterPowered ? null : new ItemSmallBlock(this).setDisplay("Redstone-Verstärker").setTab(CheatTab.TECHNOLOGY);
}
public Property[] getUnsavedProperties() {
return new Property[] {LOCKED};
}
}

View file

@ -1,242 +0,0 @@
package common.block.tech;
import java.util.List;
import java.util.Map;
import common.block.Block;
import common.collect.Lists;
import common.collect.Maps;
import common.init.Blocks;
import common.init.Items;
import common.init.SoundEvent;
import common.item.CheatTab;
import common.item.Item;
import common.rng.Random;
import common.util.BlockPos;
import common.util.Facing;
import common.util.ParticleType;
import common.world.IWorldAccess;
import common.world.AWorldClient;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
public class BlockRedstoneTorch extends BlockTorch
{
private static Map<World, List<BlockRedstoneTorch.Toggle>> toggles = Maps.<World, List<BlockRedstoneTorch.Toggle>>newHashMap();
private final boolean isOn;
private boolean isBurnedOut(AWorldServer worldIn, BlockPos pos, boolean turnOff)
{
if (!toggles.containsKey(worldIn))
{
toggles.put(worldIn, Lists.<BlockRedstoneTorch.Toggle>newArrayList());
}
List<BlockRedstoneTorch.Toggle> list = (List)toggles.get(worldIn);
if (turnOff)
{
list.add(new BlockRedstoneTorch.Toggle(pos, worldIn.getTime()));
}
int i = 0;
for (int j = 0; j < list.size(); ++j)
{
BlockRedstoneTorch.Toggle blockredstonetorch$toggle = (BlockRedstoneTorch.Toggle)list.get(j);
if (blockredstonetorch$toggle.pos.equals(pos))
{
++i;
if (i >= 8)
{
return true;
}
}
}
return false;
}
public BlockRedstoneTorch(boolean isOn)
{
this.isOn = isOn;
// this.setTickRandomly(true);
this.setTab((CheatTab)null);
}
/**
* How many world ticks before ticking
*/
public int tickRate(World worldIn, BlockPos pos)
{
return 2;
}
public void onBlockAdded(AWorldServer worldIn, BlockPos pos, State state)
{
if (this.isOn)
{
for (Facing enumfacing : Facing.values())
{
worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this);
}
}
}
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)
{
if (this.isOn)
{
for (Facing enumfacing : Facing.values())
{
worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this);
}
}
}
public int getWeakPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
{
return this.isOn && state.getValue(FACING) != side ? 15 : 0;
}
private boolean shouldBeOff(World worldIn, BlockPos pos, State state)
{
Facing enumfacing = ((Facing)state.getValue(FACING)).getOpposite();
return worldIn.isSidePowered(pos.offset(enumfacing), enumfacing);
}
/**
* Called randomly when setTickRandomly is set to true (used by e.g. crops to grow, etc.)
*/
public void randomTick(AWorldServer worldIn, BlockPos pos, State state, Random random)
{
}
public void updateTick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{
boolean flag = this.shouldBeOff(worldIn, pos, state);
List<BlockRedstoneTorch.Toggle> list = (List)toggles.get(worldIn);
while (list != null && !list.isEmpty() && worldIn.getTime() - ((BlockRedstoneTorch.Toggle)list.get(0)).time > 60L)
{
list.remove(0);
}
if (this.isOn)
{
if (flag)
{
worldIn.setState(pos, Blocks.unlit_redstone_torch.getState().withProperty(FACING, state.getValue(FACING)), 3);
if (this.isBurnedOut(worldIn, pos, true))
{
worldIn.playSound(SoundEvent.FIZZ, (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), 0.5F);
for (int i = 0; i < 5; ++i)
{
double d0 = (double)pos.getX() + rand.doublev() * 0.6D + 0.2D;
double d1 = (double)pos.getY() + rand.doublev() * 0.6D + 0.2D;
double d2 = (double)pos.getZ() + rand.doublev() * 0.6D + 0.2D;
worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2);
}
worldIn.scheduleUpdate(pos, worldIn.getState(pos).getBlock(), 160);
}
}
}
else if (!flag && !this.isBurnedOut(worldIn, pos, false))
{
worldIn.setState(pos, Blocks.redstone_torch.getState().withProperty(FACING, state.getValue(FACING)), 3);
}
}
/**
* Called when a neighboring block changes.
*/
public void onNeighborBlockChange(World worldIn, BlockPos pos, State state, Block neighborBlock)
{
if (!this.onNeighborChangeInternal(worldIn, pos, state))
{
if (this.isOn == this.shouldBeOff(worldIn, pos, state))
{
worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos));
}
}
}
public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
{
return side == Facing.DOWN ? this.getWeakPower(worldIn, pos, state, side) : 0;
}
/**
* Get the Item that this Block should drop when harvested.
*/
public Item getItemDropped(State state, Random rand, int fortune)
{
return Items.redstone_torch;
}
/**
* Can this block provide power. Only wire currently seems to have this change based on its state.
*/
public boolean canProvidePower()
{
return true;
}
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{
if (this.isOn)
{
double d0 = (double)pos.getX() + 0.5D + (rand.doublev() - 0.5D) * 0.2D;
double d1 = (double)pos.getY() + 0.7D + (rand.doublev() - 0.5D) * 0.2D;
double d2 = (double)pos.getZ() + 0.5D + (rand.doublev() - 0.5D) * 0.2D;
Facing enumfacing = (Facing)state.getValue(FACING);
if (enumfacing.getAxis().isHorizontal())
{
Facing enumfacing1 = enumfacing.getOpposite();
double d3 = 0.27D;
d0 += 0.27D * (double)enumfacing1.getFrontOffsetX();
d1 += 0.22D;
d2 += 0.27D * (double)enumfacing1.getFrontOffsetZ();
}
worldIn.spawnParticle(ParticleType.DUST, d0, d1, d2, 0xff0000);
}
}
public Item getItem(World worldIn, BlockPos pos)
{
return Items.redstone_torch;
}
public boolean isAssociatedBlock(Block other)
{
return other == Blocks.unlit_redstone_torch || other == Blocks.redstone_torch;
}
public boolean isMagnetic() {
return true;
}
protected Item getItemToRegister() {
return this.isOn ? super.getItemToRegister() : null;
}
static class Toggle
{
BlockPos pos;
long time;
public Toggle(BlockPos pos, long time)
{
this.pos = pos;
this.time = time;
}
}
}

View file

@ -22,7 +22,6 @@ import common.util.Facing;
import common.world.Explosion; import common.world.Explosion;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.AWorldServer;
public class BlockTNT extends Block public class BlockTNT extends Block
{ {

View file

@ -0,0 +1,66 @@
package common.block.tech;
import common.block.Block;
import common.block.Material;
import common.entity.npc.EntityNPC;
import common.init.Blocks;
import common.init.Items;
import common.item.Item;
import common.item.ItemStack;
import common.rng.Random;
import common.util.BlockPos;
import common.util.Facing;
import common.world.State;
import common.world.World;
public class BlockToggleableLight extends Block {
private final boolean isOn;
public BlockToggleableLight(boolean isOn) {
super(Material.LOOSE);
this.isOn = isOn;
if(isOn)
this.setLightLevel(1.0F);
}
public void toggle(World worldIn, BlockPos pos) {
worldIn.setState(pos, this.isOn ? Blocks.lamp.getState() : Blocks.lit_lamp.getState(), 2);
}
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC player, Facing side, float hitX, float hitY, float hitZ) {
if(!this.isOn) {
if(player.getCurrentEquippedItem() == null)
return super.onBlockActivated(worldIn, pos, state, player, side, hitX, hitY, hitZ);
Item item = player.getCurrentEquippedItem().getItem();
if(item != Items.flint_and_steel && item != Items.fireball)
return super.onBlockActivated(worldIn, pos, state, player, side, hitX, hitY, hitZ);
if(item == Items.flint_and_steel)
player.getCurrentEquippedItem().damage(1, player);
else
player.getCurrentEquippedItem().decrSize();
}
this.toggle(worldIn, pos);
worldIn.playAuxSFX(player, this.isOn ? 1004 : 1007, pos, 0);
return true;
}
public Item getItemDropped(State state, Random rand, int fortune) {
return Items.lamp;
}
public Item getItem(World worldIn, BlockPos pos) {
return Items.lamp;
}
public ItemStack createStackedBlock(State state) {
return new ItemStack(Items.lamp);
}
public boolean isMagnetic() {
return true;
}
protected Item getItemToRegister() {
return this.isOn ? null : super.getItemToRegister();
}
}

View file

@ -5,6 +5,7 @@ import common.block.DirectionalUp;
import common.block.Material; import common.block.Material;
import common.block.artificial.BlockFence; import common.block.artificial.BlockFence;
import common.block.artificial.BlockStainedGlass; import common.block.artificial.BlockStainedGlass;
import common.block.artificial.BlockWall;
import common.entity.types.EntityLiving; import common.entity.types.EntityLiving;
import common.init.Blocks; import common.init.Blocks;
import common.item.CheatTab; import common.item.CheatTab;
@ -13,19 +14,16 @@ import common.model.Model;
import common.model.ModelProvider; import common.model.ModelProvider;
import common.model.ModelRotation; import common.model.ModelRotation;
import common.properties.Property; import common.properties.Property;
import common.rng.Random;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.BoundingBox; import common.util.BoundingBox;
import common.util.Facing; import common.util.Facing;
import common.util.HitPosition; import common.util.HitPosition;
import common.util.ParticleType;
import common.util.Vec3; import common.util.Vec3;
import common.world.AWorldClient;
import common.world.State; import common.world.State;
import common.world.World; import common.world.World;
import common.world.AWorldServer; import common.world.AWorldServer;
public class BlockTorch extends Block implements DirectionalUp public abstract class BlockTorch extends Block implements DirectionalUp
{ {
private static boolean isBlockNormalCube(World world, BlockPos pos, boolean def) { private static boolean isBlockNormalCube(World world, BlockPos pos, boolean def) {
if(!World.isValid(pos) || (world.client && !world.isBlockLoaded(pos, false))) if(!World.isValid(pos) || (world.client && !world.isBlockLoaded(pos, false)))
@ -38,7 +36,6 @@ public class BlockTorch extends Block implements DirectionalUp
{ {
super(Material.SMALL); super(Material.SMALL);
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.UP)); this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.UP));
// this.setTickRandomly(true);
this.setTab(CheatTab.TECHNOLOGY); this.setTab(CheatTab.TECHNOLOGY);
this.setFlatItemTexture(); this.setFlatItemTexture();
} }
@ -70,7 +67,7 @@ public class BlockTorch extends Block implements DirectionalUp
else else
{ {
Block block = worldIn.getState(pos).getBlock(); Block block = worldIn.getState(pos).getBlock();
return block instanceof BlockFence || block == Blocks.glass || block == Blocks.cobblestone_wall || block instanceof BlockStainedGlass; return block instanceof BlockFence || block == Blocks.glass || block instanceof BlockWall || block instanceof BlockStainedGlass;
} }
} }
@ -217,28 +214,6 @@ public class BlockTorch extends Block implements DirectionalUp
return super.collisionRayTrace(worldIn, pos, start, end); return super.collisionRayTrace(worldIn, pos, start, end);
} }
public void randomDisplayTick(AWorldClient worldIn, BlockPos pos, State state, Random rand)
{
Facing enumfacing = (Facing)state.getValue(FACING);
double d0 = (double)pos.getX() + 0.5D;
double d1 = (double)pos.getY() + 0.7D;
double d2 = (double)pos.getZ() + 0.5D;
double d3 = 0.22D;
double d4 = 0.27D;
if (enumfacing.getAxis().isHorizontal())
{
Facing enumfacing1 = enumfacing.getOpposite();
worldIn.spawnParticle(ParticleType.SMOKE, d0 + d4 * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * (double)enumfacing1.getFrontOffsetZ());
worldIn.spawnParticle(ParticleType.FLAME, d0 + d4 * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * (double)enumfacing1.getFrontOffsetZ());
}
else
{
worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2);
worldIn.spawnParticle(ParticleType.FLAME, d0, d1, d2);
}
}
public BlockLayer getBlockLayer() public BlockLayer getBlockLayer()
{ {
return BlockLayer.CUTOUT; return BlockLayer.CUTOUT;

View file

@ -0,0 +1,51 @@
package common.block.tech;
import common.entity.npc.EntityNPC;
import common.init.Items;
import common.item.CheatTab;
import common.item.Item;
import common.util.BlockPos;
import common.util.Facing;
import common.world.State;
import common.world.World;
public class BlockUnlitTorch extends BlockTorch {
private final int particleColor;
private BlockLitTorch lit;
public BlockUnlitTorch(int color) {
this.particleColor = color;
this.setTab(CheatTab.TECHNOLOGY);
}
void setLitTorch(BlockLitTorch lit) {
this.lit = lit;
}
public int getParticleColor() {
return this.particleColor;
}
public boolean onBlockActivated(World worldIn, BlockPos pos, State state, EntityNPC playerIn, Facing side, float hitX, float hitY, float hitZ) {
if(playerIn.getCurrentEquippedItem() != null) {
Item item = playerIn.getCurrentEquippedItem().getItem();
if(item == Items.flint_and_steel || item == Items.fireball) {
worldIn.setState(pos, this.lit.getState().withProperty(FACING, state.getValue(FACING)).withProperty(BlockLitTorch.FUEL, 7), 3);
worldIn.playAuxSFX(playerIn, 1007, pos, 0);
if(item == Items.flint_and_steel) {
playerIn.getCurrentEquippedItem().damage(1, playerIn);
}
else {
playerIn.getCurrentEquippedItem().decrSize();
}
return true;
}
}
return super.onBlockActivated(worldIn, pos, state, playerIn, side, hitX, hitY, hitZ);
}
}

View file

@ -9,10 +9,8 @@ import common.block.Material;
import common.collect.Lists; import common.collect.Lists;
import common.collect.Sets; import common.collect.Sets;
import common.init.Blocks; import common.init.Blocks;
import common.init.Items;
import common.item.Item; import common.item.Item;
import common.item.StackSize; import common.item.block.ItemWire;
import common.item.block.ItemRedstone;
import common.model.BlockLayer; import common.model.BlockLayer;
import common.model.Model; import common.model.Model;
import common.model.ModelProvider; import common.model.ModelProvider;
@ -34,345 +32,345 @@ import common.world.State;
import common.world.World; import common.world.World;
import common.world.AWorldServer; import common.world.AWorldServer;
public class BlockRedstoneWire extends Block public class BlockWire extends Block
{ {
private static final Model redstone_none = ModelProvider.getModelProvider().getModel("redstone_dust_cross") private static final Model wire_none = ModelProvider.getModelProvider().getModel("wire_cross")
.add(5, 0.25f, 5, 11, 0.25f, 11).noShade() .add(5, 0.25f, 5, 11, 0.25f, 11).noShade()
.u().uv(5, 5, 11, 11).tint().noCull() .u().uv(5, 5, 11, 11).tint().noCull()
.add(5, 0.25f, 5, 11, 0.25f, 11).noShade() .add(5, 0.25f, 5, 11, 0.25f, 11).noShade()
.u("redstone_dust_cross_overlay").uv(5, 5, 11, 11).noCull() .u("wire_cross_overlay").uv(5, 5, 11, 11).noCull()
; ;
private static final Model redstone_nsew = ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() private static final Model wire_nsew = ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u().uv(0, 0, 16, 16).tint().noCull() .u().uv(0, 0, 16, 16).tint().noCull()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_cross_overlay").uv(0, 0, 16, 16).noCull() .u("wire_cross_overlay").uv(0, 0, 16, 16).noCull()
; ;
private static final Model redstone_unusueuw = ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() private static final Model wire_unusueuw = ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u().uv(0, 0, 16, 16).tint().noCull() .u().uv(0, 0, 16, 16).tint().noCull()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_cross_overlay").uv(0, 0, 16, 16).noCull() .u("wire_cross_overlay").uv(0, 0, 16, 16).noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(0.25f, 0, 0, 0.25f, 16, 16).noShade() .add(0.25f, 0, 0, 0.25f, 16, 16).noShade()
.e("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .e("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0.25f, 0, 0, 0.25f, 16, 16).noShade() .add(0.25f, 0, 0, 0.25f, 16, 16).noShade()
.e("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .e("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
; ;
private static final Model redstone_unus = ModelProvider.getModelProvider().getModel("redstone_dust_cross") private static final Model wire_unus = ModelProvider.getModelProvider().getModel("wire_cross")
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .u("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .u("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
; ;
private static final Model redstone_ueuw = ModelProvider.getModelProvider().getModel("redstone_dust_cross") private static final Model wire_ueuw = ModelProvider.getModelProvider().getModel("wire_cross")
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_line").uv(0, 0, 16, 16).tint().noCull() .u("wire_line").uv(0, 0, 16, 16).tint().noCull()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_line_overlay").uv(0, 0, 16, 16).noCull() .u("wire_line_overlay").uv(0, 0, 16, 16).noCull()
.add(0.25f, 0, 0, 0.25f, 16, 16).noShade() .add(0.25f, 0, 0, 0.25f, 16, 16).noShade()
.e("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .e("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0.25f, 0, 0, 0.25f, 16, 16).noShade() .add(0.25f, 0, 0, 0.25f, 16, 16).noShade()
.e("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .e("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
; ;
private static Model redstone_n(boolean rot) { private static Model wire_n(boolean rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross") return ModelProvider.getModelProvider().getModel("wire_cross")
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .u("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .u("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.rotate(rot ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0); .rotate(rot ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0);
} }
private static Model redstone_ne(ModelRotation rot) { private static Model wire_ne(ModelRotation rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
.u().uv(5, 0, 16, 11).tint().noCull() .u().uv(5, 0, 16, 11).tint().noCull()
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
.u("redstone_dust_cross_overlay").uv(5, 0, 16, 11).noCull() .u("wire_cross_overlay").uv(5, 0, 16, 11).noCull()
.rotate(rot); .rotate(rot);
} }
private static Model redstone_uew(boolean rot) { private static Model wire_uew(boolean rot) {
Model model = ModelProvider.getModelProvider().getModel("redstone_dust_cross") Model model = ModelProvider.getModelProvider().getModel("wire_cross")
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_line").uv(0, 0, 16, 16).tint().noCull() .u("wire_line").uv(0, 0, 16, 16).tint().noCull()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_line_overlay").uv(0, 0, 16, 16).noCull() .u("wire_line_overlay").uv(0, 0, 16, 16).noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull(); .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull();
return rot ? model.uvLock().rotate(ModelRotation.X0_Y180) : model; return rot ? model.uvLock().rotate(ModelRotation.X0_Y180) : model;
} }
private static Model redstone_nue(ModelRotation rot) { private static Model wire_nue(ModelRotation rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
.u().uv(5, 0, 16, 11).tint().noCull() .u().uv(5, 0, 16, 11).tint().noCull()
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
.u("redstone_dust_cross_overlay").uv(5, 0, 16, 11).noCull() .u("wire_cross_overlay").uv(5, 0, 16, 11).noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line").uv(0, 0, 16, 16).rot(270).tint().noCull() .w("wire_line").uv(0, 0, 16, 16).rot(270).tint().noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(270).noCull() .w("wire_line_overlay").uv(0, 0, 16, 16).rot(270).noCull()
.rotate(rot); .rotate(rot);
} }
private static Model redstone_une(ModelRotation rot) { private static Model wire_une(ModelRotation rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
.u().uv(5, 0, 16, 11).tint().noCull() .u().uv(5, 0, 16, 11).tint().noCull()
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
.u("redstone_dust_cross_overlay").uv(5, 0, 16, 11).noCull() .u("wire_cross_overlay").uv(5, 0, 16, 11).noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.rotate(rot); .rotate(rot);
} }
private static Model redstone_nse(ModelRotation rot) { private static Model wire_nse(ModelRotation rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u().uv(5, 0, 16, 16).tint().noCull() .u().uv(5, 0, 16, 16).tint().noCull()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
.rotate(rot); .rotate(rot);
} }
private static Model redstone_uns(boolean lock, ModelRotation rot) { private static Model wire_uns(boolean lock, ModelRotation rot) {
Model model = ModelProvider.getModelProvider().getModel("redstone_dust_cross") Model model = ModelProvider.getModelProvider().getModel("wire_cross")
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .u("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .u("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.rotate(rot); .rotate(rot);
return lock ? model.uvLock() : model; return lock ? model.uvLock() : model;
} }
private static Model redstone_nsue(ModelRotation rot) { private static Model wire_nsue(ModelRotation rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u().uv(5, 0, 16, 16).tint().noCull() .u().uv(5, 0, 16, 16).tint().noCull()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line").uv(0, 0, 16, 16).rot(270).tint().noCull() .w("wire_line").uv(0, 0, 16, 16).rot(270).tint().noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(270).noCull() .w("wire_line_overlay").uv(0, 0, 16, 16).rot(270).noCull()
.rotate(rot); .rotate(rot);
} }
private static Model redstone_unse(ModelRotation rot) { private static Model wire_unse(ModelRotation rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u().uv(5, 0, 16, 16).tint().noCull() .u().uv(5, 0, 16, 16).tint().noCull()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.rotate(rot); .rotate(rot);
} }
private static Model redstone_nuse(ModelRotation rot) { private static Model wire_nuse(ModelRotation rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u().uv(5, 0, 16, 16).tint().noCull() .u().uv(5, 0, 16, 16).tint().noCull()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.rotate(rot); .rotate(rot);
} }
private static Model redstone_unue(ModelRotation rot) { private static Model wire_unue(ModelRotation rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
.u().uv(5, 0, 16, 11).tint().noCull() .u().uv(5, 0, 16, 11).tint().noCull()
.add(5, 0.25f, 0, 16, 0.25f, 11).noShade() .add(5, 0.25f, 0, 16, 0.25f, 11).noShade()
.u("redstone_dust_cross_overlay").uv(5, 0, 16, 11).noCull() .u("wire_cross_overlay").uv(5, 0, 16, 11).noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.rotate(rot); .rotate(rot);
} }
private static Model redstone_unusue(ModelRotation rot) { private static Model wire_unusue(ModelRotation rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u().uv(5, 0, 16, 16).tint().noCull() .u().uv(5, 0, 16, 16).tint().noCull()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.rotate(rot); .rotate(rot);
} }
private static Model redstone_unusew(boolean rot) { private static Model wire_unusew(boolean rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u().uv(0, 0, 16, 16).tint().noCull() .u().uv(0, 0, 16, 16).tint().noCull()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_cross_overlay").uv(0, 0, 16, 16).noCull() .u("wire_cross_overlay").uv(0, 0, 16, 16).noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.rotate(rot ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0); .rotate(rot ? ModelRotation.X0_Y90 : ModelRotation.X0_Y0);
} }
private static Model redstone_unusuew(ModelRotation rot) { private static Model wire_unusuew(ModelRotation rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u().uv(0, 0, 16, 16).tint().noCull() .u().uv(0, 0, 16, 16).tint().noCull()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_cross_overlay").uv(0, 0, 16, 16).noCull() .u("wire_cross_overlay").uv(0, 0, 16, 16).noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.rotate(rot); .rotate(rot);
} }
private static Model redstone_unuse(ModelRotation rot) { private static Model wire_unuse(ModelRotation rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u().uv(5, 0, 16, 16).tint().noCull() .u().uv(5, 0, 16, 16).tint().noCull()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.rotate(rot); .rotate(rot);
} }
private static Model redstone_nusue(ModelRotation rot) { private static Model wire_nusue(ModelRotation rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u().uv(5, 0, 16, 16).tint().noCull() .u().uv(5, 0, 16, 16).tint().noCull()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .n("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 15.75f, 16, 16, 15.75f).noShade() .add(0, 0, 15.75f, 16, 16, 15.75f).noShade()
.n("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .n("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.rotate(rot); .rotate(rot);
} }
private static Model redstone_unsew(ModelRotation rot) { private static Model wire_unsew(ModelRotation rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u().uv(0, 0, 16, 16).tint().noCull() .u().uv(0, 0, 16, 16).tint().noCull()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_cross_overlay").uv(0, 0, 16, 16).noCull() .u("wire_cross_overlay").uv(0, 0, 16, 16).noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.rotate(rot); .rotate(rot);
} }
private static Model redstone_unsuew(ModelRotation rot) { private static Model wire_unsuew(ModelRotation rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u().uv(0, 0, 16, 16).tint().noCull() .u().uv(0, 0, 16, 16).tint().noCull()
.add(0, 0.25f, 0, 16, 0.25f, 16).noShade() .add(0, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_cross_overlay").uv(0, 0, 16, 16).noCull() .u("wire_cross_overlay").uv(0, 0, 16, 16).noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.rotate(rot); .rotate(rot);
} }
private static Model redstone_unsue(ModelRotation rot) { private static Model wire_unsue(ModelRotation rot) {
return ModelProvider.getModelProvider().getModel("redstone_dust_cross").uvLock() return ModelProvider.getModelProvider().getModel("wire_cross").uvLock()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u().uv(5, 0, 16, 16).tint().noCull() .u().uv(5, 0, 16, 16).tint().noCull()
.add(5, 0.25f, 0, 16, 0.25f, 16).noShade() .add(5, 0.25f, 0, 16, 0.25f, 16).noShade()
.u("redstone_dust_cross_overlay").uv(5, 0, 16, 16).noCull() .u("wire_cross_overlay").uv(5, 0, 16, 16).noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .s("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(0, 0, 0.25f, 16, 16, 0.25f).noShade() .add(0, 0, 0.25f, 16, 16, 0.25f).noShade()
.s("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .s("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line").uv(0, 0, 16, 16).rot(90).tint().noCull() .w("wire_line").uv(0, 0, 16, 16).rot(90).tint().noCull()
.add(15.75f, 0, 0, 15.75f, 16, 16).noShade() .add(15.75f, 0, 0, 15.75f, 16, 16).noShade()
.w("redstone_dust_line_overlay").uv(0, 0, 16, 16).rot(90).noCull() .w("wire_line_overlay").uv(0, 0, 16, 16).rot(90).noCull()
.rotate(rot); .rotate(rot);
} }
public static final PropertyEnum<BlockRedstoneWire.EnumAttachPosition> NORTH = PropertyEnum.<BlockRedstoneWire.EnumAttachPosition>create("north", BlockRedstoneWire.EnumAttachPosition.class); public static final PropertyEnum<EnumAttachPosition> NORTH = PropertyEnum.<EnumAttachPosition>create("north", EnumAttachPosition.class);
public static final PropertyEnum<BlockRedstoneWire.EnumAttachPosition> EAST = PropertyEnum.<BlockRedstoneWire.EnumAttachPosition>create("east", BlockRedstoneWire.EnumAttachPosition.class); public static final PropertyEnum<EnumAttachPosition> EAST = PropertyEnum.<EnumAttachPosition>create("east", EnumAttachPosition.class);
public static final PropertyEnum<BlockRedstoneWire.EnumAttachPosition> SOUTH = PropertyEnum.<BlockRedstoneWire.EnumAttachPosition>create("south", BlockRedstoneWire.EnumAttachPosition.class); public static final PropertyEnum<EnumAttachPosition> SOUTH = PropertyEnum.<EnumAttachPosition>create("south", EnumAttachPosition.class);
public static final PropertyEnum<BlockRedstoneWire.EnumAttachPosition> WEST = PropertyEnum.<BlockRedstoneWire.EnumAttachPosition>create("west", BlockRedstoneWire.EnumAttachPosition.class); public static final PropertyEnum<EnumAttachPosition> WEST = PropertyEnum.<EnumAttachPosition>create("west", EnumAttachPosition.class);
public static final PropertyInteger POWER = PropertyInteger.create("power", 0, 15); public static final PropertyInteger POWER = PropertyInteger.create("power", 0, 15);
private boolean canProvidePower = true; private boolean canProvidePower = true;
private final Set<BlockPos> blocksNeedingUpdate = Sets.<BlockPos>newHashSet(); private final Set<BlockPos> blocksNeedingUpdate = Sets.<BlockPos>newHashSet();
public BlockRedstoneWire() public BlockWire()
{ {
super(Material.SMALL); super(Material.SMALL);
this.setDefaultState(this.getBaseState().withProperty(NORTH, BlockRedstoneWire.EnumAttachPosition.NONE).withProperty(EAST, BlockRedstoneWire.EnumAttachPosition.NONE).withProperty(SOUTH, BlockRedstoneWire.EnumAttachPosition.NONE).withProperty(WEST, BlockRedstoneWire.EnumAttachPosition.NONE).withProperty(POWER, Integer.valueOf(0))); this.setDefaultState(this.getBaseState().withProperty(NORTH, EnumAttachPosition.NONE).withProperty(EAST, EnumAttachPosition.NONE).withProperty(SOUTH, EnumAttachPosition.NONE).withProperty(WEST, EnumAttachPosition.NONE).withProperty(POWER, Integer.valueOf(0)));
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0625F, 1.0F);
} }
@ -389,19 +387,19 @@ public class BlockRedstoneWire extends Block
return state; return state;
} }
private BlockRedstoneWire.EnumAttachPosition getAttachPosition(IBlockAccess worldIn, BlockPos pos, Facing direction) private EnumAttachPosition getAttachPosition(IBlockAccess worldIn, BlockPos pos, Facing direction)
{ {
BlockPos blockpos = pos.offset(direction); BlockPos blockpos = pos.offset(direction);
Block block = worldIn.getState(pos.offset(direction)).getBlock(); Block block = worldIn.getState(pos.offset(direction)).getBlock();
if (!canConnectTo(worldIn.getState(blockpos), direction) && (block.isBlockNormalCube() || !canConnectUpwardsTo(worldIn.getState(blockpos.down())))) if (!this.canConnectTo(worldIn.getState(blockpos), direction) && (block.isBlockNormalCube() || !this.canConnectUpwardsTo(worldIn.getState(blockpos.down()))))
{ {
Block block1 = worldIn.getState(pos.up()).getBlock(); Block block1 = worldIn.getState(pos.up()).getBlock();
return !block1.isBlockNormalCube() && block.isBlockNormalCube() && canConnectUpwardsTo(worldIn.getState(blockpos.up())) ? BlockRedstoneWire.EnumAttachPosition.UP : BlockRedstoneWire.EnumAttachPosition.NONE; return !block1.isBlockNormalCube() && block.isBlockNormalCube() && this.canConnectUpwardsTo(worldIn.getState(blockpos.up())) ? EnumAttachPosition.UP : EnumAttachPosition.NONE;
} }
else else
{ {
return BlockRedstoneWire.EnumAttachPosition.SIDE; return EnumAttachPosition.SIDE;
} }
} }
@ -434,7 +432,7 @@ public class BlockRedstoneWire extends Block
return worldIn.isBlockSolid(pos.down()) || worldIn.getState(pos.down()).getBlock() == Blocks.glowstone; return worldIn.isBlockSolid(pos.down()) || worldIn.getState(pos.down()).getBlock() == Blocks.glowstone;
} }
private State updateSurroundingRedstone(World worldIn, BlockPos pos, State state) private State updateSurroundings(World worldIn, BlockPos pos, State state)
{ {
state = this.calculateCurrentChanges(worldIn, pos, pos, state); state = this.calculateCurrentChanges(worldIn, pos, pos, state);
List<BlockPos> list = Lists.newArrayList(this.blocksNeedingUpdate); List<BlockPos> list = Lists.newArrayList(this.blocksNeedingUpdate);
@ -455,7 +453,7 @@ public class BlockRedstoneWire extends Block
int j = 0; int j = 0;
j = this.getMaxCurrentStrength(worldIn, pos2, j); j = this.getMaxCurrentStrength(worldIn, pos2, j);
this.canProvidePower = false; this.canProvidePower = false;
int k = worldIn.isBlockIndirectlyGettingPowered(pos1); int k = 0; // TODO: worldIn.isBlockIndirectlyGettingPowered(pos1);
this.canProvidePower = true; this.canProvidePower = true;
if (k > 0 && k > j - 1) if (k > 0 && k > j - 1)
@ -527,7 +525,7 @@ public class BlockRedstoneWire extends Block
} }
/** /**
* Calls World.notifyNeighborsOfStateChange() for all neighboring blocks, but only if the given block is a redstone * Calls World.notifyNeighborsOfStateChange() for all neighboring blocks, but only if the given block is a
* wire. * wire.
*/ */
private void notifyWireNeighborsOfStateChange(World worldIn, BlockPos pos) private void notifyWireNeighborsOfStateChange(World worldIn, BlockPos pos)
@ -547,7 +545,7 @@ public class BlockRedstoneWire extends Block
{ {
if (!worldIn.client) if (!worldIn.client)
{ {
this.updateSurroundingRedstone(worldIn, pos, state); this.updateSurroundings(worldIn, pos, state);
for (Facing enumfacing : Facing.Plane.VERTICAL) for (Facing enumfacing : Facing.Plane.VERTICAL)
{ {
@ -586,7 +584,7 @@ public class BlockRedstoneWire extends Block
worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this); worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing), this);
} }
this.updateSurroundingRedstone(worldIn, pos, state); this.updateSurroundings(worldIn, pos, state);
for (Facing enumfacing1 : Facing.Plane.HORIZONTAL) for (Facing enumfacing1 : Facing.Plane.HORIZONTAL)
{ {
@ -631,7 +629,7 @@ public class BlockRedstoneWire extends Block
{ {
if (this.canPlaceBlockAt(worldIn, pos)) if (this.canPlaceBlockAt(worldIn, pos))
{ {
this.updateSurroundingRedstone(worldIn, pos, state); this.updateSurroundings(worldIn, pos, state);
} }
else else
{ {
@ -646,7 +644,7 @@ public class BlockRedstoneWire extends Block
*/ */
public Item getItemDropped(State state, Random rand, int fortune) public Item getItemDropped(State state, Random rand, int fortune)
{ {
return Items.redstone; return this.getItem();
} }
public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side) public int getStrongPower(IWorldAccess worldIn, BlockPos pos, State state, Facing side)
@ -707,32 +705,32 @@ public class BlockRedstoneWire extends Block
Block block = iblockstate.getBlock(); Block block = iblockstate.getBlock();
boolean flag = block.isNormalCube(); boolean flag = block.isNormalCube();
boolean flag1 = worldIn.getState(pos.up()).getBlock().isNormalCube(); boolean flag1 = worldIn.getState(pos.up()).getBlock().isNormalCube();
return !flag1 && flag && canConnectUpwardsTo(worldIn, blockpos.up()) ? true : (canConnectTo(iblockstate, side) ? true : (block == Blocks.powered_repeater && iblockstate.getValue(BlockRedstoneDiode.FACING) == side ? true : !flag && canConnectUpwardsTo(worldIn, blockpos.down()))); return !flag1 && flag && this.canConnectUpwardsTo(worldIn, blockpos.up()) ? true : (this.canConnectTo(iblockstate, side) ? true : /* (block == Blocks.powered_repeater && iblockstate.getValue(BlockwireDiode.FACING) == side ? true : */ !flag && this.canConnectUpwardsTo(worldIn, blockpos.down()));
} }
protected static boolean canConnectUpwardsTo(IBlockAccess worldIn, BlockPos pos) protected boolean canConnectUpwardsTo(IBlockAccess worldIn, BlockPos pos)
{ {
return canConnectUpwardsTo(worldIn.getState(pos)); return this.canConnectUpwardsTo(worldIn.getState(pos));
} }
protected static boolean canConnectUpwardsTo(State state) protected boolean canConnectUpwardsTo(State state)
{ {
return canConnectTo(state, (Facing)null); return this.canConnectTo(state, (Facing)null);
} }
protected static boolean canConnectTo(State blockState, Facing side) protected boolean canConnectTo(State blockState, Facing side)
{ {
Block block = blockState.getBlock(); Block block = blockState.getBlock();
if (block == Blocks.redstone) if (block == this)
{ {
return true; return true;
} }
else if (Blocks.repeater.isAssociated(block)) // else if (Blocks.repeater.isAssociated(block))
{ // {
Facing enumfacing = (Facing)blockState.getValue(BlockRedstoneRepeater.FACING); // Facing enumfacing = (Facing)blockState.getValue(BlockwireRepeater.FACING);
return enumfacing == side || enumfacing.getOpposite() == side; // return enumfacing == side || enumfacing.getOpposite() == side;
} // }
else else
{ {
return block.canProvidePower() && side != null; return block.canProvidePower() && side != null;
@ -791,7 +789,7 @@ public class BlockRedstoneWire extends Block
public Item getItem(World worldIn, BlockPos pos) public Item getItem(World worldIn, BlockPos pos)
{ {
return Items.redstone; return this.getItem();
} }
public BlockLayer getBlockLayer() public BlockLayer getBlockLayer()
@ -823,186 +821,186 @@ public class BlockRedstoneWire extends Block
boolean er = state.getValue(EAST) == EnumAttachPosition.SIDE; boolean er = state.getValue(EAST) == EnumAttachPosition.SIDE;
if(ea && na && sa && wa) if(ea && na && sa && wa)
return redstone_none; return wire_none;
else if(eu && nu && su && wu) else if(eu && nu && su && wu)
return redstone_unusueuw; return wire_unusueuw;
else if(er && nr && sr && wr) else if(er && nr && sr && wr)
return redstone_nsew; return wire_nsew;
else if(ea && nu && su && wa) else if(ea && nu && su && wa)
return redstone_unus; return wire_unus;
else if(eu && na && sa && wu) else if(eu && na && sa && wu)
return redstone_ueuw; return wire_ueuw;
else if(ea && nr && sa && wa) else if(ea && nr && sa && wa)
return redstone_n(false); return wire_n(false);
else if(ea && na && sr && wa) else if(ea && na && sr && wa)
return redstone_n(false); return wire_n(false);
else if(er && na && sa && wa) else if(er && na && sa && wa)
return redstone_n(true); return wire_n(true);
else if(ea && na && sa && wr) else if(ea && na && sa && wr)
return redstone_n(true); return wire_n(true);
else if(ea && nu && sa && wa) else if(ea && nu && sa && wa)
return redstone_uns(false, ModelRotation.X0_Y0); return wire_uns(false, ModelRotation.X0_Y0);
else if(ea && na && su && wa) else if(ea && na && su && wa)
return redstone_uns(true, ModelRotation.X0_Y180); return wire_uns(true, ModelRotation.X0_Y180);
else if(eu && na && sa && wa) else if(eu && na && sa && wa)
return redstone_uew(false); return wire_uew(false);
else if(ea && na && sa && wu) else if(ea && na && sa && wu)
return redstone_uew(true); return wire_uew(true);
else if(er && nr && sa && wa) else if(er && nr && sa && wa)
return redstone_ne(ModelRotation.X0_Y0); return wire_ne(ModelRotation.X0_Y0);
else if(er && nu && sa && wa) else if(er && nu && sa && wa)
return redstone_une(ModelRotation.X0_Y0); return wire_une(ModelRotation.X0_Y0);
else if(eu && nr && sa && wa) else if(eu && nr && sa && wa)
return redstone_nue(ModelRotation.X0_Y0); return wire_nue(ModelRotation.X0_Y0);
else if(eu && nu && sa && wa) else if(eu && nu && sa && wa)
return redstone_unue(ModelRotation.X0_Y0); return wire_unue(ModelRotation.X0_Y0);
else if(er && na && sr && wa) else if(er && na && sr && wa)
return redstone_ne(ModelRotation.X0_Y90); return wire_ne(ModelRotation.X0_Y90);
else if(eu && na && sr && wa) else if(eu && na && sr && wa)
return redstone_une(ModelRotation.X0_Y90); return wire_une(ModelRotation.X0_Y90);
else if(er && na && su && wa) else if(er && na && su && wa)
return redstone_nue(ModelRotation.X0_Y90); return wire_nue(ModelRotation.X0_Y90);
else if(eu && na && su && wa) else if(eu && na && su && wa)
return redstone_unue(ModelRotation.X0_Y90); return wire_unue(ModelRotation.X0_Y90);
else if(ea && na && sr && wr) else if(ea && na && sr && wr)
return redstone_ne(ModelRotation.X0_Y180); return wire_ne(ModelRotation.X0_Y180);
else if(ea && na && su && wr) else if(ea && na && su && wr)
return redstone_une(ModelRotation.X0_Y180); return wire_une(ModelRotation.X0_Y180);
else if(ea && na && sr && wu) else if(ea && na && sr && wu)
return redstone_nue(ModelRotation.X0_Y180); return wire_nue(ModelRotation.X0_Y180);
else if(ea && na && su && wu) else if(ea && na && su && wu)
return redstone_unue(ModelRotation.X0_Y180); return wire_unue(ModelRotation.X0_Y180);
else if(ea && nr && sa && wr) else if(ea && nr && sa && wr)
return redstone_ne(ModelRotation.X0_Y270); return wire_ne(ModelRotation.X0_Y270);
else if(ea && nr && sa && wu) else if(ea && nr && sa && wu)
return redstone_une(ModelRotation.X0_Y270); return wire_une(ModelRotation.X0_Y270);
else if(ea && nu && sa && wr) else if(ea && nu && sa && wr)
return redstone_nue(ModelRotation.X0_Y270); return wire_nue(ModelRotation.X0_Y270);
else if(ea && nu && sa && wu) else if(ea && nu && sa && wu)
return redstone_unue(ModelRotation.X0_Y270); return wire_unue(ModelRotation.X0_Y270);
else if(ea && nr && sr && wa) else if(ea && nr && sr && wa)
return redstone_n(false); return wire_n(false);
else if(ea && nu && sr && wa) else if(ea && nu && sr && wa)
return redstone_uns(false, ModelRotation.X0_Y0); return wire_uns(false, ModelRotation.X0_Y0);
else if(ea && nr && su && wa) else if(ea && nr && su && wa)
return redstone_uns(false, ModelRotation.X0_Y180); return wire_uns(false, ModelRotation.X0_Y180);
else if(er && na && sa && wr) else if(er && na && sa && wr)
return redstone_n(true); return wire_n(true);
else if(eu && na && sa && wr) else if(eu && na && sa && wr)
return redstone_uns(false, ModelRotation.X0_Y90); return wire_uns(false, ModelRotation.X0_Y90);
else if(er && na && sa && wu) else if(er && na && sa && wu)
return redstone_uns(false, ModelRotation.X0_Y270); return wire_uns(false, ModelRotation.X0_Y270);
else if(er && nr && sr && wa) else if(er && nr && sr && wa)
return redstone_nse(ModelRotation.X0_Y0); return wire_nse(ModelRotation.X0_Y0);
else if(er && nu && sr && wa) else if(er && nu && sr && wa)
return redstone_unse(ModelRotation.X0_Y0); return wire_unse(ModelRotation.X0_Y0);
else if(er && nr && su && wa) else if(er && nr && su && wa)
return redstone_nuse(ModelRotation.X0_Y0); return wire_nuse(ModelRotation.X0_Y0);
else if(eu && nr && sr && wa) else if(eu && nr && sr && wa)
return redstone_nsue(ModelRotation.X0_Y0); return wire_nsue(ModelRotation.X0_Y0);
else if(eu && nr && su && wa) else if(eu && nr && su && wa)
return redstone_nusue(ModelRotation.X0_Y0); return wire_nusue(ModelRotation.X0_Y0);
else if(er && nu && su && wa) else if(er && nu && su && wa)
return redstone_unuse(ModelRotation.X0_Y0); return wire_unuse(ModelRotation.X0_Y0);
else if(eu && nu && sr && wa) else if(eu && nu && sr && wa)
return redstone_unsue(ModelRotation.X0_Y0); return wire_unsue(ModelRotation.X0_Y0);
else if(eu && nu && su && wa) else if(eu && nu && su && wa)
return redstone_unusue(ModelRotation.X0_Y0); return wire_unusue(ModelRotation.X0_Y0);
else if(er && na && sr && wr) else if(er && na && sr && wr)
return redstone_nse(ModelRotation.X0_Y90); return wire_nse(ModelRotation.X0_Y90);
else if(eu && na && sr && wr) else if(eu && na && sr && wr)
return redstone_unse(ModelRotation.X0_Y90); return wire_unse(ModelRotation.X0_Y90);
else if(er && na && sr && wu) else if(er && na && sr && wu)
return redstone_nuse(ModelRotation.X0_Y90); return wire_nuse(ModelRotation.X0_Y90);
else if(er && na && su && wr) else if(er && na && su && wr)
return redstone_nsue(ModelRotation.X0_Y90); return wire_nsue(ModelRotation.X0_Y90);
else if(er && na && su && wu) else if(er && na && su && wu)
return redstone_nusue(ModelRotation.X0_Y90); return wire_nusue(ModelRotation.X0_Y90);
else if(eu && na && sr && wu) else if(eu && na && sr && wu)
return redstone_unuse(ModelRotation.X0_Y90); return wire_unuse(ModelRotation.X0_Y90);
else if(eu && na && su && wr) else if(eu && na && su && wr)
return redstone_unsue(ModelRotation.X0_Y90); return wire_unsue(ModelRotation.X0_Y90);
else if(eu && na && su && wu) else if(eu && na && su && wu)
return redstone_unusue(ModelRotation.X0_Y90); return wire_unusue(ModelRotation.X0_Y90);
else if(ea && nr && sr && wr) else if(ea && nr && sr && wr)
return redstone_nse(ModelRotation.X0_Y180); return wire_nse(ModelRotation.X0_Y180);
else if(ea && nr && su && wr) else if(ea && nr && su && wr)
return redstone_unse(ModelRotation.X0_Y180); return wire_unse(ModelRotation.X0_Y180);
else if(ea && nu && sr && wr) else if(ea && nu && sr && wr)
return redstone_nuse(ModelRotation.X0_Y180); return wire_nuse(ModelRotation.X0_Y180);
else if(ea && nr && sr && wu) else if(ea && nr && sr && wu)
return redstone_nsue(ModelRotation.X0_Y180); return wire_nsue(ModelRotation.X0_Y180);
else if(ea && nu && sr && wu) else if(ea && nu && sr && wu)
return redstone_nusue(ModelRotation.X0_Y180); return wire_nusue(ModelRotation.X0_Y180);
else if(ea && nu && su && wr) else if(ea && nu && su && wr)
return redstone_unuse(ModelRotation.X0_Y180); return wire_unuse(ModelRotation.X0_Y180);
else if(ea && nr && su && wu) else if(ea && nr && su && wu)
return redstone_unsue(ModelRotation.X0_Y180); return wire_unsue(ModelRotation.X0_Y180);
else if(ea && nu && su && wu) else if(ea && nu && su && wu)
return redstone_unusue(ModelRotation.X0_Y180); return wire_unusue(ModelRotation.X0_Y180);
else if(er && nr && sa && wr) else if(er && nr && sa && wr)
return redstone_nse(ModelRotation.X0_Y270); return wire_nse(ModelRotation.X0_Y270);
else if(er && nr && sa && wu) else if(er && nr && sa && wu)
return redstone_unse(ModelRotation.X0_Y270); return wire_unse(ModelRotation.X0_Y270);
else if(eu && nr && sa && wr) else if(eu && nr && sa && wr)
return redstone_nuse(ModelRotation.X0_Y270); return wire_nuse(ModelRotation.X0_Y270);
else if(er && nu && sa && wr) else if(er && nu && sa && wr)
return redstone_nsue(ModelRotation.X0_Y270); return wire_nsue(ModelRotation.X0_Y270);
else if(eu && nu && sa && wr) else if(eu && nu && sa && wr)
return redstone_nusue(ModelRotation.X0_Y270); return wire_nusue(ModelRotation.X0_Y270);
else if(eu && nr && sa && wu) else if(eu && nr && sa && wu)
return redstone_unuse(ModelRotation.X0_Y270); return wire_unuse(ModelRotation.X0_Y270);
else if(er && nu && sa && wu) else if(er && nu && sa && wu)
return redstone_unsue(ModelRotation.X0_Y270); return wire_unsue(ModelRotation.X0_Y270);
else if(eu && nu && sa && wu) else if(eu && nu && sa && wu)
return redstone_unusue(ModelRotation.X0_Y270); return wire_unusue(ModelRotation.X0_Y270);
else if(er && nu && sr && wr) else if(er && nu && sr && wr)
return redstone_unsew(ModelRotation.X0_Y0); return wire_unsew(ModelRotation.X0_Y0);
else if(er && nr && su && wr) else if(er && nr && su && wr)
return redstone_unsew(ModelRotation.X0_Y180); return wire_unsew(ModelRotation.X0_Y180);
else if(eu && nr && sr && wr) else if(eu && nr && sr && wr)
return redstone_unsew(ModelRotation.X0_Y90); return wire_unsew(ModelRotation.X0_Y90);
else if(er && nr && sr && wu) else if(er && nr && sr && wu)
return redstone_unsew(ModelRotation.X0_Y270); return wire_unsew(ModelRotation.X0_Y270);
else if(er && nu && su && wr) else if(er && nu && su && wr)
return redstone_unusew(false); return wire_unusew(false);
else if(eu && nr && sr && wu) else if(eu && nr && sr && wu)
return redstone_unusew(true); return wire_unusew(true);
else if(eu && nu && sr && wr) else if(eu && nu && sr && wr)
return redstone_unsuew(ModelRotation.X0_Y0); return wire_unsuew(ModelRotation.X0_Y0);
else if(eu && nr && su && wr) else if(eu && nr && su && wr)
return redstone_unsuew(ModelRotation.X0_Y90); return wire_unsuew(ModelRotation.X0_Y90);
else if(er && nr && su && wu) else if(er && nr && su && wu)
return redstone_unsuew(ModelRotation.X0_Y180); return wire_unsuew(ModelRotation.X0_Y180);
else if(er && nu && sr && wu) else if(er && nu && sr && wu)
return redstone_unsuew(ModelRotation.X0_Y270); return wire_unsuew(ModelRotation.X0_Y270);
else if(eu && nu && su && wr) else if(eu && nu && su && wr)
return redstone_unusuew(ModelRotation.X0_Y0); return wire_unusuew(ModelRotation.X0_Y0);
else if(eu && nr && su && wu) else if(eu && nr && su && wu)
return redstone_unusuew(ModelRotation.X0_Y90); return wire_unusuew(ModelRotation.X0_Y90);
else if(er && nu && su && wu) else if(er && nu && su && wu)
return redstone_unusuew(ModelRotation.X0_Y180); return wire_unusuew(ModelRotation.X0_Y180);
else if(eu && nu && sr && wu) else if(eu && nu && sr && wu)
return redstone_unusuew(ModelRotation.X0_Y270); return wire_unusuew(ModelRotation.X0_Y270);
else else
return redstone_none; return wire_none;
} }
public Property<?>[] getIgnoredProperties() { public Property<?>[] getIgnoredProperties() {
@ -1010,7 +1008,7 @@ public class BlockRedstoneWire extends Block
} }
protected Item getItemToRegister() { protected Item getItemToRegister() {
return new ItemRedstone(Blocks.redstone).setDisplay("Redstone").setMaxAmount(StackSize.XL); return new ItemWire(this);
} }
public Property[] getUnsavedProperties() { public Property[] getUnsavedProperties() {

View file

@ -1,7 +1,6 @@
package common.entity.item; package common.entity.item;
import common.block.tech.BlockRailBase; import common.block.tech.BlockRail;
import common.block.tech.BlockRailPowered;
import common.entity.DamageSource; import common.entity.DamageSource;
import common.entity.Entity; import common.entity.Entity;
import common.entity.types.EntityLiving; import common.entity.types.EntityLiving;
@ -247,7 +246,7 @@ public abstract class EntityCart extends Entity
int l = ExtMath.floord(this.posY); int l = ExtMath.floord(this.posY);
int i1 = ExtMath.floord(this.posZ); int i1 = ExtMath.floord(this.posZ);
if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(k, l - 1, i1))) if (BlockRail.isRailBlock(this.worldObj, new BlockPos(k, l - 1, i1)))
{ {
--l; --l;
} }
@ -255,14 +254,14 @@ public abstract class EntityCart extends Entity
BlockPos blockpos = new BlockPos(k, l, i1); BlockPos blockpos = new BlockPos(k, l, i1);
State iblockstate = this.worldObj.getState(blockpos); State iblockstate = this.worldObj.getState(blockpos);
if (BlockRailBase.isRailBlock(iblockstate)) if (BlockRail.isRailBlock(iblockstate))
{ {
this.func_180460_a(blockpos, iblockstate); this.moveRailedCart(blockpos, iblockstate);
if (iblockstate.getBlock() == Blocks.activator_rail) // if (iblockstate.getBlock() == Blocks.activator_rail) // TODO: activation
{ // {
this.onActivatorRailPass(k, l, i1, ((Boolean)iblockstate.getValue(BlockRailPowered.POWERED)).booleanValue()); // this.onActivatorRailPass(k, l, i1, ((Boolean)iblockstate.getValue(BlockRailPowered.POWERED)).booleanValue());
} // }
} }
else else
{ {
@ -358,23 +357,23 @@ public abstract class EntityCart extends Entity
} }
protected void func_180460_a(BlockPos p_180460_1_, State p_180460_2_) protected void moveRailedCart(BlockPos pos, State state)
{ {
this.fallDistance = 0.0F; this.fallDistance = 0.0F;
Vec3 vec3 = this.func_70489_a(this.posX, this.posY, this.posZ); Vec3 vec3 = this.func_70489_a(this.posX, this.posY, this.posZ);
this.posY = (double)p_180460_1_.getY(); this.posY = (double)pos.getY();
boolean flag = false; boolean accel = false;
boolean flag1 = false; boolean brake = false;
BlockRailBase blockrailbase = (BlockRailBase)p_180460_2_.getBlock(); BlockRail blockrailbase = (BlockRail)state.getBlock();
if (blockrailbase == Blocks.golden_rail) if (true) // TODO: power!
{ {
flag = ((Boolean)p_180460_2_.getValue(BlockRailPowered.POWERED)).booleanValue(); accel = true; // ((Boolean)state.getValue(BlockRailPowered.POWERED)).booleanValue();
flag1 = !flag; brake = !accel;
} }
double d0 = 0.0078125D; double d0 = 0.0078125D;
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)p_180460_2_.getValue(blockrailbase.getShapeProperty()); BlockRail.EnumRailDirection blockrailbase$enumraildirection = (BlockRail.EnumRailDirection)state.getValue(BlockRail.SHAPE);
switch (blockrailbase$enumraildirection) switch (blockrailbase$enumraildirection)
{ {
@ -434,12 +433,12 @@ public abstract class EntityCart extends Entity
{ {
this.motionX += d7 * 0.1D; this.motionX += d7 * 0.1D;
this.motionZ += d8 * 0.1D; this.motionZ += d8 * 0.1D;
flag1 = false; brake = false;
} }
} }
} }
if (flag1) if (brake)
{ {
double d17 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); double d17 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
@ -458,22 +457,22 @@ public abstract class EntityCart extends Entity
} }
double d18 = 0.0D; double d18 = 0.0D;
double d19 = (double)p_180460_1_.getX() + 0.5D + (double)aint[0][0] * 0.5D; double d19 = (double)pos.getX() + 0.5D + (double)aint[0][0] * 0.5D;
double d20 = (double)p_180460_1_.getZ() + 0.5D + (double)aint[0][2] * 0.5D; double d20 = (double)pos.getZ() + 0.5D + (double)aint[0][2] * 0.5D;
double d21 = (double)p_180460_1_.getX() + 0.5D + (double)aint[1][0] * 0.5D; double d21 = (double)pos.getX() + 0.5D + (double)aint[1][0] * 0.5D;
double d10 = (double)p_180460_1_.getZ() + 0.5D + (double)aint[1][2] * 0.5D; double d10 = (double)pos.getZ() + 0.5D + (double)aint[1][2] * 0.5D;
d1 = d21 - d19; d1 = d21 - d19;
d2 = d10 - d20; d2 = d10 - d20;
if (d1 == 0.0D) if (d1 == 0.0D)
{ {
this.posX = (double)p_180460_1_.getX() + 0.5D; this.posX = (double)pos.getX() + 0.5D;
d18 = this.posZ - (double)p_180460_1_.getZ(); d18 = this.posZ - (double)pos.getZ();
} }
else if (d2 == 0.0D) else if (d2 == 0.0D)
{ {
this.posZ = (double)p_180460_1_.getZ() + 0.5D; this.posZ = (double)pos.getZ() + 0.5D;
d18 = this.posX - (double)p_180460_1_.getX(); d18 = this.posX - (double)pos.getX();
} }
else else
{ {
@ -499,11 +498,11 @@ public abstract class EntityCart extends Entity
d23 = ExtMath.clampd(d23, -d13, d13); d23 = ExtMath.clampd(d23, -d13, d13);
this.moveEntity(d22, 0.0D, d23); this.moveEntity(d22, 0.0D, d23);
if (aint[0][1] != 0 && ExtMath.floord(this.posX) - p_180460_1_.getX() == aint[0][0] && ExtMath.floord(this.posZ) - p_180460_1_.getZ() == aint[0][2]) if (aint[0][1] != 0 && ExtMath.floord(this.posX) - pos.getX() == aint[0][0] && ExtMath.floord(this.posZ) - pos.getZ() == aint[0][2])
{ {
this.setPosition(this.posX, this.posY + (double)aint[0][1], this.posZ); this.setPosition(this.posX, this.posY + (double)aint[0][1], this.posZ);
} }
else if (aint[1][1] != 0 && ExtMath.floord(this.posX) - p_180460_1_.getX() == aint[1][0] && ExtMath.floord(this.posZ) - p_180460_1_.getZ() == aint[1][2]) else if (aint[1][1] != 0 && ExtMath.floord(this.posX) - pos.getX() == aint[1][0] && ExtMath.floord(this.posZ) - pos.getZ() == aint[1][2])
{ {
this.setPosition(this.posX, this.posY + (double)aint[1][1], this.posZ); this.setPosition(this.posX, this.posY + (double)aint[1][1], this.posZ);
} }
@ -528,14 +527,14 @@ public abstract class EntityCart extends Entity
int j = ExtMath.floord(this.posX); int j = ExtMath.floord(this.posX);
int i = ExtMath.floord(this.posZ); int i = ExtMath.floord(this.posZ);
if (j != p_180460_1_.getX() || i != p_180460_1_.getZ()) if (j != pos.getX() || i != pos.getZ())
{ {
d5 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); d5 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
this.motionX = d5 * (double)(j - p_180460_1_.getX()); this.motionX = d5 * (double)(j - pos.getX());
this.motionZ = d5 * (double)(i - p_180460_1_.getZ()); this.motionZ = d5 * (double)(i - pos.getZ());
} }
if (flag) if (accel)
{ {
double d15 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ); double d15 = Math.sqrt(this.motionX * this.motionX + this.motionZ * this.motionZ);
@ -545,24 +544,24 @@ public abstract class EntityCart extends Entity
this.motionX += this.motionX / d15 * d16; this.motionX += this.motionX / d15 * d16;
this.motionZ += this.motionZ / d15 * d16; this.motionZ += this.motionZ / d15 * d16;
} }
else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.EAST_WEST) else if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.EAST_WEST)
{ {
if (this.worldObj.getState(p_180460_1_.west()).getBlock().isNormalCube()) if (this.worldObj.getState(pos.west()).getBlock().isNormalCube())
{ {
this.motionX = 0.02D; this.motionX = 0.02D;
} }
else if (this.worldObj.getState(p_180460_1_.east()).getBlock().isNormalCube()) else if (this.worldObj.getState(pos.east()).getBlock().isNormalCube())
{ {
this.motionX = -0.02D; this.motionX = -0.02D;
} }
} }
else if (blockrailbase$enumraildirection == BlockRailBase.EnumRailDirection.NORTH_SOUTH) else if (blockrailbase$enumraildirection == BlockRail.EnumRailDirection.NORTH_SOUTH)
{ {
if (this.worldObj.getState(p_180460_1_.north()).getBlock().isNormalCube()) if (this.worldObj.getState(pos.north()).getBlock().isNormalCube())
{ {
this.motionZ = 0.02D; this.motionZ = 0.02D;
} }
else if (this.worldObj.getState(p_180460_1_.south()).getBlock().isNormalCube()) else if (this.worldObj.getState(pos.south()).getBlock().isNormalCube())
{ {
this.motionZ = -0.02D; this.motionZ = -0.02D;
} }
@ -605,16 +604,16 @@ public abstract class EntityCart extends Entity
int j = ExtMath.floord(p_70495_3_); int j = ExtMath.floord(p_70495_3_);
int k = ExtMath.floord(p_70495_5_); int k = ExtMath.floord(p_70495_5_);
if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(i, j - 1, k))) if (BlockRail.isRailBlock(this.worldObj, new BlockPos(i, j - 1, k)))
{ {
--j; --j;
} }
State iblockstate = this.worldObj.getState(new BlockPos(i, j, k)); State iblockstate = this.worldObj.getState(new BlockPos(i, j, k));
if (BlockRailBase.isRailBlock(iblockstate)) if (BlockRail.isRailBlock(iblockstate))
{ {
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)iblockstate.getValue(((BlockRailBase)iblockstate.getBlock()).getShapeProperty()); BlockRail.EnumRailDirection blockrailbase$enumraildirection = (BlockRail.EnumRailDirection)iblockstate.getValue(BlockRail.SHAPE);
p_70495_3_ = (double)j; p_70495_3_ = (double)j;
if (blockrailbase$enumraildirection.isAscending()) if (blockrailbase$enumraildirection.isAscending())
@ -654,16 +653,16 @@ public abstract class EntityCart extends Entity
int j = ExtMath.floord(p_70489_3_); int j = ExtMath.floord(p_70489_3_);
int k = ExtMath.floord(p_70489_5_); int k = ExtMath.floord(p_70489_5_);
if (BlockRailBase.isRailBlock(this.worldObj, new BlockPos(i, j - 1, k))) if (BlockRail.isRailBlock(this.worldObj, new BlockPos(i, j - 1, k)))
{ {
--j; --j;
} }
State iblockstate = this.worldObj.getState(new BlockPos(i, j, k)); State iblockstate = this.worldObj.getState(new BlockPos(i, j, k));
if (BlockRailBase.isRailBlock(iblockstate)) if (BlockRail.isRailBlock(iblockstate))
{ {
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = (BlockRailBase.EnumRailDirection)iblockstate.getValue(((BlockRailBase)iblockstate.getBlock()).getShapeProperty()); BlockRail.EnumRailDirection blockrailbase$enumraildirection = (BlockRail.EnumRailDirection)iblockstate.getValue(BlockRail.SHAPE);
int[][] aint = matrix[blockrailbase$enumraildirection.ordinal()]; int[][] aint = matrix[blockrailbase$enumraildirection.ordinal()];
double d0 = 0.0D; double d0 = 0.0D;
double d1 = (double)i + 0.5D + (double)aint[0][0] * 0.5D; double d1 = (double)i + 0.5D + (double)aint[0][0] * 0.5D;

View file

@ -133,48 +133,6 @@ public class EntityLeashKnot extends Entity
} }
} }
// /**
// * checks to make sure painting can be placed there
// */
// public boolean onValidSurface()
// {
// if (!this.worldObj.getCollidingBoundingBoxes(this, this.getEntityBoundingBox()).isEmpty())
// {
// return false;
// }
// else
// {
// int i = Math.max(1, this.getWidthPixels() / 16);
// int j = Math.max(1, this.getHeightPixels() / 16);
// BlockPos blockpos = this.hangingPosition.offset(this.facingDirection.getOpposite());
// Facing enumfacing = this.facingDirection.rotateYCCW();
//
// for (int k = 0; k < i; ++k)
// {
// for (int l = 0; l < j; ++l)
// {
// BlockPos blockpos1 = blockpos.offset(enumfacing, k).up(l);
// Block block = this.worldObj.getState(blockpos1).getBlock();
//
// if (!block.getMaterial().isSolid() && !BlockRedstoneDiode.isRedstoneRepeaterBlockID(block))
// {
// return false;
// }
// }
// }
//
// for (Entity entity : this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox()))
// {
// if (entity instanceof EntityLeashKnot)
// {
// return false;
// }
// }
//
// return true;
// }
// }
/** /**
* Returns true if other Entities should be prevented from moving through this Entity. * Returns true if other Entities should be prevented from moving through this Entity.
*/ */

View file

@ -1,6 +1,6 @@
package common.entity.item; package common.entity.item;
import common.block.tech.BlockRailBase; import common.block.tech.BlockRail;
import common.entity.DamageSource; import common.entity.DamageSource;
import common.entity.Entity; import common.entity.Entity;
import common.entity.EntityType; import common.entity.EntityType;
@ -198,12 +198,12 @@ public class EntityTntCart extends EntityCart
*/ */
public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, State blockStateIn) public float getExplosionResistance(Explosion explosionIn, World worldIn, BlockPos pos, State blockStateIn)
{ {
return !this.isIgnited() || !BlockRailBase.isRailBlock(blockStateIn) && !BlockRailBase.isRailBlock(worldIn, pos.up()) ? super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn) : 0.0F; return !this.isIgnited() || !BlockRail.isRailBlock(blockStateIn) && !BlockRail.isRailBlock(worldIn, pos.up()) ? super.getExplosionResistance(explosionIn, worldIn, pos, blockStateIn) : 0.0F;
} }
public boolean verifyExplosion(Explosion explosionIn, World worldIn, BlockPos pos, State blockStateIn, float p_174816_5_) public boolean verifyExplosion(Explosion explosionIn, World worldIn, BlockPos pos, State blockStateIn, float p_174816_5_)
{ {
return !this.isIgnited() || !BlockRailBase.isRailBlock(blockStateIn) && !BlockRailBase.isRailBlock(worldIn, pos.up()) ? super.verifyExplosion(explosionIn, worldIn, pos, blockStateIn, p_174816_5_) : false; return !this.isIgnited() || !BlockRail.isRailBlock(blockStateIn) && !BlockRail.isRailBlock(worldIn, pos.up()) ? super.verifyExplosion(explosionIn, worldIn, pos, blockStateIn, p_174816_5_) : false;
} }
protected void readEntity(TagObject tagCompund) protected void readEntity(TagObject tagCompund)

View file

@ -66,6 +66,7 @@ import common.item.tool.ItemArmor;
import common.item.tool.ItemBow; import common.item.tool.ItemBow;
import common.item.tool.ItemGunBase; import common.item.tool.ItemGunBase;
import common.item.tool.ItemHoe; import common.item.tool.ItemHoe;
import common.item.tool.ItemKey;
import common.item.tool.ItemPotion; import common.item.tool.ItemPotion;
import common.item.tool.ItemShears; import common.item.tool.ItemShears;
import common.item.tool.ItemSword; import common.item.tool.ItemSword;
@ -4138,7 +4139,7 @@ public abstract class EntityNPC extends EntityLiving
public boolean canOpen(String code) public boolean canOpen(String code)
{ {
ItemStack stack = this.getCurrentEquippedItem(); ItemStack stack = this.getCurrentEquippedItem();
return stack != null && stack.getItem() == Items.key && return stack != null && stack.getItem() instanceof ItemKey &&
stack.hasDisplayName() && stack.getDisplayName().equals(code); stack.hasDisplayName() && stack.getDisplayName().equals(code);
} }

View file

@ -11,7 +11,7 @@ import common.block.artificial.BlockBed;
import common.block.artificial.BlockBookshelf; import common.block.artificial.BlockBookshelf;
import common.block.artificial.BlockCake; import common.block.artificial.BlockCake;
import common.block.artificial.BlockCarpet; import common.block.artificial.BlockCarpet;
import common.block.artificial.BlockCompressedPowered; import common.block.artificial.BlockMagnetic;
import common.block.artificial.BlockDoor; import common.block.artificial.BlockDoor;
import common.block.artificial.BlockDragonEgg; import common.block.artificial.BlockDragonEgg;
import common.block.artificial.BlockFence; import common.block.artificial.BlockFence;
@ -82,7 +82,6 @@ import common.block.natural.BlockObsidian;
import common.block.natural.BlockOre; import common.block.natural.BlockOre;
import common.block.natural.BlockPackedIce; import common.block.natural.BlockPackedIce;
import common.block.natural.BlockPodzol; import common.block.natural.BlockPodzol;
import common.block.natural.BlockRedstoneOre;
import common.block.natural.BlockSandStone; import common.block.natural.BlockSandStone;
import common.block.natural.BlockSlime; import common.block.natural.BlockSlime;
import common.block.natural.BlockSnow; import common.block.natural.BlockSnow;
@ -116,18 +115,14 @@ import common.block.tech.BlockPistonMoving;
import common.block.tech.BlockPressurePlate; import common.block.tech.BlockPressurePlate;
import common.block.tech.BlockPressurePlateWeighted; import common.block.tech.BlockPressurePlateWeighted;
import common.block.tech.BlockRail; import common.block.tech.BlockRail;
import common.block.tech.BlockRailDetector; import common.block.tech.BlockToggleableLight;
import common.block.tech.BlockRailPowered; import common.block.tech.BlockLitTorch;
import common.block.tech.BlockRedstoneComparator; import common.block.tech.BlockWire;
import common.block.tech.BlockRedstoneLight;
import common.block.tech.BlockRedstoneRepeater;
import common.block.tech.BlockRedstoneTorch;
import common.block.tech.BlockRedstoneWire;
import common.block.tech.BlockTNT; import common.block.tech.BlockTNT;
import common.block.tech.BlockTianReactor; import common.block.tech.BlockTianReactor;
import common.block.tech.BlockTorch;
import common.block.tech.BlockTripWire; import common.block.tech.BlockTripWire;
import common.block.tech.BlockTripWireHook; import common.block.tech.BlockTripWireHook;
import common.block.tech.BlockUnlitTorch;
import common.block.tech.BlockWarpChest; import common.block.tech.BlockWarpChest;
import common.block.tech.BlockWorkbench; import common.block.tech.BlockWorkbench;
import common.block.tile.BlockStandingSign; import common.block.tile.BlockStandingSign;
@ -317,11 +312,9 @@ public abstract class BlockRegistry {
.setDisplay("Quarzerz")); .setDisplay("Quarzerz"));
register("black_quartz_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE) register("black_quartz_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE)
.setDisplay("Schwarzes Quarzerz")); .setDisplay("Schwarzes Quarzerz"));
register("charge_ore", (new BlockOre()).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE)
register("redstone_ore", (new BlockRedstoneOre(false)).setHardness(3.0F).setResistance(5.0F).setStepSound(SoundType.STONE) .setDisplay("Geladenes Erz").setMiningLevel(2));
.setDisplay("Redstone-Erz").setTab(CheatTab.GEMS).setMiningLevel(2));
register("lit_redstone_ore", (new BlockRedstoneOre(true)).setLightLevel(0.625F).setHardness(3.0F).setResistance(5.0F)
.setStepSound(SoundType.STONE).setDisplay("Redstone-Erz").setMiningLevel(2));
for(MetalType metal : MetalType.values()) { for(MetalType metal : MetalType.values()) {
// String loc = metal.name.substring(0, 1).toUpperCase() + metal.name.substring(1); // String loc = metal.name.substring(0, 1).toUpperCase() + metal.name.substring(1);
register(metal.name + "_ore", (new BlockMetalOre(metal)).setHardness(3.0F).setResistance(5.0F) register(metal.name + "_ore", (new BlockMetalOre(metal)).setHardness(3.0F).setResistance(5.0F)
@ -414,8 +407,8 @@ public abstract class BlockRegistry {
.setStepSound(SoundType.STONE).setDisplay("Lapislazuliblock").setTab(CheatTab.GEMS).setMiningLevel(1)); .setStepSound(SoundType.STONE).setDisplay("Lapislazuliblock").setTab(CheatTab.GEMS).setMiningLevel(1));
register("emerald_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F) register("emerald_block", (new Block(Material.SOLID)).setHardness(5.0F).setResistance(10.0F)
.setStepSound(SoundType.STONE).setDisplay("Smaragdblock").setTab(CheatTab.GEMS).setMiningLevel(2)); .setStepSound(SoundType.STONE).setDisplay("Smaragdblock").setTab(CheatTab.GEMS).setMiningLevel(2));
register("redstone_block", (new BlockCompressedPowered(Material.SOLID)).setHardness(5.0F).setResistance(10.0F) register("charged_block", (new BlockMagnetic(Material.SOLID)).setHardness(5.0F).setResistance(10.0F)
.setStepSound(SoundType.STONE).setDisplay("Redstone-Block").setTab(CheatTab.TECHNOLOGY)); .setStepSound(SoundType.STONE).setDisplay("Geladener Block").setTab(CheatTab.GEMS));
register("glass", (new BlockGlass()).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Glas")); register("glass", (new BlockGlass()).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Glas"));
for(DyeColor color : DyeColor.values()) { for(DyeColor color : DyeColor.values()) {
@ -439,9 +432,6 @@ public abstract class BlockRegistry {
} }
register("ladder", (new BlockLadder()).setHardness(0.4F).setStepSound(SoundType.LADDER).setDisplay("Leiter").setAxeHarvestable()); register("ladder", (new BlockLadder()).setHardness(0.4F).setStepSound(SoundType.LADDER).setDisplay("Leiter").setAxeHarvestable());
register("torch", (new BlockTorch()).setHardness(0.0F).setLightLevel(0.9375F).setStepSound(SoundType.WOOD).setDisplay("Fackel"));
register("lamp", (new Block(Material.TRANSLUCENT)).setHardness(0.3F).setStepSound(SoundType.GLASS).setLightLevel(1.0F)
.setDisplay("Lampe").setTab(CheatTab.TECHNOLOGY));
register("bookshelf", (new BlockBookshelf()).setHardness(1.5F).setStepSound(SoundType.WOOD).setDisplay("Bücherregal")); register("bookshelf", (new BlockBookshelf()).setHardness(1.5F).setStepSound(SoundType.WOOD).setDisplay("Bücherregal"));
register("cake", (new BlockCake()).setHardness(0.5F).setStepSound(SoundType.CLOTH).setDisplay("Kuchen")); register("cake", (new BlockCake()).setHardness(0.5F).setStepSound(SoundType.CLOTH).setDisplay("Kuchen"));
register("dragon_egg", (new BlockDragonEgg()).setHardness(3.0F).setResistance(15.0F).setStepSound(SoundType.STONE) register("dragon_egg", (new BlockDragonEgg()).setHardness(3.0F).setResistance(15.0F).setStepSound(SoundType.STONE)
@ -645,9 +635,6 @@ public abstract class BlockRegistry {
register("tian_reactor", (new BlockTianReactor()).setHardness(3.0F).setResistance(8.0F).setStepSound(SoundType.STONE).setDisplay("Tianreaktor")); register("tian_reactor", (new BlockTianReactor()).setHardness(3.0F).setResistance(8.0F).setStepSound(SoundType.STONE).setDisplay("Tianreaktor"));
register("rail", (new BlockRail()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Schiene").setMiningLevel(0)); register("rail", (new BlockRail()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Schiene").setMiningLevel(0));
register("golden_rail", (new BlockRailPowered()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Antriebsschiene").setMiningLevel(0));
register("detector_rail", (new BlockRailDetector()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Sensorschiene").setMiningLevel(0));
register("activator_rail", (new BlockRailPowered()).setHardness(0.7F).setStepSound(SoundType.STONE).setDisplay("Aktivierungsschiene").setMiningLevel(0));
register("lever", (new BlockLever()).setHardness(0.5F).setStepSound(SoundType.WOOD).setDisplay("Hebel")); register("lever", (new BlockLever()).setHardness(0.5F).setStepSound(SoundType.WOOD).setDisplay("Hebel"));
@ -664,18 +651,21 @@ public abstract class BlockRegistry {
register("wooden_button", (new BlockButton(true, 30, "oak_planks")).setHardness(0.5F).setStepSound(SoundType.WOOD).setDisplay("Knopf")); register("wooden_button", (new BlockButton(true, 30, "oak_planks")).setHardness(0.5F).setStepSound(SoundType.WOOD).setDisplay("Knopf"));
register("red_button", (new BlockButton(true, 10, "red_button")).setHardness(0.5F).setStepSound(SoundType.STONE).setDisplay("Knopf")); register("red_button", (new BlockButton(true, 10, "red_button")).setHardness(0.5F).setStepSound(SoundType.STONE).setDisplay("Knopf"));
register("redstone", (new BlockRedstoneWire()).setHardness(0.0F).setStepSound(SoundType.STONE).setDisplay("Redstone-Staub")); register("wire", (new BlockWire()).setHardness(0.0F).setStepSound(SoundType.STONE).setDisplay("Kabel"));
register("unlit_redstone_torch", (new BlockRedstoneTorch(false)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Fackel")); BlockUnlitTorch torch;
register("redstone_torch", (new BlockRedstoneTorch(true)).setHardness(0.0F).setLightLevel(0.5F).setStepSound(SoundType.WOOD) register("torch", (torch = new BlockUnlitTorch(0xffffffff)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Fackel"));
.setDisplay("Redstone-Fackel").setTab(CheatTab.TECHNOLOGY)); register("lit_torch", (new BlockLitTorch(torch)).setHardness(0.0F).setLightLevel(0.9375F).setStepSound(SoundType.WOOD).setDisplay("Fackel"));
register("repeater", (new BlockRedstoneRepeater(false)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Verstärker")); BlockUnlitTorch tianTorch;
register("powered_repeater", (new BlockRedstoneRepeater(true)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Verstärker")); register("tian_torch", (tianTorch = new BlockUnlitTorch(0x7f00ff)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Tian-Fackel"));
register("comparator", (new BlockRedstoneComparator(false)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Redstone-Komparator")); register("lit_tian_torch", (new BlockLitTorch(tianTorch)).setHardness(0.0F).setLightLevel(0.5F).setStepSound(SoundType.WOOD)
register("powered_comparator", (new BlockRedstoneComparator(true)).setHardness(0.0F).setLightLevel(0.625F) .setDisplay("Tian-Fackel"));
.setStepSound(SoundType.WOOD).setDisplay("Redstone-Komparator")); BlockUnlitTorch soulTorch;
register("redstone_lamp", (new BlockRedstoneLight(false)).setHardness(0.3F).setStepSound(SoundType.GLASS) register("soul_torch", (soulTorch = new BlockUnlitTorch(0x1f1fff)).setHardness(0.0F).setStepSound(SoundType.WOOD).setDisplay("Seelenfackel"));
.setDisplay("Redstone-Lampe").setTab(CheatTab.TECHNOLOGY)); register("lit_soul_torch", (new BlockLitTorch(soulTorch)).setHardness(0.0F).setLightLevel(0.75F).setStepSound(SoundType.WOOD)
register("lit_redstone_lamp", (new BlockRedstoneLight(true)).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Redstone-Lampe")); .setDisplay("Seelenfackel"));
register("lamp", (new BlockToggleableLight(false)).setHardness(0.3F).setStepSound(SoundType.GLASS)
.setDisplay("Lampe").setTab(CheatTab.TECHNOLOGY));
register("lit_lamp", (new BlockToggleableLight(true)).setHardness(0.3F).setStepSound(SoundType.GLASS).setDisplay("Lampe"));
register("daylight_detector", new BlockDaylightDetector(false).setDisplay("Tageslichtsensor")); register("daylight_detector", new BlockDaylightDetector(false).setDisplay("Tageslichtsensor"));
register("daylight_detector_inverted", new BlockDaylightDetector(true).setDisplay("Tageslichtsensor")); register("daylight_detector_inverted", new BlockDaylightDetector(true).setDisplay("Tageslichtsensor"));
register("tripwire_hook", (new BlockTripWireHook()).setDisplay("Haken")); register("tripwire_hook", (new BlockTripWireHook()).setDisplay("Haken"));

View file

@ -35,7 +35,6 @@ public abstract class Blocks {
public static final BlockSlab acacia_slab = get("acacia_slab"); public static final BlockSlab acacia_slab = get("acacia_slab");
public static final BlockStairs acacia_stairs = get("acacia_stairs"); public static final BlockStairs acacia_stairs = get("acacia_stairs");
public static final BlockStaticLiquid acid = get("acid"); public static final BlockStaticLiquid acid = get("acid");
public static final BlockRailPowered activator_rail = get("activator_rail");
public static final BlockFlower allium = get("allium"); public static final BlockFlower allium = get("allium");
public static final Block aluminium_block = get("aluminium_block"); public static final Block aluminium_block = get("aluminium_block");
public static final BlockOre aluminium_ore = get("aluminium_ore"); public static final BlockOre aluminium_ore = get("aluminium_ore");
@ -166,7 +165,6 @@ public abstract class Blocks {
public static final BlockStairs cobblestone_stairs = get("cobblestone_stairs"); public static final BlockStairs cobblestone_stairs = get("cobblestone_stairs");
public static final BlockWall cobblestone_wall = get("cobblestone_wall"); public static final BlockWall cobblestone_wall = get("cobblestone_wall");
public static final BlockCocoa cocoa = get("cocoa"); public static final BlockCocoa cocoa = get("cocoa");
public static final BlockRedstoneComparator comparator = get("comparator");
public static final BlockWorkbench construction_table = get("construction_table"); public static final BlockWorkbench construction_table = get("construction_table");
public static final Block copper_block = get("copper_block"); public static final Block copper_block = get("copper_block");
public static final BlockOre copper_ore = get("copper_ore"); public static final BlockOre copper_ore = get("copper_ore");
@ -196,7 +194,6 @@ public abstract class Blocks {
public static final BlockDaylightDetector daylight_detector_inverted = get("daylight_detector_inverted"); public static final BlockDaylightDetector daylight_detector_inverted = get("daylight_detector_inverted");
public static final BlockTallGrass dead_bush = get("dead_bush"); public static final BlockTallGrass dead_bush = get("dead_bush");
public static final BlockDeadBush deadbush = get("deadbush"); public static final BlockDeadBush deadbush = get("deadbush");
public static final BlockRailDetector detector_rail = get("detector_rail");
public static final Block diamond_block = get("diamond_block"); public static final Block diamond_block = get("diamond_block");
public static final BlockOre diamond_ore = get("diamond_ore"); public static final BlockOre diamond_ore = get("diamond_ore");
public static final Block dirt = get("dirt"); public static final Block dirt = get("dirt");
@ -246,7 +243,6 @@ public abstract class Blocks {
public static final BlockGlowstone glowstone = get("glowstone"); public static final BlockGlowstone glowstone = get("glowstone");
public static final Block gold_block = get("gold_block"); public static final Block gold_block = get("gold_block");
public static final BlockOre gold_ore = get("gold_ore"); public static final BlockOre gold_ore = get("gold_ore");
public static final BlockRailPowered golden_rail = get("golden_rail");
public static final BlockStaticLiquid goo = get("goo"); public static final BlockStaticLiquid goo = get("goo");
public static final BlockGrass grass = get("grass"); public static final BlockGrass grass = get("grass");
public static final BlockGravel gravel = get("gravel"); public static final BlockGravel gravel = get("gravel");
@ -291,7 +287,6 @@ public abstract class Blocks {
public static final BlockSlab jungle_slab = get("jungle_slab"); public static final BlockSlab jungle_slab = get("jungle_slab");
public static final BlockStairs jungle_stairs = get("jungle_stairs"); public static final BlockStairs jungle_stairs = get("jungle_stairs");
public static final BlockLadder ladder = get("ladder"); public static final BlockLadder ladder = get("ladder");
public static final Block lamp = get("lamp");
public static final Block lapis_block = get("lapis_block"); public static final Block lapis_block = get("lapis_block");
public static final BlockOre lapis_ore = get("lapis_ore"); public static final BlockOre lapis_ore = get("lapis_ore");
public static final BlockDoublePlant large_fern = get("large_fern"); public static final BlockDoublePlant large_fern = get("large_fern");
@ -313,8 +308,6 @@ public abstract class Blocks {
public static final BlockWool lime_wool = get("lime_wool"); public static final BlockWool lime_wool = get("lime_wool");
public static final BlockFurnace lit_furnace = get("lit_furnace"); public static final BlockFurnace lit_furnace = get("lit_furnace");
public static final BlockPumpkin lit_pumpkin = get("lit_pumpkin"); public static final BlockPumpkin lit_pumpkin = get("lit_pumpkin");
public static final BlockRedstoneLight lit_redstone_lamp = get("lit_redstone_lamp");
public static final BlockRedstoneOre lit_redstone_ore = get("lit_redstone_ore");
public static final Block lithium_block = get("lithium_block"); public static final Block lithium_block = get("lithium_block");
public static final BlockOre lithium_ore = get("lithium_ore"); public static final BlockOre lithium_ore = get("lithium_ore");
public static final BlockCarpet magenta_carpet = get("magenta_carpet"); public static final BlockCarpet magenta_carpet = get("magenta_carpet");
@ -407,8 +400,6 @@ public abstract class Blocks {
public static final Block potassium_block = get("potassium_block"); public static final Block potassium_block = get("potassium_block");
public static final BlockOre potassium_ore = get("potassium_ore"); public static final BlockOre potassium_ore = get("potassium_ore");
public static final BlockPotato potato = get("potato"); public static final BlockPotato potato = get("potato");
public static final BlockRedstoneComparator powered_comparator = get("powered_comparator");
public static final BlockRedstoneRepeater powered_repeater = get("powered_repeater");
public static final Block praseodymium_block = get("praseodymium_block"); public static final Block praseodymium_block = get("praseodymium_block");
public static final BlockOre praseodymium_ore = get("praseodymium_ore"); public static final BlockOre praseodymium_ore = get("praseodymium_ore");
public static final BlockPumpkin pumpkin = get("pumpkin"); public static final BlockPumpkin pumpkin = get("pumpkin");
@ -439,13 +430,9 @@ public abstract class Blocks {
public static final BlockFalling red_sand = get("red_sand"); public static final BlockFalling red_sand = get("red_sand");
public static final BlockFlower red_tulip = get("red_tulip"); public static final BlockFlower red_tulip = get("red_tulip");
public static final BlockWool red_wool = get("red_wool"); public static final BlockWool red_wool = get("red_wool");
public static final BlockRedstoneWire redstone = get("redstone"); public static final BlockMagnetic charged_block = get("charged_block");
public static final BlockCompressedPowered redstone_block = get("redstone_block"); public static final BlockOre charge_ore = get("charge_ore");
public static final BlockRedstoneLight redstone_lamp = get("redstone_lamp");
public static final BlockRedstoneOre redstone_ore = get("redstone_ore");
public static final BlockRedstoneTorch redstone_torch = get("redstone_torch");
public static final BlockReed reeds = get("reeds"); public static final BlockReed reeds = get("reeds");
public static final BlockRedstoneRepeater repeater = get("repeater");
public static final Block rock = get("rock"); public static final Block rock = get("rock");
public static final BlockFlower rose = get("rose"); public static final BlockFlower rose = get("rose");
public static final BlockDoublePlant rose_bush = get("rose_bush"); public static final BlockDoublePlant rose_bush = get("rose_bush");
@ -539,12 +526,10 @@ public abstract class Blocks {
public static final BlockTNT tnt_5 = get("tnt_5"); public static final BlockTNT tnt_5 = get("tnt_5");
public static final BlockTNT tnt_6 = get("tnt_6"); public static final BlockTNT tnt_6 = get("tnt_6");
public static final BlockTNT tnt_7 = get("tnt_7"); public static final BlockTNT tnt_7 = get("tnt_7");
public static final BlockTorch torch = get("torch");
public static final BlockTrapDoor trapdoor = get("trapdoor"); public static final BlockTrapDoor trapdoor = get("trapdoor");
public static final BlockTripWireHook tripwire_hook = get("tripwire_hook"); public static final BlockTripWireHook tripwire_hook = get("tripwire_hook");
public static final Block tungsten_block = get("tungsten_block"); public static final Block tungsten_block = get("tungsten_block");
public static final BlockOre tungsten_ore = get("tungsten_ore"); public static final BlockOre tungsten_ore = get("tungsten_ore");
public static final BlockRedstoneTorch unlit_redstone_torch = get("unlit_redstone_torch");
public static final Block uranium_block = get("uranium_block"); public static final Block uranium_block = get("uranium_block");
public static final BlockOre uranium_ore = get("uranium_ore"); public static final BlockOre uranium_ore = get("uranium_ore");
public static final Block vanadium_block = get("vanadium_block"); public static final Block vanadium_block = get("vanadium_block");
@ -599,6 +584,15 @@ public abstract class Blocks {
public static final BlockChest xlarge_chest = get("xlarge_chest"); public static final BlockChest xlarge_chest = get("xlarge_chest");
public static final BlockChest xxlarge_chest = get("xxlarge_chest"); public static final BlockChest xxlarge_chest = get("xxlarge_chest");
public static final BlockChest xxxlarge_chest = get("xxxlarge_chest"); public static final BlockChest xxxlarge_chest = get("xxxlarge_chest");
public static final BlockUnlitTorch torch = get("torch");
public static final BlockLitTorch lit_torch = get("lit_torch");
public static final BlockUnlitTorch tian_torch = get("tian_torch");
public static final BlockLitTorch lit_tian_torch = get("lit_tian_torch");
public static final BlockUnlitTorch soul_torch = get("soul_torch");
public static final BlockLitTorch lit_soul_torch = get("lit_soul_torch");
public static final BlockToggleableLight lamp = get("lamp");
public static final BlockToggleableLight lit_lamp = get("lit_lamp");
public static final BlockWire wire = get("wire");
private static <T extends Block> T get(String id) { private static <T extends Block> T get(String id) {
T block = (T)BlockRegistry.byNameExact(id); T block = (T)BlockRegistry.byNameExact(id);

View file

@ -33,7 +33,7 @@ public abstract class CraftingRegistry
private static final Object[][] COMPRESSED = new Object[][] { private static final Object[][] COMPRESSED = new Object[][] {
{Items.emerald_block, new ItemStack(Items.emerald, 9)}, {Items.emerald_block, new ItemStack(Items.emerald, 9)},
{Items.lapis_block, new ItemStack(Items.lapis_lazuli, 9)}, {Items.lapis_block, new ItemStack(Items.lapis_lazuli, 9)},
{Items.redstone_block, new ItemStack(Items.redstone, 9)}, {Items.charged_block, new ItemStack(Items.charged_powder, 9)},
{Items.coal_block, new ItemStack(Items.coal, 9)}, {Items.coal_block, new ItemStack(Items.coal, 9)},
{Items.hay_block, new ItemStack(Items.wheats, 9)}, {Items.hay_block, new ItemStack(Items.wheats, 9)},
{Items.slime_block, new ItemStack(Items.slime_ball, 9)} {Items.slime_block, new ItemStack(Items.slime_ball, 9)}
@ -153,12 +153,11 @@ public abstract class CraftingRegistry
addShapeless(new ItemStack(Items.mossy_cobblestone), Items.cobblestone, Items.vine); addShapeless(new ItemStack(Items.mossy_cobblestone), Items.cobblestone, Items.vine);
add(new ItemStack(Items.iron_bars, 16), "###", "###", '#', Items.iron_ingot); add(new ItemStack(Items.iron_bars, 16), "###", "###", '#', Items.iron_ingot);
add(new ItemStack(Items.glass_pane, 16), "###", "###", '#', Items.glass); add(new ItemStack(Items.glass_pane, 16), "###", "###", '#', Items.glass);
add(new ItemStack(Items.redstone_lamp, 1), " R ", "RGR", " R ", 'R', Items.redstone, 'G', Items.glowstone); add(new ItemStack(Items.lamp, 1), " R ", "RGR", " R ", 'R', Items.charged_powder, 'G', Items.glowstone);
add(new ItemStack(Items.lamp, 1), " R ", "RGR", " R ", 'R', Items.glass, 'G', Items.glowstone);
add(new ItemStack(Items.effect_generator, 1), "GGG", "GSG", "OOO", 'G', Items.glass, 'S', Items.charge_crystal, 'O', Items.obsidian); add(new ItemStack(Items.effect_generator, 1), "GGG", "GSG", "OOO", 'G', Items.glass, 'S', Items.charge_crystal, 'O', Items.obsidian);
add(new ItemStack(Items.blood_brick, 1), "NN", "NN", 'N', Items.bloodbrick); add(new ItemStack(Items.blood_brick, 1), "NN", "NN", 'N', Items.bloodbrick);
add(new ItemStack(Items.coarse_dirt, 4), "DG", "GD", 'D', Items.dirt, 'G', Items.gravel); add(new ItemStack(Items.coarse_dirt, 4), "DG", "GD", 'D', Items.dirt, 'G', Items.gravel);
add(new ItemStack(Items.lamp, 1), " R ", "RGR", " R ", 'R', Items.glass, 'G', Items.glowstone);
for (DyeColor color : DyeColor.values()) for (DyeColor color : DyeColor.values())
{ {
@ -235,7 +234,7 @@ public abstract class CraftingRegistry
add(new ItemStack(Items.tripwire_hook, 2), "I", "S", "#", '#', planks, 'S', Items.stick, 'I', Items.iron_ingot); add(new ItemStack(Items.tripwire_hook, 2), "I", "S", "#", '#', planks, 'S', Items.stick, 'I', Items.iron_ingot);
add(new ItemStack(Items.wooden_button, 1), "#", '#', planks); add(new ItemStack(Items.wooden_button, 1), "#", '#', planks);
add(new ItemStack(Items.wooden_pressure_plate, 1), "##", '#', planks); add(new ItemStack(Items.wooden_pressure_plate, 1), "##", '#', planks);
add(new ItemStack(Items.piston, 1), "TTT", "#X#", "#R#", '#', Items.cobblestone, 'X', Items.iron_ingot, 'R', Items.redstone, 'T', planks); add(new ItemStack(Items.piston, 1), "TTT", "#X#", "#R#", '#', Items.cobblestone, 'X', Items.iron_ingot, 'R', Items.charged_powder, 'T', planks);
for(DyeColor color : BlockBed.COLORS) { for(DyeColor color : BlockBed.COLORS) {
add(new ItemStack(ItemRegistry.byName(color.getName() + "_bed"), 1), "###", "XXX", '#', BlockWool.getByColor(color).getItem(), 'X', planks); add(new ItemStack(ItemRegistry.byName(color.getName() + "_bed"), 1), "###", "XXX", '#', BlockWool.getByColor(color).getItem(), 'X', planks);
} }
@ -275,9 +274,6 @@ public abstract class CraftingRegistry
add(new ItemStack(Items.torch, 4), "X", "#", 'X', Items.charcoal, '#', Items.stick); add(new ItemStack(Items.torch, 4), "X", "#", 'X', Items.charcoal, '#', Items.stick);
add(new ItemStack(Items.glass_bottle, 3), "# #", " # ", '#', Items.glass); add(new ItemStack(Items.glass_bottle, 3), "# #", " # ", '#', Items.glass);
add(new ItemStack(Items.rail, 16), "X X", "X#X", "X X", 'X', Items.iron_ingot, '#', Items.stick); add(new ItemStack(Items.rail, 16), "X X", "X#X", "X X", 'X', Items.iron_ingot, '#', Items.stick);
add(new ItemStack(Items.golden_rail, 6), "X X", "X#X", "XRX", 'X', Items.gold_ingot, 'R', Items.redstone, '#', Items.stick);
add(new ItemStack(Items.activator_rail, 6), "XSX", "X#X", "XSX", 'X', Items.iron_ingot, '#', Items.redstone_torch, 'S', Items.stick);
add(new ItemStack(Items.detector_rail, 6), "X X", "X#X", "XRX", 'X', Items.iron_ingot, 'R', Items.redstone, '#', Items.stone_pressure_plate);
add(new ItemStack(Items.minecart, 1), "# #", "###", '#', Items.iron_ingot); add(new ItemStack(Items.minecart, 1), "# #", "###", '#', Items.iron_ingot);
add(new ItemStack(Items.cauldron, 1), "# #", "# #", "###", '#', Items.iron_ingot); add(new ItemStack(Items.cauldron, 1), "# #", "# #", "###", '#', Items.iron_ingot);
add(new ItemStack(Items.brewing_stand, 1), " B ", "###", '#', Items.cobblestone, 'B', Items.demon_rod); add(new ItemStack(Items.brewing_stand, 1), " B ", "###", '#', Items.cobblestone, 'B', Items.demon_rod);
@ -301,16 +297,13 @@ public abstract class CraftingRegistry
add(new ItemStack(Items.golden_carrot, 1), "###", "#X#", "###", '#', Items.gold_nugget, 'X', Items.carrot); add(new ItemStack(Items.golden_carrot, 1), "###", "#X#", "###", '#', Items.gold_nugget, 'X', Items.carrot);
add(new ItemStack(Items.speckled_melon, 1), "###", "#X#", "###", '#', Items.gold_nugget, 'X', Items.melon); add(new ItemStack(Items.speckled_melon, 1), "###", "#X#", "###", '#', Items.gold_nugget, 'X', Items.melon);
add(new ItemStack(Items.lever, 1), "X", "#", '#', Items.cobblestone, 'X', Items.stick); add(new ItemStack(Items.lever, 1), "X", "#", '#', Items.cobblestone, 'X', Items.stick);
add(new ItemStack(Items.redstone_torch, 1), "X", "#", '#', Items.stick, 'X', Items.redstone); add(new ItemStack(Items.navigator, 1), " # ", "#X#", " # ", '#', Items.iron_ingot, 'X', Items.charged_powder);
add(new ItemStack(Items.repeater, 1), "#X#", "III", '#', Items.redstone_torch, 'X', Items.redstone, 'I', Items.stone);
add(new ItemStack(Items.comparator, 1), " # ", "#X#", "III", '#', Items.redstone_torch, 'X', Items.quartz, 'I', Items.stone);
add(new ItemStack(Items.navigator, 1), " # ", "#X#", " # ", '#', Items.iron_ingot, 'X', Items.redstone);
add(new ItemStack(Items.stone_button, 1), "#", '#', Items.stone); add(new ItemStack(Items.stone_button, 1), "#", '#', Items.stone);
add(new ItemStack(Items.stone_pressure_plate, 1), "##", '#', Items.stone); add(new ItemStack(Items.stone_pressure_plate, 1), "##", '#', Items.stone);
add(new ItemStack(Items.heavy_weighted_pressure_plate, 1), "##", '#', Items.iron_ingot); add(new ItemStack(Items.heavy_weighted_pressure_plate, 1), "##", '#', Items.iron_ingot);
add(new ItemStack(Items.light_weighted_pressure_plate, 1), "##", '#', Items.gold_ingot); add(new ItemStack(Items.light_weighted_pressure_plate, 1), "##", '#', Items.gold_ingot);
add(new ItemStack(Items.dispenser, 1), "###", "#X#", "#R#", '#', Items.cobblestone, 'X', Items.bow, 'R', Items.redstone); add(new ItemStack(Items.dispenser, 1), "###", "#X#", "#R#", '#', Items.cobblestone, 'X', Items.bow, 'R', Items.charged_powder);
add(new ItemStack(Items.dropper, 1), "###", "# #", "#R#", '#', Items.cobblestone, 'R', Items.redstone); add(new ItemStack(Items.dropper, 1), "###", "# #", "#R#", '#', Items.cobblestone, 'R', Items.charged_powder);
add(new ItemStack(Items.sticky_piston, 1), "S", "P", 'S', Items.slime_ball, 'P', Items.piston); add(new ItemStack(Items.sticky_piston, 1), "S", "P", 'S', Items.slime_ball, 'P', Items.piston);
add(new ItemStack(Items.enchanting_table, 1), " B ", "D#D", "###", '#', Items.obsidian, 'B', Items.book, 'D', Items.diamond); add(new ItemStack(Items.enchanting_table, 1), " B ", "D#D", "###", '#', Items.obsidian, 'B', Items.book, 'D', Items.diamond);
add(new ItemStack(Items.anvil, 1), "III", " i ", "iii", 'I', Items.iron_block, 'i', Items.iron_ingot); add(new ItemStack(Items.anvil, 1), "III", " i ", "iii", 'I', Items.iron_block, 'i', Items.iron_ingot);
@ -334,9 +327,9 @@ public abstract class CraftingRegistry
add(new ItemStack(Items.mob_spawner, 1), "###", "#X#", "###", 'X', Items.charge_crystal, '#', Items.iron_bars); add(new ItemStack(Items.mob_spawner, 1), "###", "#X#", "###", 'X', Items.charge_crystal, '#', Items.iron_bars);
add(new ItemStack(Items.dragon_egg, 1), "###", "#X#", "#D#", 'X', Items.charge_crystal, 'D', Items.diamond, '#', Items.obsidian); add(new ItemStack(Items.dragon_egg, 1), "###", "#X#", "#D#", 'X', Items.charge_crystal, 'D', Items.diamond, '#', Items.obsidian);
add(new ItemStack(Items.red_button, 1), "#", '#', Items.redstone); add(new ItemStack(Items.red_button, 1), "#", '#', Items.charged_powder);
add(new ItemStack(Items.chick_magnet, 1), "A A", "N N", " C ", 'A', Items.aluminium_ingot, 'N', Items.nickel_ingot, 'C', Items.cobalt_ingot); add(new ItemStack(Items.chick_magnet, 1), "A A", "N N", " C ", 'A', Items.aluminium_ingot, 'N', Items.nickel_ingot, 'C', Items.cobalt_ingot);
add(new ItemStack(Items.magnet, 1), "I I", "N N", " R ", 'I', Items.iron_ingot, 'N', Items.neodymium_ingot, 'R', Items.redstone); add(new ItemStack(Items.magnet, 1), "I I", "N N", " R ", 'I', Items.iron_ingot, 'N', Items.neodymium_ingot, 'R', Items.charged_powder);
add(new ItemStack(Items.construction_table), "---", "-#-", "---", '#', Items.workbench, '-', Items.iron_ingot); add(new ItemStack(Items.construction_table), "---", "-#-", "---", '#', Items.workbench, '-', Items.iron_ingot);
add(new ItemStack(Items.bedrock), "#####", "#####", "#####", "#####", "#####", '#', Items.obsidian); add(new ItemStack(Items.bedrock), "#####", "#####", "#####", "#####", "#####", '#', Items.obsidian);

View file

@ -207,7 +207,15 @@ public abstract class ItemRegistry {
register("scanner", (new ItemScanner()).setDisplay("Infowerkzeug")); register("scanner", (new ItemScanner()).setDisplay("Infowerkzeug"));
register("trident", (new ItemTrident()).setDisplay("Geladenes Zepter")); register("trident", (new ItemTrident()).setDisplay("Geladenes Zepter"));
register("banhammer", (new ItemBanHammer()).setDisplay("Hammer der Verbannung")); register("banhammer", (new ItemBanHammer()).setDisplay("Hammer der Verbannung"));
register("key", (new ItemKey()).setDisplay("Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L)); ItemKey key;
register("key", (key = new ItemKey()).setDisplay("Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L));
register("black_key", (new ItemKey()).setDisplay("Schwarzer Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L));
register("shiny_key", (new ItemKey()).setDisplay("Glänzender Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L));
register("rusty_key", (new ItemKey()).setDisplay("Rostiger Schlüssel").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L));
register("red_keycard", (new ItemKey()).setDisplay("Rote Schlüsselkarte").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L));
register("green_keycard", (new ItemKey()).setDisplay("Grüne Schlüsselkarte").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L));
register("blue_keycard", (new ItemKey()).setDisplay("Blaue Schlüsselkarte").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L));
register("black_keycard", (new ItemKey()).setDisplay("Schwarze Schlüsselkarte").setTab(CheatTab.TOOLS).setMaxAmount(StackSize.L));
for(Pair<Integer, TextColor> sides : ItemDie.DIE_SIDES) { for(Pair<Integer, TextColor> sides : ItemDie.DIE_SIDES) {
register("die_" + sides.first(), (new ItemDie(sides.first(), sides.second())).setMaxAmount(StackSize.L)); register("die_" + sides.first(), (new ItemDie(sides.first(), sides.second())).setMaxAmount(StackSize.L));
} }
@ -335,6 +343,8 @@ public abstract class ItemRegistry {
register("dynamite" + (z == 0 ? "" : ("_" + z)), (new ItemDynamite(z)).setDisplay("Dynamit" + Util.getTierSuffix(z)).setColor(TextColor.RED)); register("dynamite" + (z == 0 ? "" : ("_" + z)), (new ItemDynamite(z)).setDisplay("Dynamit" + Util.getTierSuffix(z)).setColor(TextColor.RED));
} }
register("chain", (new ItemMagnetic()).setDisplay("Kette").setTab(CheatTab.MATERIALS)); register("chain", (new ItemMagnetic()).setDisplay("Kette").setTab(CheatTab.MATERIALS));
Item chargedPowder = (new ItemMagnetic()).setDisplay("Geladener Staub").setTab(CheatTab.METALS);
register("charged_powder", chargedPowder);
for(OreType ore : OreType.values()) { for(OreType ore : OreType.values()) {
Item itm = (new Item()).setDisplay(ore.itemDisplay).setTab(CheatTab.METALS); Item itm = (new Item()).setDisplay(ore.itemDisplay).setTab(CheatTab.METALS);
@ -376,11 +386,14 @@ public abstract class ItemRegistry {
register("record_delay", (new ItemRecord()).setDisplay("Protokoll #13 - Verzögerung der Umsetzung")); register("record_delay", (new ItemRecord()).setDisplay("Protokoll #13 - Verzögerung der Umsetzung"));
register("record_extend", (new ItemRecord()).setDisplay("Protokoll #14 - Explosive Erweiterung unseres Labors")); register("record_extend", (new ItemRecord()).setDisplay("Protokoll #14 - Explosive Erweiterung unseres Labors"));
((BlockOre)BlockRegistry.byName("coal_ore")).setDropItem(new ItemStack(coal), 0); Blocks.coal_ore.setDropItem(new ItemStack(coal), 0);
((BlockOre)BlockRegistry.byName("emerald_ore")).setDropItem(new ItemStack(emerald), 3); Blocks.emerald_ore.setDropItem(new ItemStack(emerald), 3);
((BlockOre)BlockRegistry.byName("lapis_ore")).setDropItem(new ItemStack(lapis, 4), 4, 2); Blocks.lapis_ore.setDropItem(new ItemStack(lapis, 4), 4, 2);
((BlockOre)BlockRegistry.byName("quartz_ore")).setDropItem(new ItemStack(quartz), 2); Blocks.quartz_ore.setDropItem(new ItemStack(quartz), 2);
((BlockOre)BlockRegistry.byName("black_quartz_ore")).setDropItem(new ItemStack(bquartz), 3); Blocks.black_quartz_ore.setDropItem(new ItemStack(bquartz), 3);
Blocks.charge_ore.setDropItem(new ItemStack(chargedPowder, 4), 2, 1);
Blocks.iron_door.setKeyItem(key);
Blocks.iron_trapdoor.setKeyItem(key);
Log.SYSTEM.debug("%d Gegenstände registriert", ITEM_MAP.size()); Log.SYSTEM.debug("%d Gegenstände registriert", ITEM_MAP.size());
} }

View file

@ -23,7 +23,7 @@ import common.item.block.ItemLilyPad;
import common.item.block.ItemMetalBlock; import common.item.block.ItemMetalBlock;
import common.item.block.ItemPiston; import common.item.block.ItemPiston;
import common.item.block.ItemPressurePlate; import common.item.block.ItemPressurePlate;
import common.item.block.ItemRedstone; import common.item.block.ItemWire;
import common.item.block.ItemSeedFood; import common.item.block.ItemSeedFood;
import common.item.block.ItemSeeds; import common.item.block.ItemSeeds;
import common.item.block.ItemSign; import common.item.block.ItemSign;
@ -104,7 +104,6 @@ public abstract class Items {
public static final ItemSlab acacia_slab = get("acacia_slab"); public static final ItemSlab acacia_slab = get("acacia_slab");
public static final ItemBlock acacia_stairs = get("acacia_stairs"); public static final ItemBlock acacia_stairs = get("acacia_stairs");
public static final ItemBucket acid_bucket = get("acid_bucket"); public static final ItemBucket acid_bucket = get("acid_bucket");
public static final ItemBlock activator_rail = get("activator_rail");
public static final Item ahrd_fragment = get("ahrd_fragment"); public static final Item ahrd_fragment = get("ahrd_fragment");
public static final ItemBlock allium = get("allium"); public static final ItemBlock allium = get("allium");
public static final ItemMetalBlock aluminium_block = get("aluminium_block"); public static final ItemMetalBlock aluminium_block = get("aluminium_block");
@ -290,7 +289,6 @@ public abstract class Items {
public static final ItemBlock cobblestone_stairs = get("cobblestone_stairs"); public static final ItemBlock cobblestone_stairs = get("cobblestone_stairs");
public static final ItemWall cobblestone_wall = get("cobblestone_wall"); public static final ItemWall cobblestone_wall = get("cobblestone_wall");
public static final ItemDye cocoa = get("cocoa"); public static final ItemDye cocoa = get("cocoa");
public static final ItemSmallBlock comparator = get("comparator");
public static final ItemBlock construction_table = get("construction_table"); public static final ItemBlock construction_table = get("construction_table");
public static final ItemFood cooked_beef = get("cooked_beef"); public static final ItemFood cooked_beef = get("cooked_beef");
public static final ItemFood cooked_chicken = get("cooked_chicken"); public static final ItemFood cooked_chicken = get("cooked_chicken");
@ -326,7 +324,6 @@ public abstract class Items {
public static final ItemBlock daylight_detector = get("daylight_detector"); public static final ItemBlock daylight_detector = get("daylight_detector");
public static final ItemColored dead_bush = get("dead_bush"); public static final ItemColored dead_bush = get("dead_bush");
public static final ItemBlock deadbush = get("deadbush"); public static final ItemBlock deadbush = get("deadbush");
public static final ItemBlock detector_rail = get("detector_rail");
public static final Item diamond = get("diamond"); public static final Item diamond = get("diamond");
public static final ItemAxe diamond_axe = get("diamond_axe"); public static final ItemAxe diamond_axe = get("diamond_axe");
public static final ItemBlock diamond_block = get("diamond_block"); public static final ItemBlock diamond_block = get("diamond_block");
@ -406,7 +403,6 @@ public abstract class Items {
public static final ItemAppleGold golden_apple = get("golden_apple"); public static final ItemAppleGold golden_apple = get("golden_apple");
public static final ItemAppleGold charged_apple = get("charged_apple"); public static final ItemAppleGold charged_apple = get("charged_apple");
public static final ItemFood golden_carrot = get("golden_carrot"); public static final ItemFood golden_carrot = get("golden_carrot");
public static final ItemBlock golden_rail = get("golden_rail");
public static final ItemBucket goo_bucket = get("goo_bucket"); public static final ItemBucket goo_bucket = get("goo_bucket");
public static final ItemColored grass = get("grass"); public static final ItemColored grass = get("grass");
public static final ItemBlock gravel = get("gravel"); public static final ItemBlock gravel = get("gravel");
@ -471,9 +467,7 @@ public abstract class Items {
public static final ItemBlock jungle_sapling = get("jungle_sapling"); public static final ItemBlock jungle_sapling = get("jungle_sapling");
public static final ItemSlab jungle_slab = get("jungle_slab"); public static final ItemSlab jungle_slab = get("jungle_slab");
public static final ItemBlock jungle_stairs = get("jungle_stairs"); public static final ItemBlock jungle_stairs = get("jungle_stairs");
public static final ItemKey key = get("key");
public static final ItemBlock ladder = get("ladder"); public static final ItemBlock ladder = get("ladder");
public static final ItemBlock lamp = get("lamp");
public static final ItemBlock lapis_block = get("lapis_block"); public static final ItemBlock lapis_block = get("lapis_block");
public static final ItemDye lapis_lazuli = get("lapis_lazuli"); public static final ItemDye lapis_lazuli = get("lapis_lazuli");
public static final ItemBlock lapis_ore = get("lapis_ore"); public static final ItemBlock lapis_ore = get("lapis_ore");
@ -693,13 +687,7 @@ public abstract class Items {
public static final ItemBlock red_sand = get("red_sand"); public static final ItemBlock red_sand = get("red_sand");
public static final ItemBlock red_tulip = get("red_tulip"); public static final ItemBlock red_tulip = get("red_tulip");
public static final ItemBlock red_wool = get("red_wool"); public static final ItemBlock red_wool = get("red_wool");
public static final ItemRedstone redstone = get("redstone");
public static final ItemBlock redstone_block = get("redstone_block");
public static final ItemBlock redstone_lamp = get("redstone_lamp");
public static final ItemBlock redstone_ore = get("redstone_ore");
public static final ItemBlock redstone_torch = get("redstone_torch");
public static final ItemSmallBlock reeds = get("reeds"); public static final ItemSmallBlock reeds = get("reeds");
public static final ItemSmallBlock repeater = get("repeater");
public static final ItemBlock rock = get("rock"); public static final ItemBlock rock = get("rock");
public static final ItemBlock rose = get("rose"); public static final ItemBlock rose = get("rose");
public static final ItemDoublePlant rose_bush = get("rose_bush"); public static final ItemDoublePlant rose_bush = get("rose_bush");
@ -825,7 +813,6 @@ public abstract class Items {
public static final ItemBlock tnt_6 = get("tnt_6"); public static final ItemBlock tnt_6 = get("tnt_6");
public static final ItemBlock tnt_7 = get("tnt_7"); public static final ItemBlock tnt_7 = get("tnt_7");
public static final ItemMinecart tnt_minecart = get("tnt_minecart"); public static final ItemMinecart tnt_minecart = get("tnt_minecart");
public static final ItemBlock torch = get("torch");
public static final ItemBlock trapdoor = get("trapdoor"); public static final ItemBlock trapdoor = get("trapdoor");
public static final ItemBlock tripwire_hook = get("tripwire_hook"); public static final ItemBlock tripwire_hook = get("tripwire_hook");
public static final ItemMetalBlock tungsten_block = get("tungsten_block"); public static final ItemMetalBlock tungsten_block = get("tungsten_block");
@ -1008,6 +995,22 @@ public abstract class Items {
public static final ItemChest xlarge_chest = get("xlarge_chest"); public static final ItemChest xlarge_chest = get("xlarge_chest");
public static final ItemChest xxlarge_chest = get("xxlarge_chest"); public static final ItemChest xxlarge_chest = get("xxlarge_chest");
public static final ItemChest xxxlarge_chest = get("xxxlarge_chest"); public static final ItemChest xxxlarge_chest = get("xxxlarge_chest");
public static final ItemKey key = get("key");
public static final ItemKey black_key = get("black_key");
public static final ItemKey black_keycard = get("black_keycard");
public static final ItemKey blue_keycard = get("blue_keycard");
public static final ItemKey green_keycard = get("green_keycard");
public static final ItemKey red_keycard = get("red_keycard");
public static final ItemKey rusty_key = get("rusty_key");
public static final ItemKey shiny_key = get("shiny_key");
public static final ItemBlock lamp = get("lamp");
public static final ItemMagnetic charged_powder = get("charged_powder");
public static final ItemWire wire = get("wire");
public static final ItemBlock charged_block = get("charged_block");
public static final ItemBlock charge_ore = get("charge_ore");
public static final ItemBlock torch = get("torch");
public static final ItemBlock soul_torch = get("soul_torch");
public static final ItemBlock tian_torch = get("tian_torch");
private static <T extends Item> T get(String id) { private static <T extends Item> T get(String id) {
T item = (T)ItemRegistry.byName(id); T item = (T)ItemRegistry.byName(id);

View file

@ -47,7 +47,7 @@ public abstract class SmeltingRegistry
add(Items.coal_ore, new ItemStack(Items.coal), 0.1F); add(Items.coal_ore, new ItemStack(Items.coal), 0.1F);
add(Items.lapis_ore, new ItemStack(Items.lapis_lazuli), 0.2F); add(Items.lapis_ore, new ItemStack(Items.lapis_lazuli), 0.2F);
add(Items.quartz_ore, new ItemStack(Items.quartz), 0.2F); add(Items.quartz_ore, new ItemStack(Items.quartz), 0.2F);
add(Items.redstone_ore, new ItemStack(Items.redstone), 0.7F); add(Items.charge_ore, new ItemStack(Items.charged_powder), 0.7F);
for(OreType ore : OreType.values()) { for(OreType ore : OreType.values()) {
Item item = ItemRegistry.byName(ore.item); Item item = ItemRegistry.byName(ore.item);

View file

@ -55,7 +55,7 @@ public abstract class TradeRegistry {
new ItemForGem(Items.name_tag, new PriceInfo(20, 22)), new ItemForGem(Items.name_tag, new PriceInfo(20, 22)),
new GemForItem(Items.rotten_flesh, new PriceInfo(36, 40)), new GemForItem(Items.rotten_flesh, new PriceInfo(36, 40)),
new GemForItem(Items.gold_ingot, new PriceInfo(8, 10)), new GemForItem(Items.gold_ingot, new PriceInfo(8, 10)),
new ItemForGem(Items.redstone, new PriceInfo(-4, -1)), new ItemForGem(Items.charged_powder, new PriceInfo(-4, -1)),
new ItemForGem(Items.ink_sack, new PriceInfo(-2, -1)), new ItemForGem(Items.ink_sack, new PriceInfo(-2, -1)),
new ItemForGem(Items.charged_orb, new PriceInfo(7, 11)), new ItemForGem(Items.charged_orb, new PriceInfo(7, 11)),
new ItemForGem(Items.glowstone, new PriceInfo(-3, -1)), new ItemForGem(Items.glowstone, new PriceInfo(-3, -1)),

View file

@ -331,7 +331,7 @@ public abstract class UniverseRegistry {
.addOre(Blocks.gravel.getState(), 8, 0, 33, 0, 256, false) .addOre(Blocks.gravel.getState(), 8, 0, 33, 0, 256, false)
.addOre(Blocks.rock.getState(), 6, 0, 22, 24, 72, false) .addOre(Blocks.rock.getState(), 6, 0, 22, 24, 72, false)
.addOre(Blocks.coal_ore.getState(), 20, 0, 17, 0, 128, false) .addOre(Blocks.coal_ore.getState(), 20, 0, 17, 0, 128, false)
.addOre(Blocks.redstone_ore.getState(), 8, 0, 8, 0, 16, false) .addOre(Blocks.charge_ore.getState(), 8, 0, 8, 0, 16, false)
.addOre(Blocks.lapis_ore.getState(), 1, 0, 7, 16, 16, true) .addOre(Blocks.lapis_ore.getState(), 1, 0, 7, 16, 16, true)
.addOre(Blocks.diamond_ore.getState(), 1, 0, 8, 0, 16, false) .addOre(Blocks.diamond_ore.getState(), 1, 0, 8, 0, 16, false)
.addOre(Blocks.ruby_ore.getState(), 1, 0, 4, 12, 8, true) .addOre(Blocks.ruby_ore.getState(), 1, 0, 4, 12, 8, true)

View file

@ -776,12 +776,12 @@ public abstract class Container
/** /**
* Like the version that takes an inventory. If the given TileEntity is not an Inventory, 0 is returned instead. * Like the version that takes an inventory. If the given TileEntity is not an Inventory, 0 is returned instead.
*/ */
public static int calcRedstone(TileEntity te) public static int calcSignal(TileEntity te)
{ {
return te instanceof IInventory ? calcRedstoneFromInventory((IInventory)te) : 0; return te instanceof IInventory ? calcSignalFrom((IInventory)te) : 0;
} }
public static int calcRedstoneFromInventory(IInventory inv) public static int calcSignalFrom(IInventory inv)
{ {
if (inv == null) if (inv == null)
{ {

View file

@ -47,7 +47,7 @@ public enum CheatTab {
return Items.hay_block; return Items.hay_block;
} }
}, },
TECHNOLOGY("Redstone & Technik", true) { TECHNOLOGY("Technik", true) {
protected Item getIconItem() { protected Item getIconItem() {
return Items.tnt; return Items.tnt;
} }

View file

@ -1,24 +1,27 @@
package common.item.block; package common.item.block;
import common.block.Block; import common.block.Block;
import common.block.tech.BlockRedstoneWire; import common.block.tech.BlockWire;
import common.entity.Entity; import common.entity.Entity;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.item.CheatTab; import common.item.CheatTab;
import common.item.Item; import common.item.Item;
import common.item.ItemStack; import common.item.ItemStack;
import common.item.StackSize;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.Facing; import common.util.Facing;
import common.world.World; import common.world.World;
public class ItemRedstone extends Item public class ItemWire extends Item
{ {
private final BlockRedstoneWire block; private final BlockWire block;
public ItemRedstone(BlockRedstoneWire block) public ItemWire(BlockWire block)
{ {
this.block = block; this.block = block;
this.setTab(CheatTab.TECHNOLOGY); this.setTab(CheatTab.TECHNOLOGY);
this.setDisplay(block.getDisplay());
this.setMaxAmount(StackSize.XL);
} }
public Block getBlock() public Block getBlock()
@ -26,9 +29,6 @@ public class ItemRedstone extends Item
return this.block; return this.block;
} }
/**
* Called when a Block is right-clicked with this Item
*/
public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ) public boolean onItemUse(ItemStack stack, EntityNPC playerIn, World worldIn, BlockPos pos, Facing side, float hitX, float hitY, float hitZ)
{ {
boolean flag = worldIn.getState(pos).getBlock().isReplaceable(worldIn, pos); boolean flag = worldIn.getState(pos).getBlock().isReplaceable(worldIn, pos);

View file

@ -1,6 +1,6 @@
package common.item.spawner; package common.item.spawner;
import common.block.tech.BlockRailBase; import common.block.tech.BlockRail;
import common.entity.item.EntityCart; import common.entity.item.EntityCart;
import common.entity.item.EntityMinecart; import common.entity.item.EntityMinecart;
import common.entity.item.EntityTntCart; import common.entity.item.EntityTntCart;
@ -39,7 +39,7 @@ public class ItemMinecart extends Item
{ {
State iblockstate = worldIn.getState(pos); State iblockstate = worldIn.getState(pos);
if (BlockRailBase.isRailBlock(iblockstate)) if (BlockRail.isRailBlock(iblockstate))
{ {
if (!worldIn.client) if (!worldIn.client)
{ {
@ -52,7 +52,7 @@ public class ItemMinecart extends Item
// entityitem.setOwner(playerIn.getUser()); // entityitem.setOwner(playerIn.getUser());
// } // }
// } // }
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() instanceof BlockRailBase ? (BlockRailBase.EnumRailDirection)iblockstate.getValue(((BlockRailBase)iblockstate.getBlock()).getShapeProperty()) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; BlockRail.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() instanceof BlockRail ? (BlockRail.EnumRailDirection)iblockstate.getValue(BlockRail.SHAPE) : BlockRail.EnumRailDirection.NORTH_SOUTH;
double d0 = 0.0D; double d0 = 0.0D;
if (blockrailbase$enumraildirection.isAscending()) if (blockrailbase$enumraildirection.isAscending())
@ -91,10 +91,10 @@ public class ItemMinecart extends Item
double d2 = blockpos.getZ() + 0.5 + (double)facing.getFrontOffsetZ() * 1.125D; double d2 = blockpos.getZ() + 0.5 + (double)facing.getFrontOffsetZ() * 1.125D;
BlockPos pos = blockpos.offset(facing); BlockPos pos = blockpos.offset(facing);
State iblockstate = world.getState(pos); State iblockstate = world.getState(pos);
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() instanceof BlockRailBase ? (BlockRailBase.EnumRailDirection)iblockstate.getValue(((BlockRailBase)iblockstate.getBlock()).getShapeProperty()) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; BlockRail.EnumRailDirection blockrailbase$enumraildirection = iblockstate.getBlock() instanceof BlockRail ? (BlockRail.EnumRailDirection)iblockstate.getValue(BlockRail.SHAPE) : BlockRail.EnumRailDirection.NORTH_SOUTH;
double d3; double d3;
if (BlockRailBase.isRailBlock(iblockstate)) if (BlockRail.isRailBlock(iblockstate))
{ {
if (blockrailbase$enumraildirection.isAscending()) if (blockrailbase$enumraildirection.isAscending())
{ {
@ -107,13 +107,13 @@ public class ItemMinecart extends Item
} }
else else
{ {
if (iblockstate.getBlock() != Blocks.air || !BlockRailBase.isRailBlock(world.getState(pos.down()))) if (iblockstate.getBlock() != Blocks.air || !BlockRail.isRailBlock(world.getState(pos.down())))
{ {
return super.dispenseStack(world, source, position, blockpos, facing, stack); return super.dispenseStack(world, source, position, blockpos, facing, stack);
} }
State iblockstate1 = world.getState(pos.down()); State iblockstate1 = world.getState(pos.down());
BlockRailBase.EnumRailDirection blockrailbase$enumraildirection1 = iblockstate1.getBlock() instanceof BlockRailBase ? (BlockRailBase.EnumRailDirection)iblockstate1.getValue(((BlockRailBase)iblockstate1.getBlock()).getShapeProperty()) : BlockRailBase.EnumRailDirection.NORTH_SOUTH; BlockRail.EnumRailDirection blockrailbase$enumraildirection1 = iblockstate1.getBlock() instanceof BlockRail ? (BlockRail.EnumRailDirection)iblockstate1.getValue(BlockRail.SHAPE) : BlockRail.EnumRailDirection.NORTH_SOUTH;
if (facing != Facing.DOWN && blockrailbase$enumraildirection1.isAscending()) if (facing != Facing.DOWN && blockrailbase$enumraildirection1.isAscending())
{ {

View file

@ -58,7 +58,6 @@ public class ItemChargedOrb extends ItemFragile
else else
{ {
worldIn.setState(pos, iblockstate.withProperty(BlockPortalFrame.ORB, Boolean.valueOf(true)), 2); worldIn.setState(pos, iblockstate.withProperty(BlockPortalFrame.ORB, Boolean.valueOf(true)), 2);
worldIn.updateComparatorOutputLevel(pos, Blocks.portal_frame);
stack.decrSize(); stack.decrSize();
for (int i = 0; i < 16; ++i) for (int i = 0; i < 16; ++i)

View file

@ -2,6 +2,7 @@ package common.item.tool;
import common.block.Block; import common.block.Block;
import common.block.Material; import common.block.Material;
import common.block.tech.BlockWire;
import common.entity.types.EntityLiving; import common.entity.types.EntityLiving;
import common.init.Blocks; import common.init.Blocks;
import common.init.ToolMaterial; import common.init.ToolMaterial;
@ -37,7 +38,7 @@ public class ItemShears extends Item
public boolean canHarvestBlock(Block blockIn) public boolean canHarvestBlock(Block blockIn)
{ {
return blockIn.getMaterial() == Material.FLUFF || blockIn == Blocks.redstone || blockIn == Blocks.string; return blockIn.getMaterial() == Material.FLUFF || blockIn instanceof BlockWire || blockIn == Blocks.string;
} }
public float getStrVsBlock(ItemStack stack, Block state) public float getStrVsBlock(ItemStack stack, Block state)

View file

@ -6,7 +6,7 @@ import common.block.artificial.BlockDoor;
import common.block.artificial.BlockFence; import common.block.artificial.BlockFence;
import common.block.artificial.BlockFenceGate; import common.block.artificial.BlockFenceGate;
import common.block.artificial.BlockWall; import common.block.artificial.BlockWall;
import common.block.tech.BlockRailBase; import common.block.tech.BlockRail;
import common.entity.Entity; import common.entity.Entity;
import common.init.Blocks; import common.init.Blocks;
import common.util.BlockPos; import common.util.BlockPos;
@ -231,9 +231,9 @@ public class WalkNodeProcessor extends NodeProcessor
flag = true; flag = true;
} }
if (entity.worldObj.getState(mpos).getBlock() instanceof BlockRailBase) if (entity.worldObj.getState(mpos).getBlock() instanceof BlockRail)
{ {
if (!(entity.worldObj.getState(blockpos).getBlock() instanceof BlockRailBase) && !(entity.worldObj.getState(blockpos.down()).getBlock() instanceof BlockRailBase)) if (!(entity.worldObj.getState(blockpos).getBlock() instanceof BlockRail) && !(entity.worldObj.getState(blockpos.down()).getBlock() instanceof BlockRail))
{ {
return -3; return -3;
} }

View file

@ -3,7 +3,6 @@ package common.tileentity;
import common.block.Block; import common.block.Block;
import common.block.ITileEntityProvider; import common.block.ITileEntityProvider;
import common.init.BlockRegistry; import common.init.BlockRegistry;
import common.init.Blocks;
import common.log.Log; import common.log.Log;
import common.network.Packet; import common.network.Packet;
import common.tags.TagObject; import common.tags.TagObject;
@ -94,11 +93,6 @@ public abstract class TileEntity
this.blockState = this.worldObj.getState(this.pos); this.blockState = this.worldObj.getState(this.pos);
if(!this.worldObj.client) if(!this.worldObj.client)
((AWorldServer)this.worldObj).markChunkDirty(this.pos); ((AWorldServer)this.worldObj).markChunkDirty(this.pos);
if (this.getBlockType() != Blocks.air)
{
this.worldObj.updateComparatorOutputLevel(this.pos, this.getBlockType());
}
} }
} }
@ -184,4 +178,12 @@ public abstract class TileEntity
} }
public abstract int getColor(); public abstract int getColor();
public boolean hasPower() {
return true;
}
public boolean decrPower() {
return true;
}
} }

View file

@ -1,5 +1,6 @@
package common.tileentity; package common.tileentity;
import common.block.tech.BlockDispenser;
import common.collect.Lists; import common.collect.Lists;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.inventory.Container; import common.inventory.Container;
@ -8,12 +9,19 @@ import common.inventory.InventoryPlayer;
import common.item.ItemStack; import common.item.ItemStack;
import common.rng.Random; import common.rng.Random;
import common.tags.TagObject; import common.tags.TagObject;
import common.util.BlockPos;
import common.util.Facing;
import common.vars.Vars;
import common.world.State;
import common.world.World;
import java.util.List; import java.util.List;
public class TileEntityDispenser extends TileEntityInventory public class TileEntityDispenser extends TileEntityInventory implements ITickable
{ {
private static final Random RNG = new Random(); private static final Random RNG = new Random();
private ItemStack[] stacks = new ItemStack[9]; private ItemStack[] stacks = new ItemStack[9];
private int cooldown = 0;
/** /**
* Returns the number of slots in the inventory. * Returns the number of slots in the inventory.
@ -133,6 +141,7 @@ public class TileEntityDispenser extends TileEntityInventory
public void readTags(TagObject compound) public void readTags(TagObject compound)
{ {
super.readTags(compound); super.readTags(compound);
this.cooldown = compound.getInt("Cooldown");
List<TagObject> nbttaglist = compound.getList("Items"); List<TagObject> nbttaglist = compound.getList("Items");
this.stacks = new ItemStack[this.getSizeInventory()]; this.stacks = new ItemStack[this.getSizeInventory()];
@ -151,6 +160,7 @@ public class TileEntityDispenser extends TileEntityInventory
public void writeTags(TagObject compound) public void writeTags(TagObject compound)
{ {
super.writeTags(compound); super.writeTags(compound);
compound.setInt("Cooldown", this.cooldown);
List<TagObject> nbttaglist = Lists.newArrayList(); List<TagObject> nbttaglist = Lists.newArrayList();
for (int i = 0; i < this.stacks.length; ++i) for (int i = 0; i < this.stacks.length; ++i)
@ -229,4 +239,54 @@ public class TileEntityDispenser extends TileEntityInventory
public int getColor() { public int getColor() {
return 0xffbf00; return 0xffbf00;
} }
protected ItemStack dispenseStack(ItemStack stack, World world, BlockPos pos)
{
Facing facing = world.getState(pos).getValue(BlockDispenser.FACING);
ItemStack nstack = stack.getItem().dispenseStack(world, world.getTileEntity(pos), BlockDispenser.getDispensePosition(pos, facing), pos, facing, stack);
int id = stack.getItem().getDispenseSoundId();
if(id != 0)
world.playAuxSFX(id, pos, 0);
world.playAuxSFX(2000, pos, facing.getFrontOffsetX() + 1 + (facing.getFrontOffsetZ() + 1) * 3);
return nstack;
}
protected void dispense(World worldIn, BlockPos pos)
{
TileEntity te = worldIn.getTileEntity(pos);
if (te instanceof TileEntityDispenser tileentitydispenser)
{
int i = tileentitydispenser.getDispenseSlot();
if (i < 0)
{
return;
}
else
{
ItemStack itemstack = tileentitydispenser.getStackInSlot(i);
if(itemstack != null) {
ItemStack itemstack1 = this.dispenseStack(itemstack, worldIn, pos);
tileentitydispenser.setInventorySlotContents(i, itemstack1.isEmpty() ? null : itemstack1);
}
}
}
}
public void update() {
if(this.worldObj != null && !this.worldObj.client) {
if (this.cooldown <= 0)
{
State state = this.getBlockState();
if(!(state.getBlock() instanceof BlockDispenser) || !this.decrPower())
return;
this.dispense(this.worldObj, this.pos);
this.cooldown = Vars.dispenserDelay;
}
else {
this.cooldown--;
}
}
}
} }

View file

@ -1,5 +1,77 @@
package common.tileentity; package common.tileentity;
import common.block.tech.BlockDispenser;
import common.inventory.IInventory;
import common.item.ItemStack;
import common.util.BlockPos;
import common.util.Facing;
import common.world.World;
public class TileEntityDropper extends TileEntityDispenser public class TileEntityDropper extends TileEntityDispenser
{ {
protected ItemStack dispenseStack(ItemStack stack, World world, BlockPos pos)
{
Facing facing = world.getState(pos).getValue(BlockDispenser.FACING);
BlockDispenser.dispense(world, 6.0, facing, BlockDispenser.getDispensePosition(pos, facing), stack.split(1));
world.playAuxSFX(1000, pos, 0);
world.playAuxSFX(2000, pos, facing.getFrontOffsetX() + 1 + (facing.getFrontOffsetZ() + 1) * 3);
return stack;
}
protected void dispense(World worldIn, BlockPos pos)
{
TileEntity te = worldIn.getTileEntity(pos);
if (te instanceof TileEntityDispenser tileentitydispenser)
{
int i = tileentitydispenser.getDispenseSlot();
if (i < 0)
{
return;
}
else
{
ItemStack itemstack = tileentitydispenser.getStackInSlot(i);
if (itemstack != null)
{
Facing enumfacing = (Facing)worldIn.getState(pos).getValue(BlockDispenser.FACING);
BlockPos blockpos = pos.offset(enumfacing);
IInventory iinventory = TileEntityHopper.getInventoryAtPosition(worldIn, (double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ());
ItemStack itemstack1;
if (iinventory == null)
{
itemstack1 = this.dispenseStack(itemstack, worldIn, pos);
if (itemstack1 != null && itemstack1.isEmpty())
{
itemstack1 = null;
}
}
else
{
itemstack1 = TileEntityHopper.putStackInInventoryAllSlots(iinventory, itemstack.copy().split(1), enumfacing.getOpposite());
if (itemstack1 == null)
{
itemstack1 = itemstack.copy();
if (itemstack1.decrSize())
{
itemstack1 = null;
}
}
else
{
itemstack1 = itemstack.copy();
}
}
tileentitydispenser.setInventorySlotContents(i, itemstack1);
}
}
}
}
} }

View file

@ -212,7 +212,7 @@ public class TileEntityHopper extends TileEntityInventory implements ITickable
if (!this.isOnTransferCooldown()) if (!this.isOnTransferCooldown())
{ {
State state = this.getBlockState(); State state = this.getBlockState();
if(!(state.getBlock() instanceof BlockHopper) || !state.getValue(BlockHopper.ENABLED)) if(!(state.getBlock() instanceof BlockHopper) || !this.decrPower())
return false; return false;
boolean flag = false; boolean flag = false;

View file

@ -249,8 +249,8 @@ public abstract class Vars {
public static int healChance = 5; public static int healChance = 5;
@Var(name = "hopperCooldown", min = 0, max = 160) @Var(name = "hopperCooldown", min = 0, max = 160)
public static int hopperDelay = 2; public static int hopperDelay = 2;
@Var(name = "hopperCartCooldown", min = 0, max = 160) @Var(name = "dispenserCooldown", min = 0, max = 160)
public static int hopperCartDelay = 1; public static int dispenserDelay = 1;
@Var(name = "xpCooldown", min = 0, max = 10) @Var(name = "xpCooldown", min = 0, max = 10)
public static int xpDelay = 0; // 2 public static int xpDelay = 0; // 2
@Var(name = "eggLayTime") @Var(name = "eggLayTime")
@ -263,6 +263,8 @@ public abstract class Vars {
public static int distance = 8; public static int distance = 8;
@Var(name = "timeFlow", min = 1) @Var(name = "timeFlow", min = 1)
public static int timeFlow = 1; public static int timeFlow = 1;
@Var(name = "torchBurnoutChance")
public static int torchBurnout = 30;
@Var(name = "gravity", min = -10.0f, max = 10.0f) @Var(name = "gravity", min = -10.0f, max = 10.0f)
public static float gravity = 1.0f; public static float gravity = 1.0f;

View file

@ -237,10 +237,6 @@ public abstract class World implements IWorldAccess {
if(!this.client && (flags & 1) != 0) { if(!this.client && (flags & 1) != 0) {
this.notifyNeighborsOfStateChange(pos, iblockstate.getBlock()); this.notifyNeighborsOfStateChange(pos, iblockstate.getBlock());
if(block.hasSignalProcessing()) {
this.updateComparatorOutputLevel(pos, block);
}
} }
return true; return true;
@ -1835,89 +1831,6 @@ public abstract class World implements IWorldAccess {
return 63; return 63;
} }
private int getStrongPower(BlockPos pos, Facing direction) {
State iblockstate = this.getState(pos);
return iblockstate.getBlock().getStrongPower(this, pos, iblockstate, direction);
}
private int getStrongPower(BlockPos pos) {
int i = 0;
i = Math.max(i, this.getStrongPower(pos.down(), Facing.DOWN));
if(i >= 15) {
return i;
}
else {
i = Math.max(i, this.getStrongPower(pos.up(), Facing.UP));
if(i >= 15) {
return i;
}
else {
i = Math.max(i, this.getStrongPower(pos.north(), Facing.NORTH));
if(i >= 15) {
return i;
}
else {
i = Math.max(i, this.getStrongPower(pos.south(), Facing.SOUTH));
if(i >= 15) {
return i;
}
else {
i = Math.max(i, this.getStrongPower(pos.west(), Facing.WEST));
if(i >= 15) {
return i;
}
else {
i = Math.max(i, this.getStrongPower(pos.east(), Facing.EAST));
return i >= 15 ? i : i;
}
}
}
}
}
}
public boolean isSidePowered(BlockPos pos, Facing side) {
return this.getRedstonePower(pos, side) > 0;
}
public int getRedstonePower(BlockPos pos, Facing facing) {
State iblockstate = this.getState(pos);
Block block = iblockstate.getBlock();
return block.isNormalCube() ? this.getStrongPower(pos) : block.getWeakPower(this, pos, iblockstate, facing);
}
public boolean isBlockPowered(BlockPos pos) {
return this.getRedstonePower(pos.down(), Facing.DOWN) > 0 ? true
: (this.getRedstonePower(pos.up(), Facing.UP) > 0 ? true
: (this.getRedstonePower(pos.north(), Facing.NORTH) > 0 ? true
: (this.getRedstonePower(pos.south(), Facing.SOUTH) > 0 ? true
: (this.getRedstonePower(pos.west(), Facing.WEST) > 0 ? true
: this.getRedstonePower(pos.east(), Facing.EAST) > 0))));
}
public int isBlockIndirectlyGettingPowered(BlockPos pos) {
int i = 0;
for(Facing enumfacing : Facing.values()) {
int j = this.getRedstonePower(pos.offset(enumfacing), enumfacing);
if(j >= 15) {
return 15;
}
if(j > i) {
i = j;
}
}
return i;
}
public EntityNPC getClosestPlayerToEntity(Entity entityIn, double distance) { public EntityNPC getClosestPlayerToEntity(Entity entityIn, double distance) {
return this.getClosestPlayer(entityIn.posX, entityIn.posY, entityIn.posZ, distance); return this.getClosestPlayer(entityIn.posX, entityIn.posY, entityIn.posZ, distance);
} }
@ -2076,47 +1989,10 @@ public abstract class World implements IWorldAccess {
return Math.abs(gravity) < 0.075 ? 0.0 : gravity; return Math.abs(gravity) < 0.075 ? 0.0 : gravity;
} }
// public void setItemData(String dataID, WorldSavedData worldSavedDataIn) {
// }
//
// public WorldSavedData loadItemData(Class<? extends WorldSavedData> clazz, String dataID) {
// return null;
// }
//
// public int getNextMapId() {
// return 0;
// }
public final void playAuxSFX(int type, BlockPos pos, int data) { public final void playAuxSFX(int type, BlockPos pos, int data) {
this.playAuxSFX(null, type, pos, data); this.playAuxSFX(null, type, pos, data);
} }
public void updateComparatorOutputLevel(BlockPos pos, Block blockIn) {
for(Facing enumfacing : Facing.Plane.HORIZONTAL) {
BlockPos blockpos = pos.offset(enumfacing);
if(this.isBlockLoaded(blockpos)) {
State iblockstate = this.getState(blockpos);
if(Blocks.comparator.isAssociated(iblockstate.getBlock())) {
iblockstate.getBlock().onNeighborBlockChange(this, blockpos, iblockstate, blockIn);
}
else if(iblockstate.getBlock().isNormalCube()) {
blockpos = blockpos.offset(enumfacing);
iblockstate = this.getState(blockpos);
if(Blocks.comparator.isAssociated(iblockstate.getBlock())) {
iblockstate.getBlock().onNeighborBlockChange(this, blockpos, iblockstate, blockIn);
}
}
}
}
}
// public DifficultyInstance getDifficultyForLocation(BlockPos pos) {
// return null;
// }
public void scheduleUpdate(BlockPos pos, Block blockIn, int delay) { public void scheduleUpdate(BlockPos pos, Block blockIn, int delay) {
} }
@ -2127,14 +2003,6 @@ public abstract class World implements IWorldAccess {
this.spawnParticle(particleType, xCoord, yCoord, zCoord, 0); this.spawnParticle(particleType, xCoord, yCoord, zCoord, 0);
} }
// public Difficulty getDifficulty() {
// return this.difficulty;
// }
// public void setDifficulty(Difficulty diff) {
// this.difficulty = diff;
// }
public abstract Chunk getChunk(int x, int z); public abstract Chunk getChunk(int x, int z);
public abstract void markBlockForUpdate(BlockPos pos); public abstract void markBlockForUpdate(BlockPos pos);
protected abstract void notifyLightSet(BlockPos pos); protected abstract void notifyLightSet(BlockPos pos);
@ -2142,7 +2010,6 @@ public abstract class World implements IWorldAccess {
public abstract void playSound(SoundEvent sound, double x, double y, double z, float volume); public abstract void playSound(SoundEvent sound, double x, double y, double z, float volume);
protected abstract void onEntityAdded(Entity entityIn); protected abstract void onEntityAdded(Entity entityIn);
protected abstract void onEntityRemoved(Entity entityIn); protected abstract void onEntityRemoved(Entity entityIn);
// public abstract void broadcastSound(int soundID, BlockPos pos, int data);
public abstract void playAuxSFX(EntityNPC player, int sfxType, BlockPos blockPosIn, int data); public abstract void playAuxSFX(EntityNPC player, int sfxType, BlockPos blockPosIn, int data);
public abstract void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress); public abstract void sendBlockBreakProgress(int breakerId, BlockPos pos, int progress);
} }

View file

@ -11,7 +11,7 @@ import java.util.Set;
import common.block.Block; import common.block.Block;
import common.block.ITileEntityProvider; import common.block.ITileEntityProvider;
import common.block.artificial.BlockDoor; import common.block.artificial.BlockDoor;
import common.block.tech.BlockRailBase; import common.block.tech.BlockRail;
import common.collect.Lists; import common.collect.Lists;
import common.init.Blocks; import common.init.Blocks;
import common.inventory.IInventory; import common.inventory.IInventory;
@ -125,7 +125,7 @@ public class ClipboardPlacer {
} }
} }
} }
else if(type instanceof BlockRailBase) { else if(type instanceof BlockRail) {
// Here, rails are hardcoded to be attached to the block below them. // Here, rails are hardcoded to be attached to the block below them.
// They're also attached to the block they're ascending towards via BlockType.getAttachment. // They're also attached to the block they're ascending towards via BlockType.getAttachment.
BlockPos lowerBlock = current.add(0, -1, 0); BlockPos lowerBlock = current.add(0, -1, 0);

View file

@ -42,7 +42,7 @@ public abstract class ReorderRegistry {
// return STATE_ATTACH.get(state); // return STATE_ATTACH.get(state);
// } // }
public static void register() { public static void register() { // TODO: FIX this mess later
for(WoodType wood : WoodType.values()) { for(WoodType wood : WoodType.values()) {
PLACE_LAST.add(BlockRegistry.byName(wood.getName() + "_sapling")); PLACE_LAST.add(BlockRegistry.byName(wood.getName() + "_sapling"));
} }
@ -50,8 +50,6 @@ public abstract class ReorderRegistry {
for(DyeColor color : BlockBed.COLORS) { for(DyeColor color : BlockBed.COLORS) {
PLACE_LAST.add(BlockRegistry.byName(color.getName() + "_bed")); PLACE_LAST.add(BlockRegistry.byName(color.getName() + "_bed"));
} }
PLACE_LAST.add(Blocks.golden_rail);
PLACE_LAST.add(Blocks.detector_rail);
PLACE_LAST.add(Blocks.tallgrass); PLACE_LAST.add(Blocks.tallgrass);
PLACE_LAST.add(Blocks.deadbush); PLACE_LAST.add(Blocks.deadbush);
PLACE_LAST.add(Blocks.piston_head); PLACE_LAST.add(Blocks.piston_head);
@ -60,24 +58,22 @@ public abstract class ReorderRegistry {
} }
PLACE_LAST.add(Blocks.brown_mushroom); PLACE_LAST.add(Blocks.brown_mushroom);
PLACE_LAST.add(Blocks.red_mushroom_block); PLACE_LAST.add(Blocks.red_mushroom_block);
PLACE_LAST.add(Blocks.torch); // PLACE_LAST.add(Blocks.torch);
PLACE_LAST.add(Blocks.fire); PLACE_LAST.add(Blocks.fire);
PLACE_LAST.add(Blocks.soul_fire); PLACE_LAST.add(Blocks.soul_fire);
PLACE_LAST.add(Blocks.black_fire); PLACE_LAST.add(Blocks.black_fire);
PLACE_LAST.add(Blocks.redstone); // PLACE_LAST.add(Blocks.wire);
PLACE_LAST.add(Blocks.wheat); PLACE_LAST.add(Blocks.wheat);
PLACE_LAST.add(Blocks.ladder); PLACE_LAST.add(Blocks.ladder);
PLACE_LAST.add(Blocks.rail); PLACE_LAST.add(Blocks.rail);
PLACE_LAST.add(Blocks.lever); PLACE_LAST.add(Blocks.lever);
PLACE_LAST.add(Blocks.stone_pressure_plate); PLACE_LAST.add(Blocks.stone_pressure_plate);
PLACE_LAST.add(Blocks.wooden_pressure_plate); PLACE_LAST.add(Blocks.wooden_pressure_plate);
PLACE_LAST.add(Blocks.unlit_redstone_torch); // PLACE_LAST.add(Blocks.unlit__torch);
PLACE_LAST.add(Blocks.redstone_torch); // PLACE_LAST.add(Blocks.lit_t);
PLACE_LAST.add(Blocks.stone_button); PLACE_LAST.add(Blocks.stone_button);
PLACE_LAST.add(Blocks.snow_layer); PLACE_LAST.add(Blocks.snow_layer);
PLACE_LAST.add(Blocks.portal); PLACE_LAST.add(Blocks.portal);
PLACE_LAST.add(Blocks.repeater);
PLACE_LAST.add(Blocks.powered_repeater);
PLACE_LAST.add(Blocks.trapdoor); PLACE_LAST.add(Blocks.trapdoor);
PLACE_LAST.add(Blocks.vine); PLACE_LAST.add(Blocks.vine);
PLACE_LAST.add(Blocks.waterlily); PLACE_LAST.add(Blocks.waterlily);
@ -100,9 +96,6 @@ public abstract class ReorderRegistry {
} }
PLACE_LAST.add(Blocks.light_weighted_pressure_plate); PLACE_LAST.add(Blocks.light_weighted_pressure_plate);
PLACE_LAST.add(Blocks.heavy_weighted_pressure_plate); PLACE_LAST.add(Blocks.heavy_weighted_pressure_plate);
PLACE_LAST.add(Blocks.comparator);
PLACE_LAST.add(Blocks.powered_comparator);
PLACE_LAST.add(Blocks.activator_rail);
PLACE_LAST.add(Blocks.iron_trapdoor); PLACE_LAST.add(Blocks.iron_trapdoor);
for(BlockCarpet block : BlockCarpet.CARPETS) { for(BlockCarpet block : BlockCarpet.CARPETS) {
PLACE_LAST.add(block); PLACE_LAST.add(block);
@ -158,12 +151,12 @@ public abstract class ReorderRegistry {
} }
addAttach(Blocks.brown_mushroom, Facing.DOWN); addAttach(Blocks.brown_mushroom, Facing.DOWN);
addAttach(Blocks.red_mushroom, Facing.DOWN); addAttach(Blocks.red_mushroom, Facing.DOWN);
for (Block blockId : new Block[] { Blocks.torch, Blocks.redstone_torch, Blocks.unlit_redstone_torch }) { for (Block blockId : new Block[] { Blocks.torch, Blocks.u_torch, l_torch }) {
addAttach(blockId.getStateFromMeta(0), Facing.DOWN); addAttach(blockId.getStateFromMeta(0), Facing.DOWN);
addAttach(blockId.getStateFromMeta(5), Facing.DOWN); // According to the wiki, this one is history. Keeping both, for now... addAttach(blockId.getStateFromMeta(5), Facing.DOWN); // According to the wiki, this one is history. Keeping both, for now...
addCardinals(blockId, 4, 1, 3, 2); addCardinals(blockId, 4, 1, 3, 2);
} }
addAttach(Blocks.redstone, Facing.DOWN); addAttach(Blocks.wire, Facing.DOWN);
addAttach(Blocks.wheat, Facing.DOWN); addAttach(Blocks.wheat, Facing.DOWN);
addAttach(Blocks.sign, Facing.DOWN); addAttach(Blocks.sign, Facing.DOWN);
addCardinals(Blocks.ladder, 2, 5, 3, 4); addCardinals(Blocks.ladder, 2, 5, 3, 4);
@ -178,7 +171,7 @@ public abstract class ReorderRegistry {
addAttach(Blocks.stone_pressure_plate, Facing.DOWN); addAttach(Blocks.stone_pressure_plate, Facing.DOWN);
addAttach(Blocks.iron_door, Facing.DOWN); addAttach(Blocks.iron_door, Facing.DOWN);
addAttach(Blocks.wooden_pressure_plate, Facing.DOWN); addAttach(Blocks.wooden_pressure_plate, Facing.DOWN);
// redstone torches: see torches // other torches: see torches
for (int offset = 0; offset < 16; offset += 8) { for (int offset = 0; offset < 16; offset += 8) {
addCardinals(Blocks.stone_button, offset + 4, offset + 1, offset + 3, offset + 2); addCardinals(Blocks.stone_button, offset + 4, offset + 1, offset + 3, offset + 2);
addCardinals(Blocks.wooden_button, offset + 4, offset + 1, offset + 3, offset + 2); addCardinals(Blocks.wooden_button, offset + 4, offset + 1, offset + 3, offset + 2);

View file

@ -75,16 +75,9 @@ import common.block.tech.BlockPistonHead.EnumPistonType;
import common.block.tech.BlockPressurePlate; import common.block.tech.BlockPressurePlate;
import common.block.tech.BlockPressurePlateWeighted; import common.block.tech.BlockPressurePlateWeighted;
import common.block.tech.BlockRail; import common.block.tech.BlockRail;
import common.block.tech.BlockRailBase.EnumRailDirection; import common.block.tech.BlockRail.EnumRailDirection;
import common.block.tech.BlockRailDetector;
import common.block.tech.BlockRailPowered;
import common.block.tech.BlockRedstoneComparator;
import common.block.tech.BlockRedstoneComparator.Mode;
import common.block.tech.BlockRedstoneRepeater;
import common.block.tech.BlockRedstoneTorch;
import common.block.tech.BlockRedstoneWire;
import common.block.tech.BlockTNT;
import common.block.tech.BlockTorch; import common.block.tech.BlockTorch;
import common.block.tech.BlockTNT;
import common.block.tech.BlockTripWire; import common.block.tech.BlockTripWire;
import common.block.tech.BlockTripWireHook; import common.block.tech.BlockTripWireHook;
import common.block.tech.BlockWarpChest; import common.block.tech.BlockWarpChest;
@ -479,18 +472,18 @@ public abstract class Converter {
mapBlock(Blocks.glass, 20); mapBlock(Blocks.glass, 20);
mapBlock(Blocks.lapis_ore, 21); mapBlock(Blocks.lapis_ore, 21);
mapBlock(Blocks.lapis_block, 22); mapBlock(Blocks.lapis_block, 22);
mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.DOWN).withProperty(BlockDispenser.TRIGGERED, false), 23, 0, 6); mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.DOWN), 23, 0, 6);
mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.UP).withProperty(BlockDispenser.TRIGGERED, false), 23, 1, 7); mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.UP), 23, 1, 7);
mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.NORTH).withProperty(BlockDispenser.TRIGGERED, false), 23, 2); mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.NORTH), 23, 2);
mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.SOUTH).withProperty(BlockDispenser.TRIGGERED, false), 23, 3); mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.SOUTH), 23, 3);
mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.WEST).withProperty(BlockDispenser.TRIGGERED, false), 23, 4); mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.WEST), 23, 4);
mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.EAST).withProperty(BlockDispenser.TRIGGERED, false), 23, 5); mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.EAST), 23, 5);
mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.DOWN).withProperty(BlockDispenser.TRIGGERED, true), 23, 8, 14); mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.DOWN), 23, 8, 14);
mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.UP).withProperty(BlockDispenser.TRIGGERED, true), 23, 9, 15); mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.UP), 23, 9, 15);
mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.NORTH).withProperty(BlockDispenser.TRIGGERED, true), 23, 10); mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.NORTH), 23, 10);
mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.SOUTH).withProperty(BlockDispenser.TRIGGERED, true), 23, 11); mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.SOUTH), 23, 11);
mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.WEST).withProperty(BlockDispenser.TRIGGERED, true), 23, 12); mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.WEST), 23, 12);
mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.EAST).withProperty(BlockDispenser.TRIGGERED, true), 23, 13); mapBlock(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, Facing.EAST), 23, 13);
mapBlock(Blocks.sandstone, 24); mapBlock(Blocks.sandstone, 24);
mapBlock(Blocks.carved_sandstone, 24, 1); mapBlock(Blocks.carved_sandstone, 24, 1);
mapBlock(Blocks.smooth_sandstone, 24, 2); mapBlock(Blocks.smooth_sandstone, 24, 2);
@ -503,30 +496,30 @@ public abstract class Converter {
mapBlock(Blocks.red_bed.getState().withProperty(BlockBed.FACING, Facing.WEST).withProperty(BlockBed.PART, EnumPartType.HEAD), 26, 9, 13); mapBlock(Blocks.red_bed.getState().withProperty(BlockBed.FACING, Facing.WEST).withProperty(BlockBed.PART, EnumPartType.HEAD), 26, 9, 13);
mapBlock(Blocks.red_bed.getState().withProperty(BlockBed.FACING, Facing.NORTH).withProperty(BlockBed.PART, EnumPartType.HEAD), 26, 10, 14); mapBlock(Blocks.red_bed.getState().withProperty(BlockBed.FACING, Facing.NORTH).withProperty(BlockBed.PART, EnumPartType.HEAD), 26, 10, 14);
mapBlock(Blocks.red_bed.getState().withProperty(BlockBed.FACING, Facing.EAST).withProperty(BlockBed.PART, EnumPartType.HEAD), 26, 11, 15); mapBlock(Blocks.red_bed.getState().withProperty(BlockBed.FACING, Facing.EAST).withProperty(BlockBed.PART, EnumPartType.HEAD), 26, 11, 15);
mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.NORTH_SOUTH), 27, 0, 6, 7); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.NORTH_SOUTH), 27, 0, 6, 7);
mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.EAST_WEST), 27, 1); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.EAST_WEST), 27, 1);
mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_EAST), 27, 2); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_EAST), 27, 2);
mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_WEST), 27, 3); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_WEST), 27, 3);
mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_NORTH), 27, 4); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_NORTH), 27, 4);
mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 27, 5); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 27, 5);
mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.NORTH_SOUTH), 27, 8, 14, 15); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.NORTH_SOUTH), 27, 8, 14, 15);
mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.EAST_WEST), 27, 9); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.EAST_WEST), 27, 9);
mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_EAST), 27, 10); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_EAST), 27, 10);
mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_WEST), 27, 11); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_WEST), 27, 11);
mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_NORTH), 27, 12); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_NORTH), 27, 12);
mapBlock(Blocks.golden_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 27, 13); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 27, 13);
mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, false).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.NORTH_SOUTH), 28, 0, 6, 7); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.NORTH_SOUTH), 28, 0, 6, 7);
mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, false).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.EAST_WEST), 28, 1); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.EAST_WEST), 28, 1);
mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, false).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_EAST), 28, 2); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_EAST), 28, 2);
mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, false).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_WEST), 28, 3); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_WEST), 28, 3);
mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, false).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_NORTH), 28, 4); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_NORTH), 28, 4);
mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, false).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 28, 5); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 28, 5);
mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, true).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.NORTH_SOUTH), 28, 8, 14, 15); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.NORTH_SOUTH), 28, 8, 14, 15);
mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, true).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.EAST_WEST), 28, 9); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.EAST_WEST), 28, 9);
mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, true).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_EAST), 28, 10); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_EAST), 28, 10);
mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, true).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_WEST), 28, 11); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_WEST), 28, 11);
mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, true).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_NORTH), 28, 12); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_NORTH), 28, 12);
mapBlock(Blocks.detector_rail.getState().withProperty(BlockRailDetector.POWERED, true).withProperty(BlockRailDetector.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 28, 13); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 28, 13);
mapBlock(Blocks.sticky_piston.getState().withProperty(BlockPistonBase.EXTENDED, false).withProperty(BlockPistonBase.FACING, Facing.DOWN), 29, 0, 7); mapBlock(Blocks.sticky_piston.getState().withProperty(BlockPistonBase.EXTENDED, false).withProperty(BlockPistonBase.FACING, Facing.DOWN), 29, 0, 7);
mapBlock(Blocks.sticky_piston.getState().withProperty(BlockPistonBase.EXTENDED, false).withProperty(BlockPistonBase.FACING, Facing.UP), 29, 1, 6); mapBlock(Blocks.sticky_piston.getState().withProperty(BlockPistonBase.EXTENDED, false).withProperty(BlockPistonBase.FACING, Facing.UP), 29, 1, 6);
mapBlock(Blocks.sticky_piston.getState().withProperty(BlockPistonBase.EXTENDED, false).withProperty(BlockPistonBase.FACING, Facing.NORTH), 29, 2); mapBlock(Blocks.sticky_piston.getState().withProperty(BlockPistonBase.EXTENDED, false).withProperty(BlockPistonBase.FACING, Facing.NORTH), 29, 2);
@ -655,11 +648,11 @@ public abstract class Converter {
mapBlock(Blocks.bookshelf, 47); mapBlock(Blocks.bookshelf, 47);
mapBlock(Blocks.mossy_cobblestone, 48); mapBlock(Blocks.mossy_cobblestone, 48);
mapBlock(Blocks.obsidian, 49); mapBlock(Blocks.obsidian, 49);
mapBlock(Blocks.torch.getState().withProperty(BlockTorch.FACING, Facing.UP), 50); mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.UP), 50);
mapBlock(Blocks.torch.getState().withProperty(BlockTorch.FACING, Facing.EAST), 50, 1); mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.EAST), 50, 1);
mapBlock(Blocks.torch.getState().withProperty(BlockTorch.FACING, Facing.WEST), 50, 2); mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.WEST), 50, 2);
mapBlock(Blocks.torch.getState().withProperty(BlockTorch.FACING, Facing.SOUTH), 50, 3); mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.SOUTH), 50, 3);
mapBlock(Blocks.torch.getState().withProperty(BlockTorch.FACING, Facing.NORTH), 50, 4); mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.NORTH), 50, 4);
mapBlock(new BlockFunction() { mapBlock(new BlockFunction() {
public State getState(int id, int data) { public State getState(int id, int data) {
return Blocks.fire.getState().withProperty(BlockFire.AGE, data); return Blocks.fire.getState().withProperty(BlockFire.AGE, data);
@ -678,22 +671,6 @@ public abstract class Converter {
mapBlock(Blocks.chest.getState().withProperty(BlockChest.FACING, Facing.SOUTH), 54, 3, 9, 15); mapBlock(Blocks.chest.getState().withProperty(BlockChest.FACING, Facing.SOUTH), 54, 3, 9, 15);
mapBlock(Blocks.chest.getState().withProperty(BlockChest.FACING, Facing.WEST), 54, 4, 10); mapBlock(Blocks.chest.getState().withProperty(BlockChest.FACING, Facing.WEST), 54, 4, 10);
mapBlock(Blocks.chest.getState().withProperty(BlockChest.FACING, Facing.EAST), 54, 5, 11); mapBlock(Blocks.chest.getState().withProperty(BlockChest.FACING, Facing.EAST), 54, 5, 11);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 0), 55, 0);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 1), 55, 1);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 2), 55, 2);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 3), 55, 3);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 4), 55, 4);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 5), 55, 5);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 6), 55, 6);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 7), 55, 7);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 8), 55, 8);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 9), 55, 9);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 10), 55, 10);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 11), 55, 11);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 12), 55, 12);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 13), 55, 13);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 14), 55, 14);
mapBlock(Blocks.redstone.getState().withProperty(BlockRedstoneWire.POWER, 15), 55, 15);
mapBlock(Blocks.diamond_ore, 56); mapBlock(Blocks.diamond_ore, 56);
mapBlock(Blocks.diamond_block, 57); mapBlock(Blocks.diamond_block, 57);
mapBlock(Blocks.workbench, 58); mapBlock(Blocks.workbench, 58);
@ -785,18 +762,18 @@ public abstract class Converter {
mapBlock(Blocks.iron_door, 71); mapBlock(Blocks.iron_door, 71);
mapBlock(Blocks.wooden_pressure_plate.getState().withProperty(BlockPressurePlate.POWERED, false), 72); mapBlock(Blocks.wooden_pressure_plate.getState().withProperty(BlockPressurePlate.POWERED, false), 72);
mapBlock(Blocks.wooden_pressure_plate.getState().withProperty(BlockPressurePlate.POWERED, true), 72, 1); mapBlock(Blocks.wooden_pressure_plate.getState().withProperty(BlockPressurePlate.POWERED, true), 72, 1);
mapBlock(Blocks.redstone_ore, 73); mapBlock(Blocks.charge_ore, 73);
mapBlock(Blocks.lit_redstone_ore, 74); mapBlock(Blocks.charge_ore, 74);
mapBlock(Blocks.unlit_redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.UP), 75); mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.UP), 75);
mapBlock(Blocks.unlit_redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.EAST), 75, 1); mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.EAST), 75, 1);
mapBlock(Blocks.unlit_redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.WEST), 75, 2); mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.WEST), 75, 2);
mapBlock(Blocks.unlit_redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.SOUTH), 75, 3); mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.SOUTH), 75, 3);
mapBlock(Blocks.unlit_redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.NORTH), 75, 4); mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.NORTH), 75, 4);
mapBlock(Blocks.redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.UP), 76); mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.UP), 76);
mapBlock(Blocks.redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.EAST), 76, 1); mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.EAST), 76, 1);
mapBlock(Blocks.redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.WEST), 76, 2); mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.WEST), 76, 2);
mapBlock(Blocks.redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.SOUTH), 76, 3); mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.SOUTH), 76, 3);
mapBlock(Blocks.redstone_torch.getState().withProperty(BlockRedstoneTorch.FACING, Facing.NORTH), 76, 4); mapBlock(Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.NORTH), 76, 4);
mapBlock(Blocks.stone_button.getState().withProperty(BlockButton.FACING, Facing.DOWN).withProperty(BlockButton.POWERED, false), 77, 0); mapBlock(Blocks.stone_button.getState().withProperty(BlockButton.FACING, Facing.DOWN).withProperty(BlockButton.POWERED, false), 77, 0);
mapBlock(Blocks.stone_button.getState().withProperty(BlockButton.FACING, Facing.EAST).withProperty(BlockButton.POWERED, false), 77, 1); mapBlock(Blocks.stone_button.getState().withProperty(BlockButton.FACING, Facing.EAST).withProperty(BlockButton.POWERED, false), 77, 1);
mapBlock(Blocks.stone_button.getState().withProperty(BlockButton.FACING, Facing.WEST).withProperty(BlockButton.POWERED, false), 77, 2); mapBlock(Blocks.stone_button.getState().withProperty(BlockButton.FACING, Facing.WEST).withProperty(BlockButton.POWERED, false), 77, 2);
@ -862,38 +839,6 @@ public abstract class Converter {
mapBlock(Blocks.cake.getState().withProperty(BlockCake.BITES, 4), 92, 4); mapBlock(Blocks.cake.getState().withProperty(BlockCake.BITES, 4), 92, 4);
mapBlock(Blocks.cake.getState().withProperty(BlockCake.BITES, 5), 92, 5); mapBlock(Blocks.cake.getState().withProperty(BlockCake.BITES, 5), 92, 5);
mapBlock(Blocks.cake.getState().withProperty(BlockCake.BITES, 6), 92, 6); mapBlock(Blocks.cake.getState().withProperty(BlockCake.BITES, 6), 92, 6);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 93, 0);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 93, 1);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 93, 2);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 93, 3);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 93, 4);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 93, 5);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 93, 6);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 93, 7);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 93, 8);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 93, 9);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 93, 10);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 93, 11);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 93, 12);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 93, 13);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 93, 14);
mapBlock(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 93, 15);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 94, 0);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 94, 1);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 94, 2);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 1).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 94, 3);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 94, 4);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 94, 5);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 94, 6);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 2).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 94, 7);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 94, 8);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 94, 9);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 94, 10);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 3).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 94, 11);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.SOUTH), 94, 12);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.WEST), 94, 13);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH), 94, 14);
mapBlock(Blocks.powered_repeater.getState().withProperty(BlockRedstoneRepeater.DELAY, 4).withProperty(BlockRedstoneRepeater.FACING, Facing.EAST), 94, 15);
mapBlock(new BlockFunction() { mapBlock(new BlockFunction() {
public State getState(int id, int data) { public State getState(int id, int data) {
return BlockStainedGlass.getByColor(COLOR_LOOKUP[data]).getState(); return BlockStainedGlass.getByColor(COLOR_LOOKUP[data]).getState();
@ -986,22 +931,22 @@ public abstract class Converter {
mapBlock(Blocks.vine.getState().withProperty(BlockVine.EAST, true).withProperty(BlockVine.NORTH, true).withProperty(BlockVine.SOUTH, true).withProperty(BlockVine.WEST, false), 106, 13); mapBlock(Blocks.vine.getState().withProperty(BlockVine.EAST, true).withProperty(BlockVine.NORTH, true).withProperty(BlockVine.SOUTH, true).withProperty(BlockVine.WEST, false), 106, 13);
mapBlock(Blocks.vine.getState().withProperty(BlockVine.EAST, true).withProperty(BlockVine.NORTH, true).withProperty(BlockVine.SOUTH, false).withProperty(BlockVine.WEST, true), 106, 14); mapBlock(Blocks.vine.getState().withProperty(BlockVine.EAST, true).withProperty(BlockVine.NORTH, true).withProperty(BlockVine.SOUTH, false).withProperty(BlockVine.WEST, true), 106, 14);
mapBlock(Blocks.vine.getState().withProperty(BlockVine.EAST, true).withProperty(BlockVine.NORTH, true).withProperty(BlockVine.SOUTH, true).withProperty(BlockVine.WEST, true), 106, 15); mapBlock(Blocks.vine.getState().withProperty(BlockVine.EAST, true).withProperty(BlockVine.NORTH, true).withProperty(BlockVine.SOUTH, true).withProperty(BlockVine.WEST, true), 106, 15);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 107, 0); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 107, 0);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 107, 1); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 107, 1);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 107, 2); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 107, 2);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 107, 3); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 107, 3);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 107, 4); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 107, 4);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 107, 5); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 107, 5);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 107, 6); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 107, 6);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 107, 7); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 107, 7);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 107, 8); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 107, 8);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 107, 9); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 107, 9);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 107, 10); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 107, 10);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 107, 11); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 107, 11);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 107, 12); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 107, 12);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 107, 13); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 107, 13);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 107, 14); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 107, 14);
mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 107, 15); mapBlock(Blocks.oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 107, 15);
mapBlock(Blocks.brick_stairs.getState().withProperty(BlockStairs.FACING, Facing.EAST).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 108, 0, 8); mapBlock(Blocks.brick_stairs.getState().withProperty(BlockStairs.FACING, Facing.EAST).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 108, 0, 8);
mapBlock(Blocks.brick_stairs.getState().withProperty(BlockStairs.FACING, Facing.WEST).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 108, 1, 9); mapBlock(Blocks.brick_stairs.getState().withProperty(BlockStairs.FACING, Facing.WEST).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 108, 1, 9);
mapBlock(Blocks.brick_stairs.getState().withProperty(BlockStairs.FACING, Facing.SOUTH).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 108, 2, 10); mapBlock(Blocks.brick_stairs.getState().withProperty(BlockStairs.FACING, Facing.SOUTH).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 108, 2, 10);
@ -1051,8 +996,8 @@ public abstract class Converter {
mapBlock(Blocks.obsidian, 120); mapBlock(Blocks.obsidian, 120);
mapBlock(Blocks.cell_rock, 121); mapBlock(Blocks.cell_rock, 121);
mapBlock(Blocks.dragon_egg, 122); mapBlock(Blocks.dragon_egg, 122);
mapBlock(Blocks.redstone_lamp, 123); mapBlock(Blocks.lamp, 123);
mapBlock(Blocks.lit_redstone_lamp, 124); mapBlock(Blocks.lit_lamp, 124);
mapBlock(Blocks.oak_planks, mapBlock(Blocks.oak_planks,
125); 125);
mapBlock(Blocks.spruce_planks, mapBlock(Blocks.spruce_planks,
@ -1248,38 +1193,6 @@ public abstract class Converter {
mapBlock(Blocks.heavy_weighted_pressure_plate.getState().withProperty(BlockPressurePlateWeighted.POWER, 13), 148, 13); mapBlock(Blocks.heavy_weighted_pressure_plate.getState().withProperty(BlockPressurePlateWeighted.POWER, 13), 148, 13);
mapBlock(Blocks.heavy_weighted_pressure_plate.getState().withProperty(BlockPressurePlateWeighted.POWER, 14), 148, 14); mapBlock(Blocks.heavy_weighted_pressure_plate.getState().withProperty(BlockPressurePlateWeighted.POWER, 14), 148, 14);
mapBlock(Blocks.heavy_weighted_pressure_plate.getState().withProperty(BlockPressurePlateWeighted.POWER, 15), 148, 15); mapBlock(Blocks.heavy_weighted_pressure_plate.getState().withProperty(BlockPressurePlateWeighted.POWER, 15), 148, 15);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 149, 0);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 149, 1);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 149, 2);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 149, 3);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 149, 4);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 149, 5);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 149, 6);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 149, 7);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 149, 8);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 149, 9);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 149, 10);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 149, 11);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 149, 12);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 149, 13);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 149, 14);
mapBlock(Blocks.comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 149, 15);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 150, 0);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 150, 1);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 150, 2);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, false), 150, 3);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 150, 4);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 150, 5);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 150, 6);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, false), 150, 7);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 150, 8);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 150, 9);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 150, 10);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.COMPARE).withProperty(BlockRedstoneComparator.POWERED, true), 150, 11);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.SOUTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 150, 12);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.WEST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 150, 13);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.NORTH).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 150, 14);
mapBlock(Blocks.powered_comparator.getState().withProperty(BlockRedstoneComparator.FACING, Facing.EAST).withProperty(BlockRedstoneComparator.MODE, Mode.SUBTRACT).withProperty(BlockRedstoneComparator.POWERED, true), 150, 15);
mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 0), 151, 0); mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 0), 151, 0);
mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 1), 151, 1); mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 1), 151, 1);
mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 2), 151, 2); mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 2), 151, 2);
@ -1296,18 +1209,18 @@ public abstract class Converter {
mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 13), 151, 13); mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 13), 151, 13);
mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 14), 151, 14); mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 14), 151, 14);
mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 15), 151, 15); mapBlock(Blocks.daylight_detector.getState().withProperty(BlockDaylightDetector.POWER, 15), 151, 15);
mapBlock(Blocks.redstone_block, 152); mapBlock(Blocks.charged_block, 152);
mapBlock(Blocks.quartz_ore, 153); mapBlock(Blocks.quartz_ore, 153);
mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, true).withProperty(BlockHopper.FACING, Facing.DOWN), 154, 0, 1, 6, 7); mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.DOWN), 154, 0, 1, 6, 7);
mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, true).withProperty(BlockHopper.FACING, Facing.NORTH), 154, 2); mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.NORTH), 154, 2);
mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, true).withProperty(BlockHopper.FACING, Facing.SOUTH), 154, 3); mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.SOUTH), 154, 3);
mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, true).withProperty(BlockHopper.FACING, Facing.WEST), 154, 4); mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.WEST), 154, 4);
mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, true).withProperty(BlockHopper.FACING, Facing.EAST), 154, 5); mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.EAST), 154, 5);
mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, false).withProperty(BlockHopper.FACING, Facing.DOWN), 154, 8, 9, 14, 15); mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.DOWN), 154, 8, 9, 14, 15);
mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, false).withProperty(BlockHopper.FACING, Facing.NORTH), 154, 10); mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.NORTH), 154, 10);
mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, false).withProperty(BlockHopper.FACING, Facing.SOUTH), 154, 11); mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.SOUTH), 154, 11);
mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, false).withProperty(BlockHopper.FACING, Facing.WEST), 154, 12); mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.WEST), 154, 12);
mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.ENABLED, false).withProperty(BlockHopper.FACING, Facing.EAST), 154, 13); mapBlock(Blocks.hopper.getState().withProperty(BlockHopper.FACING, Facing.EAST), 154, 13);
mapBlock(Blocks.quartz_block, 155); mapBlock(Blocks.quartz_block, 155);
mapBlock(Blocks.quartz_ornaments, 155, 1); mapBlock(Blocks.quartz_ornaments, 155, 1);
mapBlock(Blocks.quartz_pillar.getState().withProperty(BlockQuartzPillar.AXIS, Facing.Axis.Y), 155, 2); mapBlock(Blocks.quartz_pillar.getState().withProperty(BlockQuartzPillar.AXIS, Facing.Axis.Y), 155, 2);
@ -1321,30 +1234,30 @@ public abstract class Converter {
mapBlock(Blocks.quartz_stairs.getState().withProperty(BlockStairs.FACING, Facing.WEST).withProperty(BlockStairs.HALF, EnumHalf.TOP), 156, 5, 13); mapBlock(Blocks.quartz_stairs.getState().withProperty(BlockStairs.FACING, Facing.WEST).withProperty(BlockStairs.HALF, EnumHalf.TOP), 156, 5, 13);
mapBlock(Blocks.quartz_stairs.getState().withProperty(BlockStairs.FACING, Facing.SOUTH).withProperty(BlockStairs.HALF, EnumHalf.TOP), 156, 6, 14); mapBlock(Blocks.quartz_stairs.getState().withProperty(BlockStairs.FACING, Facing.SOUTH).withProperty(BlockStairs.HALF, EnumHalf.TOP), 156, 6, 14);
mapBlock(Blocks.quartz_stairs.getState().withProperty(BlockStairs.FACING, Facing.NORTH).withProperty(BlockStairs.HALF, EnumHalf.TOP), 156, 7, 15); mapBlock(Blocks.quartz_stairs.getState().withProperty(BlockStairs.FACING, Facing.NORTH).withProperty(BlockStairs.HALF, EnumHalf.TOP), 156, 7, 15);
mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.NORTH_SOUTH), 157, 0, 6, 7); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.NORTH_SOUTH), 157, 0, 6, 7);
mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.EAST_WEST), 157, 1); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.EAST_WEST), 157, 1);
mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_EAST), 157, 2); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_EAST), 157, 2);
mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_WEST), 157, 3); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_WEST), 157, 3);
mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_NORTH), 157, 4); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_NORTH), 157, 4);
mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, false).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 157, 5); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 157, 5);
mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.NORTH_SOUTH), 157, 8, 14, 15); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.NORTH_SOUTH), 157, 8, 14, 15);
mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.EAST_WEST), 157, 9); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.EAST_WEST), 157, 9);
mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_EAST), 157, 10); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_EAST), 157, 10);
mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_WEST), 157, 11); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_WEST), 157, 11);
mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_NORTH), 157, 12); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_NORTH), 157, 12);
mapBlock(Blocks.activator_rail.getState().withProperty(BlockRailPowered.POWERED, true).withProperty(BlockRailPowered.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 157, 13); mapBlock(Blocks.rail.getState().withProperty(BlockRail.SHAPE, EnumRailDirection.ASCENDING_SOUTH), 157, 13);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN).withProperty(BlockDropper.TRIGGERED, false), 158, 0, 6); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN), 158, 0, 6);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP).withProperty(BlockDropper.TRIGGERED, false), 158, 1, 7); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP), 158, 1, 7);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH).withProperty(BlockDropper.TRIGGERED, false), 158, 2); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH), 158, 2);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH).withProperty(BlockDropper.TRIGGERED, false), 158, 3); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH), 158, 3);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST).withProperty(BlockDropper.TRIGGERED, false), 158, 4); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST), 158, 4);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST).withProperty(BlockDropper.TRIGGERED, false), 158, 5); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST), 158, 5);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN).withProperty(BlockDropper.TRIGGERED, true), 158, 8, 14); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN), 158, 8, 14);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP).withProperty(BlockDropper.TRIGGERED, true), 158, 9, 15); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP), 158, 9, 15);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH).withProperty(BlockDropper.TRIGGERED, true), 158, 10); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH), 158, 10);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH).withProperty(BlockDropper.TRIGGERED, true), 158, 11); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH), 158, 11);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST).withProperty(BlockDropper.TRIGGERED, true), 158, 12); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST), 158, 12);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST).withProperty(BlockDropper.TRIGGERED, true), 158, 13); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST), 158, 13);
mapBlock(new BlockFunction() { mapBlock(new BlockFunction() {
public State getState(int id, int data) { public State getState(int id, int data) {
return BlockColoredClay.getByColor(COLOR_LOOKUP[data]).getState(); return BlockColoredClay.getByColor(COLOR_LOOKUP[data]).getState();
@ -1414,7 +1327,7 @@ public abstract class Converter {
mapBlock(Blocks.stonebrick, 168); mapBlock(Blocks.stonebrick, 168);
mapBlock(Blocks.smooth_rock, 168, 1); mapBlock(Blocks.smooth_rock, 168, 1);
mapBlock(Blocks.black_brick, 168, 2); mapBlock(Blocks.black_brick, 168, 2);
mapBlock(Blocks.lamp, 169); mapBlock(Blocks.lit_lamp, 169);
mapBlock(Blocks.hay_block.getState().withProperty(BlockHay.AXIS, Axis.Y), 170); mapBlock(Blocks.hay_block.getState().withProperty(BlockHay.AXIS, Axis.Y), 170);
mapBlock(Blocks.hay_block.getState().withProperty(BlockHay.AXIS, Axis.X), 170, 4, 5, 6, 7); mapBlock(Blocks.hay_block.getState().withProperty(BlockHay.AXIS, Axis.X), 170, 4, 5, 6, 7);
mapBlock(Blocks.hay_block.getState().withProperty(BlockHay.AXIS, Axis.Z), 170, 8, 9, 10, 11); mapBlock(Blocks.hay_block.getState().withProperty(BlockHay.AXIS, Axis.Z), 170, 8, 9, 10, 11);
@ -1465,86 +1378,86 @@ public abstract class Converter {
Facing.DOWN), 182); Facing.DOWN), 182);
mapBlock(Blocks.sandstone_slab.getState().withProperty(BlockSlab.FACING, mapBlock(Blocks.sandstone_slab.getState().withProperty(BlockSlab.FACING,
Facing.UP), 182, 8); Facing.UP), 182, 8);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 183, 0); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 183, 0);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 183, 1); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 183, 1);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 183, 2); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 183, 2);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 183, 3); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 183, 3);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 183, 4); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 183, 4);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 183, 5); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 183, 5);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 183, 6); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 183, 6);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 183, 7); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 183, 7);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 183, 8); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 183, 8);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 183, 9); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 183, 9);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 183, 10); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 183, 10);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 183, 11); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 183, 11);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 183, 12); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 183, 12);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 183, 13); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 183, 13);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 183, 14); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 183, 14);
mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 183, 15); mapBlock(Blocks.spruce_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 183, 15);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 184, 0); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 184, 0);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 184, 1); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 184, 1);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 184, 2); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 184, 2);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 184, 3); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 184, 3);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 184, 4); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 184, 4);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 184, 5); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 184, 5);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 184, 6); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 184, 6);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 184, 7); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 184, 7);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 184, 8); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 184, 8);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 184, 9); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 184, 9);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 184, 10); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 184, 10);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 184, 11); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 184, 11);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 184, 12); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 184, 12);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 184, 13); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 184, 13);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 184, 14); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 184, 14);
mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 184, 15); mapBlock(Blocks.birch_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 184, 15);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 185, 0); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 185, 0);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 185, 1); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 185, 1);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 185, 2); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 185, 2);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 185, 3); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 185, 3);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 185, 4); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 185, 4);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 185, 5); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 185, 5);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 185, 6); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 185, 6);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 185, 7); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 185, 7);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 185, 8); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 185, 8);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 185, 9); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 185, 9);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 185, 10); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 185, 10);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 185, 11); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 185, 11);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 185, 12); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 185, 12);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 185, 13); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 185, 13);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 185, 14); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 185, 14);
mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 185, 15); mapBlock(Blocks.jungle_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 185, 15);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 186, 0); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 186, 0);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 186, 1); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 186, 1);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 186, 2); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 186, 2);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 186, 3); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 186, 3);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 186, 4); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 186, 4);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 186, 5); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 186, 5);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 186, 6); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 186, 6);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 186, 7); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 186, 7);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 186, 8); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 186, 8);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 186, 9); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 186, 9);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 186, 10); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 186, 10);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 186, 11); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 186, 11);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 186, 12); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 186, 12);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 186, 13); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 186, 13);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 186, 14); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 186, 14);
mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 186, 15); mapBlock(Blocks.dark_oak_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 186, 15);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 187, 0); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 187, 0);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 187, 1); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 187, 1);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 187, 2); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 187, 2);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, false), 187, 3); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 187, 3);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 187, 4); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 187, 4);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 187, 5); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 187, 5);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 187, 6); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 187, 6);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, false), 187, 7); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 187, 7);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 187, 8); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, false), 187, 8);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 187, 9); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, false), 187, 9);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 187, 10); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, false), 187, 10);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false).withProperty(BlockFenceGate.POWERED, true), 187, 11); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, false), 187, 11);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 187, 12); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.SOUTH).withProperty(BlockFenceGate.OPEN, true), 187, 12);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 187, 13); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.WEST).withProperty(BlockFenceGate.OPEN, true), 187, 13);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 187, 14); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.NORTH).withProperty(BlockFenceGate.OPEN, true), 187, 14);
mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true).withProperty(BlockFenceGate.POWERED, true), 187, 15); mapBlock(Blocks.acacia_fence_gate.getState().withProperty(BlockFenceGate.FACING, Facing.EAST).withProperty(BlockFenceGate.OPEN, true), 187, 15);
mapBlock(Blocks.spruce_fence, 188); mapBlock(Blocks.spruce_fence, 188);
mapBlock(Blocks.birch_fence, 189); mapBlock(Blocks.birch_fence, 189);
mapBlock(Blocks.jungle_fence, 190); mapBlock(Blocks.jungle_fence, 190);
@ -1593,18 +1506,18 @@ public abstract class Converter {
mapBlock(Blocks.blood_brick, 215); mapBlock(Blocks.blood_brick, 215);
mapBlock(Blocks.quartz_block, 216); mapBlock(Blocks.quartz_block, 216);
mapBlock(Blocks.glass, 217); mapBlock(Blocks.glass, 217);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN).withProperty(BlockDropper.TRIGGERED, false), 218, 0, 6); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN), 218, 0, 6);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP).withProperty(BlockDropper.TRIGGERED, false), 218, 1, 7); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP), 218, 1, 7);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH).withProperty(BlockDropper.TRIGGERED, false), 218, 2); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH), 218, 2);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH).withProperty(BlockDropper.TRIGGERED, false), 218, 3); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH), 218, 3);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST).withProperty(BlockDropper.TRIGGERED, false), 218, 4); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST), 218, 4);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST).withProperty(BlockDropper.TRIGGERED, false), 218, 5); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST), 218, 5);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN).withProperty(BlockDropper.TRIGGERED, true), 218, 8, 14); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.DOWN), 218, 8, 14);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP).withProperty(BlockDropper.TRIGGERED, true), 218, 9, 15); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.UP), 218, 9, 15);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH).withProperty(BlockDropper.TRIGGERED, true), 218, 10); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.NORTH), 218, 10);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH).withProperty(BlockDropper.TRIGGERED, true), 218, 11); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.SOUTH), 218, 11);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST).withProperty(BlockDropper.TRIGGERED, true), 218, 12); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.WEST), 218, 12);
mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST).withProperty(BlockDropper.TRIGGERED, true), 218, 13); mapBlock(Blocks.dropper.getState().withProperty(BlockDropper.FACING, Facing.EAST), 218, 13);
for(int id = 219; id <= 234; id++) { for(int id = 219; id <= 234; id++) {
mapBlock(BlockWool.getByColor(COLOR_LOOKUP[id - 219]).getState(), id); mapBlock(BlockWool.getByColor(COLOR_LOOKUP[id - 219]).getState(), id);
} }
@ -1752,7 +1665,6 @@ public abstract class Converter {
else if(id == 64 || id == 71 || (id >= 193 && id <= 197)) else if(id == 64 || id == 71 || (id >= 193 && id <= 197))
return state.withProperty(BlockDoor.HALF, (meta & 8) > 0 ? BlockDoor.EnumDoorHalf.UPPER : BlockDoor.EnumDoorHalf.LOWER) return state.withProperty(BlockDoor.HALF, (meta & 8) > 0 ? BlockDoor.EnumDoorHalf.UPPER : BlockDoor.EnumDoorHalf.LOWER)
.withProperty(BlockDoor.HINGE, (((meta & 8) > 0 ? meta : up) & 1) > 0 ? BlockDoor.EnumHingePosition.RIGHT : BlockDoor.EnumHingePosition.LEFT) .withProperty(BlockDoor.HINGE, (((meta & 8) > 0 ? meta : up) & 1) > 0 ? BlockDoor.EnumHingePosition.RIGHT : BlockDoor.EnumHingePosition.LEFT)
.withProperty(BlockDoor.POWERED, (((meta & 8) > 0 ? meta : up) & 2) > 0)
.withProperty(BlockDoor.OPEN, (((meta & 8) > 0 ? down : meta) & 4) > 0) .withProperty(BlockDoor.OPEN, (((meta & 8) > 0 ? down : meta) & 4) > 0)
.withProperty(BlockDoor.FACING, Facing.getHorizontal(((meta & 8) > 0 ? down : meta) & 3).rotateYCCW()); .withProperty(BlockDoor.FACING, Facing.getHorizontal(((meta & 8) > 0 ? down : meta) & 3).rotateYCCW());
else else

View file

@ -15,7 +15,7 @@ public abstract class LootConstants {
new RngLoot(Items.diamond_horse_armor, 1, 1, 1)); new RngLoot(Items.diamond_horse_armor, 1, 1, 1));
public static final WeightedList<RngLoot> STRONGHOLD_CHEST = new WeightedList(new RngLoot(Items.orb, 1, 1, 10), public static final WeightedList<RngLoot> STRONGHOLD_CHEST = new WeightedList(new RngLoot(Items.orb, 1, 1, 10),
new RngLoot(Items.diamond, 1, 3, 3), new RngLoot(Items.iron_ingot, 1, 5, 10), new RngLoot(Items.gold_ingot, 1, 3, 5), new RngLoot(Items.diamond, 1, 3, 3), new RngLoot(Items.iron_ingot, 1, 5, 10), new RngLoot(Items.gold_ingot, 1, 3, 5),
new RngLoot(Items.redstone, 4, 9, 5), new RngLoot(Items.bread, 1, 3, 15), new RngLoot(Items.apple, 1, 3, 15), new RngLoot(Items.charged_powder, 4, 9, 5), new RngLoot(Items.bread, 1, 3, 15), new RngLoot(Items.apple, 1, 3, 15),
new RngLoot(Items.iron_pickaxe, 1, 1, 5), new RngLoot(Items.iron_sword, 1, 1, 5), new RngLoot(Items.iron_chestplate, 1, 1, 5), new RngLoot(Items.iron_pickaxe, 1, 1, 5), new RngLoot(Items.iron_sword, 1, 1, 5), new RngLoot(Items.iron_chestplate, 1, 1, 5),
new RngLoot(Items.iron_helmet, 1, 1, 5), new RngLoot(Items.iron_leggings, 1, 1, 5), new RngLoot(Items.iron_boots, 1, 1, 5), new RngLoot(Items.iron_helmet, 1, 1, 5), new RngLoot(Items.iron_leggings, 1, 1, 5), new RngLoot(Items.iron_boots, 1, 1, 5),
new RngLoot(Items.golden_apple, 1, 1, 1), new RngLoot(Items.saddle, 1, 1, 1), new RngLoot(Items.iron_horse_armor, 1, 1, 1), new RngLoot(Items.golden_apple, 1, 1, 1), new RngLoot(Items.saddle, 1, 1, 1), new RngLoot(Items.iron_horse_armor, 1, 1, 1),
@ -23,7 +23,7 @@ public abstract class LootConstants {
public static final WeightedList<RngLoot> STRONGHOLD_LIBRARY = new WeightedList(new RngLoot(Items.book, 1, 3, 20), public static final WeightedList<RngLoot> STRONGHOLD_LIBRARY = new WeightedList(new RngLoot(Items.book, 1, 3, 20),
new RngLoot(Items.paper, 2, 7, 20), new RngLoot(Items.string, 1, 1, 1), new RngLoot(Items.navigator, 1, 1, 1)); new RngLoot(Items.paper, 2, 7, 20), new RngLoot(Items.string, 1, 1, 1), new RngLoot(Items.navigator, 1, 1, 1));
public static final WeightedList<RngLoot> STRONGHOLD_CROSS = new WeightedList(new RngLoot(Items.iron_ingot, 1, 5, 10), public static final WeightedList<RngLoot> STRONGHOLD_CROSS = new WeightedList(new RngLoot(Items.iron_ingot, 1, 5, 10),
new RngLoot(Items.gold_ingot, 1, 3, 5), new RngLoot(Items.redstone, 4, 9, 5), new RngLoot(Items.coal, 3, 8, 10), new RngLoot(Items.gold_ingot, 1, 3, 5), new RngLoot(Items.charged_powder, 4, 9, 5), new RngLoot(Items.coal, 3, 8, 10),
new RngLoot(Items.bread, 1, 3, 15), new RngLoot(Items.apple, 1, 3, 15), new RngLoot(Items.iron_pickaxe, 1, 1, 1)); new RngLoot(Items.bread, 1, 3, 15), new RngLoot(Items.apple, 1, 3, 15), new RngLoot(Items.iron_pickaxe, 1, 1, 1));
public static final WeightedList<RngLoot> DESERT_PYRAMID = new WeightedList(new RngLoot(Items.diamond, 1, 3, 3), public static final WeightedList<RngLoot> DESERT_PYRAMID = new WeightedList(new RngLoot(Items.diamond, 1, 3, 3),
new RngLoot(Items.iron_ingot, 1, 5, 10), new RngLoot(Items.gold_ingot, 2, 7, 15), new RngLoot(Items.emerald, 1, 3, 2), new RngLoot(Items.iron_ingot, 1, 5, 10), new RngLoot(Items.gold_ingot, 2, 7, 15), new RngLoot(Items.emerald, 1, 3, 2),
@ -37,7 +37,7 @@ public abstract class LootConstants {
new RngLoot(Items.diamond_horse_armor, 1, 1, 1)); new RngLoot(Items.diamond_horse_armor, 1, 1, 1));
public static final WeightedList<RngLoot> JUNGLE_TRAP = new WeightedList(new RngLoot(Items.arrow, 2, 7, 30)); public static final WeightedList<RngLoot> JUNGLE_TRAP = new WeightedList(new RngLoot(Items.arrow, 2, 7, 30));
public static final WeightedList<RngLoot> MINESHAFT_CHEST = new WeightedList(new RngLoot(Items.iron_ingot, 1, 5, 10), public static final WeightedList<RngLoot> MINESHAFT_CHEST = new WeightedList(new RngLoot(Items.iron_ingot, 1, 5, 10),
new RngLoot(Items.gold_ingot, 1, 3, 5), new RngLoot(Items.redstone, 4, 9, 5), new RngLoot(Items.gold_ingot, 1, 3, 5), new RngLoot(Items.charged_powder, 4, 9, 5),
new RngLoot(Items.lapis_lazuli, 4, 9, 5), new RngLoot(Items.diamond, 1, 2, 3), new RngLoot(Items.lapis_lazuli, 4, 9, 5), new RngLoot(Items.diamond, 1, 2, 3),
new RngLoot(Items.coal, 3, 8, 10), new RngLoot(Items.bread, 1, 3, 15), new RngLoot(Items.iron_pickaxe, 1, 1, 1), new RngLoot(Items.coal, 3, 8, 10), new RngLoot(Items.bread, 1, 3, 15), new RngLoot(Items.iron_pickaxe, 1, 1, 1),
new RngLoot(Items.rail, 4, 8, 1), new RngLoot(Items.melon_stem, 2, 4, 10), new RngLoot(Items.rail, 4, 8, 1), new RngLoot(Items.melon_stem, 2, 4, 10),
@ -51,7 +51,7 @@ public abstract class LootConstants {
public static final WeightedList<RngLoot> DUNGEON_CHEST = new WeightedList(new RngLoot(Items.saddle, 1, 1, 11), public static final WeightedList<RngLoot> DUNGEON_CHEST = new WeightedList(new RngLoot(Items.saddle, 1, 1, 11),
new RngLoot(Items.iron_ingot, 1, 4, 11), new RngLoot(Items.bread, 1, 1, 11), new RngLoot(Items.wheats, 1, 4, 11), new RngLoot(Items.iron_ingot, 1, 4, 11), new RngLoot(Items.bread, 1, 1, 11), new RngLoot(Items.wheats, 1, 4, 11),
new RngLoot(Items.gunpowder, 1, 4, 11), new RngLoot(Items.string, 1, 4, 11), new RngLoot(Items.bucket, 1, 1, 11), new RngLoot(Items.gunpowder, 1, 4, 11), new RngLoot(Items.string, 1, 4, 11), new RngLoot(Items.bucket, 1, 1, 11),
new RngLoot(Items.golden_apple, 1, 1, 1), new RngLoot(Items.redstone, 1, 4, 11), new RngLoot(Items.aluminium_ingot, 1, 1, 5), new RngLoot(Items.golden_apple, 1, 1, 1), new RngLoot(Items.charged_powder, 1, 4, 11), new RngLoot(Items.aluminium_ingot, 1, 1, 5),
new RngLoot(Items.copper_ingot, 1, 1, 5), new RngLoot(Items.name_tag, 1, 1, 11), new RngLoot(Items.gold_horse_armor, 1, 1, 3), new RngLoot(Items.copper_ingot, 1, 1, 5), new RngLoot(Items.name_tag, 1, 1, 11), new RngLoot(Items.gold_horse_armor, 1, 1, 3),
new RngLoot(Items.iron_horse_armor, 1, 1, 6), new RngLoot(Items.diamond_horse_armor, 1, 1, 2), new RngLoot(Items.iron_horse_armor, 1, 1, 6), new RngLoot(Items.diamond_horse_armor, 1, 1, 2),
new RngLoot(Items.record_13, 1, 1, 1), new RngLoot(Items.record_cat, 1, 1, 1), new RngLoot(Items.record_blocks, 1, 1, 1), new RngLoot(Items.record_13, 1, 1, 1), new RngLoot(Items.record_cat, 1, 1, 1), new RngLoot(Items.record_blocks, 1, 1, 1),

View file

@ -11,7 +11,6 @@ import common.block.tech.BlockDispenser;
import common.block.tech.BlockLever; import common.block.tech.BlockLever;
import common.block.tech.BlockPistonBase; import common.block.tech.BlockPistonBase;
import common.block.tech.BlockRail; import common.block.tech.BlockRail;
import common.block.tech.BlockRailBase;
import common.init.Blocks; import common.init.Blocks;
import common.item.RngLoot; import common.item.RngLoot;
import common.item.block.ItemDoor; import common.item.block.ItemDoor;
@ -265,12 +264,12 @@ public abstract class StructureComponent
{ {
if (this.coordBaseMode == Facing.WEST || this.coordBaseMode == Facing.EAST) if (this.coordBaseMode == Facing.WEST || this.coordBaseMode == Facing.EAST)
{ {
if (state.getValue(BlockRail.SHAPE) == BlockRailBase.EnumRailDirection.EAST_WEST) if (state.getValue(BlockRail.SHAPE) == BlockRail.EnumRailDirection.EAST_WEST)
{ {
return state.withProperty(BlockRail.SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH); return state.withProperty(BlockRail.SHAPE, BlockRail.EnumRailDirection.NORTH_SOUTH);
} }
return state.withProperty(BlockRail.SHAPE, BlockRailBase.EnumRailDirection.EAST_WEST); return state.withProperty(BlockRail.SHAPE, BlockRail.EnumRailDirection.EAST_WEST);
} }
} }
else if (blockIn instanceof Rotatable) else if (blockIn instanceof Rotatable)

View file

@ -5,7 +5,6 @@ import java.util.List;
import common.block.tech.BlockChest; import common.block.tech.BlockChest;
import common.block.tech.BlockRail; import common.block.tech.BlockRail;
import common.block.tech.BlockRailBase;
import common.block.tech.BlockTorch; import common.block.tech.BlockTorch;
import common.entity.npc.EntityArachnoid; import common.entity.npc.EntityArachnoid;
import common.init.Blocks; import common.init.Blocks;
@ -352,8 +351,8 @@ public class StructureMineshaft
this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 2, 2, k1 - 2, Blocks.web.getState()); this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 2, 2, k1 - 2, Blocks.web.getState());
this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 0, 2, k1 + 2, Blocks.web.getState()); this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 0, 2, k1 + 2, Blocks.web.getState());
this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 2, 2, k1 + 2, Blocks.web.getState()); this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 2, 2, k1 + 2, Blocks.web.getState());
this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k1 - 1, Blocks.torch.getState().withProperty(BlockTorch.FACING, Facing.UP)); this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k1 - 1, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.UP));
this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k1 + 1, Blocks.torch.getState().withProperty(BlockTorch.FACING, Facing.UP)); this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.05F, 1, 2, k1 + 1, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, Facing.UP));
if (randomIn.zrange(100) == 0) if (randomIn.zrange(100) == 0)
{ {
@ -407,7 +406,7 @@ public class StructureMineshaft
if (iblockstate.getBlock() != Blocks.air && iblockstate.getBlock().isFullBlock()) if (iblockstate.getBlock() != Blocks.air && iblockstate.getBlock().isFullBlock())
{ {
this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.7F, 1, 0, l2, this.getMetadataWithOffset(Blocks.rail.getState().withProperty(BlockRail.SHAPE, BlockRailBase.EnumRailDirection.NORTH_SOUTH))); this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.7F, 1, 0, l2, this.getMetadataWithOffset(Blocks.rail.getState().withProperty(BlockRail.SHAPE, BlockRail.EnumRailDirection.NORTH_SOUTH)));
} }
} }
} }

View file

@ -4,7 +4,6 @@ import common.block.artificial.BlockStairs;
import common.block.foliage.BlockVine; import common.block.foliage.BlockVine;
import common.block.tech.BlockLever; import common.block.tech.BlockLever;
import common.block.tech.BlockPistonBase; import common.block.tech.BlockPistonBase;
import common.block.tech.BlockRedstoneRepeater;
import common.block.tech.BlockTripWire; import common.block.tech.BlockTripWire;
import common.block.tech.BlockTripWireHook; import common.block.tech.BlockTripWireHook;
import common.entity.npc.EntityMage; import common.entity.npc.EntityMage;
@ -354,7 +353,7 @@ public class StructureScattered
private boolean placedHiddenChest; private boolean placedHiddenChest;
private boolean placedTrap1; private boolean placedTrap1;
private boolean placedTrap2; private boolean placedTrap2;
private static StructureScattered.JunglePyramid.Stones junglePyramidsRandomScatteredStones = new StructureScattered.JunglePyramid.Stones(); private static StructureScattered.JunglePyramid.Stones scattered = new StructureScattered.JunglePyramid.Stones();
public JunglePyramid() public JunglePyramid()
{ {
@ -395,19 +394,19 @@ public class StructureScattered
State j = this.getMetadataWithOffset(Blocks.cobblestone_stairs.getState().withProperty(BlockStairs.FACING, Facing.SOUTH)); State j = this.getMetadataWithOffset(Blocks.cobblestone_stairs.getState().withProperty(BlockStairs.FACING, Facing.SOUTH));
State k = this.getMetadataWithOffset(Blocks.cobblestone_stairs.getState().withProperty(BlockStairs.FACING, Facing.EAST)); State k = this.getMetadataWithOffset(Blocks.cobblestone_stairs.getState().withProperty(BlockStairs.FACING, Facing.EAST));
State l = this.getMetadataWithOffset(Blocks.cobblestone_stairs.getState().withProperty(BlockStairs.FACING, Facing.WEST)); State l = this.getMetadataWithOffset(Blocks.cobblestone_stairs.getState().withProperty(BlockStairs.FACING, Facing.WEST));
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, -4, 0, this.scatteredFeatureSizeX - 1, 0, this.scatteredFeatureSizeZ - 1, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 2, 9, 2, 2, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 2, 9, 2, 2, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 12, 9, 2, 12, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 12, 9, 2, 12, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 3, 2, 2, 11, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 1, 3, 2, 2, 11, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 1, 3, 9, 2, 11, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 1, 3, 9, 2, 11, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 1, 10, 6, 1, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 1, 10, 6, 1, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 13, 10, 6, 13, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 13, 10, 6, 13, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 2, 1, 6, 12, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, 3, 2, 1, 6, 12, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 10, 3, 2, 10, 6, 12, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 10, 3, 2, 10, 6, 12, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 3, 2, 9, 3, 12, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 3, 2, 9, 3, 12, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 6, 2, 9, 6, 12, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 6, 2, 9, 6, 12, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 3, 7, 3, 8, 7, 11, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 3, 7, 3, 8, 7, 11, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 8, 4, 7, 8, 10, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 8, 4, 7, 8, 10, false, randomIn, scattered);
this.fillWithAir(worldIn, structureBoundingBoxIn, 3, 1, 3, 8, 2, 11); this.fillWithAir(worldIn, structureBoundingBoxIn, 3, 1, 3, 8, 2, 11);
this.fillWithAir(worldIn, structureBoundingBoxIn, 4, 3, 6, 7, 3, 9); this.fillWithAir(worldIn, structureBoundingBoxIn, 4, 3, 6, 7, 3, 9);
this.fillWithAir(worldIn, structureBoundingBoxIn, 2, 4, 2, 9, 5, 12); this.fillWithAir(worldIn, structureBoundingBoxIn, 2, 4, 2, 9, 5, 12);
@ -424,34 +423,34 @@ public class StructureScattered
for (int i1 = 0; i1 <= 14; i1 += 14) for (int i1 = 0; i1 <= 14; i1 += 14)
{ {
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 4, i1, 2, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 4, i1, 2, 5, i1, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 4, i1, 4, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 4, i1, 4, 5, i1, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 4, i1, 7, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 4, i1, 7, 5, i1, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 4, i1, 9, 5, i1, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 4, i1, 9, 5, i1, false, randomIn, scattered);
} }
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 6, 0, 6, 6, 0, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 6, 0, 6, 6, 0, false, randomIn, scattered);
for (int k1 = 0; k1 <= 11; k1 += 11) for (int k1 = 0; k1 <= 11; k1 += 11)
{ {
for (int j1 = 2; j1 <= 12; j1 += 2) for (int j1 = 2; j1 <= 12; j1 += 2)
{ {
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 4, j1, k1, 5, j1, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 4, j1, k1, 5, j1, false, randomIn, scattered);
} }
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 6, 5, k1, 6, 5, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 6, 5, k1, 6, 5, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 6, 9, k1, 6, 9, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, k1, 6, 9, k1, 6, 9, false, randomIn, scattered);
} }
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 7, 2, 2, 9, 2, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 7, 2, 2, 9, 2, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 7, 2, 9, 9, 2, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 7, 2, 9, 9, 2, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 7, 12, 2, 9, 12, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, 7, 12, 2, 9, 12, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 7, 12, 9, 9, 12, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, 7, 12, 9, 9, 12, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 9, 4, 4, 9, 4, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 9, 4, 4, 9, 4, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 9, 4, 7, 9, 4, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 9, 4, 7, 9, 4, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 9, 10, 4, 9, 10, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 9, 10, 4, 9, 10, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 9, 10, 7, 9, 10, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 9, 10, 7, 9, 10, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 9, 7, 6, 9, 7, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 9, 7, 6, 9, 7, false, randomIn, scattered);
this.setBlockState(worldIn, i, 5, 9, 6, structureBoundingBoxIn); this.setBlockState(worldIn, i, 5, 9, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, i, 6, 9, 6, structureBoundingBoxIn); this.setBlockState(worldIn, i, 6, 9, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, j, 5, 9, 8, structureBoundingBoxIn); this.setBlockState(worldIn, j, 5, 9, 8, structureBoundingBoxIn);
@ -466,10 +465,10 @@ public class StructureScattered
this.setBlockState(worldIn, i, 7, 1, 8, structureBoundingBoxIn); this.setBlockState(worldIn, i, 7, 1, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, i, 7, 2, 9, structureBoundingBoxIn); this.setBlockState(worldIn, i, 7, 2, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, i, 7, 3, 10, structureBoundingBoxIn); this.setBlockState(worldIn, i, 7, 3, 10, structureBoundingBoxIn);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 9, 4, 1, 9, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 9, 4, 1, 9, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 1, 9, 7, 1, 9, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, 1, 9, 7, 1, 9, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 10, 7, 2, 10, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 4, 1, 10, 7, 2, 10, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 4, 5, 6, 4, 5, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 5, 4, 5, 6, 4, 5, false, randomIn, scattered);
this.setBlockState(worldIn, k, 4, 4, 5, structureBoundingBoxIn); this.setBlockState(worldIn, k, 4, 4, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, l, 7, 4, 5, structureBoundingBoxIn); this.setBlockState(worldIn, l, 7, 4, 5, structureBoundingBoxIn);
@ -486,30 +485,22 @@ public class StructureScattered
for (int i2 = 1; i2 <= 13; i2 += 2) for (int i2 = 1; i2 <= 13; i2 += 2)
{ {
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, -3, i2, 1, -2, i2, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, -3, i2, 1, -2, i2, false, randomIn, scattered);
} }
for (int j2 = 2; j2 <= 12; j2 += 2) for (int j2 = 2; j2 <= 12; j2 += 2)
{ {
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, -1, j2, 3, -1, j2, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 1, -1, j2, 3, -1, j2, false, randomIn, scattered);
} }
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, -2, 1, 5, -2, 1, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 2, -2, 1, 5, -2, 1, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, -2, 1, 9, -2, 1, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 7, -2, 1, 9, -2, 1, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 6, -3, 1, 6, -3, 1, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 6, -3, 1, 6, -3, 1, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 6, -1, 1, 6, -1, 1, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 6, -1, 1, 6, -1, 1, false, randomIn, scattered);
this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.FACING, Facing.EAST).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true))), 1, -3, 8, structureBoundingBoxIn); this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.FACING, Facing.EAST).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true))), 1, -3, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.FACING, Facing.WEST).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true))), 4, -3, 8, structureBoundingBoxIn); this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.FACING, Facing.WEST).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true))), 4, -3, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 2, -3, 8, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 2, -3, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 3, -3, 8, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 3, -3, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 7, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 4, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 5, -3, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 4, -3, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 3, -3, 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 3, -3, 1, structureBoundingBoxIn);
if (!this.placedTrap1) if (!this.placedTrap1)
@ -523,11 +514,7 @@ public class StructureScattered
this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 7, -3, 2, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 7, -3, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 7, -3, 3, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 7, -3, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 7, -3, 4, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, Boolean.valueOf(true)), 7, -3, 4, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 8, -3, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 9, -3, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 9, -3, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 9, -3, 4, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 9, -3, 4, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 9, -2, 4, structureBoundingBoxIn);
if (!this.placedTrap2) if (!this.placedTrap2)
{ {
@ -551,7 +538,7 @@ public class StructureScattered
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 7, -2, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 7, -2, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 7, -1, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 7, -1, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 8, -3, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 8, -3, 5, structureBoundingBoxIn);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, -1, 1, 9, -1, 5, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 9, -1, 1, 9, -1, 5, false, randomIn, scattered);
this.fillWithAir(worldIn, structureBoundingBoxIn, 8, -3, 8, 10, -1, 10); this.fillWithAir(worldIn, structureBoundingBoxIn, 8, -3, 8, 10, -1, 10);
this.setBlockState(worldIn, Blocks.carved_stonebrick.getState(), 8, -2, 11, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.carved_stonebrick.getState(), 8, -2, 11, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.carved_stonebrick.getState(), 9, -2, 11, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.carved_stonebrick.getState(), 9, -2, 11, structureBoundingBoxIn);
@ -559,16 +546,12 @@ public class StructureScattered
this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.lever.getState().withProperty(BlockLever.FACING, BlockLever.EnumOrientation.NORTH)), 8, -2, 12, structureBoundingBoxIn); this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.lever.getState().withProperty(BlockLever.FACING, BlockLever.EnumOrientation.NORTH)), 8, -2, 12, structureBoundingBoxIn);
this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.lever.getState().withProperty(BlockLever.FACING, BlockLever.EnumOrientation.NORTH)), 9, -2, 12, structureBoundingBoxIn); this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.lever.getState().withProperty(BlockLever.FACING, BlockLever.EnumOrientation.NORTH)), 9, -2, 12, structureBoundingBoxIn);
this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.lever.getState().withProperty(BlockLever.FACING, BlockLever.EnumOrientation.NORTH)), 10, -2, 12, structureBoundingBoxIn); this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.lever.getState().withProperty(BlockLever.FACING, BlockLever.EnumOrientation.NORTH)), 10, -2, 12, structureBoundingBoxIn);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 8, -3, 8, 8, -3, 10, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 8, -3, 8, 8, -3, 10, false, randomIn, scattered);
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 10, -3, 8, 10, -3, 10, false, randomIn, junglePyramidsRandomScatteredStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 10, -3, 8, 10, -3, 10, false, randomIn, scattered);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 10, -2, 9, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 10, -2, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 8, -2, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 8, -2, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.redstone.getState(), 10, -1, 9, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.sticky_piston.getState().withProperty(BlockPistonBase.FACING, Facing.UP), 9, -2, 8, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.sticky_piston.getState().withProperty(BlockPistonBase.FACING, Facing.UP), 9, -2, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.sticky_piston.getState().withProperty(BlockPistonBase.FACING, Facing.WEST)), 10, -2, 8, structureBoundingBoxIn); this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.sticky_piston.getState().withProperty(BlockPistonBase.FACING, Facing.WEST)), 10, -2, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.sticky_piston.getState().withProperty(BlockPistonBase.FACING, Facing.WEST)), 10, -1, 8, structureBoundingBoxIn); this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.sticky_piston.getState().withProperty(BlockPistonBase.FACING, Facing.WEST)), 10, -1, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.repeater.getState().withProperty(BlockRedstoneRepeater.FACING, Facing.NORTH)), 10, -2, 10, structureBoundingBoxIn);
if (!this.placedHiddenChest) if (!this.placedHiddenChest)
{ {

View file

@ -532,7 +532,7 @@ public class StructureStronghold
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 5, 7, 4, 5, 9, Blocks.concrete_slab.getState(), Blocks.concrete_slab.getState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 5, 7, 4, 5, 9, Blocks.concrete_slab.getState(), Blocks.concrete_slab.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 7, 8, 5, 9, Blocks.concrete_slab.getState(), Blocks.concrete_slab.getState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 8, 5, 7, 8, 5, 9, Blocks.concrete_slab.getState(), Blocks.concrete_slab.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 7, 7, 5, 9, Blocks.concrete.getState(), Blocks.concrete.getState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 5, 5, 7, 7, 5, 9, Blocks.concrete.getState(), Blocks.concrete.getState(), false);
this.setBlockState(worldIn, Blocks.torch.getState(), 6, 5, 6, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState(), 6, 5, 6, structureBoundingBoxIn);
return true; return true;
} }
} }
@ -668,8 +668,8 @@ public class StructureStronghold
{ {
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, l, 1, 4, l, Blocks.oak_planks.getState(), Blocks.oak_planks.getState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 1, l, 1, 4, l, Blocks.oak_planks.getState(), Blocks.oak_planks.getState(), false);
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, l, 12, 4, l, Blocks.oak_planks.getState(), Blocks.oak_planks.getState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 12, 1, l, 12, 4, l, Blocks.oak_planks.getState(), Blocks.oak_planks.getState(), false);
this.setBlockState(worldIn, Blocks.torch.getState(), 2, 3, l, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState(), 2, 3, l, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState(), 11, 3, l, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState(), 11, 3, l, structureBoundingBoxIn);
if (this.isLargeRoom) if (this.isLargeRoom)
{ {
@ -735,12 +735,12 @@ public class StructureStronghold
this.setBlockState(worldIn, Blocks.oak_fence.getState(), i1 - 1, 7, j1 + 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.oak_fence.getState(), i1 - 1, 7, j1 + 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.oak_fence.getState(), i1, 7, j1 - 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.oak_fence.getState(), i1, 7, j1 - 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.oak_fence.getState(), i1, 7, j1 + 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.oak_fence.getState(), i1, 7, j1 + 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState(), i1 - 2, 8, j1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState(), i1 - 2, 8, j1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState(), i1 + 1, 8, j1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState(), i1 + 1, 8, j1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState(), i1 - 1, 8, j1 - 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState(), i1 - 1, 8, j1 - 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState(), i1 - 1, 8, j1 + 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState(), i1 - 1, 8, j1 + 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState(), i1, 8, j1 - 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState(), i1, 8, j1 - 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState(), i1, 8, j1 + 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState(), i1, 8, j1 + 1, structureBoundingBoxIn);
} }
this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 3, 5, RngLoot.addToList(LootConstants.STRONGHOLD_LIBRARY, ItemEnchantedBook.getRandom(randomIn, 1, 5, 2)), 1 + randomIn.zrange(4)); this.generateChestContents(worldIn, structureBoundingBoxIn, randomIn, 3, 3, 5, RngLoot.addToList(LootConstants.STRONGHOLD_LIBRARY, ItemEnchantedBook.getRandom(randomIn, 1, 5, 2)), 1 + randomIn.zrange(4));
@ -1076,10 +1076,10 @@ public class StructureStronghold
this.setBlockState(worldIn, Blocks.stonebrick.getState(), 5, 1, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.stonebrick.getState(), 5, 1, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stonebrick.getState(), 5, 2, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.stonebrick.getState(), 5, 2, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.stonebrick.getState(), 5, 3, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.stonebrick.getState(), 5, 3, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState(), 4, 3, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState(), 4, 3, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState(), 6, 3, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState(), 6, 3, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState(), 5, 3, 4, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState(), 5, 3, 4, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState(), 5, 3, 6, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState(), 5, 3, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.concrete_slab.getState(), 4, 1, 4, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.concrete_slab.getState(), 4, 1, 4, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.concrete_slab.getState(), 4, 1, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.concrete_slab.getState(), 4, 1, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.concrete_slab.getState(), 4, 1, 6, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.concrete_slab.getState(), 4, 1, 6, structureBoundingBoxIn);
@ -1135,7 +1135,7 @@ public class StructureStronghold
this.setBlockState(worldIn, Blocks.cobblestone.getState(), 6, k, 6, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.cobblestone.getState(), 6, k, 6, structureBoundingBoxIn);
} }
this.setBlockState(worldIn, Blocks.torch.getState(), 5, 3, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState(), 5, 3, 5, structureBoundingBoxIn);
for (int l = 2; l <= 8; ++l) for (int l = 2; l <= 8; ++l)
{ {
@ -1440,10 +1440,10 @@ public class StructureStronghold
this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 6, true, randomIn, StructureStronghold.strongholdStones); this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 6, true, randomIn, StructureStronghold.strongholdStones);
this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 1, 0); this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.field_143013_d, 1, 1, 0);
this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStronghold.Stronghold.Door.OPENING, 1, 1, 6); this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStronghold.Stronghold.Door.OPENING, 1, 1, 6);
this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 1, 2, 1, Blocks.torch.getState()); this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 1, 2, 1, Blocks.lit_torch.getState());
this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 3, 2, 1, Blocks.torch.getState()); this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 3, 2, 1, Blocks.lit_torch.getState());
this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 1, 2, 5, Blocks.torch.getState()); this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 1, 2, 5, Blocks.lit_torch.getState());
this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 3, 2, 5, Blocks.torch.getState()); this.randomlyPlaceBlock(worldIn, structureBoundingBoxIn, randomIn, 0.1F, 3, 2, 5, Blocks.lit_torch.getState());
if (this.expandsX) if (this.expandsX)
{ {

View file

@ -342,10 +342,10 @@ public class StructureVillage
this.setBlockState(worldIn, Blocks.glass_pane.getState(), 0, 3, 6, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.glass_pane.getState(), 0, 3, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.glass_pane.getState(), 4, 3, 6, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.glass_pane.getState(), 4, 3, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.glass_pane.getState(), 2, 3, 8, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.glass_pane.getState(), 2, 3, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 2, 4, 7, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 2, 4, 7, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateY()), 1, 4, 6, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateY()), 1, 4, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateYCCW()), 3, 4, 6, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateYCCW()), 3, 4, 6, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 4, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 4, 5, structureBoundingBoxIn);
State i = this.getMetadataWithOffset(Blocks.ladder.getState().withProperty(BlockLadder.FACING, Facing.WEST)); State i = this.getMetadataWithOffset(Blocks.ladder.getState().withProperty(BlockLadder.FACING, Facing.WEST));
for (int j = 1; j <= 9; ++j) for (int j = 1; j <= 9; ++j)
@ -679,7 +679,7 @@ public class StructureVillage
this.setBlockState(worldIn, Blocks.concrete.getState(), 6, 1, 2, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.concrete.getState(), 6, 1, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 2, 1, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 2, 1, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 2, 2, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 2, 2, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn);
this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 2, 1, 0, this.getMetadataWithOffset(Blocks.oak_door.getState().withProperty(BlockDoor.FACING, Facing.SOUTH))); this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 2, 1, 0, this.getMetadataWithOffset(Blocks.oak_door.getState().withProperty(BlockDoor.FACING, Facing.SOUTH)));
if (this.getBlockStateFromPos(worldIn, 2, 0, -1, structureBoundingBoxIn).getBlock() == Blocks.air && this.getBlockStateFromPos(worldIn, 2, -1, -1, structureBoundingBoxIn).getBlock() != Blocks.air) if (this.getBlockStateFromPos(worldIn, 2, 0, -1, structureBoundingBoxIn).getBlock() == Blocks.air && this.getBlockStateFromPos(worldIn, 2, -1, -1, structureBoundingBoxIn).getBlock() != Blocks.air)
@ -689,7 +689,7 @@ public class StructureVillage
this.setBlockState(worldIn, Blocks.air.getState(), 6, 1, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 6, 1, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 6, 2, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 6, 2, 5, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 6, 3, 4, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 6, 3, 4, structureBoundingBoxIn);
this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 6, 1, 5, this.getMetadataWithOffset(Blocks.oak_door.getState().withProperty(BlockDoor.FACING, Facing.SOUTH))); this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 6, 1, 5, this.getMetadataWithOffset(Blocks.oak_door.getState().withProperty(BlockDoor.FACING, Facing.SOUTH)));
for (int i1 = 0; i1 < 5; ++i1) for (int i1 = 0; i1 < 5; ++i1)
@ -1075,7 +1075,7 @@ public class StructureVillage
this.setBlockState(worldIn, Blocks.oak_planks.getState(), 5, 5, 10, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.oak_planks.getState(), 5, 5, 10, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 2, 1, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 2, 1, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.air.getState(), 2, 2, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.air.getState(), 2, 2, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn);
this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 2, 1, 0, this.getMetadataWithOffset(Blocks.oak_door.getState().withProperty(BlockDoor.FACING, Facing.SOUTH))); this.placeDoorCurrentPosition(worldIn, structureBoundingBoxIn, randomIn, 2, 1, 0, this.getMetadataWithOffset(Blocks.oak_door.getState().withProperty(BlockDoor.FACING, Facing.SOUTH)));
this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, -1, 3, 2, -1, Blocks.air.getState(), Blocks.air.getState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 0, -1, 3, 2, -1, Blocks.air.getState(), Blocks.air.getState(), false);
@ -1220,7 +1220,7 @@ public class StructureVillage
this.setBlockState(worldIn, i, 3, 4, 3, structureBoundingBoxIn); this.setBlockState(worldIn, i, 3, 4, 3, structureBoundingBoxIn);
} }
this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 2, 3, 1, structureBoundingBoxIn);
for (int k = 0; k < 5; ++k) for (int k = 0; k < 5; ++k)
{ {
@ -1479,10 +1479,10 @@ public class StructureVillage
this.setBlockState(worldIn, Blocks.oak_fence.getState(), 1, 2, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.oak_fence.getState(), 1, 2, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.white_wool.getState(), 1, 3, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.white_wool.getState(), 1, 3, 0, structureBoundingBoxIn);
boolean flag = this.coordBaseMode == Facing.EAST || this.coordBaseMode == Facing.NORTH; boolean flag = this.coordBaseMode == Facing.EAST || this.coordBaseMode == Facing.NORTH;
this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateY()), flag ? 2 : 0, 3, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateY()), flag ? 2 : 0, 3, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 1, 3, 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode), 1, 3, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateYCCW()), flag ? 0 : 2, 3, 0, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.rotateYCCW()), flag ? 0 : 2, 3, 0, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 1, 3, -1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.lit_torch.getState().withProperty(BlockTorch.FACING, this.coordBaseMode.getOpposite()), 1, 3, -1, structureBoundingBoxIn);
return true; return true;
} }
} }