Skip to content

Commit

Permalink
Fixed #3, changed namespace to match Fabric
Browse files Browse the repository at this point in the history
  • Loading branch information
RaymondBlaze committed Apr 24, 2022
1 parent 1e4f955 commit a1d1646
Show file tree
Hide file tree
Showing 76 changed files with 743 additions and 730 deletions.
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ repositories {
}

dependencies {
minecraft "net.minecraftforge:forge:${project.forge_version}"
minecraft "net.minecraftforge:forge:${project.mc_version}-${project.forge_version}"

//Dependencies
implementation fg.deobf(group: 'top.theillusivec4.caelus', name: 'caelus-forge', version: "${project.caelus_version}")
Expand All @@ -116,7 +116,10 @@ processResources {
inputs.property "version", project.version

filesMatching("META-INF/mods.toml") {
expand "version": project.version
expand 'version': project.version,
'mc_requirements': project.mc_requirements,
'forge_requirements': project.forge_requirements,
'origins_requirements': project.origins_requirements
}
}

Expand Down
15 changes: 9 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,24 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

# Base properties
minecraft_version=1.18.2
forge_version=1.18.2-40.0.52
mc_version=1.18.2
forge_version=40.1.0
mappings_channel=parchment
mappings_version=2022.03.13-1.18.2

# Mod Properties
mod_version=1.1.2.1
mod_id=origins_classes
mod_author=LimonBlaze
maven_group=limonblaze.originsclasses
archives_base_name=origins-classes-forge
mod_version=1.1.3
mod_id=origins_classes
mod_author=LimonBlaze
mc_requirements=[1.18.2,1.19)
forge_requirements=[40.0.47,)
origins_requirements=[1.18.2-1.4.1,)

# Dependencies
caelus_version=1.18.1-3.0.0.2
origins_version=3757460
origins_version=3761477

# Compat Dependencies
apotheosis_version=3717791
9 changes: 8 additions & 1 deletion src/main/java/limonblaze/originsclasses/OriginsClasses.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.world.entity.EntityType;
import net.minecraftforge.event.entity.EntityAttributeModificationEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.apache.logging.log4j.LogManager;
Expand All @@ -18,6 +19,7 @@
@Mod(OriginsClasses.MODID)
public class OriginsClasses {
public static final String MODID = "origins_classes";
public static final String LEGACY_MODID = "origins-classes";
public static final Logger LOGGER = LogManager.getLogger();

public OriginsClasses() {
Expand All @@ -32,10 +34,15 @@ public OriginsClasses() {
modBus.addListener(this::attachAttributes);
modBus.addListener(OriginsClassesCommon::setup);
modBus.addListener(OriginsClassesClient::setup);
LOGGER.info("Origins:Classes " + ModLoadingContext.get().getActiveContainer().getModInfo().getVersion() + " has initialized. Time for work!");
}

public static ResourceLocation identifier(String path) {
return new ResourceLocation(OriginsClasses.MODID, path);
return new ResourceLocation(MODID, path);
}

public static ResourceLocation legacyIdentifier(String path) {
return new ResourceLocation(LEGACY_MODID, path);
}

public void attachAttributes(EntityAttributeModificationEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public class OriginsClassesEntityTypeTags {

public static final TagKey<EntityType<?>> INFINITE_TRADER = tag(OriginsClasses.identifier("infinite_trader"));
public static final TagKey<EntityType<?>> INFINITE_TRADER = tag(OriginsClasses.legacyIdentifier("infinite_trader"));

private static TagKey<EntityType<?>> tag(ResourceLocation id) {
return TagKey.create(Registry.ENTITY_TYPE_REGISTRY, id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public class OriginsClassesItemTags {

public static final TagKey<Item> MERCHANT_BLACKLIST = tag(OriginsClasses.identifier("merchant_blacklist"));
public static final TagKey<Item> MERCHANT_BLACKLIST = tag(OriginsClasses.legacyIdentifier("merchant_blacklist"));

private static TagKey<Item> tag(ResourceLocation id) {
return TagKey.create(Registry.ITEM_REGISTRY, id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class AbstractCauldronBlockMixin {
ItemStack stack = player.getItemInHand(hand);
if(stack.getItem() instanceof PotionItem &&
!PotionUtils.getPotion(stack).getEffects().isEmpty() &&
NbtUtils.getOriginsClassesData(stack, NbtUtils.POTION_BONUS, NbtType.BYTE).isPresent()) {
NbtUtils.getOriginsClassesData(stack, NbtUtils.POTION_BONUS, NbtType.BYTE).isPresent()) {
int bonus = IPowerContainer.getPowers(player, OriginsClassesPowers.POTION_BONUS.get()).stream()
.filter(cp -> cp.isActive(player)).mapToInt(cp -> cp.getConfiguration().value()).sum();
if(bonus > 0) {
Expand Down
10 changes: 5 additions & 5 deletions src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ authors="LimonBlaze"
description = "An add-on for the Origins mod which adds classes to the game."

[[dependencies.origins_classes]]
modId = "forge"
modId = "minecraft"
mandatory = true
versionRange = "[40.0.47,)"
versionRange = "${mc_requirements}"
ordering = "NONE"
side = "BOTH"

[[dependencies.origins_classes]]
modId = "minecraft"
modId = "forge"
mandatory = true
versionRange = "[1.18.2,)"
versionRange = "${forge_requirements}"
ordering = "NONE"
side = "BOTH"

[[dependencies.origins_classes]]
modId = "origins"
mandatory = true
versionRange = "[1.18.2-1.4.1,)"
versionRange = "${origins_requirements}"
ordering = "NONE"
side = "BOTH"
134 changes: 134 additions & 0 deletions src/main/resources/assets/origins-classes/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
{
"layer.origins-classes.class.name": "Class",
"layer.origins-classes.class.missing_origin.name": "Missing",
"layer.origins-classes.class.missing_origin.description": "You do not have a class.",

"attribute.origins_classes.mining_speed": "Mining Speed",
"attribute.origins_classes.projectile_strength": "Projectile Strength",

"tooltip.origins_classes.food_bonus": "+%s Nourishment",
"tooltip.origins_classes.potion_bonus": "+%s Quality",

"origin.origins-classes.warrior.name": "Warrior",
"origin.origins-classes.warrior.description": "These honorable fighters favor the sword and shield to take down their foes.",

"origin.origins-classes.archer.name": "Archer",
"origin.origins-classes.archer.description": "One shot, one kill.",

"origin.origins-classes.rogue.name": "Rogue",
"origin.origins-classes.rogue.description": "Usually known to be thieves and robbers, rogues are proficient in ambushes and stealth attacks.",

"origin.origins-classes.beastmaster.name": "Beastmaster",
"origin.origins-classes.beastmaster.description": "Beastmasters are solitary people who prefer the company of animals.",

"origin.origins-classes.blacksmith.name": "Blacksmith",
"origin.origins-classes.blacksmith.description": "Valued friends of anyone, Blacksmiths are able to create better tools, weapons and armor.",

"origin.origins-classes.cleric.name": "Cleric",
"origin.origins-classes.cleric.description": "They have learned how to channel the magic present in the world and use that to their advantage.",

"origin.origins-classes.cook.name": "Cook",
"origin.origins-classes.cook.description": "There is no one better to prepare your food than a Cook.",

"origin.origins-classes.farmer.name": "Farmer",
"origin.origins-classes.farmer.description": "Farmers have been known to provide everyone with food for as long as anyone can remember.",

"origin.origins-classes.merchant.name": "Merchant",
"origin.origins-classes.merchant.description": "Always looking for an additional emerald, Merchants are proficient traders.",

"origin.origins-classes.rancher.name": "Rancher",
"origin.origins-classes.rancher.description": "Making the most of animals, Ranchers are able to gather many useful resources.",

"origin.origins-classes.miner.name": "Miner",
"origin.origins-classes.miner.description": "Miners are the most proficient at digging up the earth's treasures.",

"origin.origins-classes.lumberjack.name": "Lumberjack",
"origin.origins-classes.lumberjack.description": "Trees should watch out when Lumberjacks are around.",

"origin.origins-classes.explorer.name": "Explorer",
"origin.origins-classes.explorer.description": "Explorers find their way through the most difficult terrain easily and discover hidden landmarks.",

"origin.origins-classes.nitwit.name": "Nitwit",
"origin.origins-classes.nitwit.description": "Nitwits aren't really good at anything.",

"power.origins-classes.less_shield_slowdown.name": "Shield Wield",
"power.origins-classes.less_shield_slowdown.description": "You are slowed down less when protecting yourself with a shield.",

"power.origins-classes.sneaky.name": "Sneaky",
"power.origins-classes.sneaky.description": "Your nameplate is never visible through walls, even when you're not sneaking.",

"power.origins-classes.stealth.name": "In the Shadows",
"power.origins-classes.stealth.description": "When you have been sneaking for 5 seconds, you enter Stealth.",

"power.origins-classes.stealth_core.name": "Stealth",
"power.origins-classes.stealth_core.description": "While in stealth, you make less sound and deal extra damage when attacking an enemy from behind. You exit Stealth when you stop sneaking.",

"power.origins-classes.less_bow_slowdown.name": "Agility",
"power.origins-classes.less_bow_slowdown.description": "You can move quicker than others while drawing your bow.",

"power.origins-classes.no_projectile_divergence.name": "Accuracy",
"power.origins-classes.no_projectile_divergence.description": "All of your projectiles have increased accuracy.",

"power.origins-classes.more_attack_damage.name": "Weapon Knowledge",
"power.origins-classes.more_attack_damage.description": "Able to use each weapon to its fullest potential, you deal a bit more damage.",

"power.origins-classes.tamed_animal_boost.name": "Fauna Friends",
"power.origins-classes.tamed_animal_boost.description": "Animals you tame receive a permanent buff to their health and strength.",

"power.origins-classes.tamed_potion_diffusal.name": "Effective Empathy",
"power.origins-classes.tamed_potion_diffusal.description": "Your nearby tamed animals also receive potion effects when you drink a potion.",

"power.origins-classes.more_smoker_xp.name": "Smoking",
"power.origins-classes.more_smoker_xp.description": "You receive more experience from cooking food in a smoker.",

"power.origins-classes.better_crafted_food.name": "Good Meals",
"power.origins-classes.better_crafted_food.description": "Food crafted by you is more saturating.",

"power.origins-classes.potion_bonus.name": "Qualified Potions",
"power.origins-classes.potion_bonus.description": "As a last step in potion brewing, you may strengthen(for instant effects) or extend(for lasting effects) the potion effects with water from a cauldron.",

"power.origins-classes.better_enchanting.name": "Enchantment Mastery",
"power.origins-classes.better_enchanting.description": "You are able achieve higher enchantment levels at an enchantment table.",

"power.origins-classes.quality_equipment.name": "High-Quality Equipment",
"power.origins-classes.quality_equipment.description": "Equipment you create provides small buffs.",

"power.origins-classes.efficient_repairs.name": "Efficient Repairs",
"power.origins-classes.efficient_repairs.description": "Repairing equipment in an anvil costs less material. Repairing by combining equipment restores more durability.",

"power.origins-classes.more_crop_drops.name": "Bountiful Harvest",
"power.origins-classes.more_crop_drops.description": "When harvesting crops, there is a chance that you receive twice the yield.",

"power.origins-classes.better_bone_meal.name": "Fertilizing Techniques",
"power.origins-classes.better_bone_meal.description": "Bone meal is twice as effective in your experienced hands when used on crops and plants.",

"power.origins-classes.twin_breeding.name": "Twin Births",
"power.origins-classes.twin_breeding.description": "Animals bred by you have a chance to produce two babies.",

"power.origins-classes.more_animal_loot.name": "Scavenging",
"power.origins-classes.more_animal_loot.description": "You are able to sometimes receive more material from killing animals.",

"power.origins-classes.trade_availability.name": "Restocking",
"power.origins-classes.trade_availability.description": "Villagers you trade with never run out of resources to trade for you.",

"power.origins-classes.rare_wandering_loot.name": "Charisma",
"power.origins-classes.rare_wandering_loot.description": "You are able to convince wandering traders to offer some of their rarer items to you.",

"power.origins-classes.no_sprint_exhaustion.name": "Fit",
"power.origins-classes.no_sprint_exhaustion.description": "Sprinting doesn't cause you to exhaust.",

"power.origins-classes.explorer_kit.name": "Explorer Kit",
"power.origins-classes.explorer_kit.description": "You start the game with a compass, a clock and nine empty maps.",

"power.origins-classes.no_mining_exhaustion.name": "Experienced Excavator",
"power.origins-classes.no_mining_exhaustion.description": "Breaking blocks doesn't cause you to exhaust.",

"power.origins-classes.more_stone_break_speed.name": "Mining Expert",
"power.origins-classes.more_stone_break_speed.description": "You mine stone material quicker than others.",

"power.origins-classes.tree_felling.name": "Timber!",
"power.origins-classes.tree_felling.description": "You cut down whole trees at once, unless you sneak.",

"power.origins-classes.more_planks_from_logs.name": "Woodcutting",
"power.origins-classes.more_planks_from_logs.description": "You gain two more wooden planks from a single log when crafting."
}
Loading

0 comments on commit a1d1646

Please sign in to comment.