fix wires

This commit is contained in:
Sen 2025-08-04 14:05:50 +02:00
parent 4e16421651
commit 03fbf90a68
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
15 changed files with 461 additions and 958 deletions

View file

Before

Width:  |  Height:  |  Size: 233 B

After

Width:  |  Height:  |  Size: 233 B

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 4.9 KiB

Before After
Before After

View file

@ -24,28 +24,18 @@ import common.world.State;
import common.world.World;
import common.world.AWorldServer;
public class BlockTripWireHook extends Block implements Rotatable
public class BlockHook extends Block implements Rotatable
{
public static final PropertyBool POWERED = PropertyBool.create("powered");
public static final PropertyBool TRIGGERED = PropertyBool.create("triggered");
public static final PropertyBool ATTACHED = PropertyBool.create("attached");
public static final PropertyBool SUSPENDED = PropertyBool.create("suspended");
public BlockTripWireHook()
public BlockHook()
{
super(Material.SMALL);
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(POWERED, Boolean.valueOf(false)).withProperty(ATTACHED, Boolean.valueOf(false)).withProperty(SUSPENDED, Boolean.valueOf(false)));
this.setDefaultState(this.getBaseState().withProperty(FACING, Facing.NORTH).withProperty(TRIGGERED, Boolean.valueOf(false)).withProperty(ATTACHED, Boolean.valueOf(false)));
this.setTab(CheatTab.TECHNOLOGY);
}
/**
* 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 getState(State state, IWorldAccess worldIn, BlockPos pos)
{
return state.withProperty(SUSPENDED, Boolean.valueOf(!World.isSolidSurface(worldIn.getState(pos.down()))));
}
public BoundingBox getCollisionBox(World worldIn, BlockPos pos, State state)
{
return null;
@ -91,7 +81,7 @@ public class BlockTripWireHook extends Block implements Rotatable
*/
public State getPlacedState(World worldIn, BlockPos pos, Facing facing, float hitX, float hitY, float hitZ, EntityLiving placer)
{
State iblockstate = this.getState().withProperty(POWERED, Boolean.valueOf(false)).withProperty(ATTACHED, Boolean.valueOf(false)).withProperty(SUSPENDED, Boolean.valueOf(false));
State iblockstate = this.getState().withProperty(TRIGGERED, Boolean.valueOf(false)).withProperty(ATTACHED, Boolean.valueOf(false));
if (facing.getAxis().isHorizontal())
{
@ -134,8 +124,7 @@ public class BlockTripWireHook extends Block implements Rotatable
{
Facing enumfacing = (Facing)hookState.getValue(FACING);
boolean attached = ((Boolean)hookState.getValue(ATTACHED)).booleanValue();
boolean powered = ((Boolean)hookState.getValue(POWERED)).booleanValue();
boolean floating = !worldIn.isBlockSolid(pos.down());
boolean powered = ((Boolean)hookState.getValue(TRIGGERED)).booleanValue();
boolean nowAttached = !removed;
boolean nowPowered = false;
int i = 0;
@ -146,7 +135,7 @@ public class BlockTripWireHook extends Block implements Rotatable
BlockPos blockpos = pos.offset(enumfacing, j);
State iblockstate = worldIn.getState(blockpos);
if (iblockstate.getBlock() == Blocks.tripwire_hook)
if (iblockstate.getBlock() instanceof BlockHook)
{
if (iblockstate.getValue(FACING) == enumfacing.getOpposite())
{
@ -156,7 +145,7 @@ public class BlockTripWireHook extends Block implements Rotatable
break;
}
if (iblockstate.getBlock() != Blocks.string && j != wireDist)
if (!(iblockstate.getBlock() instanceof BlockString) && j != wireDist)
{
aiblockstate[j] = null;
nowAttached = false;
@ -168,24 +157,20 @@ public class BlockTripWireHook extends Block implements Rotatable
iblockstate = wireState == null ? iblockstate : wireState; // (State)Objects.firstNonNull(wireState, iblockstate);
}
boolean flag5 = !((Boolean)iblockstate.getValue(BlockTripWire.DISARMED)).booleanValue();
boolean flag6 = ((Boolean)iblockstate.getValue(BlockTripWire.POWERED)).booleanValue();
boolean flag7 = ((Boolean)iblockstate.getValue(BlockTripWire.SUSPENDED)).booleanValue();
nowAttached &= flag7 == floating;
nowPowered |= flag5 && flag6;
boolean flag6 = ((Boolean)iblockstate.getValue(BlockString.TOUCHED)).booleanValue();
nowPowered |= flag6;
aiblockstate[j] = iblockstate;
if (j == wireDist)
{
worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos));
nowAttached &= flag5;
}
}
}
nowAttached = nowAttached & i > 1;
nowPowered = nowPowered & nowAttached;
State iblockstate1 = this.getState().withProperty(ATTACHED, Boolean.valueOf(nowAttached)).withProperty(POWERED, Boolean.valueOf(nowPowered));
State iblockstate1 = this.getState().withProperty(ATTACHED, Boolean.valueOf(nowAttached)).withProperty(TRIGGERED, Boolean.valueOf(nowPowered));
if (i > 0)
{
@ -215,7 +200,7 @@ public class BlockTripWireHook extends Block implements Rotatable
BlockPos blockpos2 = pos.offset(enumfacing, k);
State iblockstate2 = aiblockstate[k];
if (iblockstate2 != null && worldIn.getState(blockpos2).getBlock() != Blocks.air)
if (iblockstate2 != null && worldIn.getState(blockpos2).getBlock() instanceof BlockHook)
{
worldIn.setState(blockpos2, iblockstate2.withProperty(ATTACHED, Boolean.valueOf(nowAttached)), 3);
}
@ -295,7 +280,7 @@ public class BlockTripWireHook extends Block implements Rotatable
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
{
boolean flag = ((Boolean)state.getValue(ATTACHED)).booleanValue();
boolean flag1 = ((Boolean)state.getValue(POWERED)).booleanValue();
boolean flag1 = ((Boolean)state.getValue(TRIGGERED)).booleanValue();
if (flag || flag1)
{
@ -313,7 +298,7 @@ public class BlockTripWireHook extends Block implements Rotatable
@Serverside
public double getResistance(AWorldServer worldIn, BlockPos pos, State state) {
return state.getValue(POWERED) ? 0.0 : super.getResistance(worldIn, pos, state);
return state.getValue(TRIGGERED) ? 0.0 : super.getResistance(worldIn, pos, state);
}
/**
@ -331,7 +316,7 @@ public class BlockTripWireHook extends Block implements Rotatable
protected Property[] getProperties()
{
return new Property[] {FACING, POWERED, ATTACHED, SUSPENDED};
return new Property[] {FACING, TRIGGERED, ATTACHED};
}
public boolean isMagnetic() {
@ -341,165 +326,87 @@ public class BlockTripWireHook extends Block implements Rotatable
public Model getModel(ModelProvider provider, String name, State state) {
Model model;
if(state.getValue(ATTACHED)) {
if(state.getValue(SUSPENDED)) {
if(state.getValue(POWERED))
model = provider.getModel("oak_planks")
.add(7.75f, 2.5f, 0, 8.25f, 2.5f, 6.7f).rotate(8, 0, 0, Facing.Axis.X, -22.5f, true)
.d("trip_wire").uv(0, 8, 16, 6).rot(90).noCull()
.u("trip_wire").uv(0, 6, 16, 8).rot(90).noCull()
.add(6.2f, 4.2f, 6.7f, 9.8f, 5, 10.3f)
.d("tripwire_hook").uv(5, 3, 11, 9).noCull()
.u("tripwire_hook").uv(5, 3, 11, 9).noCull()
.n("tripwire_hook").uv(5, 3, 11, 4).noCull()
.s("tripwire_hook").uv(5, 8, 11, 9).noCull()
.w("tripwire_hook").uv(5, 8, 11, 9).noCull()
.e("tripwire_hook").uv(5, 3, 11, 4).noCull()
.add(7.4f, 4.2f, 9.1f, 8.6f, 5, 9.1f)
.n("tripwire_hook").uv(7, 8, 9, 9).noCull()
.add(7.4f, 4.2f, 7.9f, 8.6f, 5, 7.9f)
.s("tripwire_hook").uv(7, 3, 9, 4).noCull()
.add(7.4f, 4.2f, 7.9f, 7.4f, 5, 9.1f)
.e("tripwire_hook").uv(7, 8, 9, 9).noCull()
.add(8.6f, 4.2f, 7.9f, 8.6f, 5, 9.1f)
.w("tripwire_hook").uv(7, 3, 9, 4).noCull()
.add(7.4f, 5.2f, 10, 8.8f, 6.8f, 14).rotate(8, 6, 14, Facing.Axis.X, -22.5f, false)
.d().uv(7, 9, 9, 14).noCull()
.u().uv(7, 2, 9, 7).noCull()
.n().uv(7, 9, 9, 11).noCull()
.s().uv(7, 9, 9, 11).noCull()
.w().uv(2, 9, 7, 11).noCull()
.e().uv(9, 9, 14, 11).noCull()
.add(6, 1, 14, 10, 9, 16)
.d().uv(6, 14, 10, 16).noCull()
.u().uv(6, 0, 10, 2).noCull()
.n().uv(6, 7, 10, 15)
.s().uv(6, 7, 10, 15).noCull()
.w().uv(0, 7, 2, 15).noCull()
.e().uv(14, 7, 16, 15).noCull();
else
model = provider.getModel("oak_planks")
.add(7.75f, 3.5f, 0, 8.25f, 3.5f, 6.7f).rotate(8, 0, 0, Facing.Axis.X, -22.5f, true)
.d("trip_wire").uv(0, 8, 16, 6).rot(90).noCull()
.u("trip_wire").uv(0, 6, 16, 8).rot(90).noCull()
.add(6.2f, 4.2f, 6.7f, 9.8f, 5, 10.3f)
.d("tripwire_hook").uv(5, 3, 11, 9).noCull()
.u("tripwire_hook").uv(5, 3, 11, 9).noCull()
.n("tripwire_hook").uv(5, 3, 11, 4).noCull()
.s("tripwire_hook").uv(5, 8, 11, 9).noCull()
.w("tripwire_hook").uv(5, 8, 11, 9).noCull()
.e("tripwire_hook").uv(5, 3, 11, 4).noCull()
.add(7.4f, 4.2f, 9.1f, 8.6f, 5, 9.1f)
.n("tripwire_hook").uv(7, 8, 9, 9).noCull()
.add(7.4f, 4.2f, 7.9f, 8.6f, 5, 7.9f)
.s("tripwire_hook").uv(7, 3, 9, 4).noCull()
.add(7.4f, 4.2f, 7.9f, 7.4f, 5, 9.1f)
.e("tripwire_hook").uv(7, 8, 9, 9).noCull()
.add(8.6f, 4.2f, 7.9f, 8.6f, 5, 9.1f)
.w("tripwire_hook").uv(7, 3, 9, 4).noCull()
.add(7.4f, 5.2f, 10, 8.8f, 6.8f, 14).rotate(8, 6, 14, Facing.Axis.X, -22.5f, false)
.d().uv(7, 9, 9, 14).noCull()
.u().uv(7, 2, 9, 7).noCull()
.n().uv(7, 9, 9, 11).noCull()
.s().uv(7, 9, 9, 11).noCull()
.w().uv(2, 9, 7, 11).noCull()
.e().uv(9, 9, 14, 11).noCull()
.add(6, 1, 14, 10, 9, 16)
.d().uv(6, 14, 10, 16).noCull()
.u().uv(6, 0, 10, 2).noCull()
.n().uv(6, 7, 10, 15)
.s().uv(6, 7, 10, 15).noCull()
.w().uv(0, 7, 2, 15).noCull()
.e().uv(14, 7, 16, 15).noCull();
}
else {
if(state.getValue(POWERED))
model = provider.getModel("oak_planks")
.add(7.75f, 0.5f, 0, 8.25f, 0.5f, 6.7f).rotate(8, 0, 0, Facing.Axis.X, -22.5f, true)
.d("trip_wire").uv(0, 8, 16, 6).rot(90).noCull()
.u("trip_wire").uv(0, 6, 16, 8).rot(90).noCull()
.add(6.2f, 4.2f, 6.7f, 9.8f, 5, 10.3f)
.d("tripwire_hook").uv(5, 3, 11, 9).noCull()
.u("tripwire_hook").uv(5, 3, 11, 9).noCull()
.n("tripwire_hook").uv(5, 3, 11, 4).noCull()
.s("tripwire_hook").uv(5, 8, 11, 9).noCull()
.w("tripwire_hook").uv(5, 8, 11, 9).noCull()
.e("tripwire_hook").uv(5, 3, 11, 4).noCull()
.add(7.4f, 4.2f, 9.1f, 8.6f, 5, 9.1f)
.n("tripwire_hook").uv(7, 8, 9, 9).noCull()
.add(7.4f, 4.2f, 7.9f, 8.6f, 5, 7.9f)
.s("tripwire_hook").uv(7, 3, 9, 4).noCull()
.add(7.4f, 4.2f, 7.9f, 7.4f, 5, 9.1f)
.e("tripwire_hook").uv(7, 8, 9, 9).noCull()
.add(8.6f, 4.2f, 7.9f, 8.6f, 5, 9.1f)
.w("tripwire_hook").uv(7, 3, 9, 4).noCull()
.add(7.4f, 5.2f, 10, 8.8f, 6.8f, 14).rotate(8, 6, 14, Facing.Axis.X, -22.5f, false)
.d().uv(7, 9, 9, 14).noCull()
.u().uv(7, 2, 9, 7).noCull()
.n().uv(7, 9, 9, 11).noCull()
.s().uv(7, 9, 9, 11).noCull()
.w().uv(2, 9, 7, 11).noCull()
.e().uv(9, 9, 14, 11).noCull()
.add(6, 1, 14, 10, 9, 16)
.d().uv(6, 14, 10, 16).noCull()
.u().uv(6, 0, 10, 2).noCull()
.n().uv(6, 7, 10, 15)
.s().uv(6, 7, 10, 15).noCull()
.w().uv(0, 7, 2, 15).noCull()
.e().uv(14, 7, 16, 15).noCull();
else
model = provider.getModel("oak_planks")
.add(7.75f, 1.5f, 0, 8.25f, 1.5f, 6.7f).rotate(8, 0, 0, Facing.Axis.X, -22.5f, true)
.d("trip_wire").uv(0, 8, 16, 6).rot(90).noCull()
.u("trip_wire").uv(0, 6, 16, 8).rot(90).noCull()
.add(6.2f, 4.2f, 6.7f, 9.8f, 5, 10.3f)
.d("tripwire_hook").uv(5, 3, 11, 9).noCull()
.u("tripwire_hook").uv(5, 3, 11, 9).noCull()
.n("tripwire_hook").uv(5, 3, 11, 4).noCull()
.s("tripwire_hook").uv(5, 8, 11, 9).noCull()
.w("tripwire_hook").uv(5, 8, 11, 9).noCull()
.e("tripwire_hook").uv(5, 3, 11, 4).noCull()
.add(7.4f, 4.2f, 9.1f, 8.6f, 5, 9.1f)
.n("tripwire_hook").uv(7, 8, 9, 9).noCull()
.add(7.4f, 4.2f, 7.9f, 8.6f, 5, 7.9f)
.s("tripwire_hook").uv(7, 3, 9, 4).noCull()
.add(7.4f, 4.2f, 7.9f, 7.4f, 5, 9.1f)
.e("tripwire_hook").uv(7, 8, 9, 9).noCull()
.add(8.6f, 4.2f, 7.9f, 8.6f, 5, 9.1f)
.w("tripwire_hook").uv(7, 3, 9, 4).noCull()
.add(7.4f, 5.2f, 10, 8.8f, 6.8f, 14)
.d().uv(7, 9, 9, 14).noCull()
.u().uv(7, 2, 9, 7).noCull()
.n().uv(7, 9, 9, 11).noCull()
.s().uv(7, 9, 9, 11).noCull()
.w().uv(2, 9, 7, 11).noCull()
.e().uv(9, 9, 14, 11).noCull()
.add(6, 1, 14, 10, 9, 16)
.d().uv(6, 14, 10, 16).noCull()
.u().uv(6, 0, 10, 2).noCull()
.n().uv(6, 7, 10, 15)
.s().uv(6, 7, 10, 15).noCull()
.w().uv(0, 7, 2, 15).noCull()
.e().uv(14, 7, 16, 15).noCull();
}
if(state.getValue(TRIGGERED))
model = provider.getModel("oak_planks")
.add(6.2f, 4.2f, 6.7f, 9.8f, 5, 10.3f)
.d(name).uv(5, 3, 11, 9).noCull()
.u(name).uv(5, 3, 11, 9).noCull()
.n(name).uv(5, 3, 11, 4).noCull()
.s(name).uv(5, 8, 11, 9).noCull()
.w(name).uv(5, 8, 11, 9).noCull()
.e(name).uv(5, 3, 11, 4).noCull()
.add(7.4f, 4.2f, 9.1f, 8.6f, 5, 9.1f)
.n(name).uv(7, 8, 9, 9).noCull()
.add(7.4f, 4.2f, 7.9f, 8.6f, 5, 7.9f)
.s(name).uv(7, 3, 9, 4).noCull()
.add(7.4f, 4.2f, 7.9f, 7.4f, 5, 9.1f)
.e(name).uv(7, 8, 9, 9).noCull()
.add(8.6f, 4.2f, 7.9f, 8.6f, 5, 9.1f)
.w(name).uv(7, 3, 9, 4).noCull()
.add(7.4f, 5.2f, 10, 8.8f, 6.8f, 14).rotate(8, 6, 14, Facing.Axis.X, -22.5f, false)
.d().uv(7, 9, 9, 14).noCull()
.u().uv(7, 2, 9, 7).noCull()
.n().uv(7, 9, 9, 11).noCull()
.s().uv(7, 9, 9, 11).noCull()
.w().uv(2, 9, 7, 11).noCull()
.e().uv(9, 9, 14, 11).noCull()
.add(6, 1, 14, 10, 9, 16)
.d().uv(6, 14, 10, 16).noCull()
.u().uv(6, 0, 10, 2).noCull()
.n().uv(6, 7, 10, 15)
.s().uv(6, 7, 10, 15).noCull()
.w().uv(0, 7, 2, 15).noCull()
.e().uv(14, 7, 16, 15).noCull();
else
model = provider.getModel("oak_planks")
.add(6.2f, 4.2f, 6.7f, 9.8f, 5, 10.3f)
.d(name).uv(5, 3, 11, 9).noCull()
.u(name).uv(5, 3, 11, 9).noCull()
.n(name).uv(5, 3, 11, 4).noCull()
.s(name).uv(5, 8, 11, 9).noCull()
.w(name).uv(5, 8, 11, 9).noCull()
.e(name).uv(5, 3, 11, 4).noCull()
.add(7.4f, 4.2f, 9.1f, 8.6f, 5, 9.1f)
.n(name).uv(7, 8, 9, 9).noCull()
.add(7.4f, 4.2f, 7.9f, 8.6f, 5, 7.9f)
.s(name).uv(7, 3, 9, 4).noCull()
.add(7.4f, 4.2f, 7.9f, 7.4f, 5, 9.1f)
.e(name).uv(7, 8, 9, 9).noCull()
.add(8.6f, 4.2f, 7.9f, 8.6f, 5, 9.1f)
.w(name).uv(7, 3, 9, 4).noCull()
.add(7.4f, 5.2f, 10, 8.8f, 6.8f, 14)
.d().uv(7, 9, 9, 14).noCull()
.u().uv(7, 2, 9, 7).noCull()
.n().uv(7, 9, 9, 11).noCull()
.s().uv(7, 9, 9, 11).noCull()
.w().uv(2, 9, 7, 11).noCull()
.e().uv(9, 9, 14, 11).noCull()
.add(6, 1, 14, 10, 9, 16)
.d().uv(6, 14, 10, 16).noCull()
.u().uv(6, 0, 10, 2).noCull()
.n().uv(6, 7, 10, 15)
.s().uv(6, 7, 10, 15).noCull()
.w().uv(0, 7, 2, 15).noCull()
.e().uv(14, 7, 16, 15).noCull();
}
else {
if(state.getValue(POWERED))
if(state.getValue(TRIGGERED))
model = provider.getModel("oak_planks")
.add(6.2f, 4.2f, 6.7f, 9.8f, 5, 10.3f)
.d("tripwire_hook").uv(5, 3, 11, 9).noCull()
.u("tripwire_hook").uv(5, 3, 11, 9).noCull()
.n("tripwire_hook").uv(5, 3, 11, 4).noCull()
.s("tripwire_hook").uv(5, 8, 11, 9).noCull()
.w("tripwire_hook").uv(5, 8, 11, 9).noCull()
.e("tripwire_hook").uv(5, 3, 11, 4).noCull()
.d(name).uv(5, 3, 11, 9).noCull()
.u(name).uv(5, 3, 11, 9).noCull()
.n(name).uv(5, 3, 11, 4).noCull()
.s(name).uv(5, 8, 11, 9).noCull()
.w(name).uv(5, 8, 11, 9).noCull()
.e(name).uv(5, 3, 11, 4).noCull()
.add(7.4f, 4.2f, 9.1f, 8.6f, 5, 9.1f)
.n("tripwire_hook").uv(7, 8, 9, 9).noCull()
.n(name).uv(7, 8, 9, 9).noCull()
.add(7.4f, 4.2f, 7.9f, 8.6f, 5, 7.9f)
.s("tripwire_hook").uv(7, 3, 9, 4).noCull()
.s(name).uv(7, 3, 9, 4).noCull()
.add(7.4f, 4.2f, 7.9f, 7.4f, 5, 9.1f)
.e("tripwire_hook").uv(7, 8, 9, 9).noCull()
.e(name).uv(7, 8, 9, 9).noCull()
.add(8.6f, 4.2f, 7.9f, 8.6f, 5, 9.1f)
.w("tripwire_hook").uv(7, 3, 9, 4).noCull()
.w(name).uv(7, 3, 9, 4).noCull()
.add(7.4f, 5.2f, 10, 8.8f, 6.8f, 14).rotate(8, 6, 14, Facing.Axis.X, -22.5f, false)
.d().uv(7, 9, 9, 14).noCull()
.u().uv(7, 2, 9, 7).noCull()
@ -517,20 +424,20 @@ public class BlockTripWireHook extends Block implements Rotatable
else
model = provider.getModel("oak_planks")
.add(6.2f, 3.8f, 7.9f, 9.8f, 4.6f, 11.5f).rotate(8, 6, 5.2f, Facing.Axis.X, -45, false)
.d("tripwire_hook").uv(5, 3, 11, 9).noCull()
.u("tripwire_hook").uv(5, 3, 11, 9).noCull()
.n("tripwire_hook").uv(5, 3, 11, 4).noCull()
.s("tripwire_hook").uv(5, 8, 11, 9).noCull()
.w("tripwire_hook").uv(5, 8, 11, 9).noCull()
.e("tripwire_hook").uv(5, 3, 11, 4).noCull()
.d(name).uv(5, 3, 11, 9).noCull()
.u(name).uv(5, 3, 11, 9).noCull()
.n(name).uv(5, 3, 11, 4).noCull()
.s(name).uv(5, 8, 11, 9).noCull()
.w(name).uv(5, 8, 11, 9).noCull()
.e(name).uv(5, 3, 11, 4).noCull()
.add(7.4f, 3.8f, 10.3f, 8.6f, 4.6f, 10.3f).rotate(8, 6, 5.2f, Facing.Axis.X, -45, false)
.n("tripwire_hook").uv(7, 8, 9, 9).noCull()
.n(name).uv(7, 8, 9, 9).noCull()
.add(7.4f, 3.8f, 9.1f, 8.6f, 4.6f, 9.1f).rotate(8, 6, 5.2f, Facing.Axis.X, -45, false)
.s("tripwire_hook").uv(7, 3, 9, 4).noCull()
.s(name).uv(7, 3, 9, 4).noCull()
.add(7.4f, 3.8f, 9.1f, 7.4f, 4.6f, 10.3f).rotate(8, 6, 5.2f, Facing.Axis.X, -45, false)
.e("tripwire_hook").uv(7, 8, 9, 9).noCull()
.e(name).uv(7, 8, 9, 9).noCull()
.add(8.6f, 3.8f, 9.1f, 8.6f, 4.6f, 10.3f).rotate(8, 6, 5.2f, Facing.Axis.X, -45, false)
.w("tripwire_hook").uv(7, 3, 9, 4).noCull()
.w(name).uv(7, 3, 9, 4).noCull()
.add(7.4f, 5.2f, 10, 8.8f, 6.8f, 14).rotate(8, 6, 14, Facing.Axis.X, 45, false)
.d().uv(7, 9, 9, 14).noCull()
.u().uv(7, 2, 9, 7).noCull()
@ -552,8 +459,4 @@ public class BlockTripWireHook extends Block implements Rotatable
public GuiPosition getItemPosition() {
return GuiPosition.PANE_SIDE;
}
protected Property[] getUnsavedProperties() {
return new Property[] {SUSPENDED};
}
}

View file

@ -0,0 +1,318 @@
package common.block.tech;
import java.util.List;
import common.block.Block;
import common.block.Material;
import common.entity.Entity;
import common.item.StackSize;
import common.model.Model;
import common.model.Model.ModelProvider;
import common.model.ModelRotation;
import common.model.GuiPosition;
import common.properties.Property;
import common.properties.PropertyBool;
import common.rng.Random;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.Clientside;
import common.util.Facing;
import common.world.IBlockAccess;
import common.world.IWorldAccess;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
public class BlockString extends Block
{
public static final PropertyBool TOUCHED = PropertyBool.create("touched");
public static final PropertyBool NORTH = PropertyBool.create("north");
public static final PropertyBool EAST = PropertyBool.create("east");
public static final PropertyBool SOUTH = PropertyBool.create("south");
public static final PropertyBool WEST = PropertyBool.create("west");
public BlockString()
{
super(Material.SMALL);
this.setDefaultState(this.getBaseState().withProperty(TOUCHED, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)));
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15625F, 1.0F);
}
/**
* 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 getState(State state, IWorldAccess worldIn, BlockPos pos)
{
return state.withProperty(NORTH, Boolean.valueOf(isConnectedTo(worldIn, pos, state, Facing.NORTH))).withProperty(EAST, Boolean.valueOf(isConnectedTo(worldIn, pos, state, Facing.EAST))).withProperty(SOUTH, Boolean.valueOf(isConnectedTo(worldIn, pos, state, Facing.SOUTH))).withProperty(WEST, Boolean.valueOf(isConnectedTo(worldIn, pos, state, Facing.WEST)));
}
public BoundingBox getCollisionBox(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;
}
public boolean isFullCube()
{
return false;
}
@Clientside
public boolean hasTransparency() {
return true;
}
public void onAdded(AWorldServer worldIn, BlockPos pos, State state)
{
this.notifyHook(worldIn, pos, state);
}
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
{
this.notifyHook(worldIn, pos, state.withProperty(TOUCHED, Boolean.valueOf(true)));
}
private void notifyHook(AWorldServer worldIn, BlockPos pos, State state)
{
for (Facing enumfacing : new Facing[] {Facing.SOUTH, Facing.WEST})
{
for (int i = 1; i < 42; ++i)
{
BlockPos blockpos = pos.offset(enumfacing, i);
State iblockstate = worldIn.getState(blockpos);
if (iblockstate.getBlock() instanceof BlockHook hook)
{
if (iblockstate.getValue(BlockHook.FACING) == enumfacing.getOpposite())
{
hook.triggerHookAt(worldIn, blockpos, iblockstate, false, true, i, state);
}
break;
}
if (!(iblockstate.getBlock() instanceof BlockString))
{
break;
}
}
}
}
/**
* Called When an Entity Collided with the Block
*/
public void onCollideUpdate(World worldIn, BlockPos pos, State state, Entity entityIn)
{
if (!worldIn.client)
{
if (!((Boolean)state.getValue(TOUCHED)).booleanValue())
{
this.updateState((AWorldServer)worldIn, pos);
}
}
}
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{
// if (!worldIn.client)
// {
if (((Boolean)worldIn.getState(pos).getValue(TOUCHED)).booleanValue())
{
this.updateState(worldIn, pos);
}
// }
}
private void updateState(AWorldServer worldIn, BlockPos pos)
{
State iblockstate = worldIn.getState(pos);
boolean flag = ((Boolean)iblockstate.getValue(TOUCHED)).booleanValue();
boolean flag1 = false;
List <? extends Entity > list = worldIn.getEntitiesWithinAABBExcludingEntity((Entity)null, new BoundingBox((double)pos.getX() + this.minX, (double)pos.getY() + this.minY, (double)pos.getZ() + this.minZ, (double)pos.getX() + this.maxX, (double)pos.getY() + this.maxY, (double)pos.getZ() + this.maxZ));
if (!list.isEmpty())
{
for (Entity entity : list)
{
if (!entity.doesEntityNotTriggerPressurePlate())
{
flag1 = true;
break;
}
}
}
if (flag1 != flag)
{
iblockstate = iblockstate.withProperty(TOUCHED, Boolean.valueOf(flag1));
worldIn.setState(pos, iblockstate, 3);
this.notifyHook(worldIn, pos, iblockstate);
}
if (flag1)
{
worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos));
}
}
public static boolean isConnectedTo(IBlockAccess worldIn, BlockPos pos, State state, Facing direction)
{
BlockPos blockpos = pos.offset(direction);
State iblockstate = worldIn.getState(blockpos);
Block block = iblockstate.getBlock();
if (block instanceof BlockHook)
{
Facing enumfacing = direction.getOpposite();
return iblockstate.getValue(BlockHook.FACING) == enumfacing;
}
return block instanceof BlockString;
}
protected Property[] getProperties()
{
return new Property[] {TOUCHED, NORTH, EAST, WEST, SOUTH};
}
private static Model getStringModel(Model model, boolean n, boolean s, boolean w, boolean e, int sides) {
if(sides == 0)
return model
.add(7, 0.25f, 2, 9, 0.25f, 4).noShade()
.d().uv(8, 9, 10, 7).rot(90).noCull()
.u().uv(8, 7, 10, 9).rot(90).noCull()
.add(7, 0.25f, 4, 9, 0.25f, 8).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(7, 0.25f, 8, 9, 0.25f, 12).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(7, 0.25f, 12, 9, 0.25f, 14).noShade()
.d().uv(6, 9, 8, 7).rot(90).noCull()
.u().uv(6, 7, 8, 9).rot(90).noCull()
.rotate(ModelRotation.X0_Y90);
else if(sides == 1)
return model
.add(7, 0.25f, 0, 9, 0.25f, 4).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(7, 0.25f, 4, 9, 0.25f, 8).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(7, 0.25f, 8, 9, 0.25f, 12).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.rotate(n ? ModelRotation.X0_Y0 : (s ? ModelRotation.X0_Y180 : (w ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
else if(sides == 2 && ((e != w) || (n != s)))
return model
.add(7, 0.25f, 0, 9, 0.25f, 4).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(7, 0.25f, 4, 9, 0.25f, 8).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(8, 0.25f, 7, 12, 0.25f, 9).noShade()
.d().uv(6, 9, 10, 7).noCull()
.u().uv(6, 7, 10, 9).noCull()
.add(12, 0.25f, 7, 16, 0.25f, 9).noShade()
.d().uv(6, 9, 10, 7).noCull()
.u().uv(6, 7, 10, 9).noCull()
.rotate(n && e ? ModelRotation.X0_Y0 : (s && w ? ModelRotation.X0_Y180 :
(n && w ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
else if(sides == 2)
return model
.add(7, 0.25f, 0, 9, 0.25f, 4).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(7, 0.25f, 4, 9, 0.25f, 8).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(7, 0.25f, 8, 9, 0.25f, 12).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(7, 0.25f, 12, 9, 0.25f, 16).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.rotate(n ? ModelRotation.X0_Y0 : ModelRotation.X0_Y90);
else if(sides == 3)
return model
.add(7, 0.25f, 0, 9, 0.25f, 4).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(7, 0.25f, 4, 9, 0.25f, 8).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(7, 0.25f, 8, 9, 0.25f, 12).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(7, 0.25f, 12, 9, 0.25f, 16).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(8, 0.25f, 7, 12, 0.25f, 9).noShade()
.d().uv(6, 9, 10, 7).noCull()
.u().uv(6, 7, 10, 9).noCull()
.add(12, 0.25f, 7, 16, 0.25f, 9).noShade()
.d().uv(6, 9, 10, 7).noCull()
.u().uv(6, 7, 10, 9).noCull()
.rotate(!w ? ModelRotation.X0_Y0 : (!e ? ModelRotation.X0_Y180 : (!s ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
else
return model
.add(7, 0.25f, 0, 9, 0.25f, 4).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(7, 0.25f, 4, 9, 0.25f, 8).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(7, 0.25f, 8, 9, 0.25f, 12).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(7, 0.25f, 12, 9, 0.25f, 16).noShade()
.d().uv(6, 9, 10, 7).rot(90).noCull()
.u().uv(6, 7, 10, 9).rot(90).noCull()
.add(0, 0.25f, 7, 4, 0.25f, 9).noShade()
.d().uv(6, 9, 10, 7).noCull()
.u().uv(6, 7, 10, 9).noCull()
.add(4, 0.25f, 7, 8, 0.25f, 9).noShade()
.d().uv(6, 9, 10, 7).noCull()
.u().uv(6, 7, 10, 9).noCull()
.add(8, 0.25f, 7, 12, 0.25f, 9).noShade()
.d().uv(6, 9, 10, 7).noCull()
.u().uv(6, 7, 10, 9).noCull()
.add(12, 0.25f, 7, 16, 0.25f, 9).noShade()
.d().uv(6, 9, 10, 7).noCull()
.u().uv(6, 7, 10, 9).noCull();
}
public Model getModel(ModelProvider provider, String name, State state) {
boolean n = state.getValue(NORTH);
boolean s = state.getValue(SOUTH);
boolean w = state.getValue(WEST);
boolean e = state.getValue(EAST);
int sides = (n ? 1 : 0) + (s ? 1 : 0) + (w ? 1 : 0) + (e ? 1 : 0);
return getStringModel(provider.getModel(name), n, s, w, e, sides);
}
public Property<?>[] getIgnoredProperties() {
return new Property[] {TOUCHED};
}
public StackSize getMaxAmount() {
return StackSize.XXXL;
}
protected Property[] getUnsavedProperties() {
return new Property[] {NORTH, SOUTH, WEST, EAST};
}
public GuiPosition getItemPosition() {
return GuiPosition.WIRE;
}
}

View file

@ -1,654 +0,0 @@
package common.block.tech;
import java.util.List;
import common.block.Block;
import common.block.Material;
import common.entity.Entity;
import common.entity.npc.EntityNPC;
import common.init.Blocks;
import common.item.StackSize;
import common.item.tool.ItemTool;
import common.model.Model;
import common.model.Model.ModelProvider;
import common.model.ModelRotation;
import common.model.GuiPosition;
import common.properties.Property;
import common.properties.PropertyBool;
import common.rng.Random;
import common.util.BlockPos;
import common.util.BoundingBox;
import common.util.Clientside;
import common.util.Facing;
import common.util.Equipment;
import common.world.IBlockAccess;
import common.world.IWorldAccess;
import common.world.State;
import common.world.World;
import common.world.AWorldServer;
public class BlockTripWire extends Block
{
public static final PropertyBool POWERED = PropertyBool.create("powered");
public static final PropertyBool SUSPENDED = PropertyBool.create("suspended");
public static final PropertyBool ATTACHED = PropertyBool.create("attached");
public static final PropertyBool DISARMED = PropertyBool.create("disarmed");
public static final PropertyBool NORTH = PropertyBool.create("north");
public static final PropertyBool EAST = PropertyBool.create("east");
public static final PropertyBool SOUTH = PropertyBool.create("south");
public static final PropertyBool WEST = PropertyBool.create("west");
public BlockTripWire()
{
super(Material.SMALL);
this.setDefaultState(this.getBaseState().withProperty(POWERED, Boolean.valueOf(false)).withProperty(SUSPENDED, Boolean.valueOf(false)).withProperty(ATTACHED, Boolean.valueOf(false)).withProperty(DISARMED, Boolean.valueOf(false)).withProperty(NORTH, Boolean.valueOf(false)).withProperty(EAST, Boolean.valueOf(false)).withProperty(SOUTH, Boolean.valueOf(false)).withProperty(WEST, Boolean.valueOf(false)));
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.15625F, 1.0F);
}
/**
* 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 getState(State state, IWorldAccess worldIn, BlockPos pos)
{
return state.withProperty(NORTH, Boolean.valueOf(isConnectedTo(worldIn, pos, state, Facing.NORTH))).withProperty(EAST, Boolean.valueOf(isConnectedTo(worldIn, pos, state, Facing.EAST))).withProperty(SOUTH, Boolean.valueOf(isConnectedTo(worldIn, pos, state, Facing.SOUTH))).withProperty(WEST, Boolean.valueOf(isConnectedTo(worldIn, pos, state, Facing.WEST)));
}
public BoundingBox getCollisionBox(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;
}
public boolean isFullCube()
{
return false;
}
@Clientside
public boolean hasTransparency() {
return true;
}
/**
* Called when a neighboring block changes.
*/
public void onUpdate(AWorldServer worldIn, BlockPos pos, State state, Block neighborBlock)
{
boolean flag = ((Boolean)state.getValue(SUSPENDED)).booleanValue();
boolean flag1 = !worldIn.isBlockSolid(pos.down());
if (flag != flag1)
{
this.drop(worldIn, pos, state, 0);
worldIn.setBlockToAir(pos);
}
}
public void setBlockBounds(IWorldAccess worldIn, BlockPos pos)
{
State iblockstate = worldIn.getState(pos);
boolean flag = ((Boolean)iblockstate.getValue(ATTACHED)).booleanValue();
boolean flag1 = ((Boolean)iblockstate.getValue(SUSPENDED)).booleanValue();
if (!flag1)
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.09375F, 1.0F);
}
else if (!flag)
{
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.5F, 1.0F);
}
else
{
this.setBlockBounds(0.0F, 0.0625F, 0.0F, 1.0F, 0.15625F, 1.0F);
}
}
public void onAdded(AWorldServer worldIn, BlockPos pos, State state)
{
state = state.withProperty(SUSPENDED, Boolean.valueOf(!worldIn.isBlockSolid(pos.down())));
worldIn.setState(pos, state, 3);
this.notifyHook(worldIn, pos, state);
}
public void onRemoved(AWorldServer worldIn, BlockPos pos, State state)
{
this.notifyHook(worldIn, pos, state.withProperty(POWERED, Boolean.valueOf(true)));
}
public void preBroken(World worldIn, BlockPos pos, State state, EntityNPC player)
{
if (!worldIn.client)
{
if (player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemTool tool && tool.getToolType() == Equipment.SHEARS)
{
worldIn.setState(pos, state.withProperty(DISARMED, Boolean.valueOf(true)), 4);
}
}
}
private void notifyHook(AWorldServer worldIn, BlockPos pos, State state)
{
for (Facing enumfacing : new Facing[] {Facing.SOUTH, Facing.WEST})
{
for (int i = 1; i < 42; ++i)
{
BlockPos blockpos = pos.offset(enumfacing, i);
State iblockstate = worldIn.getState(blockpos);
if (iblockstate.getBlock() == Blocks.tripwire_hook)
{
if (iblockstate.getValue(BlockTripWireHook.FACING) == enumfacing.getOpposite())
{
Blocks.tripwire_hook.triggerHookAt(worldIn, blockpos, iblockstate, false, true, i, state);
}
break;
}
if (iblockstate.getBlock() != Blocks.string)
{
break;
}
}
}
}
/**
* Called When an Entity Collided with the Block
*/
public void onCollideUpdate(World worldIn, BlockPos pos, State state, Entity entityIn)
{
if (!worldIn.client)
{
if (!((Boolean)state.getValue(POWERED)).booleanValue())
{
this.updateState((AWorldServer)worldIn, pos);
}
}
}
public void tick(AWorldServer worldIn, BlockPos pos, State state, Random rand)
{
// if (!worldIn.client)
// {
if (((Boolean)worldIn.getState(pos).getValue(POWERED)).booleanValue())
{
this.updateState(worldIn, pos);
}
// }
}
private void updateState(AWorldServer worldIn, BlockPos pos)
{
State iblockstate = worldIn.getState(pos);
boolean flag = ((Boolean)iblockstate.getValue(POWERED)).booleanValue();
boolean flag1 = false;
List <? extends Entity > list = worldIn.getEntitiesWithinAABBExcludingEntity((Entity)null, new BoundingBox((double)pos.getX() + this.minX, (double)pos.getY() + this.minY, (double)pos.getZ() + this.minZ, (double)pos.getX() + this.maxX, (double)pos.getY() + this.maxY, (double)pos.getZ() + this.maxZ));
if (!list.isEmpty())
{
for (Entity entity : list)
{
if (!entity.doesEntityNotTriggerPressurePlate())
{
flag1 = true;
break;
}
}
}
if (flag1 != flag)
{
iblockstate = iblockstate.withProperty(POWERED, Boolean.valueOf(flag1));
worldIn.setState(pos, iblockstate, 3);
this.notifyHook(worldIn, pos, iblockstate);
}
if (flag1)
{
worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, pos));
}
}
public static boolean isConnectedTo(IBlockAccess worldIn, BlockPos pos, State state, Facing direction)
{
BlockPos blockpos = pos.offset(direction);
State iblockstate = worldIn.getState(blockpos);
Block block = iblockstate.getBlock();
if (block == Blocks.tripwire_hook)
{
Facing enumfacing = direction.getOpposite();
return iblockstate.getValue(BlockTripWireHook.FACING) == enumfacing;
}
else if (block == Blocks.string)
{
boolean flag = ((Boolean)state.getValue(SUSPENDED)).booleanValue();
boolean flag1 = ((Boolean)iblockstate.getValue(SUSPENDED)).booleanValue();
return flag == flag1;
}
else
{
return false;
}
}
protected Property[] getProperties()
{
return new Property[] {POWERED, SUSPENDED, ATTACHED, DISARMED, NORTH, EAST, WEST, SOUTH};
}
private static Model getModelDetached(Model model, boolean n, boolean s, boolean w, boolean e, int sides) {
if(sides == 1)
return model
.add(7.75f, 1.5f, 0, 8.25f, 1.5f, 4).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 1.5f, 4, 8.25f, 1.5f, 8).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 1.5f, 8, 8.25f, 1.5f, 12).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.rotate(n ? ModelRotation.X0_Y0 : (s ? ModelRotation.X0_Y180 : (w ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
else if(sides == 2 && ((e != w) || (n != s)))
return model
.add(7.75f, 1.5f, 0, 8.25f, 1.5f, 4).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 1.5f, 4, 8.25f, 1.5f, 8).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(8, 1.5f, 7.75f, 12, 1.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull()
.add(12, 1.5f, 7.75f, 16, 1.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull()
.rotate(n && e ? ModelRotation.X0_Y0 : (s && w ? ModelRotation.X0_Y180 :
(n && w ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
else if(sides == 2)
return model
.add(7.75f, 1.5f, 0, 8.25f, 1.5f, 4).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 1.5f, 4, 8.25f, 1.5f, 8).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 1.5f, 8, 8.25f, 1.5f, 12).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 1.5f, 12, 8.25f, 1.5f, 16).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.rotate(n ? ModelRotation.X0_Y0 : ModelRotation.X0_Y90);
else if(sides == 3)
return model
.add(7.75f, 1.5f, 0, 8.25f, 1.5f, 4).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 1.5f, 4, 8.25f, 1.5f, 8).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 1.5f, 8, 8.25f, 1.5f, 12).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 1.5f, 12, 8.25f, 1.5f, 16).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(8, 1.5f, 7.75f, 12, 1.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull()
.add(12, 1.5f, 7.75f, 16, 1.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull()
.rotate(!w ? ModelRotation.X0_Y0 : (!e ? ModelRotation.X0_Y180 : (!s ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
else
return model
.add(7.75f, 1.5f, 0, 8.25f, 1.5f, 4).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 1.5f, 4, 8.25f, 1.5f, 8).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 1.5f, 8, 8.25f, 1.5f, 12).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 1.5f, 12, 8.25f, 1.5f, 16).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(0, 1.5f, 7.75f, 4, 1.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull()
.add(4, 1.5f, 7.75f, 8, 1.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull()
.add(8, 1.5f, 7.75f, 12, 1.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull()
.add(12, 1.5f, 7.75f, 16, 1.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull();
}
private static Model getModelAttached(Model model, boolean n, boolean s, boolean w, boolean e, int sides) {
if(sides == 1)
return model
.add(7.75f, 1.5f, 0, 8.25f, 1.5f, 4).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 1.5f, 4, 8.25f, 1.5f, 8).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 1.5f, 8, 8.25f, 1.5f, 12).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.rotate(n ? ModelRotation.X0_Y0 : (s ? ModelRotation.X0_Y180 : (w ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
else if(sides == 2 && ((e != w) || (n != s)))
return model
.add(7.75f, 1.5f, 0, 8.25f, 1.5f, 4).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 1.5f, 4, 8.25f, 1.5f, 8).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(8, 1.5f, 7.75f, 12, 1.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull()
.add(12, 1.5f, 7.75f, 16, 1.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull()
.rotate(n && e ? ModelRotation.X0_Y0 : (s && w ? ModelRotation.X0_Y180 :
(n && w ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
else if(sides == 2)
return model
.add(7.75f, 1.5f, 0, 8.25f, 1.5f, 4).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 1.5f, 4, 8.25f, 1.5f, 8).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 1.5f, 8, 8.25f, 1.5f, 12).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 1.5f, 12, 8.25f, 1.5f, 16).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.rotate(n ? ModelRotation.X0_Y0 : ModelRotation.X0_Y90);
else if(sides == 3)
return model
.add(7.75f, 1.5f, 0, 8.25f, 1.5f, 4).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 1.5f, 4, 8.25f, 1.5f, 8).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 1.5f, 8, 8.25f, 1.5f, 12).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 1.5f, 12, 8.25f, 1.5f, 16).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(8, 1.5f, 7.75f, 12, 1.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull()
.add(12, 1.5f, 7.75f, 16, 1.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull()
.rotate(!w ? ModelRotation.X0_Y0 : (!e ? ModelRotation.X0_Y180 : (!s ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
else
return model
.add(7.75f, 1.5f, 0, 8.25f, 1.5f, 4).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 1.5f, 4, 8.25f, 1.5f, 8).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 1.5f, 8, 8.25f, 1.5f, 12).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 1.5f, 12, 8.25f, 1.5f, 16).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(0, 1.5f, 7.75f, 4, 1.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull()
.add(4, 1.5f, 7.75f, 8, 1.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull()
.add(8, 1.5f, 7.75f, 12, 1.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull()
.add(12, 1.5f, 7.75f, 16, 1.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull();
}
private static Model getModelDetSuspend(Model model, boolean n, boolean s, boolean w, boolean e, int sides) {
if(sides == 1)
return model
.add(7.75f, 3.5f, 0, 8.25f, 3.5f, 4).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 3.5f, 4, 8.25f, 3.5f, 8).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 3.5f, 8, 8.25f, 3.5f, 12).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.rotate(n ? ModelRotation.X0_Y0 : (s ? ModelRotation.X0_Y180 : (w ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
else if(sides == 2 && ((e != w) || (n != s)))
return model
.add(7.75f, 3.5f, 0, 8.25f, 3.5f, 4).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 3.5f, 4, 8.25f, 3.5f, 8).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(8, 3.5f, 7.75f, 12, 3.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull()
.add(12, 3.5f, 7.75f, 16, 3.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull()
.rotate(n && e ? ModelRotation.X0_Y0 : (s && w ? ModelRotation.X0_Y180 :
(n && w ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
else if(sides == 2)
return model
.add(7.75f, 3.5f, 0, 8.25f, 3.5f, 4).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 3.5f, 4, 8.25f, 3.5f, 8).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 3.5f, 8, 8.25f, 3.5f, 12).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 3.5f, 12, 8.25f, 3.5f, 16).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.rotate(n ? ModelRotation.X0_Y0 : ModelRotation.X0_Y90);
else if(sides == 3)
return model
.add(7.75f, 3.5f, 0, 8.25f, 3.5f, 4).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 3.5f, 4, 8.25f, 3.5f, 8).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 3.5f, 8, 8.25f, 3.5f, 12).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 3.5f, 12, 8.25f, 3.5f, 16).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(8, 3.5f, 7.75f, 12, 3.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull()
.add(12, 3.5f, 7.75f, 16, 3.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull()
.rotate(!w ? ModelRotation.X0_Y0 : (!e ? ModelRotation.X0_Y180 : (!s ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
else
return model
.add(7.75f, 3.5f, 0, 8.25f, 3.5f, 4).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 3.5f, 4, 8.25f, 3.5f, 8).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 3.5f, 8, 8.25f, 3.5f, 12).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(7.75f, 3.5f, 12, 8.25f, 3.5f, 16).noShade()
.d().uv(0, 2, 16, 0).rot(90).noCull()
.u().uv(0, 0, 16, 2).rot(90).noCull()
.add(0, 3.5f, 7.75f, 4, 3.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull()
.add(4, 3.5f, 7.75f, 8, 3.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull()
.add(8, 3.5f, 7.75f, 12, 3.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull()
.add(12, 3.5f, 7.75f, 16, 3.5f, 8.25f).noShade()
.d().uv(0, 2, 16, 0).noCull()
.u().uv(0, 0, 16, 2).noCull();
}
private static Model getModelAttSuspend(Model model, boolean n, boolean s, boolean w, boolean e, int sides) {
if(sides == 1)
return model
.add(7.75f, 3.5f, 0, 8.25f, 3.5f, 4).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 3.5f, 4, 8.25f, 3.5f, 8).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 3.5f, 8, 8.25f, 3.5f, 12).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.rotate(n ? ModelRotation.X0_Y0 : (s ? ModelRotation.X0_Y180 : (w ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
else if(sides == 2 && ((e != w) || (n != s)))
return model
.add(7.75f, 3.5f, 0, 8.25f, 3.5f, 4).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 3.5f, 4, 8.25f, 3.5f, 8).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(8, 3.5f, 7.75f, 12, 3.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull()
.add(12, 3.5f, 7.75f, 16, 3.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull()
.rotate(n && e ? ModelRotation.X0_Y0 : (s && w ? ModelRotation.X0_Y180 :
(n && w ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
else if(sides == 2)
return model
.add(7.75f, 3.5f, 0, 8.25f, 3.5f, 4).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 3.5f, 4, 8.25f, 3.5f, 8).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 3.5f, 8, 8.25f, 3.5f, 12).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 3.5f, 12, 8.25f, 3.5f, 16).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.rotate(n ? ModelRotation.X0_Y0 : ModelRotation.X0_Y90);
else if(sides == 3)
return model
.add(7.75f, 3.5f, 0, 8.25f, 3.5f, 4).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 3.5f, 4, 8.25f, 3.5f, 8).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 3.5f, 8, 8.25f, 3.5f, 12).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 3.5f, 12, 8.25f, 3.5f, 16).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(8, 3.5f, 7.75f, 12, 3.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull()
.add(12, 3.5f, 7.75f, 16, 3.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull()
.rotate(!w ? ModelRotation.X0_Y0 : (!e ? ModelRotation.X0_Y180 : (!s ? ModelRotation.X0_Y270 : ModelRotation.X0_Y90)));
else
return model
.add(7.75f, 3.5f, 0, 8.25f, 3.5f, 4).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 3.5f, 4, 8.25f, 3.5f, 8).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 3.5f, 8, 8.25f, 3.5f, 12).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(7.75f, 3.5f, 12, 8.25f, 3.5f, 16).noShade()
.d().uv(0, 4, 16, 2).rot(90).noCull()
.u().uv(0, 2, 16, 4).rot(90).noCull()
.add(0, 3.5f, 7.75f, 4, 3.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull()
.add(4, 3.5f, 7.75f, 8, 3.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull()
.add(8, 3.5f, 7.75f, 12, 3.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull()
.add(12, 3.5f, 7.75f, 16, 3.5f, 8.25f).noShade()
.d().uv(0, 4, 16, 2).noCull()
.u().uv(0, 2, 16, 4).noCull();
}
public Model getModel(ModelProvider provider, String name, State state) {
boolean n = state.getValue(NORTH);
boolean s = state.getValue(SOUTH);
boolean w = state.getValue(WEST);
boolean e = state.getValue(EAST);
int sides = (n ? 1 : 0) + (s ? 1 : 0) + (w ? 1 : 0) + (e ? 1 : 0);
if(sides == 0) {
n = true;
s = true;
sides = 2;
}
Model model = provider.getModel("trip_wire");
return (state.getValue(SUSPENDED) ? ((state.getValue(ATTACHED) ? getModelAttSuspend(model, n, s, w, e, sides) :
getModelDetSuspend(model, n, s, w, e, sides))) : (state.getValue(ATTACHED) ? getModelAttached(model, n, s, w, e, sides) :
getModelDetached(model, n, s, w, e, sides)));
}
public Property<?>[] getIgnoredProperties() {
return new Property[] {DISARMED, POWERED};
}
public StackSize getMaxAmount() {
return StackSize.XXXL;
}
protected Property[] getUnsavedProperties() {
return new Property[] {NORTH, SOUTH, WEST, EAST};
}
public GuiPosition getItemPosition() {
return GuiPosition.THIN_WIRE;
}
}

View file

@ -10,7 +10,7 @@ public abstract class FishConstants {
new RngFishable(new ItemStack(Items.bone), 10), new RngFishable(new ItemStack(Items.water_bottle), 10),
new RngFishable(new ItemStack(Items.string), 5), (new RngFishable(new ItemStack(Items.fishing_rod), 2)).setMaxDamagePercent(0.9F),
new RngFishable(new ItemStack(Items.stick), 5), new RngFishable(new ItemStack(Items.ink_sack, 10), 1),
new RngFishable(new ItemStack(Items.tripwire_hook), 10), new RngFishable(new ItemStack(Items.rotten_flesh), 10));
new RngFishable(new ItemStack(Items.hook), 10), new RngFishable(new ItemStack(Items.rotten_flesh), 10));
public static final WeightedList<RngFishable> FISHING_TREASURE = new WeightedList<RngFishable>(
new RngFishable(new ItemStack(Items.waterlily), 1), new RngFishable(new ItemStack(Items.name_tag), 1),
new RngFishable(new ItemStack(Items.saddle), 1),

View file

@ -505,7 +505,6 @@ public abstract class BlockRegistry {
register("black_quartz_pillar", (new BlockQuartzPillar(true)).setSound(SoundType.STONE).setHardness(0.8F).setDisplay("Schwarze Quarzsäule"));
register("iron_bars", (new BlockPane(Material.SOLID)).setHardness(5.0F).setResistance(10.0F).setSound(SoundType.STONE).setDisplay("Eisengitter"));
register("iron_trapdoor", (new BlockTrapDoor(Material.SOLID)).setHardness(5.0F).setSound(SoundType.STONE).setDisplay("Eisenfalltür"));
Block brick_block = (new Block(Material.SOLID)).setHardness(2.0F).setResistance(10.0F).setSound(SoundType.STONE)
.setDisplay("Ziegelsteine").setTab(CheatTab.BLOCKS);
@ -559,11 +558,9 @@ public abstract class BlockRegistry {
register(deco.name + "_stairs", (new BlockStairs(block)).setDisplay(deco.display + " - Treppe"));
}
register("iron_door", (new BlockDoor(Material.SOLID)).setHardness(5.0F).setSound(SoundType.STONE).setDisplay("Eisentür"));
register("trapdoor", (new BlockTrapDoor(Material.WOOD)).setHardness(3.0F).setSound(SoundType.WOOD).setDisplay("Holzfalltür").setFlammable(5, 20));
register("iron_trapdoor", (new BlockTrapDoor(Material.SOLID)).setHardness(5.0F).setSound(SoundType.STONE).setDisplay("Eisenfalltür"));
register("core", new BlockCore().setHardness(1.5F).setResistance(10.0F).setSound(SoundType.STONE)
.setDisplay("Chunk-Lade-Kern"));
@ -640,10 +637,8 @@ public abstract class BlockRegistry {
register("lamp", (new BlockToggleableLight(false)).setHardness(0.3F).setSound(SoundType.GLASS)
.setDisplay("Lampe").setTab(CheatTab.TECHNOLOGY));
register("lit_lamp", (new BlockToggleableLight(true)).setHardness(0.3F).setSound(SoundType.GLASS).setDisplay("Lampe"));
register("tripwire_hook", (new BlockTripWireHook()).setDisplay("Haken"));
register("string", (new BlockTripWire()).setDisplay("Stolperdraht").setTab(CheatTab.TECHNOLOGY));
register("iron_door", (new BlockDoor(Material.SOLID)).setHardness(5.0F).setSound(SoundType.STONE).setDisplay("Eisentür"));
register("hook", (new BlockHook()).setDisplay("Haken"));
register("string", (new BlockString()).setDisplay("Seil").setTab(CheatTab.TECHNOLOGY));
for(Block block : BLOCKS) {
for(State state : block.getSavedStates()) {

View file

@ -464,7 +464,7 @@ public abstract class Blocks {
public static final Block stonebrick = get("stonebrick");
public static final BlockSlab stonebrick_slab = get("stonebrick_slab");
public static final BlockStairs stonebrick_stairs = get("stonebrick_stairs");
public static final BlockTripWire string = get("string");
public static final BlockString string = get("string");
public static final BlockMetalBlock sulfur_block = get("sulfur_block");
public static final BlockMetalOre sulfur_ore = get("sulfur_ore");
public static final BlockDoublePlant sunflower = get("sunflower");
@ -501,7 +501,7 @@ public abstract class Blocks {
public static final BlockTNT tnt_6 = get("tnt_6");
public static final BlockTNT tnt_7 = get("tnt_7");
public static final BlockTrapDoor trapdoor = get("trapdoor");
public static final BlockTripWireHook tripwire_hook = get("tripwire_hook");
public static final BlockHook hook = get("hook");
public static final BlockMetalBlock tungsten_block = get("tungsten_block");
public static final BlockMetalOre tungsten_ore = get("tungsten_ore");
public static final BlockMetalBlock uranium_block = get("uranium_block");

View file

@ -182,7 +182,7 @@ public abstract class CraftingRegistry
add(new ItemStack(Items.sign, 3), "###", "###", " X ", '#', planks, 'X', Items.stick);
add(new ItemStack(Items.stick, 4), "#", "#", '#', planks);
add(new ItemStack(Items.boat, 1), "# #", "###", '#', planks);
add(new ItemStack(Items.tripwire_hook, 2), "I", "S", "#", '#', planks, 'S', Items.stick, 'I', Items.iron_ingot);
add(new ItemStack(Items.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_pressure_plate, 1), "##", '#', planks);
add(new ItemStack(Items.piston, 1), "TTT", "#X#", "#R#", '#', Items.cobblestone, 'X', Items.iron_ingot, 'R', Items.charged_powder, 'T', planks);

View file

@ -741,7 +741,7 @@ public abstract class Items {
public static final Item tnt_6 = get("tnt_6");
public static final Item tnt_7 = get("tnt_7");
public static final Item trapdoor = get("trapdoor");
public static final Item tripwire_hook = get("tripwire_hook");
public static final Item hook = get("hook");
public static final Item tungsten_block = get("tungsten_block");
public static final ItemMetal tungsten_ingot = get("tungsten_ingot");
public static final Item tungsten_ore = get("tungsten_ore");

View file

@ -12,7 +12,6 @@ public enum GuiPosition {
CROSS(0.0f, 45.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.25f),
CROSS_SMALL(0.0f, 45.0f, 0.0f, 0.0f, 0.5f, 0.0f, 1.5f),
WIRE(90.0f, 45.0f, -90.0f, 0.0f, -4.0f, 0.0f, 1.75f),
THIN_WIRE(50.0f, 45.0f, -50.0f, 5.0f, 1.75f, 0.0f, 2.25f),
PANE(0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.25f),
PANE_SIDE(0.0f, 0.0f, 0.0f, -4.5f, -3.75f, 0.0f, 1.25f),
FENCE(0.0f, 90.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f);

View file

@ -85,7 +85,7 @@ public abstract class ReorderRegistry {
PLACE_LAST.add(Blocks.soul_grass);
PLACE_LAST.add(Blocks.piston);
PLACE_LAST.add(Blocks.sticky_piston);
PLACE_LAST.add(Blocks.tripwire_hook);
PLACE_LAST.add(Blocks.hook);
PLACE_LAST.add(Blocks.string);
for(BlockFlowerPot block : BlockFlowerPot.POTS) {
PLACE_LAST.add(block);
@ -202,7 +202,7 @@ public abstract class ReorderRegistry {
addCardinals(Blocks.cocoa, offset + 0, offset + 1, offset + 2, offset + 3);
}
for (int offset = 0; offset < 16; offset += 4) {
addCardinals(Blocks.tripwire_hook, offset + 2, offset + 3, offset + 0, offset + 1);
addCardinals(Blocks.hook, offset + 2, offset + 3, offset + 0, offset + 1);
}
addAttach(Blocks.string, Facing.DOWN);
for(BlockFlowerPot block : BlockFlowerPot.POTS) {

View file

@ -73,8 +73,8 @@ import common.block.tech.BlockStandingSign;
import common.block.tech.BlockRail.EnumRailDirection;
import common.block.tech.BlockTorch;
import common.block.tech.BlockTNT;
import common.block.tech.BlockTripWire;
import common.block.tech.BlockTripWireHook;
import common.block.tech.BlockString;
import common.block.tech.BlockHook;
import common.block.tech.BlockWallSign;
import common.block.tech.BlockWarpChest;
import common.collect.Lists;
@ -1003,38 +1003,38 @@ public abstract class Converter {
mapBlock(Blocks.warp_chest.getState().withProperty(BlockWarpChest.FACING, Facing.SOUTH), 130, 3, 9, 15);
mapBlock(Blocks.warp_chest.getState().withProperty(BlockWarpChest.FACING, Facing.WEST), 130, 4, 10);
mapBlock(Blocks.warp_chest.getState().withProperty(BlockWarpChest.FACING, Facing.EAST), 130, 5, 11);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, false).withProperty(BlockTripWireHook.FACING, Facing.SOUTH).withProperty(BlockTripWireHook.POWERED, false), 131, 0);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, false).withProperty(BlockTripWireHook.FACING, Facing.WEST).withProperty(BlockTripWireHook.POWERED, false), 131, 1);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, false).withProperty(BlockTripWireHook.FACING, Facing.NORTH).withProperty(BlockTripWireHook.POWERED, false), 131, 2);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, false).withProperty(BlockTripWireHook.FACING, Facing.EAST).withProperty(BlockTripWireHook.POWERED, false), 131, 3);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, true).withProperty(BlockTripWireHook.FACING, Facing.SOUTH).withProperty(BlockTripWireHook.POWERED, false), 131, 4);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, true).withProperty(BlockTripWireHook.FACING, Facing.WEST).withProperty(BlockTripWireHook.POWERED, false), 131, 5);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, true).withProperty(BlockTripWireHook.FACING, Facing.NORTH).withProperty(BlockTripWireHook.POWERED, false), 131, 6);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, true).withProperty(BlockTripWireHook.FACING, Facing.EAST).withProperty(BlockTripWireHook.POWERED, false), 131, 7);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, false).withProperty(BlockTripWireHook.FACING, Facing.SOUTH).withProperty(BlockTripWireHook.POWERED, true), 131, 8);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, false).withProperty(BlockTripWireHook.FACING, Facing.WEST).withProperty(BlockTripWireHook.POWERED, true), 131, 9);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, false).withProperty(BlockTripWireHook.FACING, Facing.NORTH).withProperty(BlockTripWireHook.POWERED, true), 131, 10);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, false).withProperty(BlockTripWireHook.FACING, Facing.EAST).withProperty(BlockTripWireHook.POWERED, true), 131, 11);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, true).withProperty(BlockTripWireHook.FACING, Facing.SOUTH).withProperty(BlockTripWireHook.POWERED, true), 131, 12);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, true).withProperty(BlockTripWireHook.FACING, Facing.WEST).withProperty(BlockTripWireHook.POWERED, true), 131, 13);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, true).withProperty(BlockTripWireHook.FACING, Facing.NORTH).withProperty(BlockTripWireHook.POWERED, true), 131, 14);
mapBlock(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.ATTACHED, true).withProperty(BlockTripWireHook.FACING, Facing.EAST).withProperty(BlockTripWireHook.POWERED, true), 131, 15);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, false).withProperty(BlockTripWire.DISARMED, false).withProperty(BlockTripWire.POWERED, false).withProperty(BlockTripWire.SUSPENDED, false), 132, 0);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, false).withProperty(BlockTripWire.DISARMED, false).withProperty(BlockTripWire.POWERED, true).withProperty(BlockTripWire.SUSPENDED, false), 132, 1);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, false).withProperty(BlockTripWire.DISARMED, false).withProperty(BlockTripWire.POWERED, false).withProperty(BlockTripWire.SUSPENDED, true), 132, 2);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, false).withProperty(BlockTripWire.DISARMED, false).withProperty(BlockTripWire.POWERED, true).withProperty(BlockTripWire.SUSPENDED, true), 132, 3);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, true).withProperty(BlockTripWire.DISARMED, false).withProperty(BlockTripWire.POWERED, false).withProperty(BlockTripWire.SUSPENDED, false), 132, 4);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, true).withProperty(BlockTripWire.DISARMED, false).withProperty(BlockTripWire.POWERED, true).withProperty(BlockTripWire.SUSPENDED, false), 132, 5);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, true).withProperty(BlockTripWire.DISARMED, false).withProperty(BlockTripWire.POWERED, false).withProperty(BlockTripWire.SUSPENDED, true), 132, 6);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, true).withProperty(BlockTripWire.DISARMED, false).withProperty(BlockTripWire.POWERED, true).withProperty(BlockTripWire.SUSPENDED, true), 132, 7);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, false).withProperty(BlockTripWire.DISARMED, true).withProperty(BlockTripWire.POWERED, false).withProperty(BlockTripWire.SUSPENDED, false), 132, 8);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, false).withProperty(BlockTripWire.DISARMED, true).withProperty(BlockTripWire.POWERED, true).withProperty(BlockTripWire.SUSPENDED, false), 132, 9);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, false).withProperty(BlockTripWire.DISARMED, true).withProperty(BlockTripWire.POWERED, false).withProperty(BlockTripWire.SUSPENDED, true), 132, 10);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, false).withProperty(BlockTripWire.DISARMED, true).withProperty(BlockTripWire.POWERED, true).withProperty(BlockTripWire.SUSPENDED, true), 132, 11);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, true).withProperty(BlockTripWire.DISARMED, true).withProperty(BlockTripWire.POWERED, false).withProperty(BlockTripWire.SUSPENDED, false), 132, 12);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, true).withProperty(BlockTripWire.DISARMED, true).withProperty(BlockTripWire.POWERED, true).withProperty(BlockTripWire.SUSPENDED, false), 132, 13);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, true).withProperty(BlockTripWire.DISARMED, true).withProperty(BlockTripWire.POWERED, false).withProperty(BlockTripWire.SUSPENDED, true), 132, 14);
mapBlock(Blocks.string.getState().withProperty(BlockTripWire.ATTACHED, true).withProperty(BlockTripWire.DISARMED, true).withProperty(BlockTripWire.POWERED, true).withProperty(BlockTripWire.SUSPENDED, true), 132, 15);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, false).withProperty(BlockHook.FACING, Facing.SOUTH).withProperty(BlockHook.TRIGGERED, false), 131, 0);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, false).withProperty(BlockHook.FACING, Facing.WEST).withProperty(BlockHook.TRIGGERED, false), 131, 1);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, false).withProperty(BlockHook.FACING, Facing.NORTH).withProperty(BlockHook.TRIGGERED, false), 131, 2);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, false).withProperty(BlockHook.FACING, Facing.EAST).withProperty(BlockHook.TRIGGERED, false), 131, 3);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, true).withProperty(BlockHook.FACING, Facing.SOUTH).withProperty(BlockHook.TRIGGERED, false), 131, 4);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, true).withProperty(BlockHook.FACING, Facing.WEST).withProperty(BlockHook.TRIGGERED, false), 131, 5);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, true).withProperty(BlockHook.FACING, Facing.NORTH).withProperty(BlockHook.TRIGGERED, false), 131, 6);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, true).withProperty(BlockHook.FACING, Facing.EAST).withProperty(BlockHook.TRIGGERED, false), 131, 7);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, false).withProperty(BlockHook.FACING, Facing.SOUTH).withProperty(BlockHook.TRIGGERED, true), 131, 8);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, false).withProperty(BlockHook.FACING, Facing.WEST).withProperty(BlockHook.TRIGGERED, true), 131, 9);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, false).withProperty(BlockHook.FACING, Facing.NORTH).withProperty(BlockHook.TRIGGERED, true), 131, 10);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, false).withProperty(BlockHook.FACING, Facing.EAST).withProperty(BlockHook.TRIGGERED, true), 131, 11);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, true).withProperty(BlockHook.FACING, Facing.SOUTH).withProperty(BlockHook.TRIGGERED, true), 131, 12);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, true).withProperty(BlockHook.FACING, Facing.WEST).withProperty(BlockHook.TRIGGERED, true), 131, 13);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, true).withProperty(BlockHook.FACING, Facing.NORTH).withProperty(BlockHook.TRIGGERED, true), 131, 14);
mapBlock(Blocks.hook.getState().withProperty(BlockHook.ATTACHED, true).withProperty(BlockHook.FACING, Facing.EAST).withProperty(BlockHook.TRIGGERED, true), 131, 15);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, false), 132, 0);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, true), 132, 1);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, false), 132, 2);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, true), 132, 3);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, false), 132, 4);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, true), 132, 5);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, false), 132, 6);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, true), 132, 7);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, false), 132, 8);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, true), 132, 9);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, false), 132, 10);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, true), 132, 11);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, false), 132, 12);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, true), 132, 13);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, false), 132, 14);
mapBlock(Blocks.string.getState().withProperty(BlockString.TOUCHED, true), 132, 15);
mapBlock(Blocks.emerald_block, 133);
mapBlock(Blocks.spruce_stairs.getState().withProperty(BlockStairs.FACING, Facing.EAST).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 134, 0, 8);
mapBlock(Blocks.spruce_stairs.getState().withProperty(BlockStairs.FACING, Facing.WEST).withProperty(BlockStairs.HALF, EnumHalf.BOTTOM), 134, 1, 9);

