Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ src-todo

# Files from Forge MDK
forge*changelog.txt

.vscode/
16 changes: 8 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id 'eclipse'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '5.1.+'
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
id 'org.spongepowered.mixin' version '0.7-SNAPSHOT'
}

Expand Down Expand Up @@ -104,16 +104,16 @@ dependencies {
minecraft "net.minecraftforge:forge:${project.minecraft_version}-${project.forge_version}"

// RPG Gods
compileOnly fg.deobf("curse.maven:rpggods-${project.rpggods_project}:${project.rpggods_file}")
runtimeOnly fg.deobf("curse.maven:rpggods-${project.rpggods_project}:${project.rpggods_file}")
//compileOnly fg.deobf("curse.maven:rpggods-${project.rpggods_project}:${project.rpggods_file}")
//runtimeOnly fg.deobf("curse.maven:rpggods-${project.rpggods_project}:${project.rpggods_file}")

// JEI
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")
//compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")
//runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")
// Better Combat
implementation fg.deobf("me.shedaniel.cloth:cloth-config-forge:${project.cloth_config_version}")
implementation fg.deobf("dev.kosmx.player-anim:player-animation-lib-forge:${project.player_animator_version}")
implementation fg.deobf("maven.modrinth:better-combat:${project.better_combat_version}-forge")
//implementation fg.deobf("me.shedaniel.cloth:cloth-config-forge:${project.cloth_config_version}")
//implementation fg.deobf("dev.kosmx.player-anim:player-animation-lib-forge:${project.player_animator_version}")
//implementation fg.deobf("maven.modrinth:better-combat:${project.better_combat_version}-forge")

}
// This block of code expands all the gradle properties in the specified resource targets.
Expand Down
24 changes: 12 additions & 12 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
org.gradle.jvmargs=-Xmx4G
org.gradle.daemon=false
minecraft_version=1.19.2
minecraft_version_range=[1.19.2,)
minecraft_version=1.20.1
minecraft_version_range=[1.20.1,1.21)
mappings_channel=official
mappings_version=1.19.2
mappings_version=1.20.1

# Mod properties
mod_name=Greek Fantasy
mod_id=greekfantasy
mod_version=19.2.6
mod_version=20.1.0
mod_authors="skyjay1"
mod_description="Get your Greek on!"
maven_group=skyjay1.greekfantasy
archives_base_name=greekfantasy
#Dependencies
forge_version=43.1.47
forge_version_range=[43.1,)
loader_version_range=[43,)
forge_version=47.2.0
forge_version_range=[47.2,)
loader_version_range=[47,)
rpggods_project=601680
rpggods_file=4018407
jei_version=11.2.0.256
cloth_config_version=8.2.88
player_animator_version=0.4.0-test1
better_combat_version=1.4.4+1.19
rpggods_file=5029473
jei_version=15.2.0.27
cloth_config_version=11.1.118
player_animator_version=1.0.2+1.20
better_combat_version=1.8.5+1.20.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
34 changes: 21 additions & 13 deletions src/main/java/greekfantasy/GFConfig.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package greekfantasy;

import net.minecraft.core.registries.Registries;

