Skip to content

Commit

Permalink
Merge pull request #2 from Darkona/remake-1.20.1
Browse files Browse the repository at this point in the history
Remake 1.20.1
  • Loading branch information
Darkona authored Jun 3, 2024
2 parents 87e3bb9 + 95b93f0 commit a07611a
Show file tree
Hide file tree
Showing 77 changed files with 3,976 additions and 1,848 deletions.
67 changes: 67 additions & 0 deletions .guthub/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ "remake-1.20.1" ]
pull_request:
branches: [ "remake-1.20.1" ]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0

- name: Build with Gradle Wrapper
run: ./gradlew build

# NOTE: The Gradle Wrapper is the default and recommended way to run Gradle (https://docs.gradle.org/current/userguide/gradle_wrapper.html).
# If your project does not have the Gradle Wrapper configured, you can use the following configuration to run Gradle with a specified version.
#
# - name: Setup Gradle
# uses: gradle/actions/setup-gradle@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
# with:
# gradle-version: '8.5'
#
# - name: Build with Gradle 8.5
# run: gradle build

dependency-submission:

runs-on: ubuntu-latest
permissions:
contents: write

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

# Generates and submits a dependency graph, enabling Dependabot Alerts for all project dependencies.
# See: https://github.com/gradle/actions/blob/main/dependency-submission/README.md
- name: Generate and submit dependency graph
uses: gradle/actions/dependency-submission@417ae3ccd767c252f5661f1ace9f835f9654f2b5 # v3.1.0
29 changes: 29 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
buildscript {
repositories {
// These repositories are only for Gradle plugins, put any other repositories in the repository block further below
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
mavenCentral()
}
dependencies {
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
}
}

plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
}

apply plugin: 'org.spongepowered.mixin'

version = mod_version
group = mod_group_id

Expand Down Expand Up @@ -93,11 +106,27 @@ repositories {
maven { // CurseForge
url "https://www.cursemaven.com"
}
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
}

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

implementation fg.deobf("curse.maven:configured-457570:${configured_file_id}")
implementation fg.deobf("curse.maven:serene-seasons-291874:${serene_seasons_file_id}")

implementation fg.deobf("curse.maven:cold-sweat-506194:${cold_sweat_file_id}-sources-5011470")
//implementation "curse.maven:cold-sweat-506194:${cold_sweat_file_id}-sources-5011470"

implementation fg.deobf("curse.maven:thirst-was-taken-679270:${thirst_was_taken_file_id}")

compileOnly("curse.maven:overflowing-bars-852662:4578581")
implementation fg.deobf("curse.maven:player-animator-658587:${player_animator_file_id}")
implementation fg.deobf("curse.maven:elenai-dodge-442962:${elenai_dodge_file_id}")
compileOnly 'org.projectlombok:lombok:1.18.20'

annotationProcessor 'org.projectlombok:lombok:1.18.20'
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
}


Expand Down
65 changes: 15 additions & 50 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,59 +1,24 @@
# Sets default memory used for gradle commands. Can be overridden by user or command line properties.
# This is required to provide enough memory for the Minecraft decompilation process.
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false


## Environment Properties

# The Minecraft version must agree with the Forge version to get a valid artifact
minecraft_version=1.20
# The Minecraft version range can use any release version of Minecraft as bounds.
# Snapshots, pre-releases, and release candidates are not guaranteed to sort properly
# as they do not follow standard versioning conventions.
minecraft_version=1.20.1
minecraft_version_range=[1.20,1.21)
# The Forge version must agree with the Minecraft version to get a valid artifact
forge_version=46.0.14
# The Forge version range can use any version of Forge as bounds or match the loader version range
forge_version_range=[46,)
# The loader version range can only use the major version of Forge/FML as bounds
loader_version_range=[46,)
# The mapping channel to use for mappings.
# The default set of supported mapping channels are ["official", "snapshot", "snapshot_nodoc", "stable", "stable_nodoc"].
# Additional mapping channels can be registered through the "channelProviders" extension in a Gradle plugin.
#
# | Channel | Version | |
# |-----------|----------------------|--------------------------------------------------------------------------------|
# | official | MCVersion | Official field/method names from Mojang mapping files |
# | parchment | YYYY.MM.DD-MCVersion | Open community-sourced parameter names and javadocs layered on top of official |
#
# You must be aware of the Mojang license when using the 'official' or 'parchment' mappings.
# See more information here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
#
# Parchment is an unofficial project maintained by ParchmentMC, separate from Minecraft Forge.
# Additional setup is needed to use their mappings, see https://parchmentmc.org/docs/getting-started
forge_version=47.2.0
forge_version_range=[47,)
loader_version_range=[47,)
mapping_channel=official
# The mapping version to query from the mapping channel.
# This must match the format required by the mapping channel.
mapping_version=1.20
mapping_version=1.20.1


## Mod Properties

# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
# Must match the String constant located in the main mod class annotated with @Mod.
mod_id=feathers
# The human-readable display name for the mod.
mod_name=Feathers
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=GPU
# The mod version. See https://semver.org/
mod_version=1.1
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
mod_version=1.2
mod_group_id=com.elenai.feathers
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
mod_authors=Elenai
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
mod_description=Feathers is a stamina system for Minecraft, it adds a set of blue feathers to the hotbar to be spent by other mods, as well as an armor weight system to the game.
mod_authors=Elenai, Darkona
mod_description=Feathers is a stamina system for Minecraft, it adds a set of blue feathers to the hotbar to be spent by other mods, as well as an armor weight system to the game.
player_animator_file_id=4587214
elenai_dodge_file_id=4814313

configured_file_id=5180900
serene_seasons_file_id=4761603
cold_sweat_file_id=5349837
thirst_was_taken_file_id=5287289
Empty file modified gradlew
100644 → 100755
Empty file.
Empty file modified gradlew.bat
100644 → 100755
Empty file.
113 changes: 75 additions & 38 deletions src/main/java/com/elenai/feathers/Feathers.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
package com.elenai.feathers;

import com.elenai.feathers.attributes.FeathersAttributes;
import com.elenai.feathers.commands.CommandInit;
import com.elenai.feathers.compatibility.coldsweat.ColdSweatManager;
import com.elenai.feathers.compatibility.coldsweat.FeathersColdSweatConfig;
import com.elenai.feathers.compatibility.thirst.FeathersThirstConfig;
import com.elenai.feathers.compatibility.thirst.ThirstManager;
import com.elenai.feathers.config.FeathersClientConfig;
import com.elenai.feathers.config.FeathersCommonConfig;
import com.elenai.feathers.effect.EffectsHandler;
import com.elenai.feathers.effect.FeathersEffects;
import com.elenai.feathers.enchantment.FeathersEnchantments;
import com.elenai.feathers.networking.FeathersMessages;
import com.elenai.feathers.potion.FeathersPotions;
import net.minecraft.world.item.Items;
import net.minecraft.world.item.alchemy.PotionBrewing;
import net.minecraft.world.item.alchemy.Potions;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ModList;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
Expand All @@ -23,41 +29,72 @@

@Mod(Feathers.MODID)
public class Feathers {
public static final String MODID = "feathers";
public static final Logger logger = LogManager.getLogger(MODID);
public static final boolean OB_LOADED = ModList.get().isLoaded("overflowingbars");

public Feathers() {
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
modEventBus.addListener(this::commonSetup);

ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, FeathersClientConfig.SPEC, "Feathers-Client.toml");
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, FeathersCommonConfig.SPEC, "Feathers-Common.toml");

FeathersAttributes.register(modEventBus);
FeathersEffects.register(modEventBus);
FeathersPotions.register(modEventBus);
FeathersEnchantments.register(modEventBus);
MinecraftForge.EVENT_BUS.register(this);
}

private void commonSetup(FMLCommonSetupEvent event) {
event.enqueueWork(FeathersMessages::register);
registerBrewingRecipes();
}