View file

@ -18,7 +18,6 @@ import common.rng.WeightedList;
import common.tags.TagObject;
import common.tileentity.TileEntity;
import common.tileentity.TileEntityChest;
import common.tileentity.TileEntityDispenser;
import common.util.BlockPos;
import common.util.Facing;
import common.world.State;
@ -716,28 +715,6 @@ public abstract class StructureComponent
}
}
protected boolean generateDispenserContents(WorldServer worldIn, StructureBoundingBox boundingBoxIn, Random rand, int x, int y, int z, Facing dir, WeightedList<RngLoot> listIn, int max)
{
BlockPos blockpos = new BlockPos(this.getXWithOffset(x, z), this.getYWithOffset(y), this.getZWithOffset(x, z));
if (boundingBoxIn.isVecInside(blockpos) && worldIn.getState(blockpos).getBlock() != Blocks.dispenser)
{
worldIn.setState(blockpos, this.getMetadataWithOffset(Blocks.dispenser.getState().withProperty(BlockDispenser.FACING, dir)), 2);
TileEntity tileentity = worldIn.getTileEntity(blockpos);
if (tileentity instanceof TileEntityDispenser)
{
RngLoot.generateDispenserContents(rand, listIn, (TileEntityDispenser)tileentity, max);
}
return true;
}
else
{
return false;
}
}
/**
* Places door on given position
*/

