Skip to content

Commit c6c44ee

Browse files
committed
Add alternative textures for the configurator when on various modes
1 parent 95f0022 commit c6c44ee

File tree

10 files changed

+53
-2
lines changed

10 files changed

+53
-2
lines changed

build.gradle

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,8 @@ tasks.register('optimizePng', OptimizePng) {
537537
inputFiles.from(fileTree(dir: dir, includes: pngPatterns))
538538
}
539539
}
540+
//TODO: Make optimize png be fully compatible with the configuration cache?
541+
notCompatibleWithConfigurationCache('Up to date check is not currently compatible with the configuration cache')
540542
outputs.upToDateWhen {
541543
//Validate that none of the files has changed size, as the odds that a file has the exact same size and has changed is very low for an image file
542544
//Note: This is from Chat-GPT, I don't understand why the any check isn't just always true (and thus this being different from returning always false)

src/main/java/mekanism/client/ClientRegistration.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@
151151
import mekanism.common.block.attribute.Attribute;
152152
import mekanism.common.content.gear.shared.ModuleColorModulationUnit;
153153
import mekanism.common.item.ItemConfigurationCard;
154+
import mekanism.common.item.ItemConfigurator;
155+
import mekanism.common.item.ItemConfigurator.ConfiguratorMode;
154156
import mekanism.common.item.block.machine.ItemBlockFluidTank;
155157
import mekanism.common.lib.FieldReflectionHelper;
156158
import mekanism.common.lib.radiation.RadiationManager;
@@ -256,6 +258,15 @@ public static void init(FMLClientSetupEvent event) {
256258
});
257259
ClientRegistrationUtil.setPropertyOverride(MekanismItems.CONFIGURATION_CARD, Mekanism.rl("encoded"),
258260
(stack, world, entity, seed) -> ((ItemConfigurationCard) stack.getItem()).hasData(stack) ? 1 : 0);
261+
ClientRegistrationUtil.setPropertyOverride(MekanismItems.CONFIGURATOR, Mekanism.rl("mode"), (stack, world, entity, seed) -> {
262+
ConfiguratorMode mode = ((ItemConfigurator) stack.getItem()).getMode(stack);
263+
return switch (mode) {
264+
default -> 0;
265+
case EMPTY -> 1;
266+
case ROTATE -> 2;
267+
case WRENCH -> 3;
268+
};
269+
});
259270

260271
ClientRegistrationUtil.setPropertyOverride(MekanismItems.ELECTRIC_BOW, Mekanism.rl("pull"),
261272
(stack, world, entity, seed) -> entity != null && entity.getUseItem() == stack ? (stack.getUseDuration(entity) - entity.getUseItemRemainingTicks()) / (float) SharedConstants.TICKS_PER_SECOND : 0);
Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,26 @@
11
{
22
"parent": "item/handheld",
33
"textures": {
4-
"layer0": "mekanism:item/configurator"
5-
}
4+
"layer0": "mekanism:item/configurator_config"
5+
},
6+
"overrides": [
7+
{
8+
"predicate": {
9+
"mekanism:mode": 1
10+
},
11+
"model": "mekanism:item/configurator_empty"
12+
},
13+
{
14+
"predicate": {
15+
"mekanism:mode": 2
16+
},
17+
"model": "mekanism:item/configurator_rotate"
18+
},
19+
{
20+
"predicate": {
21+
"mekanism:mode": 3
22+
},
23+
"model": "mekanism:item/configurator_wrench"
24+
}
25+
]
626
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "item/handheld",
3+
"textures": {
4+
"layer0": "mekanism:item/configurator_empty"
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "item/handheld",
3+
"textures": {
4+
"layer0": "mekanism:item/configurator_rotate"
5+
}
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"parent": "item/handheld",
3+
"textures": {
4+
"layer0": "mekanism:item/configurator_wrench"
5+
}
6+
}
279 Bytes
Loading
253 Bytes
Loading
275 Bytes
Loading

0 commit comments

Comments
 (0)