Skip to content

Commit

Permalink
Fix up torch placement logic to handle more vanilla special-casing (M…
Browse files Browse the repository at this point in the history
  • Loading branch information
bs2609 authored and LexManos committed Feb 4, 2019
1 parent d1adf00 commit 41d07e7
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions patches/minecraft/net/minecraft/block/Block.java.patch
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@
public SoundType func_185467_w()
{
return this.field_149762_H;
@@ -934,6 +952,1369 @@
@@ -934,6 +952,1374 @@
{
}

Expand Down Expand Up @@ -837,13 +837,18 @@
+ */
+ public boolean canPlaceTorchOnTop(IBlockState state, IBlockAccess world, BlockPos pos)
+ {
+ if (state.func_185896_q() || state.func_193401_d(world, pos, EnumFacing.UP) == BlockFaceShape.SOLID)
+ if (this == Blocks.field_185775_db || this == Blocks.field_150428_aP)
+ {
+ return this != Blocks.field_185775_db && this != Blocks.field_150428_aP;
+ return false;
+ }
+ else if (state.func_185896_q() || this instanceof BlockFence || this == Blocks.field_150359_w || this == Blocks.field_150463_bK || this == Blocks.field_150399_cn)
+ {
+ return true;
+ }
+ else
+ {
+ return this instanceof BlockFence || this == Blocks.field_150359_w || this == Blocks.field_150463_bK || this == Blocks.field_150399_cn;
+ BlockFaceShape shape = state.func_193401_d(world, pos, EnumFacing.UP);
+ return (shape == BlockFaceShape.SOLID || shape == BlockFaceShape.CENTER || shape == BlockFaceShape.CENTER_BIG) && !func_193384_b(this);
+ }
+ }
+
Expand Down Expand Up @@ -1591,7 +1596,7 @@
public static void func_149671_p()
{
func_176215_a(0, field_176230_a, (new BlockAir()).func_149663_c("air"));
@@ -1105,7 +2486,7 @@
@@ -1105,7 +2491,7 @@
Block block11 = (new BlockQuartz()).func_149672_a(SoundType.field_185851_d).func_149711_c(0.8F).func_149663_c("quartzBlock");
func_176219_a(155, "quartz_block", block11);
func_176219_a(156, "quartz_stairs", (new BlockStairs(block11.func_176223_P().func_177226_a(BlockQuartz.field_176335_a, BlockQuartz.EnumType.DEFAULT))).func_149663_c("stairsQuartz"));
Expand All @@ -1600,7 +1605,7 @@
func_176219_a(158, "dropper", (new BlockDropper()).func_149711_c(3.5F).func_149672_a(SoundType.field_185851_d).func_149663_c("dropper"));
func_176219_a(159, "stained_hardened_clay", (new BlockStainedHardenedClay()).func_149711_c(1.25F).func_149752_b(7.0F).func_149672_a(SoundType.field_185851_d).func_149663_c("clayHardenedStained"));
func_176219_a(160, "stained_glass_pane", (new BlockStainedGlassPane()).func_149711_c(0.3F).func_149672_a(SoundType.field_185853_f).func_149663_c("thinStainedGlass"));
@@ -1230,31 +2611,6 @@
@@ -1230,31 +2616,6 @@
block15.field_149783_u = flag;
}
}
Expand Down

0 comments on commit 41d07e7

Please sign in to comment.