Skip to content

Commit 879e54e

Browse files
committed
Wrap translations into separate function, turbine chapter for patchouli
1 parent 8935840 commit 879e54e

File tree

103 files changed

+793
-280
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+793
-280
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parent": "minecraft:recipes/root",
3+
"criteria": {
4+
"has_the_recipe": {
5+
"conditions": {
6+
"recipe": "nuclearcraft:chamber_port"
7+
},
8+
"trigger": "minecraft:recipe_unlocked"
9+
},
10+
"item": {
11+
"conditions": {
12+
"items": [
13+
{
14+
"items": [
15+
"nuclearcraft:neutronium_frame"
16+
]
17+
}
18+
]
19+
},
20+
"trigger": "minecraft:inventory_changed"
21+
}
22+
},
23+
"requirements": [
24+
[
25+
"item",
26+
"has_the_recipe"
27+
]
28+
],
29+
"rewards": {
30+
"recipes": [
31+
"nuclearcraft:chamber_port"
32+
]
33+
},
34+
"sends_telemetry_event": false
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parent": "minecraft:recipes/root",
3+
"criteria": {
4+
"has_the_recipe": {
5+
"conditions": {
6+
"recipe": "nuclearcraft:chamber_terminal"
7+
},
8+
"trigger": "minecraft:recipe_unlocked"
9+
},
10+
"item": {
11+
"conditions": {
12+
"items": [
13+
{
14+
"items": [
15+
"nuclearcraft:neutronium_frame"
16+
]
17+
}
18+
]
19+
},
20+
"trigger": "minecraft:inventory_changed"
21+
}
22+
},
23+
"requirements": [
24+
[
25+
"item",
26+
"has_the_recipe"
27+
]
28+
],
29+
"rewards": {
30+
"recipes": [
31+
"nuclearcraft:chamber_terminal"
32+
]
33+
},
34+
"sends_telemetry_event": false
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parent": "minecraft:recipes/root",
3+
"criteria": {
4+
"has_the_recipe": {
5+
"conditions": {
6+
"recipe": "nuclearcraft:event_horizon_stabilizer"
7+
},
8+
"trigger": "minecraft:recipe_unlocked"
9+
},
10+
"item": {
11+
"conditions": {
12+
"items": [
13+
{
14+
"items": [
15+
"nuclearcraft:neutronium_frame"
16+
]
17+
}
18+
]
19+
},
20+
"trigger": "minecraft:inventory_changed"
21+
}
22+
},
23+
"requirements": [
24+
[
25+
"item",
26+
"has_the_recipe"
27+
]
28+
],
29+
"rewards": {
30+
"recipes": [
31+
"nuclearcraft:event_horizon_stabilizer"
32+
]
33+
},
34+
"sends_telemetry_event": false
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parent": "minecraft:recipes/root",
3+
"criteria": {
4+
"has_the_recipe": {
5+
"conditions": {
6+
"recipe": "nuclearcraft:expl"
7+
},
8+
"trigger": "minecraft:recipe_unlocked"
9+
},
10+
"item": {
11+
"conditions": {
12+
"items": [
13+
{
14+
"items": [
15+
"nuclearcraft:elite_lithium_ion_battery"
16+
]
17+
}
18+
]
19+
},
20+
"trigger": "minecraft:inventory_changed"
21+
}
22+
},
23+
"requirements": [
24+
[
25+
"item",
26+
"has_the_recipe"
27+
]
28+
],
29+
"rewards": {
30+
"recipes": [
31+
"nuclearcraft:expl"
32+
]
33+
},
34+
"sends_telemetry_event": false
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parent": "minecraft:recipes/root",
3+
"criteria": {
4+
"has_the_recipe": {
5+
"conditions": {
6+
"recipe": "nuclearcraft:neutronium_frame"
7+
},
8+
"trigger": "minecraft:recipe_unlocked"
9+
},
10+
"item": {
11+
"conditions": {
12+
"items": [
13+
{
14+
"items": [
15+
"nuclearcraft:plate_extreme"
16+
]
17+
}
18+
]
19+
},
20+
"trigger": "minecraft:inventory_changed"
21+
}
22+
},
23+
"requirements": [
24+
[
25+
"item",
26+
"has_the_recipe"
27+
]
28+
],
29+
"rewards": {
30+
"recipes": [
31+
"nuclearcraft:neutronium_frame"
32+
]
33+
},
34+
"sends_telemetry_event": false
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parent": "minecraft:recipes/root",
3+
"criteria": {
4+
"has_the_recipe": {
5+
"conditions": {
6+
"recipe": "nuclearcraft:photon_concentrator"
7+
},
8+
"trigger": "minecraft:recipe_unlocked"
9+
},
10+
"item": {
11+
"conditions": {
12+
"items": [
13+
{
14+
"items": [
15+
"nuclearcraft:neutronium_frame"
16+
]
17+
}
18+
]
19+
},
20+
"trigger": "minecraft:inventory_changed"
21+
}
22+
},
23+
"requirements": [
24+
[
25+
"item",
26+
"has_the_recipe"
27+
]
28+
],
29+
"rewards": {
30+
"recipes": [
31+
"nuclearcraft:photon_concentrator"
32+
]
33+
},
34+
"sends_telemetry_event": false
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parent": "minecraft:recipes/root",
3+
"criteria": {
4+
"has_the_recipe": {
5+
"conditions": {
6+
"recipe": "nuclearcraft:quantum_flux_regulator"
7+
},
8+
"trigger": "minecraft:recipe_unlocked"
9+
},
10+
"item": {
11+
"conditions": {
12+
"items": [
13+
{
14+
"items": [
15+
"nuclearcraft:neutronium_frame"
16+
]
17+
}
18+
]
19+
},
20+
"trigger": "minecraft:inventory_changed"
21+
}
22+
},
23+
"requirements": [
24+
[
25+
"item",
26+
"has_the_recipe"
27+
]
28+
],
29+
"rewards": {
30+
"recipes": [
31+
"nuclearcraft:quantum_flux_regulator"
32+
]
33+
},
34+
"sends_telemetry_event": false
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
{
2+
"parent": "minecraft:recipes/root",
3+
"criteria": {
4+
"has_the_recipe": {
5+
"conditions": {
6+
"recipe": "nuclearcraft:quantum_transformer"
7+
},
8+
"trigger": "minecraft:recipe_unlocked"
9+
},
10+
"item": {
11+
"conditions": {
12+
"items": [
13+
{
14+
"items": [
15+
"nuclearcraft:neutronium_frame"
16+
]
17+
}
18+
]
19+
},
20+
"trigger": "minecraft:inventory_changed"
21+
}
22+
},
23+
"requirements": [
24+
[
25+
"item",
26+
"has_the_recipe"
27+
]
28+
],
29+
"rewards": {
30+
"recipes": [
31+
"nuclearcraft:quantum_transformer"
32+
]
33+
},
34+
"sends_telemetry_event": false
35+
}

