Skip to content

Commit

Permalink
System -> Logger
Browse files Browse the repository at this point in the history
  • Loading branch information
i509VCB committed Mar 3, 2020
1 parent 5d83195 commit 44683db
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@ public static CottonResourcesConfig loadConfig() {
.build();
try {
JsonObject json = jankson.load(file);
System.out.println("Loading: " + json);
CottonResources.LOGGER.info("Loading: " + json);
CottonResourcesConfig loading = jankson.fromJson(json, CottonResourcesConfig.class);
System.out.println("Loaded Map: " + loading.generators);
CottonResources.LOGGER.info("Loaded Map: " + loading.generators);
//Manually reload oregen because BiomeSpec and DimensionSpec can be fussy

JsonObject oregen = json.getObject("generators");
if (oregen != null) {
System.out.println("RELOADING " + oregen.size() + " entries");
CottonResources.LOGGER.info("RELOADING " + oregen.size() + " entries");
for (Map.Entry<String, JsonElement> entry : oregen.entrySet()) {
if (entry.getValue() instanceof JsonObject) {
OreGenerationSettings settings = OreGenerationSettings.deserialize((JsonObject) entry.getValue());
Expand All @@ -208,7 +208,7 @@ public static CottonResourcesConfig loadConfig() {
}
}

System.out.println("RELOADED Map: " + loading.generators);
CottonResources.LOGGER.info("RELOADED Map: " + loading.generators);

return loading;
} catch (IOException | SyntaxError e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public List<ItemStack> getDroppedStacks(BlockState state, LootContext.Builder bu
if (pools.isEmpty()) {
//Yup. Somehow we got a loot pool that just never drops anything.
if (!complainedAboutLoot) {
System.out.println("Loot pool '"+tableId+"' doesn't seem to be able to drop anything. Supplying the ore block instead. Please report this to the Cotton team!");
CottonResources.LOGGER.error("Loot pool '"+tableId+"' doesn't seem to be able to drop anything. Supplying the ore block instead. Please report this to the Cotton team!");
complainedAboutLoot = true;
}
result.add(new ItemStack(this.asItem()));
Expand Down
12 changes: 6 additions & 6 deletions src/main/java/io/github/cottonmc/resources/compat/REICompat.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ public void registerEntries(EntryRegistry entryRegistry) {
public void recheckItemHiding(List<EntryStack> list) {
for (ResourceType rsrc : CottonResources.BUILTINS.values()) {
if (IMMUNE_TO_HIDING.contains(rsrc.getBaseResource())) continue;
System.out.println("Not hiding: "+OregenResourceListener.getConfig().ores);

CottonResources.LOGGER.info("Not hiding: "+OregenResourceListener.getConfig().ores);
boolean enabled = OregenResourceListener.getConfig().ores.contains(rsrc.getBaseResource());
for(String affix : rsrc.getAffixes()) {
Item item = rsrc.getItem(affix);
if (item==null || item.equals(Items.AIR)) {
System.out.println(rsrc.getBaseResource()+"_"+affix+" does not exist?!");
CottonResources.LOGGER.info(rsrc.getBaseResource()+"_"+affix+" does not exist?!");
continue;
}
ItemStack stack = new ItemStack(item);
Expand All @@ -57,19 +57,19 @@ public void recheckItemHiding(List<EntryStack> list) {
if (listItem.getItem() == item) {
add = false;
if (!enabled) {
//System.out.println("Removing "+item.getTranslationKey());
//CottonResources.LOGGER.info("Removing "+item.getTranslationKey());
list.remove(i);
break;
} else {
//System.out.println("Letting stay "+item.getTranslationKey());
//CottonResources.LOGGER.info("Letting stay "+item.getTranslationKey());
break;
}
}
}
}

//if (add) {
//System.out.println("Re-adding "+item.getTranslationKey());
//CottonResources.LOGGER.info("Re-adding "+item.getTranslationKey());
// list.add(Entry.create(new ItemStack(item)));
//}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ public boolean generate(IWorld world, ChunkGenerator<? extends ChunkGeneratorCon
}

Biome biome = biomeArray.getBiomeForNoiseGen(pos.getX(), pos.getY(), pos.getZ());
//System.out.println("Generating into "+toGenerateIn.getPos()+" <- "+config.ores);
//CottonResources.LOGGER.error("Generating into "+toGenerateIn.getPos()+" <- "+config.ores);
for(String s : config.ores) {
OreGenerationSettings settings = config.generators.get(s);
if (settings==null) continue;

if (settings.dimensions.test(world.getDimension()) && settings.biomes.test(biome)) {
//For now, spit debug info
if (settings.ores.isEmpty()) {
//System.out.println("Empty ore settings");
//CottonResources.LOGGER.error("Empty ore settings");
continue;
}
int clusters = settings.cluster_count;
Expand All @@ -75,7 +75,7 @@ public boolean generate(IWorld world, ChunkGenerator<? extends ChunkGeneratorCon
for(int j=0; j<SPHERES.length; j++) { //find the smallest clump in our vocabulary which expresses the number of ores
Clump clump = SPHERES[j];
if (clump.size()>=settings.cluster_size) {
//System.out.println("Cluster size "+settings.cluster_size+" matched against clump #"+j);
//CottonResources.LOGGER.error("Cluster size "+settings.cluster_size+" matched against clump #"+j);
radius = j+1;
break;
}
Expand All @@ -91,12 +91,12 @@ public boolean generate(IWorld world, ChunkGenerator<? extends ChunkGeneratorCon

int generatedThisCluster = generateVeinPartGaussianClump(s, world, clusterX, clusterY, clusterZ, settings.cluster_size, radius, settings.ores, 85, rand);
blocksGenerated += generatedThisCluster;
//System.out.println(" Generated "+generatedThisCluster+" out of "+settings.cluster_size+" expected.");
//CottonResources.LOGGER.debug(" Generated "+generatedThisCluster+" out of "+settings.cluster_size+" expected.");
}

//System.out.println(" Generated "+blocksGenerated+" in "+clusters+" clusters out of "+settings.cluster_size+"*"+clusters+"="+(settings.cluster_size*clusters));
//CottonResources.LOGGER.debug(" Generated "+blocksGenerated+" in "+clusters+" clusters out of "+settings.cluster_size+"*"+clusters+"="+(settings.cluster_size*clusters));
} else {
//System.out.println(" skipping "+s+" here.");
//CottonResources.LOGGER.debug(" skipping "+s+" here.");
}
}

Expand Down Expand Up @@ -193,7 +193,7 @@ public boolean replace(IWorld world, int x, int y, int z, String resource, Block
BlockState toReplace = world.getBlockState(pos);
HashMap<String, String> replacementSpecs = OregenResourceListener.getConfig().replacements.get(resource);
if (replacementSpecs != null) {
//System.out.println("Activating replacementSpecs for resource "+resource);
//CottonResources.LOGGER.debug("Activating replacementSpecs for resource "+resource);
for(Map.Entry<String, String> entry : replacementSpecs.entrySet()) {
if (test(toReplace.getBlock(), entry.getKey())) {
BlockState replacement = getBlockState(entry.getValue(), rand);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,11 @@ public static Set<BlockState> deserializeBlockState(JsonElement elem) {

if (elem instanceof JsonPrimitive) {
BlockState state = BlockAndItemSerializers.getBlockStatePrimitive(((JsonPrimitive) elem).getValue());
if (state==null) System.out.println("State not found for "+((JsonPrimitive) elem).getValue());
if (state==null) CottonResources.LOGGER.error("State not found for "+((JsonPrimitive) elem).getValue());
return (state==null) ? ImmutableSet.of() : ImmutableSet.of(state);
} else if (elem instanceof JsonObject) {
BlockState state = BlockAndItemSerializers.getBlockState((JsonObject) elem);
if (state==null) System.out.println("State not found for "+((JsonPrimitive) elem).getValue());
if (state==null) CottonResources.LOGGER.error("State not found for "+((JsonPrimitive) elem).getValue());
return (state==null) ? ImmutableSet.of() : ImmutableSet.of(state);
} else if (elem instanceof JsonArray) {
HashSet<BlockState> result = new HashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void apply(ResourceManager resourceManager) {
String resourceName = replacerBlockEntry.getKey();
HashMap<String, String> replacements = replacerBlockEntry.getValue();
CottonResources.LOGGER.info(" Replacers for {}: {}", resourceName, replacements);
//System.out.println(" Replacers for "+resourceName+": "+replacements);
//CottonResources.LOGGER.info(" Replacers for "+resourceName+": "+replacements);
}*/

REISafeCompat.doObjectHiding.run();
Expand Down

0 comments on commit 44683db

Please sign in to comment.