Fix sap side
This commit is contained in:
parent
2a180cb5c2
commit
f906aaa3cd
2 changed files with 22 additions and 18 deletions
|
@ -106,13 +106,17 @@ public class BlockRubberLog extends BlockLog {
|
||||||
@Override
|
@Override
|
||||||
public void tick(IBlockState state, World worldIn, BlockPos pos, Random random) {
|
public void tick(IBlockState state, World worldIn, BlockPos pos, Random random) {
|
||||||
super.tick(state, worldIn, pos, random);
|
super.tick(state, worldIn, pos, random);
|
||||||
if (!state.get(HAS_SAP)) {
|
if (state.get(AXIS) != EnumFacing.Axis.Y) {
|
||||||
if (random.nextInt(50) == 0) {
|
return;
|
||||||
EnumFacing facing = EnumFacing.byHorizontalIndex(random.nextInt(4));
|
}
|
||||||
if (worldIn.getBlockState(pos.down()).getBlock() == this
|
if (state.get(HAS_SAP)) {
|
||||||
&& worldIn.getBlockState(pos.up()).getBlock() == this) {
|
return;
|
||||||
worldIn.setBlockState(pos, state.with(HAS_SAP, true).with(SAP_SIDE, facing));
|
}
|
||||||
}
|
if (random.nextInt(50) == 0) {
|
||||||
|
EnumFacing facing = EnumFacing.byHorizontalIndex(random.nextInt(4));
|
||||||
|
if (worldIn.getBlockState(pos.down()).getBlock() == this
|
||||||
|
&& worldIn.getBlockState(pos.up()).getBlock() == this) {
|
||||||
|
worldIn.setBlockState(pos, state.with(HAS_SAP, true).with(SAP_SIDE, facing));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,17 +12,17 @@
|
||||||
"axis=y,facing=north,hassap=false": { "model": "techreborn:block/rubber_log" },
|
"axis=y,facing=north,hassap=false": { "model": "techreborn:block/rubber_log" },
|
||||||
"axis=z,facing=north,hassap=false": { "model": "techreborn:block/rubber_log", "x": 90 },
|
"axis=z,facing=north,hassap=false": { "model": "techreborn:block/rubber_log", "x": 90 },
|
||||||
"axis=x,facing=north,hassap=false": { "model": "techreborn:block/rubber_log", "x": 90, "y": 90 },
|
"axis=x,facing=north,hassap=false": { "model": "techreborn:block/rubber_log", "x": 90, "y": 90 },
|
||||||
"axis=y,facing=east,hassap=true": { "model": "techreborn:block/rubber_log_with_sap" },
|
"axis=y,facing=east,hassap=true": { "model": "techreborn:block/rubber_log_with_sap", "y": 90 },
|
||||||
"axis=z,facing=east,hassap=true": { "model": "techreborn:block/rubber_log_with_sap", "x": 90 },
|
"axis=z,facing=east,hassap=true": { "model": "techreborn:block/rubber_log", "x": 90 },
|
||||||
"axis=x,facing=east,hassap=true": { "model": "techreborn:block/rubber_log_with_sap", "x": 90, "y": 90 },
|
"axis=x,facing=east,hassap=true": { "model": "techreborn:block/rubber_log", "x": 90, "y": 90 },
|
||||||
"axis=y,facing=south,hassap=true": { "model": "techreborn:block/rubber_log_with_sap" },
|
"axis=y,facing=south,hassap=true": { "model": "techreborn:block/rubber_log_with_sap", "y": 180 },
|
||||||
"axis=z,facing=south,hassap=true": { "model": "techreborn:block/rubber_log_with_sap", "x": 90 },
|
"axis=z,facing=south,hassap=true": { "model": "techreborn:block/rubber_log", "x": 90 },
|
||||||
"axis=x,facing=south,hassap=true": { "model": "techreborn:block/rubber_log_with_sap", "x": 90, "y": 90 },
|
"axis=x,facing=south,hassap=true": { "model": "techreborn:block/rubber_log", "x": 90, "y": 90 },
|
||||||
"axis=y,facing=west,hassap=true": { "model": "techreborn:block/rubber_log_with_sap" },
|
"axis=y,facing=west,hassap=true": { "model": "techreborn:block/rubber_log_with_sap", "y": 270 },
|
||||||
"axis=z,facing=west,hassap=true": { "model": "techreborn:block/rubber_log_with_sap", "x": 90 },
|
"axis=z,facing=west,hassap=true": { "model": "techreborn:block/rubber_log", "x": 90 },
|
||||||
"axis=x,facing=west,hassap=true": { "model": "techreborn:block/rubber_log_with_sap", "x": 90, "y": 90 },
|
"axis=x,facing=west,hassap=true": { "model": "techreborn:block/rubber_log", "x": 90, "y": 90 },
|
||||||
"axis=y,facing=north,hassap=true": { "model": "techreborn:block/rubber_log_with_sap" },
|
"axis=y,facing=north,hassap=true": { "model": "techreborn:block/rubber_log_with_sap" },
|
||||||
"axis=z,facing=north,hassap=true": { "model": "techreborn:block/rubber_log_with_sap", "x": 90 },
|
"axis=z,facing=north,hassap=true": { "model": "techreborn:block/rubber_log", "x": 90 },
|
||||||
"axis=x,facing=north,hassap=true": { "model": "techreborn:block/rubber_log_with_sap", "x": 90, "y": 90 }
|
"axis=x,facing=north,hassap=true": { "model": "techreborn:block/rubber_log", "x": 90, "y": 90 }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue