Skip to content

Commit a8bb435

Browse files
committed
Rename storage blocks to be more inline with vanilla naming of storage blocks
1 parent c377444 commit a8bb435

File tree

9 files changed

+128
-36
lines changed

9 files changed

+128
-36
lines changed

src/datagen/generated/mekanism/.cache/c10fcd8abbb6a520fc3ac2cf14b627d36958dd55

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datagen/generated/mekanism/.cache/c2007283a832f570d2167eeffdb50ecb2f811654

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datagen/generated/mekanism/assets/emi/aliases/mekanism.json

Lines changed: 48 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datagen/generated/mekanism/assets/mekanism/lang/en_ud.json

Lines changed: 24 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datagen/generated/mekanism/assets/mekanism/lang/en_us.json

Lines changed: 24 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/datagen/main/java/mekanism/client/integration/MekanismAliases.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import mekanism.common.MekanismLang;
77
import net.minecraft.Util;
88

9-
//TODO - 1.20.5: Osmium Block (and other storage blocks) -> Block of Osmium (etc, though maybe we want to change the base lang entry instead for some to better match vanilla)
109
@NothingNullByDefault
1110
public enum MekanismAliases implements IAliasedTranslation {
1211
BIN_DRAWER("bin.drawer", "Drawer"),
@@ -16,6 +15,11 @@ public enum MekanismAliases implements IAliasedTranslation {
1615
REDSTONE_CONTROL("redstone_control", "Redstone Control"),
1716
ROUND_ROBIN("round_robin", "Round-Robin"),
1817
TAG_CONVERTER("tag_converter", "Tag Converter"),
18+
//Storage Block
19+
BLOCK_BRONZE("block.bronze", "Bronze Block"),
20+
BLOCK_CHARCOAL("block.charcoal", "Charcoal Block"),
21+
BLOCK_STEEL("block.steel", "Steel Block"),
22+
BLOCK_FLUORITE("block.fluorite", "Fluorite Block"),
1923
//Canteen
2024
CANTEEN_EDIBLE("canteen.edible", "Edible"),
2125
CANTEEN_FOOD_STORAGE("canteen.storage", "Food Storage"),

src/datagen/main/java/mekanism/client/integration/emi/MekanismEmiAliasProvider.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22

33
import dev.emi.emi.api.stack.EmiStack;
44
import java.util.List;
5+
import java.util.Map;
56
import java.util.concurrent.CompletableFuture;
67
import mekanism.api.annotations.NothingNullByDefault;
78
import mekanism.client.integration.MekanismAliases;
89
import mekanism.common.Mekanism;
910
import mekanism.common.content.blocktype.FactoryType;
1011
import mekanism.common.item.block.ItemBlockEnergyCube;
12+
import mekanism.common.registration.impl.BlockRegistryObject;
1113
import mekanism.common.registries.MekanismBlocks;
1214
import mekanism.common.registries.MekanismFluids;
1315
import mekanism.common.registries.MekanismGases;
1416
import mekanism.common.registries.MekanismItems;
17+
import mekanism.common.resource.IResource;
1518
import mekanism.common.tier.FactoryTier;
1619
import mekanism.common.util.EnumUtils;
1720
import mekanism.common.util.FluidUtils;
@@ -180,6 +183,7 @@ private void addMultiblockAliases() {
180183
}
181184

182185
private void addStorageAliases() {
186+
addStorageBlockAliases();
183187
addQIOAliases();
184188
addAliases(List.of(
185189
MekanismBlocks.BASIC_BIN,
@@ -237,6 +241,18 @@ private void addStorageAliases() {
237241
), MekanismAliases.STORAGE_TRASHCAN, MekanismAliases.STORAGE_VOID);
238242
}
239243

244+
private void addStorageBlockAliases() {
245+
addAliases(MekanismBlocks.BRONZE_BLOCK, MekanismAliases.BLOCK_BRONZE);
246+
addAliases(MekanismBlocks.CHARCOAL_BLOCK, MekanismAliases.BLOCK_CHARCOAL);
247+
addAliases(MekanismBlocks.STEEL_BLOCK, MekanismAliases.BLOCK_STEEL);
248+
addAliases(MekanismBlocks.FLUORITE_BLOCK, MekanismAliases.BLOCK_FLUORITE);
249+
//Dynamic storage blocks
250+
for (Map.Entry<IResource, BlockRegistryObject<?, ?>> entry : MekanismBlocks.PROCESSED_RESOURCE_BLOCKS.entrySet()) {
251+
BlockRegistryObject<?, ?> block = entry.getValue();
252+
addAliases(block, () -> Util.makeDescriptionId("alias", block.getId().withPath(entry.getKey().getRegistrySuffix())));
253+
}
254+
}
255+
240256
private void addQIOAliases() {
241257
addAliases(MekanismBlocks.QIO_REDSTONE_ADAPTER, MekanismAliases.QIO_FULL, MekanismAliases.QIO_ADAPTER_EMITTER);
242258
addAliases(MekanismBlocks.QIO_DRIVE_ARRAY, MekanismAliases.QIO_FULL, MekanismAliases.QIO_DRIVE_BAY);

src/datagen/main/java/mekanism/client/lang/MekanismLangProvider.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -466,17 +466,18 @@ private void addBlocks() {
466466
addOre(OreType.URANIUM, "A common, heavy metal, which can yield massive amounts of energy when properly processed. In its naturally-occurring form, it is not radioactive enough to cause harm.");
467467
addOre(OreType.LEAD, "A somewhat rare metal that is excellent at resisting radioactive particles.");
468468
//Storage blocks
469-
add(MekanismBlocks.BRONZE_BLOCK, "Bronze Block");
469+
add(MekanismBlocks.BRONZE_BLOCK, "Block of Bronze");
470+
add(MekanismBlocks.CHARCOAL_BLOCK, "Block of Charcoal");
471+
add(MekanismBlocks.STEEL_BLOCK, "Block of Steel");
472+
add(MekanismBlocks.FLUORITE_BLOCK, "Block of Fluorite");
470473
add(MekanismBlocks.REFINED_OBSIDIAN_BLOCK, "Refined Obsidian");
471-
add(MekanismBlocks.CHARCOAL_BLOCK, "Charcoal Block");
472474
add(MekanismBlocks.REFINED_GLOWSTONE_BLOCK, "Refined Glowstone");
473-
add(MekanismBlocks.STEEL_BLOCK, "Steel Block");
474-
add(MekanismBlocks.FLUORITE_BLOCK, "Fluorite Block");
475475
//Dynamic storage blocks
476476
for (Map.Entry<IResource, BlockRegistryObject<?, ?>> entry : MekanismBlocks.PROCESSED_RESOURCE_BLOCKS.entrySet()) {
477477
IResource key = entry.getKey();
478478
String name = formatAndCapitalize(key.getRegistrySuffix());
479-
add(entry.getValue(), name + " Block");
479+
add(entry.getValue(), "Block of " + name);
480+
addAlias(key.getRegistrySuffix(), name + " Block");
480481
addTag(MekanismTags.Items.PROCESSED_RESOURCE_BLOCKS.get(key), name + " Storage Blocks");
481482
}
482483

src/main/java/mekanism/common/content/qio/QIOGlobalItemLookup.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ protected SerializedHashedItem(HashedItem other) {
151151

152152
public Tag getNbtRepresentation(@NotNull HolderLookup.Provider provider) {
153153
if (nbtRepresentation == null) {
154-
//TODO - 1.20.5: Only bother converting the patch to nbt so that we have a smaller save and also if defaults change then they get properly updated?
155154
nbtRepresentation = internalToNBT(provider);
156155
//Override to ensure that it gets stored with a count of one in case it was raw
157156
// and that then when we read it we don't create it with extra size

0 commit comments

Comments
 (0)