@@ -89,7 +89,7 @@ public boolean useWrench(Player player, InteractionHand hand, Direction face) {
8989 return true ;
9090 }
9191 } else {
92- if (face .getAxis ().isHorizontal ()) {
92+ if (params . canBeVertical || face .getAxis ().isHorizontal ()) {
9393 facingDirection = face ;
9494 }
9595 // We consume the event to prevent the GUI from opening.
@@ -100,7 +100,7 @@ public boolean useWrench(Player player, InteractionHand hand, Direction face) {
100100
101101 public void onPlaced (@ Nullable LivingEntity placer , ItemStack itemStack ) {
102102 // The placer can be null using some mods' automatic placement: pick NORTH arbitrarily.
103- Direction dir = placer != null ? placer .getDirection () : Direction .NORTH ;
103+ Direction dir = placer != null ? ( params . canBeVertical ? placer .getNearestViewDirection () : placer . getDirection () ) : Direction .NORTH ;
104104 facingDirection = dir .getOpposite ();
105105 if (params .hasOutput ) {
106106 outputDirection = dir ;
@@ -111,11 +111,17 @@ public static class Params {
111111 public final boolean hasOutput ;
112112 public final boolean hasExtractItems ;
113113 public final boolean hasExtractFluids ;
114+ public final boolean canBeVertical ;
114115
115- public Params (boolean hasOutput , boolean hasExtractItems , boolean hasExtractFluids ) {
116+ public Params (boolean hasOutput , boolean hasExtractItems , boolean hasExtractFluids , boolean canBeVertical ) {
116117 this .hasOutput = hasOutput ;
117118 this .hasExtractItems = hasExtractItems ;
118119 this .hasExtractFluids = hasExtractFluids ;
120+ this .canBeVertical = canBeVertical ;
121+ }
122+
123+ public Params (boolean hasOutput , boolean hasExtractItems , boolean hasExtractFluids ) {
124+ this (hasOutput , hasExtractItems , hasExtractFluids , false );
119125 }
120126 }
121127
0 commit comments