Skip to content

Commit

Permalink
Clean up, code linting/style changes
Browse files Browse the repository at this point in the history
  • Loading branch information
legobmw99 committed Jun 24, 2024
1 parent 221583b commit 380cda7
Show file tree
Hide file tree
Showing 67 changed files with 548 additions and 580 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ minecraft_version=1.21
# as they do not follow standard versioning conventions.
minecraft_version_range=[1.21,1.22)
# The Neo version must agree with the Minecraft version to get a valid artifact
neo_version=21.0.21-beta
neo_version=21.0.30-beta
# The Neo version range can use any version of Neo as bounds
neo_version_range=[21.0.21-beta,)
neo_version_range=[21.0.30-beta,)
# The loader version range can only use the major version of FML as bounds
loader_version_range=[2,)
# read more on this at https://github.com/neoforged/NeoGradle/blob/NG_7.0/README.md#apply-parchment-mappings
# you can also find the latest versions at: https://parchmentmc.org/docs/getting-started
neogradle.subsystems.parchment.minecraftVersion=1.20.6
neogradle.subsystems.parchment.mappingsVersion=2024.06.16
neogradle.subsystems.parchment.minecraftVersion=1.21
neogradle.subsystems.parchment.mappingsVersion=2024.06.23
# https://www.curseforge.com/minecraft/mc-mods/jade/files/all
jade_id=5444008
jade_api=5427895
Expand Down
5 changes: 3 additions & 2 deletions src/generated/resources/assets/allomancy/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
"advancements.consequences.title": "Consequences, Vin",
"advancements.dna_entangled.desc": "Your DNA is too entangled with the spiritual realm to use Lerasium",
"advancements.dna_entangled.title": "Spiritual DNA Entanglement",
"advancements.going_loud.desc": "Allomancy can grant great stealth, unless you do that!",
"advancements.going_loud.title": "Going Loud",
"advancements.local_metallurgist.desc": "Craft a grinder to begin mixing metals",
"advancements.local_metallurgist.title": "Local Metallurgist!",
"advancements.metallic_collector.desc": "Collect every single metallic flake, even the useless ones",
"advancements.metallic_collector.title": "Metallic Collector",
"advancements.noisey.desc": "Allomancy can grant great stealth, unless you do that!",
"advancements.noisey.title": "Going Loud",
"advancements.tin_foil_hat.desc": "Protect yourself, and be a bit paranoid too",
"advancements.tin_foil_hat.title": "Tin foil hat",
"allomancy.aluminum.black": "Black Aluminum Symbol",
Expand Down Expand Up @@ -175,6 +175,7 @@
"allomancy.gold.red": "Red Gold Symbol",
"allomancy.gold.white": "White Gold Symbol",
"allomancy.gold.yellow": "Yellow Gold Symbol",
"allomancy.gui": "Select Metal",
"allomancy.iron.black": "Black Iron Symbol",
"allomancy.iron.blue": "Blue Iron Symbol",
"allomancy.iron.brown": "Brown Iron Symbol",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@
}
},
"display": {
"announce_to_chat": false,
"description": {
"translate": "advancements.noisey.desc"
"translate": "advancements.going_loud.desc"
},
"hidden": true,
"icon": {
"count": 1,
"id": "minecraft:bell"
},
"title": {
"translate": "advancements.noisey.title"
"translate": "advancements.going_loud.title"
}
},
"requirements": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"has_the_recipe": {
"conditions": {
"recipe": "minecraft:inverted_from_iron_button"
"recipe": "allomancy:inverted_from_iron_button"
},
"trigger": "minecraft:recipe_unlocked"
}
Expand All @@ -26,7 +26,7 @@
],
"rewards": {
"recipes": [
"minecraft:inverted_from_iron_button"
"allomancy:inverted_from_iron_button"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
"has_the_recipe": {
"conditions": {
"recipe": "minecraft:iron_button_from_inverted"
"recipe": "allomancy:iron_button_from_inverted"
},
"trigger": "minecraft:recipe_unlocked"
}
Expand All @@ -26,7 +26,7 @@
],
"rewards": {
"recipes": [
"minecraft:iron_button_from_inverted"
"allomancy:iron_button_from_inverted"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ public interface IAllomancerData {
/**
* Increase the amount of this metal being stored
*
* @param metal
* @param metal the Metal to store more off
*/
void incrementStored(Metal metal);

/**
* Decrease the amount of this metal being stored
*
* @param metal
* @param metal the Metal to store less of
*/
void decrementStored(Metal metal);

Expand Down
6 changes: 4 additions & 2 deletions src/main/java/com/legobmw99/allomancy/api/enums/Metal.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.legobmw99.allomancy.api.enums;

import com.mojang.serialization.Codec;
import net.minecraft.util.StringRepresentable;
import org.jetbrains.annotations.NotNull;

import java.util.Locale;

Expand Down Expand Up @@ -64,10 +66,10 @@ public int getIndex() {
}


public static final StringRepresentable.EnumCodec<Metal> CODEC = StringRepresentable.fromEnum(Metal::values);
public static final Codec<Metal> CODEC = StringRepresentable.fromEnum(Metal::values);

@Override
public String getSerializedName() {
public @NotNull String getSerializedName() {
return getName();
}
}
31 changes: 14 additions & 17 deletions src/main/java/com/legobmw99/allomancy/datagen/Advancements.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.Optional;
import java.util.function.Consumer;

public class Advancements implements AdvancementProvider.AdvancementGenerator {
class Advancements implements AdvancementProvider.AdvancementGenerator {

@Override
public void generate(HolderLookup.Provider registries,
Expand Down Expand Up @@ -121,11 +121,11 @@ public void generate(HolderLookup.Provider registries,
Component.translatable("advancements.tin_foil_hat.desc"), null, AdvancementType.TASK, true,
false, true)
.addCriterion("attempted_nicrosil_manipulation",
MetalUsedOnPlayerTrigger.TriggerInstance.instance(Optional.of(tinFoilPredicate),
Metal.NICROSIL, false))
MetalUsedOnPlayerTrigger.TriggerInstance.instance(tinFoilPredicate, Metal.NICROSIL,
false))
.addCriterion("attempted_chromium_manipulation",
MetalUsedOnPlayerTrigger.TriggerInstance.instance(Optional.of(tinFoilPredicate),
Metal.CHROMIUM, false))
MetalUsedOnPlayerTrigger.TriggerInstance.instance(tinFoilPredicate, Metal.CHROMIUM,
false))
.requirements(AdvancementRequirements.Strategy.OR)
.save(saver, "allomancy:main/tin_foil_hat");

Expand All @@ -139,14 +139,11 @@ public void generate(HolderLookup.Provider registries,
.display(Blocks.IRON_BLOCK, Component.translatable("advancements.consequences.title"),
Component.translatable("advancements.consequences.desc"), null, AdvancementType.TASK, true,
false, true)
.addCriterion("pushed_iron_golem", MetalUsedOnEntityTrigger.TriggerInstance.instance(Optional.empty(),
Optional.of(
ironGolemPredicate),
Metal.STEEL))
.addCriterion("pulled_iron_golem", MetalUsedOnEntityTrigger.TriggerInstance.instance(Optional.empty(),
Optional.of(
ironGolemPredicate),
Metal.IRON))
.addCriterion("pushed_iron_golem",
MetalUsedOnEntityTrigger.TriggerInstance.instance(null, ironGolemPredicate,
Metal.STEEL))
.addCriterion("pulled_iron_golem",
MetalUsedOnEntityTrigger.TriggerInstance.instance(null, ironGolemPredicate, Metal.IRON))
.requirements(AdvancementRequirements.Strategy.OR)
.save(saver, "allomancy:main/consequences");

Expand All @@ -156,11 +153,11 @@ public void generate(HolderLookup.Provider registries,
.parent(Advancement.Builder
.advancement()
.build(ResourceLocation.fromNamespaceAndPath(Allomancy.MODID, "main/coinshot")))
.display(Blocks.BELL, Component.translatable("advancements.noisey.title"),
Component.translatable("advancements.noisey.desc"), null, AdvancementType.TASK, true, true,
true)
.display(Blocks.BELL, Component.translatable("advancements.going_loud.title"),
Component.translatable("advancements.going_loud.desc"), null, AdvancementType.TASK, true,
true, true)
.addCriterion("allomantically_activate_bell",
AllomanticallyActivatedBlockTrigger.TriggerInstance.activatedBlock(Blocks.BELL))
.save(saver, "allomancy:main/noisey");
.save(saver, "allomancy:main/going_loud");
}
}
10 changes: 5 additions & 5 deletions src/main/java/com/legobmw99/allomancy/datagen/BannerTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@

import java.util.concurrent.CompletableFuture;

public class BannerTags extends BannerPatternTagsProvider {
class BannerTags extends BannerPatternTagsProvider {

public BannerTags(PackOutput pGenerator,
CompletableFuture<HolderLookup.Provider> registries,
net.neoforged.neoforge.common.data.ExistingFileHelper existingFileHelper) {
BannerTags(PackOutput pGenerator,
CompletableFuture<HolderLookup.Provider> registries,
net.neoforged.neoforge.common.data.ExistingFileHelper existingFileHelper) {
super(pGenerator, registries, Allomancy.MODID, existingFileHelper);
}

@Override
protected void addTags(HolderLookup.Provider pProvider) {
for (Metal mt : Metal.values()) {
Allomancy.LOGGER.debug("Creating banner tag for " + mt.getName());
Allomancy.LOGGER.debug("Creating banner tag for {}", mt.getName());
this.tag(ExtrasSetup.PATTERN_KEYS.get(mt.getIndex())).add(ExtrasSetup.PATTERNS.get(mt.getIndex()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import java.util.function.Supplier;
import java.util.stream.Stream;

public class BlockLootTables extends BlockLootSubProvider {
public BlockLootTables(HolderLookup.Provider provider) {
class BlockLootTables extends BlockLootSubProvider {
BlockLootTables(HolderLookup.Provider provider) {
super(Set.of(), FeatureFlags.REGISTRY.allFlags(), provider);
}

Expand Down
20 changes: 10 additions & 10 deletions src/main/java/com/legobmw99/allomancy/datagen/BlockStates.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@

import java.util.function.BiConsumer;

public class BlockStates extends BlockStateProvider {
class BlockStates extends BlockStateProvider {

public BlockStates(PackOutput gen, ExistingFileHelper exFileHelper) {
BlockStates(PackOutput gen, ExistingFileHelper exFileHelper) {
super(gen, Allomancy.MODID, exFileHelper);
}

Expand All @@ -26,26 +26,26 @@ protected void registerStatesAndModels() {
for (var rblock : MaterialsSetup.ORE_BLOCKS) {
Block block = rblock.get();
String path = rblock.getId().getPath();
singleTextureBlock(block, path, "block/" + path);
singleTextureBlock(block);
}

for (var rblock : MaterialsSetup.DEEPSLATE_ORE_BLOCKS) {
Block block = rblock.get();
String path = rblock.getId().getPath();
singleTextureBlock(block, path, "block/" + path);
singleTextureBlock(block);
}

for (var rblock : MaterialsSetup.RAW_ORE_BLOCKS) {
Block block = rblock.get();
String path = rblock.getId().getPath();
singleTextureBlock(block, path, "block/" + path);
singleTextureBlock(block);
}

for (var rblock : MaterialsSetup.STORAGE_BLOCKS) {
if (rblock != null) {
Block block = rblock.get();
String path = rblock.getId().getPath();
singleTextureBlock(block, path, "block/" + path);
singleTextureBlock(block);
}
}

Expand All @@ -56,15 +56,15 @@ protected void registerStatesAndModels() {
}


private void singleTextureBlock(Block block, String model, String texture) {
Allomancy.LOGGER.debug("Creating Block Data for " + BuiltInRegistries.BLOCK.getKey(block));
private void singleTextureBlock(Block block) {
Allomancy.LOGGER.debug("Creating Block Data for {}", BuiltInRegistries.BLOCK.getKey(block));
simpleBlock(block);
}


private void createIronButtonBlock(IronButtonBlock block) {
Allomancy.LOGGER.debug("Creating Block Data for allomancy:iron_button");
ModelFile inventory = models()
models()
.withExistingParent("allomancy:iron_button_inventory", mcLoc("block/button_inventory"))
.texture("texture", mcLoc("block/iron_block"));
ModelFile button = models()
Expand Down Expand Up @@ -139,7 +139,7 @@ private void createIronLeverBlock() {
.rotation()
.origin(8, 1, 8)
.axis(Direction.Axis.X)
.angle(-45F)
.angle(-45.0F)
.end()
.allFaces(lever_generator)
.end();
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/legobmw99/allomancy/datagen/BlockTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
import java.util.concurrent.CompletableFuture;


public class BlockTags extends BlockTagsProvider {
class BlockTags extends BlockTagsProvider {

public BlockTags(PackOutput gen,
CompletableFuture<HolderLookup.Provider> lookupProvider,
ExistingFileHelper exFileHelper) {
BlockTags(PackOutput gen,
CompletableFuture<HolderLookup.Provider> lookupProvider,
ExistingFileHelper exFileHelper) {
super(gen, lookupProvider, Allomancy.MODID, exFileHelper);
}

Expand Down Expand Up @@ -68,7 +68,7 @@ protected void addTags(HolderLookup.Provider pProvider) {

@SafeVarargs
private void addCommonTag(String name, ResourceKey<Block>... items) {
Allomancy.LOGGER.debug("Creating block tag for c:" + name);
Allomancy.LOGGER.debug("Creating block tag for c:{}", name);
tag(net.minecraft.tags.BlockTags.create(ResourceLocation.fromNamespaceAndPath("c", name)))
.replace(false)
.add(items);
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/com/legobmw99/allomancy/datagen/DamageTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

import java.util.concurrent.CompletableFuture;

public class DamageTags extends DamageTypeTagsProvider {
public DamageTags(PackOutput out,
CompletableFuture<HolderLookup.Provider> lookup,
@Nullable ExistingFileHelper existingFileHelper) {
class DamageTags extends DamageTypeTagsProvider {
DamageTags(PackOutput out,
CompletableFuture<HolderLookup.Provider> lookup,
@Nullable ExistingFileHelper existingFileHelper) {
super(out, lookup, Allomancy.MODID, existingFileHelper);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
public class DataGenerators {

@SubscribeEvent
public static void gatherData(GatherDataEvent event) {
public static void gatherData(final GatherDataEvent event) {
var generator = event.getGenerator();
var packOutput = generator.getPackOutput();
var lookup = event.getLookupProvider();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,17 @@
import java.util.Set;
import java.util.concurrent.CompletableFuture;

public class DatapackEntries extends DatapackBuiltinEntriesProvider {
class DatapackEntries extends DatapackBuiltinEntriesProvider {

public static final RegistrySetBuilder BUILDER = new RegistrySetBuilder()
.add(Registries.DAMAGE_TYPE, context -> {
context.register(CombatSetup.COIN_DAMAGE, new DamageType("allomancy.coin", 0.0f));
})
private static final RegistrySetBuilder BUILDER = new RegistrySetBuilder()
.add(Registries.DAMAGE_TYPE,
context -> context.register(CombatSetup.COIN_DAMAGE, new DamageType("allomancy.coin", 0.0f)))
.add(Registries.CONFIGURED_FEATURE, MaterialsSetup::bootstrapConfigured)
.add(Registries.PLACED_FEATURE, MaterialsSetup::bootstrapPlaced)
.add(Registries.BANNER_PATTERN, ExtrasSetup::bootstrapBanners)
.add(NeoForgeRegistries.Keys.BIOME_MODIFIERS, MaterialsSetup::bootstrapBiomeModifier);

public DatapackEntries(PackOutput output, CompletableFuture<HolderLookup.Provider> provider) {
DatapackEntries(PackOutput output, CompletableFuture<HolderLookup.Provider> provider) {
super(output, provider, BUILDER, Set.of("minecraft", Allomancy.MODID));
}
}
Loading

0 comments on commit 380cda7

Please sign in to comment.