View file

@ -2,10 +2,6 @@ package server.worldgen.structure;
import common.block.artificial.BlockStairs;
import common.block.foliage.BlockVine;
import common.block.tech.BlockLever;
import common.block.tech.BlockPistonBase;
import common.block.tech.BlockTripWire;
import common.block.tech.BlockTripWireHook;
import common.entity.npc.EntityMage;
import common.init.Blocks;
import common.item.RngLoot;
@ -351,8 +347,6 @@ public class StructureScattered
{
private boolean placedMainChest;
private boolean placedHiddenChest;
private boolean placedTrap1;
private boolean placedTrap2;
private static StructureScattered.JunglePyramid.Stones scattered = new StructureScattered.JunglePyramid.Stones();
public JunglePyramid()
@ -369,8 +363,6 @@ public class StructureScattered
super.writeTags(tagCompound);
tagCompound.setBool("placedMainChest", this.placedMainChest);
tagCompound.setBool("placedHiddenChest", this.placedHiddenChest);
tagCompound.setBool("placedTrap1", this.placedTrap1);
tagCompound.setBool("placedTrap2", this.placedTrap2);
}
protected void readTags(TagObject tagCompound)
@ -378,8 +370,6 @@ public class StructureScattered
super.readTags(tagCompound);
this.placedMainChest = tagCompound.getBool("placedMainChest");
this.placedHiddenChest = tagCompound.getBool("placedHiddenChest");
this.placedTrap1 = tagCompound.getBool("placedTrap1");
this.placedTrap2 = tagCompound.getBool("placedTrap2");
}
public boolean addComponentParts(WorldServer worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn)
@ -497,30 +487,11 @@ public class StructureScattered
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, scattered);
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.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)), 3, -3, 8, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 3, -3, 1, structureBoundingBoxIn);
if (!this.placedTrap1)
{
this.placedTrap1 = this.generateDispenserContents(worldIn, structureBoundingBoxIn, randomIn, 3, -2, 1, Facing.NORTH, LootConstants.JUNGLE_TRAP, 2);
}
this.setBlockState(worldIn, Blocks.vine.getState().withProperty(BlockVine.EAST, true).withProperty(BlockVine.NORTH, true).withProperty(BlockVine.SOUTH, true).withProperty(BlockVine.WEST, true), 3, -2, 2, structureBoundingBoxIn);
this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.FACING, Facing.NORTH).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true))), 7, -3, 1, structureBoundingBoxIn);
this.setBlockState(worldIn, this.getMetadataWithOffset(Blocks.tripwire_hook.getState().withProperty(BlockTripWireHook.FACING, Facing.SOUTH).withProperty(BlockTripWireHook.ATTACHED, Boolean.valueOf(true))), 7, -3, 5, 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, 4, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 9, -3, 4, structureBoundingBoxIn);
if (!this.placedTrap2)
{
this.placedTrap2 = this.generateDispenserContents(worldIn, structureBoundingBoxIn, randomIn, 9, -2, 3, Facing.WEST, LootConstants.JUNGLE_TRAP, 2);
}
this.setBlockState(worldIn, Blocks.vine.getState().withProperty(BlockVine.EAST, true).withProperty(BlockVine.NORTH, true).withProperty(BlockVine.SOUTH, true).withProperty(BlockVine.WEST, true), 8, -1, 3, structureBoundingBoxIn);
this.setBlockState(worldIn, Blocks.vine.getState().withProperty(BlockVine.EAST, true).withProperty(BlockVine.NORTH, true).withProperty(BlockVine.SOUTH, true).withProperty(BlockVine.WEST, true), 8, -2, 3, structureBoundingBoxIn);
@ -543,15 +514,9 @@ public class StructureScattered
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(), 10, -2, 11, 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)), 10, -2, 12, structureBoundingBoxIn);
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, scattered);
this.setBlockState(worldIn, Blocks.mossy_cobblestone.getState(), 10, -2, 9, 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, -1, 8, structureBoundingBoxIn);
if (!this.placedHiddenChest)
{