Reveal thy Settings

- The majority of scroll options no longer require a wrench
- Filters now use the built-in 'sprite' model
This commit is contained in:
simibubi 2023-03-07 12:45:02 +01:00
parent 0fefcd80e6
commit e8fd97b36c
16 changed files with 22 additions and 109 deletions

View file

@ -55,7 +55,6 @@ public class SteamEngineBlockEntity extends SmartBlockEntity implements IHaveGog
public void addBehaviours(List<BlockEntityBehaviour> behaviours) { public void addBehaviours(List<BlockEntityBehaviour> behaviours) {
movementDirection = new ScrollOptionBehaviour<>(RotationDirection.class, movementDirection = new ScrollOptionBehaviour<>(RotationDirection.class,
Lang.translateDirect("contraptions.windmill.rotation_direction"), this, new SteamEngineValueBox()); Lang.translateDirect("contraptions.windmill.rotation_direction"), this, new SteamEngineValueBox());
movementDirection.requiresWrench();
movementDirection.onlyActiveWhen(() -> { movementDirection.onlyActiveWhen(() -> {
PoweredShaftBlockEntity shaft = getShaft(); PoweredShaftBlockEntity shaft = getShaft();
return shaft == null || !shaft.hasSource(); return shaft == null || !shaft.hasSource();

View file

@ -55,7 +55,6 @@ public class ClockworkBearingBlockEntity extends KineticBlockEntity
super.addBehaviours(behaviours); super.addBehaviours(behaviours);
operationMode = new ScrollOptionBehaviour<>(ClockHands.class, operationMode = new ScrollOptionBehaviour<>(ClockHands.class,
Lang.translateDirect("contraptions.clockwork.clock_hands"), this, getMovementModeSlot()); Lang.translateDirect("contraptions.clockwork.clock_hands"), this, getMovementModeSlot());
operationMode.requiresWrench();
behaviours.add(operationMode); behaviours.add(operationMode);
registerAwardables(behaviours, AllAdvancements.CLOCKWORK_BEARING); registerAwardables(behaviours, AllAdvancements.CLOCKWORK_BEARING);
} }

View file

@ -53,7 +53,6 @@ public class MechanicalBearingBlockEntity extends GeneratingKineticBlockEntity
super.addBehaviours(behaviours); super.addBehaviours(behaviours);
movementMode = new ScrollOptionBehaviour<>(RotationMode.class, Lang.translateDirect("contraptions.movement_mode"), movementMode = new ScrollOptionBehaviour<>(RotationMode.class, Lang.translateDirect("contraptions.movement_mode"),
this, getMovementModeSlot()); this, getMovementModeSlot());
movementMode.requiresWrench();
behaviours.add(movementMode); behaviours.add(movementMode);
registerAwardables(behaviours, AllAdvancements.CONTRAPTION_ACTORS); registerAwardables(behaviours, AllAdvancements.CONTRAPTION_ACTORS);
} }

View file

@ -102,7 +102,6 @@ public class WindmillBearingBlockEntity extends MechanicalBearingBlockEntity {
behaviours.remove(movementMode); behaviours.remove(movementMode);
movementDirection = new ScrollOptionBehaviour<>(RotationDirection.class, movementDirection = new ScrollOptionBehaviour<>(RotationDirection.class,
Lang.translateDirect("contraptions.windmill.rotation_direction"), this, getMovementModeSlot()); Lang.translateDirect("contraptions.windmill.rotation_direction"), this, getMovementModeSlot());
movementDirection.requiresWrench();
movementDirection.withCallback($ -> onDirectionChanged()); movementDirection.withCallback($ -> onDirectionChanged());
behaviours.add(movementDirection); behaviours.add(movementDirection);
registerAwardables(behaviours, AllAdvancements.WINDMILL, AllAdvancements.WINDMILL_MAXED); registerAwardables(behaviours, AllAdvancements.WINDMILL, AllAdvancements.WINDMILL_MAXED);

View file

@ -235,7 +235,6 @@ public class CartAssemblerBlockEntity extends SmartBlockEntity implements IDispl
public void addBehaviours(List<BlockEntityBehaviour> behaviours) { public void addBehaviours(List<BlockEntityBehaviour> behaviours) {
movementMode = new ScrollOptionBehaviour<>(CartMovementMode.class, movementMode = new ScrollOptionBehaviour<>(CartMovementMode.class,
Lang.translateDirect("contraptions.cart_movement_mode"), this, getMovementModeSlot()); Lang.translateDirect("contraptions.cart_movement_mode"), this, getMovementModeSlot());
movementMode.requiresWrench();
behaviours.add(movementMode); behaviours.add(movementMode);
registerAwardables(behaviours, AllAdvancements.CONTRAPTION_ACTORS); registerAwardables(behaviours, AllAdvancements.CONTRAPTION_ACTORS);
} }

View file

@ -51,7 +51,6 @@ public abstract class LinearActuatorBlockEntity extends KineticBlockEntity
super.addBehaviours(behaviours); super.addBehaviours(behaviours);
movementMode = new ScrollOptionBehaviour<>(MovementMode.class, Lang.translateDirect("contraptions.movement_mode"), movementMode = new ScrollOptionBehaviour<>(MovementMode.class, Lang.translateDirect("contraptions.movement_mode"),
this, getMovementModeSlot()); this, getMovementModeSlot());
movementMode.requiresWrench();
movementMode.withCallback(t -> waitingForSpeedChange = false); movementMode.withCallback(t -> waitingForSpeedChange = false);
behaviours.add(movementMode); behaviours.add(movementMode);
registerAwardables(behaviours, AllAdvancements.CONTRAPTION_ACTORS); registerAwardables(behaviours, AllAdvancements.CONTRAPTION_ACTORS);

View file

@ -100,7 +100,6 @@ public class BrassTunnelBlockEntity extends BeltTunnelBlockEntity implements IHa
behaviours.add(selectionMode = new ScrollOptionBehaviour<>(SelectionMode.class, behaviours.add(selectionMode = new ScrollOptionBehaviour<>(SelectionMode.class,
Lang.translateDirect("logistics.when_multiple_outputs_available"), this, Lang.translateDirect("logistics.when_multiple_outputs_available"), this,
new CenteredSideValueBoxTransform((state, d) -> d == Direction.UP))); new CenteredSideValueBoxTransform((state, d) -> d == Direction.UP)));
selectionMode.requiresWrench();
// Propagate settings across connected tunnels // Propagate settings across connected tunnels
selectionMode.withCallback(setting -> { selectionMode.withCallback(setting -> {

View file

@ -105,8 +105,7 @@ public class EjectorBlockEntity extends KineticBlockEntity {
maxStackSize = new ScrollValueBehaviour(Lang.translateDirect("weighted_ejector.stack_size"), this, new EjectorSlot()) maxStackSize = new ScrollValueBehaviour(Lang.translateDirect("weighted_ejector.stack_size"), this, new EjectorSlot())
.between(0, 64) .between(0, 64)
.withFormatter(i -> i == 0 ? "*" : String.valueOf(i)) .withFormatter(i -> i == 0 ? "*" : String.valueOf(i))
.onlyActiveWhen(() -> state == State.CHARGED) .onlyActiveWhen(() -> state == State.CHARGED);
.requiresWrench();
behaviours.add(maxStackSize); behaviours.add(maxStackSize);
depotBehaviour.maxStackSize = () -> maxStackSize.getValue(); depotBehaviour.maxStackSize = () -> maxStackSize.getValue();

View file

@ -106,7 +106,6 @@ public class ArmBlockEntity extends KineticBlockEntity implements ITransformable
selectionMode = new ScrollOptionBehaviour<SelectionMode>(SelectionMode.class, selectionMode = new ScrollOptionBehaviour<SelectionMode>(SelectionMode.class,
Lang.translateDirect("logistics.when_multiple_outputs_available"), this, new SelectionModeValueBox()); Lang.translateDirect("logistics.when_multiple_outputs_available"), this, new SelectionModeValueBox());
selectionMode.requiresWrench();
behaviours.add(selectionMode); behaviours.add(selectionMode);
registerAwardables(behaviours, AllAdvancements.ARM_BLAZE_BURNER, AllAdvancements.ARM_MANY_TARGETS, registerAwardables(behaviours, AllAdvancements.ARM_BLAZE_BURNER, AllAdvancements.ARM_MANY_TARGETS,

View file

@ -30,7 +30,8 @@ public class ValueBoxRenderer {
.getItemRenderer(); .getItemRenderer();
BakedModel modelWithOverrides = itemRenderer.getModel(filter, null, null, 0); BakedModel modelWithOverrides = itemRenderer.getModel(filter, null, null, 0);
boolean blockItem = modelWithOverrides.isGui3d() && !(modelWithOverrides instanceof ItemMultiLayerBakedModel); boolean blockItem = modelWithOverrides.isGui3d() && !(modelWithOverrides instanceof ItemMultiLayerBakedModel);
float scale = (!blockItem ? .5f : 1f) + 1 / 64f; boolean filterItem = filter.getItem() instanceof FilterItem;
float scale = (!blockItem && !filterItem ? .5f : 1f) + 1 / 64f;
float zOffset = (!blockItem ? -.15f : 0) + customZOffset(filter.getItem()); float zOffset = (!blockItem ? -.15f : 0) + customZOffset(filter.getItem());
ms.scale(scale, scale, scale); ms.scale(scale, scale, scale);
ms.translate(0, 0, zOffset); ms.translate(0, 0, zOffset);
@ -80,7 +81,7 @@ public class ValueBoxRenderer {
private static float customZOffset(Item item) { private static float customZOffset(Item item) {
float nudge = -.1f; float nudge = -.1f;
if (item instanceof FilterItem) if (item instanceof FilterItem)
return nudge; return -nudge / 2;
if (item instanceof BlockItem) { if (item instanceof BlockItem) {
Block block = ((BlockItem) item).getBlock(); Block block = ((BlockItem) item).getBlock();
if (block instanceof AbstractSimpleShaftBlock) if (block instanceof AbstractSimpleShaftBlock)

View file

@ -1,7 +1,7 @@
{ {
"parent": "create:item/filter", "parent": "create:item/filter",
"textures": { "textures": {
"0": "create:item/property_filter", "layer0": "create:item/brass_filter",
"particle": "create:item/property_filter" "particle": "create:item/brass_filter"
} }
} }

View file

@ -1,115 +1,36 @@
{ {
"credit": "Made with Blockbench", "credit": "Made with Blockbench",
"parent": "block/block", "parent": "builtin/generated",
"textures": { "textures": {
"0": "create:item/filter", "particle": "create:item/andesite_filter",
"particle": "create:item/filter" "layer0": "create:item/andesite_filter"
}, },
"elements": [
{
"name": "siderim",
"from": [5, -0.25, 6],
"to": [6, 0.75, 10],
"faces": {
"north": {"uv": [15, 0, 16, 1], "texture": "#0"},
"east": {"uv": [14, 7, 15, 3], "rotation": 270, "texture": "#0"},
"south": {"uv": [15, 0, 16, 1], "texture": "#0"},
"west": {"uv": [15, 8, 16, 4], "rotation": 270, "texture": "#0"},
"up": {"uv": [15, 4, 16, 8], "rotation": 180, "texture": "#0"},
"down": {"uv": [15, 4, 14, 8], "rotation": 180, "texture": "#0"}
}
},
{
"name": "siderim",
"from": [10, -0.25, 6],
"to": [11, 0.75, 10],
"faces": {
"north": {"uv": [15, 0, 16, 1], "texture": "#0"},
"east": {"uv": [15, 8, 16, 4], "rotation": 270, "texture": "#0"},
"south": {"uv": [15, 0, 16, 1], "texture": "#0"},
"west": {"uv": [14, 7, 15, 3], "rotation": 270, "texture": "#0"},
"up": {"uv": [15, 5, 16, 9], "rotation": 180, "texture": "#0"},
"down": {"uv": [15, 4, 14, 8], "rotation": 180, "texture": "#0"}
}
},
{
"name": "net",
"from": [6, 0.5, 6],
"to": [10, 0.6, 10],
"faces": {
"north": {"uv": [0, 0, 4, 0.1], "texture": "#0"},
"east": {"uv": [0, 0, 4, 0.1], "texture": "#0"},
"south": {"uv": [0, 0, 4, 0.1], "texture": "#0"},
"west": {"uv": [0, 0, 4, 0.1], "texture": "#0"},
"up": {"uv": [2, 0, 6, 4], "texture": "#0"},
"down": {"uv": [2.5, 0.5, 6.5, 4.5], "texture": "#0"}
}
},
{
"name": "toprim",
"from": [5, -0.25, 5],
"to": [11, 0.75, 6],
"faces": {
"north": {"uv": [3, 9, 9, 10], "texture": "#0"},
"east": {"uv": [12, 9, 13, 10], "texture": "#0"},
"south": {"uv": [3, 9, 9, 10], "rotation": 180, "texture": "#0"},
"west": {"uv": [12, 9, 13, 10], "texture": "#0"},
"up": {"uv": [3, 9, 9, 10], "rotation": 180, "texture": "#0"},
"down": {"uv": [3, 9, 9, 10], "rotation": 180, "texture": "#0"}
}
},
{
"name": "toprim",
"from": [5, -0.25, 10],
"to": [11, 0.75, 11],
"faces": {
"north": {"uv": [3, 9, 9, 10], "texture": "#0"},
"east": {"uv": [12, 9, 13, 10], "texture": "#0"},
"south": {"uv": [5, 9, 11, 10], "rotation": 180, "texture": "#0"},
"west": {"uv": [12, 9, 13, 10], "texture": "#0"},
"up": {"uv": [5, 9, 11, 10], "rotation": 180, "texture": "#0"},
"down": {"uv": [3, 9, 9, 10], "rotation": 180, "texture": "#0"}
}
}
],
"display": { "display": {
"thirdperson_righthand": { "thirdperson_righthand": {
"rotation": [75, -180, 0], "translation": [0, 1.5, 1],
"translation": [-2.75, 2, 4.75], "scale": [0.55, 0.55, 0.55]
"scale": [0.6, 0.6, 0.6]
}, },
"thirdperson_lefthand": { "thirdperson_lefthand": {
"rotation": [75, -180, 0], "translation": [0, 1.5, 1],
"translation": [-2.75, 2, 4.75], "scale": [0.55, 0.55, 0.55]
"scale": [0.6, 0.6, 0.6]
}, },
"firstperson_righthand": { "firstperson_righthand": {
"rotation": [75, -180, 0], "rotation": [0, -90, 25],
"translation": [2.25, 1.5, 4.75], "translation": [1.13, 3.2, 2.88],
"scale": [1.35, 1.35, 1.35] "scale": [0.68, 0.68, 0.68]
}, },
"firstperson_lefthand": { "firstperson_lefthand": {
"rotation": [75, -180, 0], "rotation": [0, -90, 25],
"translation": [2.25, 1.5, 4.75], "translation": [1.13, 3.2, 2.88],
"scale": [1.35, 1.35, 1.35] "scale": [0.68, 0.68, 0.68]
},
"ground": {
"translation": [0, 3, 0],
"scale": [0.76, 0.76, 0.76]
}, },
"gui": { "gui": {
"rotation": [30, 225, 0], "rotation": [30, 135, 0],
"translation": [0, 9.5, 0],
"scale": [1.5, 1.5, 1.5] "scale": [1.5, 1.5, 1.5]
}, },
"head": {
"translation": [0, 18.25, 0],
"scale": [1.43, 1.43, 1.43]
},
"fixed": { "fixed": {
"rotation": [90, 0, 179.5], "rotation": [0, 180, 0],
"translation": [0, 0, -15], "scale": [2, 2, 2]
"scale": [2.04, 2.04, 2.04]
} }
} }
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 221 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 227 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 309 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 237 B