Gave datagen/content a marker to be filtered out if not needed

This commit is contained in:
Ayutac 2022-02-10 10:58:38 +01:00
parent d0482c1ffd
commit 4bc6841eae

View file

@ -40,6 +40,8 @@ import net.minecraft.util.Pair;
import net.minecraft.util.math.intprovider.UniformIntProvider; import net.minecraft.util.math.intprovider.UniformIntProvider;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.slf4j.Marker;
import org.slf4j.MarkerFactory;
import reborncore.api.blockentity.IUpgrade; import reborncore.api.blockentity.IUpgrade;
import reborncore.common.fluid.FluidValue; import reborncore.common.fluid.FluidValue;
import reborncore.common.misc.TagConvertible; import reborncore.common.misc.TagConvertible;
@ -99,6 +101,8 @@ import java.util.stream.Stream;
public class TRContent { public class TRContent {
public static Marker DATAGEN = MarkerFactory.getMarker("datagen");
// Misc Blocks // Misc Blocks
public static Block COMPUTER_CUBE; public static Block COMPUTER_CUBE;
public static Block NUKE; public static Block NUKE;
@ -748,7 +752,7 @@ public class TRContent {
oreVariant = Ores.valueOf(this.toString()); oreVariant = Ores.valueOf(this.toString());
} }
catch (IllegalArgumentException ex) { catch (IllegalArgumentException ex) {
TechReborn.LOGGER.warn("Raw metal {} has no ore block equivalent!", name); TechReborn.LOGGER.warn(DATAGEN, "Raw metal {} has no ore block equivalent!", name);
} }
ore = oreVariant; ore = oreVariant;
StorageBlocks blockVariant = null; StorageBlocks blockVariant = null;
@ -756,7 +760,7 @@ public class TRContent {
blockVariant = StorageBlocks.valueOf("RAW_" + this.toString()); blockVariant = StorageBlocks.valueOf("RAW_" + this.toString());
} }
catch (IllegalArgumentException ex) { catch (IllegalArgumentException ex) {
TechReborn.LOGGER.warn("Raw metal {} has no storage block equivalent!", name); TechReborn.LOGGER.warn(DATAGEN, "Raw metal {} has no storage block equivalent!", name);
} }
storageBlock = blockVariant; storageBlock = blockVariant;
InitUtils.setup(item, "raw_" + name); InitUtils.setup(item, "raw_" + name);
@ -829,7 +833,7 @@ public class TRContent {
dustVariant = Dusts.valueOf(this.toString()); dustVariant = Dusts.valueOf(this.toString());
} }
catch (IllegalArgumentException ex) { catch (IllegalArgumentException ex) {
TechReborn.LOGGER.warn("Small dust {} has no dust equivalent!", name); TechReborn.LOGGER.warn(DATAGEN, "Small dust {} has no dust equivalent!", name);
} }
dust = dustVariant; dust = dustVariant;
InitUtils.setup(item, name + "_small_dust"); InitUtils.setup(item, name + "_small_dust");
@ -898,7 +902,7 @@ public class TRContent {
dustVariant = Dusts.valueOf(this.toString()); dustVariant = Dusts.valueOf(this.toString());
} }
catch (IllegalArgumentException ex) { catch (IllegalArgumentException ex) {
TechReborn.LOGGER.warn("Gem {} has no dust item equivalent!", name); TechReborn.LOGGER.warn(DATAGEN, "Gem {} has no dust item equivalent!", name);
} }
dust = dustVariant; dust = dustVariant;
Ores oreVariant = null; Ores oreVariant = null;
@ -906,7 +910,7 @@ public class TRContent {
oreVariant = Ores.valueOf(this.toString()); oreVariant = Ores.valueOf(this.toString());
} }
catch (IllegalArgumentException ex) { catch (IllegalArgumentException ex) {
TechReborn.LOGGER.info("Gem {} has no ore block equivalent.", name); TechReborn.LOGGER.info(DATAGEN, "Gem {} has no ore block equivalent.", name);
} }
ore = oreVariant; ore = oreVariant;
StorageBlocks blockVariant = null; StorageBlocks blockVariant = null;
@ -914,7 +918,7 @@ public class TRContent {
blockVariant = StorageBlocks.valueOf(this.toString()); blockVariant = StorageBlocks.valueOf(this.toString());
} }
catch (IllegalArgumentException ex) { catch (IllegalArgumentException ex) {
TechReborn.LOGGER.warn("Gem {} has no storage block equivalent!", name); TechReborn.LOGGER.warn(DATAGEN, "Gem {} has no storage block equivalent!", name);
} }
storageBlock = blockVariant; storageBlock = blockVariant;
InitUtils.setup(item, name + "_gem"); InitUtils.setup(item, name + "_gem");
@ -1002,10 +1006,10 @@ public class TRContent {
catch (IllegalArgumentException ex) { catch (IllegalArgumentException ex) {
try { try {
RawMetals.valueOf(this.toString()); RawMetals.valueOf(this.toString());
TechReborn.LOGGER.info("Ingot {} has no dust item equivalent, but a raw metal.", name); TechReborn.LOGGER.info(DATAGEN, "Ingot {} has no dust item equivalent, but a raw metal.", name);
} }
catch (IllegalArgumentException ex2) { catch (IllegalArgumentException ex2) {
TechReborn.LOGGER.warn("Ingot {} has no dust item equivalent AND no raw metal!", name); TechReborn.LOGGER.warn(DATAGEN, "Ingot {} has no dust item equivalent AND no raw metal!", name);
} }
} }
dust = dustVariant; dust = dustVariant;
@ -1014,7 +1018,7 @@ public class TRContent {
blockVariant = StorageBlocks.valueOf(this.toString()); blockVariant = StorageBlocks.valueOf(this.toString());
} }
catch (IllegalArgumentException ex) { catch (IllegalArgumentException ex) {
TechReborn.LOGGER.warn("Ingot {} has no storage block equivalent!", name); TechReborn.LOGGER.warn(DATAGEN, "Ingot {} has no storage block equivalent!", name);
} }
storageBlock = blockVariant; storageBlock = blockVariant;
InitUtils.setup(item, name + "_ingot"); InitUtils.setup(item, name + "_ingot");
@ -1093,7 +1097,7 @@ public class TRContent {
ingotVariant = Ingots.valueOf(this.toString()); ingotVariant = Ingots.valueOf(this.toString());
} }
catch (IllegalArgumentException ex) { catch (IllegalArgumentException ex) {
TechReborn.LOGGER.warn("Nugget {} has no ingot equivalent!", name); TechReborn.LOGGER.warn(DATAGEN, "Nugget {} has no ingot equivalent!", name);
} }
ingot = ingotVariant; ingot = ingotVariant;
this.ofGem = ofGem; this.ofGem = ofGem;
@ -1288,7 +1292,7 @@ public class TRContent {
sourceVariant = Gems.valueOf(this.toString()); sourceVariant = Gems.valueOf(this.toString());
} }
catch (IllegalArgumentException ex2) { catch (IllegalArgumentException ex2) {
TechReborn.LOGGER.warn("Plate {} has no identifiable source!", name); TechReborn.LOGGER.warn(DATAGEN, "Plate {} has no identifiable source!", name);
} }
} }
} }
@ -1301,7 +1305,7 @@ public class TRContent {
else if (sourceVariant instanceof Ingots ingot) else if (sourceVariant instanceof Ingots ingot)
this.sourceBlock = ingot.getStorageBlock(); this.sourceBlock = ingot.getStorageBlock();
else { else {
TechReborn.LOGGER.info("Plate {} has no identifiable source block.", name); TechReborn.LOGGER.info(DATAGEN, "Plate {} has no identifiable source block.", name);
this.sourceBlock = null; this.sourceBlock = null;
} }
} }