private void registerBrewingRecipes() {
// Cold
PotionBrewing.addMix(Potions.AWKWARD, Items.SNOWBALL, FeathersPotions.COLD_POTION.get());

// Endurance
PotionBrewing.addMix(Potions.AWKWARD, Items.FEATHER, FeathersPotions.ENDURANCE_POTION.get());
PotionBrewing.addMix(FeathersPotions.ENDURANCE_POTION.get(), Items.REDSTONE, FeathersPotions.LONG_ENDURANCE_POTION.get());
PotionBrewing.addMix(FeathersPotions.ENDURANCE_POTION.get(), Items.GLOWSTONE_DUST, FeathersPotions.STRONG_ENDURANCE_POTION.get());

// Energized
PotionBrewing.addMix(Potions.AWKWARD, Items.RAW_COPPER, FeathersPotions.ENERGIZED_POTION.get());
PotionBrewing.addMix(FeathersPotions.ENERGIZED_POTION.get(), Items.REDSTONE, FeathersPotions.LONG_ENERGIZED_POTION.get());
PotionBrewing.addMix(FeathersPotions.ENERGIZED_POTION.get(), Items.GLOWSTONE_DUST, FeathersPotions.STRONG_ENERGIZED_POTION.get());
}
public static final String MODID = "feathers";
public static final Logger logger = LogManager.getLogger(MODID);
public static final boolean OB_LOADED = ModList.get().isLoaded("overflowingbars");
public static final boolean THIRST_LOADED = ModList.get().isLoaded("thirst");
public static final boolean COLD_SWEAT_LOADED = ModList.get().isLoaded("cold_sweat");

public Feathers() {
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
modEventBus.addListener(this::commonSetup);

ModLoadingContext.get().registerConfig(ModConfig.Type.CLIENT, FeathersClientConfig.SPEC, "feathers//Feathers-Client.toml");
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, FeathersCommonConfig.SPEC, "feathers//Feathers-Common.toml");

if (THIRST_LOADED) {
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, FeathersThirstConfig.SPEC, "feathers//Feathers-Thirst.toml");
}
if (COLD_SWEAT_LOADED) {
ModLoadingContext.get().registerConfig(ModConfig.Type.COMMON, FeathersColdSweatConfig.SPEC, "feathers//Feathers-ColdSweat.toml");
}

FeathersAttributes.register(modEventBus);
FeathersEffects.register(modEventBus);
FeathersPotions.register(modEventBus);
FeathersEnchantments.register(modEventBus);
CommandInit.ARGUMENTS.register(modEventBus);
MinecraftForge.EVENT_BUS.register(this);

}


@SubscribeEvent
public void commonSetup(FMLCommonSetupEvent event) {
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
event.enqueueWork(FeathersMessages::register);
registerBrewingRecipes();
FeathersManager.registerPlugin(EffectsHandler.getInstance());
if (THIRST_LOADED) {
FeathersManager.registerPlugin(ThirstManager.getInstance());
}
if (COLD_SWEAT_LOADED) {
FeathersManager.registerPlugin(ColdSweatManager.getInstance());
}
}

private void registerBrewingRecipes() {

// Cold
PotionBrewing.addMix(Potions.AWKWARD, Items.SNOWBALL, FeathersPotions.COLD_POTION.get());

//Hot
PotionBrewing.addMix(Potions.AWKWARD, Items.MAGMA_BLOCK, FeathersPotions.HOT_POTION.get());

// Endurance
PotionBrewing.addMix(Potions.AWKWARD, Items.FEATHER, FeathersPotions.ENDURANCE_POTION.get());
PotionBrewing.addMix(FeathersPotions.ENDURANCE_POTION.get(), Items.REDSTONE, FeathersPotions.LONG_ENDURANCE_POTION.get());
PotionBrewing.addMix(FeathersPotions.ENDURANCE_POTION.get(), Items.GLOWSTONE_DUST, FeathersPotions.STRONG_ENDURANCE_POTION.get());

// Momentum
PotionBrewing.addMix(Potions.AWKWARD, Items.BASALT, FeathersPotions.MOMENTUM_POTION.get());
PotionBrewing.addMix(FeathersPotions.MOMENTUM_POTION.get(), Items.REDSTONE, FeathersPotions.LONG_MOMENTUM_POTION.get());
PotionBrewing.addMix(FeathersPotions.MOMENTUM_POTION.get(), Items.GLOWSTONE_DUST, FeathersPotions.STRONG_MOMENTUM_POTION.get());

// Energized
PotionBrewing.addMix(Potions.AWKWARD, Items.RAW_COPPER, FeathersPotions.ENERGIZED_POTION.get());
PotionBrewing.addMix(FeathersPotions.ENERGIZED_POTION.get(), Items.REDSTONE, FeathersPotions.LONG_ENERGIZED_POTION.get());
PotionBrewing.addMix(FeathersPotions.ENERGIZED_POTION.get(), Items.GLOWSTONE_DUST, FeathersPotions.STRONG_ENERGIZED_POTION.get());
}

}
Loading

0 comments on commit a07611a

Please sign in to comment.