import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import net.minecraft.resources.ResourceLocation;
Expand Down Expand Up @@ -83,7 +85,8 @@ public class GFConfig {
public final ForgeConfigSpec.DoubleValue SHADE_SPAWN_CHANCE;
public final ForgeConfigSpec.DoubleValue SATYR_SHAMAN_CHANCE;
public final ForgeConfigSpec.DoubleValue SCYLLA_SPAWN_CHANCE;
private static final ResourceLocation SATYR_SONG_FALLBACK = new ResourceLocation(GreekFantasy.MODID, "greensleeves");
private static final ResourceLocation SATYR_SONG_FALLBACK = new ResourceLocation(GreekFantasy.MODID,
"greensleeves");
private final ForgeConfigSpec.ConfigValue<? extends String> SATYR_SONG;
private ResourceLocation satyrSong;
public final ForgeConfigSpec.BooleanValue SHADE_IMMUNE_TO_NONOWNER;
Expand Down Expand Up @@ -229,7 +232,8 @@ public GFConfig(final ForgeConfigSpec.Builder builder) {

builder.push("mobs");
CIRCE_SPAWN_CHANCE = builder.defineInRange("circe_spawn_chance", 2.0F, 0.0F, 100.0F);
GIANT_BOAR_NON_NETHER = builder.comment("Whether a hoglin must be outside of the nether to be turned to a Giant Boar")
GIANT_BOAR_NON_NETHER = builder
.comment("Whether a hoglin must be outside of the nether to be turned to a Giant Boar")
.define("giant_boar_non_nether", true);
ELPIS_SPAWN_CHANCE = builder
.comment("Percent chance that opening a mysterious box spawns an Elpis")
Expand Down Expand Up @@ -276,9 +280,10 @@ public GFConfig(final ForgeConfigSpec.Builder builder) {
CURSE_OF_CIRCE_ENABLED = builder.define("curse_of_circe_enabled", true);
CURSE_OF_CIRCE_DURATION = builder.defineInRange("curse_of_circe_duration", 900, 1, 24000);
CURSE_OF_CIRCE_WHITELIST = builder.comment("Mobs that can be affected by the Curse of Circe.",
"Accepts entity id or mod id with wildcard.",
"Example: [\"minecraft:zombie\", \"othermod:" + WILDCARD + "\"]")
.defineList("curse_of_circe_whitelist", List.of(curseOfCirceWhitelistDefault), o -> o instanceof String);
"Accepts entity id or mod id with wildcard.",
"Example: [\"minecraft:zombie\", \"othermod:" + WILDCARD + "\"]")
.defineList("curse_of_circe_whitelist", List.of(curseOfCirceWhitelistDefault),
o -> o instanceof String);
MIRRORING_EFFECT_ENABLED = builder.define("mirroring_enabled", false);
PETRIFIED_NERF = builder
.comment("When true, Petrified applies slowness instead of stunning")
Expand All @@ -291,25 +296,26 @@ public GFConfig(final ForgeConfigSpec.Builder builder) {
builder.push("palladium");
PALLADIUM_ENABLED = builder.comment("Whether the Palladium can prevent monster spawns")
.define("palladium_enabled", true);
PALLADIUM_CHUNK_RANGE = builder.comment("The radius (in chunks) of the area protected by Palladium blocks (0=same chunk only)")
PALLADIUM_CHUNK_RANGE = builder
.comment("The radius (in chunks) of the area protected by Palladium blocks (0=same chunk only)")
.defineInRange("palladium_chunk_range", 2, 0, 3);
PALLADIUM_Y_RANGE = builder.comment("The vertical area (in blocks) protected by Palladium blocks")
.defineInRange("palladium_y_range", 128, 0, 255);
builder.pop();

builder.push("mob_spawns");
SPAWN_DIMENSION_WHITELIST = builder.comment("Dimensions in which mobs can spawn.",
"Accepts dimension id or mod id with wildcard.",
"Example: [\"minecraft:the_nether\", \"rftoolsdim:" + WILDCARD + "\"]")
"Accepts dimension id or mod id with wildcard.",
"Example: [\"minecraft:the_nether\", \"rftoolsdim:" + WILDCARD + "\"]")
.define("spawn_dimensions", Lists.newArrayList("minecraft:" + WILDCARD));
IS_SPAWN_DIMENSION_WHITELIST = builder.comment("true if the above list is a whitelist, false for blacklist")
.define("is_whitelist", true);
builder.pop();

builder.comment("Feature generation chances (higher number = more features)").push("features");
FEATURE_DIMENSION_WHITELIST = builder.comment("Dimensions in which mobs can spawn.",
"Accepts dimension id or mod id with wildcard.",
"Example: [\"minecraft:the_nether\", \"rftoolsdim:" + WILDCARD + "\"]")
"Accepts dimension id or mod id with wildcard.",
"Example: [\"minecraft:the_nether\", \"rftoolsdim:" + WILDCARD + "\"]")
.define("spawn_dimensions", Lists.newArrayList("minecraft:" + WILDCARD));
IS_FEATURE_DIMENSION_WHITELIST = builder.comment("true if the above list is a whitelist, false for blacklist")
.define("is_whitelist", true);
Expand Down Expand Up @@ -343,7 +349,7 @@ public void bake() {
showPythonBossBar = SHOW_PYTHON_BOSS_BAR.get();
showScyllaBossBar = SHOW_SCYLLA_BOSS_BAR.get();
satyrSong = ResourceLocation.tryParse(SATYR_SONG.get());
if(null == satyrSong) {
if (null == satyrSong) {
satyrSong = SATYR_SONG_FALLBACK;
}
// mob effects
Expand Down Expand Up @@ -484,8 +490,10 @@ public boolean spawnMatchesDimension(final ServerLevel level) {
return matchesDimension(spawnDimensionWhitelist, isSpawnDimensionWhitelist, level.dimension().location());
}

private static boolean matchesDimension(final List<? extends String> list, final boolean isWhitelist, final ResourceLocation dimensionId) {
private static boolean matchesDimension(final List<? extends String> list, final boolean isWhitelist,
final ResourceLocation dimensionId) {
// check dimension id or mod id
return isWhitelist == (list.contains(dimensionId.toString()) || list.contains(dimensionId.getNamespace() + ":" + WILDCARD));
return isWhitelist == (list.contains(dimensionId.toString())
|| list.contains(dimensionId.getNamespace() + ":" + WILDCARD));
}
}
Loading