src/main/java/igentuman/nc/block/BarrelBlock.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
import java.util.List;
4141

4242
import static igentuman.nc.util.StackUtils.isMultiTool;
43+
import static igentuman.nc.util.TextUtils.__;
4344
import static igentuman.nc.util.TextUtils.formatLiquid;
4445
import static net.minecraft.world.item.Items.BUCKET;
4546

@@ -81,7 +82,7 @@ public InteractionResult use(BlockState state, Level level, BlockPos pos, Player
8182
dirToChange = dirToChange.getOpposite();
8283
}
8384
SideModeToggleable.SideMode mode = be.toggleSideConfig(dirToChange.ordinal());
84-
player.sendSystemMessage(Component.translatable("message.nc.barrel.side_config", mode.name()));
85+
player.sendSystemMessage(__("message.nc.barrel.side_config", mode.name()));
8586
} else
8687
if(!handStack.equals(ItemStack.EMPTY)) {
8788
if(handStack.getItem() instanceof BucketItem) {
@@ -133,9 +134,9 @@ public InteractionResult use(BlockState state, Level level, BlockPos pos, Player
133134
fluid = be.getFluidHandler().orElseGet(null).getFluidInTank(0);
134135
int storage = BarrelBlocks.all().get(code()).getCapacity();
135136
if(fluid == null || fluid.isEmpty()) {
136-
player.sendSystemMessage(Component.translatable("tooltip.nc.liquid_empty", formatLiquid(storage)).withStyle(ChatFormatting.BLUE));
137+
player.sendSystemMessage(__("tooltip.nc.liquid_empty", formatLiquid(storage)).withStyle(ChatFormatting.BLUE));
137138
} else {
138-
player.sendSystemMessage(Component.translatable("tooltip.nc.liquid_stored", fluid.getDisplayName(), formatLiquid(fluid.getAmount()), formatLiquid(storage)).withStyle(ChatFormatting.BLUE));
139+
player.sendSystemMessage(__("tooltip.nc.liquid_stored", fluid.getDisplayName(), formatLiquid(fluid.getAmount()), formatLiquid(storage)).withStyle(ChatFormatting.BLUE));
139140
}
140141
}
141142
}
@@ -212,8 +213,8 @@ public void appendHoverText(ItemStack stack, @javax.annotation.Nullable BlockGet
212213
{
213214
int storage = BarrelBlocks.all().get(code()).config().getCapacity();
214215

215-
list.add(Component.translatable("tooltip.nc.liquid_capacity", formatLiquid(storage)).withStyle(ChatFormatting.BLUE));
216-
list.add(Component.translatable("tooltip.nc.use_multitool").withStyle(ChatFormatting.YELLOW));
216+
list.add(__("tooltip.nc.liquid_capacity", formatLiquid(storage)).withStyle(ChatFormatting.BLUE));
217+
list.add(__("tooltip.nc.use_multitool").withStyle(ChatFormatting.YELLOW));
217218
}
218219

219220
public boolean registered() {

src/main/java/igentuman/nc/block/BatteryBlock.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
import static igentuman.nc.handler.config.CommonConfig.ENERGY_STORAGE;
3636
import static igentuman.nc.util.StackUtils.isMultiTool;
37+
import static igentuman.nc.util.TextUtils.__;
3738
import static igentuman.nc.util.TextUtils.formatEnergy;
3839

3940
public class BatteryBlock extends Block implements EntityBlock {
@@ -64,9 +65,9 @@ public InteractionResult use(BlockState state, Level level, BlockPos pos, Player
6465
dirToChange = dirToChange.getOpposite();
6566
}
6667
SideModeToggleable.SideMode mode = batteryBE.toggleSideConfig(dirToChange.ordinal());
67-
player.sendSystemMessage(Component.translatable("message.nc.barrel.side_config", mode.name()));
68+
player.sendSystemMessage(__("message.nc.barrel.side_config", mode.name()));
6869
} else {
69-
player.sendSystemMessage(Component.translatable("tooltip.nc.energy_stored", formatEnergy(batteryBE.energyStorage.getEnergyStored()), formatEnergy(batteryBE.energyStorage.getMaxEnergyStored())).withStyle(ChatFormatting.BLUE));
70+
player.sendSystemMessage(__("tooltip.nc.energy_stored", formatEnergy(batteryBE.energyStorage.getEnergyStored()), formatEnergy(batteryBE.energyStorage.getMaxEnergyStored())).withStyle(ChatFormatting.BLUE));
7071
}
7172
}
7273
}
@@ -144,8 +145,8 @@ public void appendHoverText(ItemStack stack, @javax.annotation.Nullable BlockGet
144145
{
145146
int storage = ENERGY_STORAGE.getCapacityFor(asItem().toString());
146147

147-
list.add(Component.translatable("tooltip.nc.energy_capacity", formatEnergy(storage)).withStyle(ChatFormatting.BLUE));
148-
list.add(Component.translatable("tooltip.nc.use_multitool").withStyle(ChatFormatting.YELLOW));
148+
list.add(__("tooltip.nc.energy_capacity", formatEnergy(storage)).withStyle(ChatFormatting.BLUE));
149+
list.add(__("tooltip.nc.use_multitool").withStyle(ChatFormatting.YELLOW));
149150
}
150151

151152
public boolean registered() {

0 commit comments

Comments
 (0)