Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public boolean useWrench(Player player, InteractionHand hand, Direction face) {
return true;
}
} else {
if (face.getAxis().isHorizontal()) {
if (params.canBeVertical || face.getAxis().isHorizontal()) {
facingDirection = face;
}
// We consume the event to prevent the GUI from opening.
Expand All @@ -100,7 +100,7 @@ public boolean useWrench(Player player, InteractionHand hand, Direction face) {

public void onPlaced(@Nullable LivingEntity placer, ItemStack itemStack) {
// The placer can be null using some mods' automatic placement: pick NORTH arbitrarily.
Direction dir = placer != null ? placer.getDirection() : Direction.NORTH;
Direction dir = placer != null ? (params.canBeVertical ? placer.getNearestViewDirection() : placer.getDirection()) : Direction.NORTH;
facingDirection = dir.getOpposite();
if (params.hasOutput) {
outputDirection = dir;
Expand All @@ -111,11 +111,21 @@ public static class Params {
public final boolean hasOutput;
public final boolean hasExtractItems;
public final boolean hasExtractFluids;
/**
* MI itself does not make use of this field, and it purely exists for addons. If you want to use this field, you will need to make your own
* model loader.
*/
public final boolean canBeVertical;

public Params(boolean hasOutput, boolean hasExtractItems, boolean hasExtractFluids) {
public Params(boolean hasOutput, boolean hasExtractItems, boolean hasExtractFluids, boolean canBeVertical) {
this.hasOutput = hasOutput;
this.hasExtractItems = hasExtractItems;
this.hasExtractFluids = hasExtractFluids;
this.canBeVertical = canBeVertical;
}

public Params(boolean hasOutput, boolean hasExtractItems, boolean hasExtractFluids) {
this(hasOutput, hasExtractItems, hasExtractFluids, false);
}
}

Expand Down
Loading