Skip to content

Commit

Permalink
Forge & Fabric 1.20.1 Backport (#495)
Browse files Browse the repository at this point in the history
* fabric 1.6

* kill neoforge

* update gradle to 8.7

* kill forge

* config overhaul

* remove SubSeason from SeasonProperties

* update dede

* optimize imports

* 1.20.1 backport attempt 1

* change short_grass to grass

* guide people to download owo-lib with help of owo-sentinel

* make config more user friendly
commented

* delete owo lib

* old configs

* old configs 2

* update glitchcore & use configsync

* update glitchcore to 1.0.4

* delete wispforest repo

* use official glitchcore

* change glitchcore ver to 1.0.0.60

* require the needed glitchcore version
(I forgot to put it back after testing)

* change glitchcore version to 0.0.1.0

* Revert "kill forge"

This reverts commit ba30ed2.

* add forge version

* try to adapt code style of Adubbz

* Revert "try to adapt code style of Adubbz"

This reverts commit b68512a.

* use 4 spaces in these classes

* use 4 tabs in this clas (I don't really know why it was like this, but I don't want to change anything)

* minimize the changes here

* minimize the changes here

* this is a catastrophe

* minimze the number of changes

* change the import to *

* fix imports here

* fix all imports in seasonsensorblock

* update glitchcore to 0.0.1.1
  • Loading branch information
marlester-dev authored Oct 7, 2024
1 parent f2f731a commit ff76e91
Show file tree
Hide file tree
Showing 24 changed files with 55 additions and 242 deletions.
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ buildscript {
}
dependencies {
classpath 'com.modrinth.minotaur:Minotaur:2.+'
classpath 'gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:1.1.7' // Required for NeoGradle
classpath 'gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:1.1.7'
classpath 'net.minecraftforge:gradleutils:2.2.0' // Required for changelog generation
}
}
Expand Down Expand Up @@ -81,7 +81,6 @@ subprojects {
var expandProps = [
minecraft_version : minecraft_version,
forge_version : forge_version, forge_version_range: forge_version_range, forge_loader_version_range: forge_loader_version_range,
neoforge_version : neoforge_version, neoforge_version_range: neoforge_version_range, neoforge_loader_version_range: neoforge_loader_version_range,
glitchcore_version : glitchcore_version,
mod_id : mod_id, mod_name: mod_name, mod_display_name: mod_display_name, mod_version: mod_version,
mod_authors : mod_authors, mod_description: mod_description,
Expand Down
10 changes: 0 additions & 10 deletions common/src/main/java/sereneseasons/block/SeasonSensorBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
******************************************************************************/
package sereneseasons.block;

import com.mojang.serialization.MapCodec;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.RenderShape;
import net.minecraft.world.level.block.entity.*;
Expand Down Expand Up @@ -33,7 +32,6 @@

public class SeasonSensorBlock extends BaseEntityBlock
{
public static final MapCodec<SeasonSensorBlock> CODEC = simpleCodec(SeasonSensorBlock::new);
public static final IntegerProperty POWER = BlockStateProperties.POWER;
protected static final VoxelShape SHAPE = Block.box(0.0D, 0.0D, 0.0D, 16.0D, 6.0D, 16.0D);
public static final IntegerProperty SEASON = IntegerProperty.create("season", 0, 3);
Expand All @@ -44,12 +42,6 @@ public SeasonSensorBlock(Properties properties)
this.registerDefaultState(this.stateDefinition.any().setValue(POWER, 0).setValue(SEASON, 0));
}

@Override
protected MapCodec<? extends BaseEntityBlock> codec()
{
return CODEC;
}

@Override
public VoxelShape getShape(BlockState state, BlockGetter reader, BlockPos pos, CollisionContext selectionContext)
{
Expand All @@ -70,8 +62,6 @@ public int getSignal(BlockState state, BlockGetter reader, BlockPos pos, Directi

public void updatePower(Level world, BlockPos pos)
{
BlockState state = world.getBlockState(pos);

if (ModConfig.seasons.isDimensionWhitelisted(world.dimension()))
{
BlockState currentState = world.getBlockState(pos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ public void load()
outOfSeasonCropBehavior = addNumber("general.out_of_season_crop_behavior", 0, 0, 2, "How crops behave when out of season.\n0 = Grow slowly\n1 = Can't grow\n2 = Break when trying to grow");
undergroundFertilityLevel = addNumber("general.underground_fertility_level", 48, DimensionType.MIN_Y, Integer.MAX_VALUE, "Maximum height level for out of season crops to have fertility underground.");
}
}
}
3 changes: 0 additions & 3 deletions common/src/main/java/sereneseasons/config/SeasonsConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,16 @@
import com.electronwill.nightconfig.core.InMemoryFormat;
import com.google.common.base.Preconditions;
import com.google.common.base.Suppliers;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import glitchcore.util.Environment;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.valueproviders.IntProvider;
import net.minecraft.util.valueproviders.UniformInt;
import net.minecraft.world.level.Level;
import sereneseasons.api.season.Season;
import sereneseasons.core.SereneSeasons;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.*;
import java.util.function.Predicate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import sereneseasons.block.entity.SeasonSensorBlockEntity;
import sereneseasons.core.SereneSeasons;

import java.util.List;
import java.util.function.BiConsumer;

public class ModBlockEntities
Expand Down
3 changes: 0 additions & 3 deletions common/src/main/java/sereneseasons/init/ModTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.BiomeTags;
import net.minecraft.tags.BlockTags;
import net.minecraft.tags.ItemTags;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.biome.Biome;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@Mixin(ServerLevel.class)
public class MixinServerLevel
{
@Redirect(method="tickPrecipitation", at=@At(value = "INVOKE", target = "Lnet/minecraft/world/level/biome/Biome;getPrecipitationAt(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/biome/Biome$Precipitation;"))
@Redirect(method="tickChunk", at=@At(value = "INVOKE", target = "Lnet/minecraft/world/level/biome/Biome;getPrecipitationAt(Lnet/minecraft/core/BlockPos;)Lnet/minecraft/world/level/biome/Biome$Precipitation;"))
public Biome.Precipitation tickIceAndSnow_getPrecipitationAt(Biome biome, BlockPos pos)
{
return SeasonHooks.getPrecipitationAtTickIceAndSnowHook((LevelReader)this, biome, pos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ public static void onWorldTick(TickEvent.Level event)

ServerLevel level = (ServerLevel)event.getLevel();
Season.SubSeason subSeason = SeasonHelper.getSeasonState(level).getSubSeason();
Season season = subSeason.getSeason();

SeasonsConfig.SeasonProperties seasonProperties = ModConfig.seasons.getSeasonProperties(subSeason);
float meltRand = seasonProperties.meltChance() / 100.0F;
Expand Down
10 changes: 0 additions & 10 deletions common/src/main/java/sereneseasons/season/SeasonColorHandlers.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,18 @@
import com.google.common.collect.Multimap;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BiomeColors;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.Registries;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.ColorResolver;
import net.minecraft.world.level.FoliageColor;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import sereneseasons.api.season.ISeasonColorProvider;
import sereneseasons.api.season.ISeasonState;
import sereneseasons.api.season.SeasonHelper;
import sereneseasons.init.ModConfig;
import sereneseasons.init.ModTags;
import sereneseasons.util.SeasonColorUtil;

import javax.annotation.Nullable;
import java.util.List;

public class SeasonColorHandlers
{
private static final Multimap<ResolverType, ColorOverride> resolverOverrides = HashMultimap.create();
Expand Down
4 changes: 1 addition & 3 deletions common/src/main/java/sereneseasons/season/SeasonHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.util.Mth;
import net.minecraft.util.datafix.DataFixTypes;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.saveddata.SavedData;
import net.minecraft.world.level.storage.DimensionDataStorage;
import sereneseasons.api.SSGameRules;
import sereneseasons.api.season.ISeasonState;
Expand Down Expand Up @@ -148,7 +146,7 @@ public static SeasonSavedData getSeasonSavedData(Level w)
return savedData;
};

return saveDataManager.computeIfAbsent(new SavedData.Factory<>(defaultSaveDataSupplier, SeasonSavedData::load, DataFixTypes.LEVEL), SeasonSavedData.DATA_IDENTIFIER);
return saveDataManager.computeIfAbsent(SeasonSavedData::load, defaultSaveDataSupplier, SeasonSavedData.DATA_IDENTIFIER);
}

//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import sereneseasons.core.SereneSeasons;
import sereneseasons.init.ModConfig;
import sereneseasons.init.ModFertility;
import sereneseasons.init.ModTags;
Expand Down
32 changes: 27 additions & 5 deletions common/src/main/resources/assets/sereneseasons/lang/de_de.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,43 @@
{
"commands.sereneseasons.usage": "/sereneseasons <getseason/setseason> [args]",
"commands.sereneseasons.usage": "/season <get/set> [args]",
"commands.sereneseasons.getseason.success": "Derzeitige Jahreszeit ist %s, Tag %s/%s, tick %s/%s",
"commands.sereneseasons.setseason.success": "Setze Jahreszeit zu %s",
"commands.sereneseasons.setseason.fail": "Ungültige Jahreszeit %s",
"commands.sereneseasons.setseason.disabled": "Jahreszeiten sind derzeit deaktiviert!",

"itemGroup.tabSereneSeasons": "Ruhige Jahreszeiten",
"gamerule.doSeasonCycle": "Jahreszeiten schreiten voran",
"itemGroup.tabSereneSeasons": "Serene Seasons",

"block.sereneseasons.season_sensor": "Jahreszeiten Sensor",

"item.sereneseasons.ss_icon": "SS Icon",
"item.sereneseasons.calendar": "Kalender",

"desc.sereneseasons.fertile_seasons": "Fertile Jahreszeiten",
"desc.sereneseasons.year_round": "Ganzjährig",
"desc.sereneseasons.day_counter": "Tag %s/%s",
"desc.sereneseasons.tropical_day_counter": " (%s/%s)",
"desc.sereneseasons.spring": "Frühling",
"desc.sereneseasons.early_spring": "Frühlingsanfang",
"desc.sereneseasons.mid_spring": "Frühlingsmitte",
"desc.sereneseasons.late_spring": "Frühlingsende",
"desc.sereneseasons.summer": "Sommer",
"desc.sereneseasons.early_summer": "Frühsommer",
"desc.sereneseasons.mid_summer": "Hochsommer",
"desc.sereneseasons.late_summer": "Spätsommer",
"desc.sereneseasons.autumn": "Herbst",
"desc.sereneseasons.winter": "Winter"
}
"desc.sereneseasons.early_autumn": "Herbstanfang",
"desc.sereneseasons.mid_autumn": "Herbstmitte",
"desc.sereneseasons.late_autumn": "Herbstende",
"desc.sereneseasons.winter": "Winter",
"desc.sereneseasons.early_winter": "Winteranfang",
"desc.sereneseasons.mid_winter": "Wintermitte",
"desc.sereneseasons.late_winter": "Winterende",

"desc.sereneseasons.early_wet": "Anfang der Regenzeit",
"desc.sereneseasons.mid_wet": "Mitte der Regenzeit",
"desc.sereneseasons.late_wet": "Ende der Regenzeit",
"desc.sereneseasons.early_dry": "Anfang der Trockenzeit",
"desc.sereneseasons.mid_dry": "Mitte der Trockenzeit",
"desc.sereneseasons.late_dry": "Ende der Trockenzeit"
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"minecraft:small_dripleaf",
"minecraft:mangrove_leaves",
"minecraft:mangrove_propagule",
"minecraft:short_grass",
"minecraft:grass",
"minecraft:fern",
"minecraft:pink_petals",
"minecraft:sunflower",
Expand Down
2 changes: 1 addition & 1 deletion fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id "fabric-loom" version "1.4-SNAPSHOT"
id "fabric-loom" version "1.6-SNAPSHOT"
id "com.matthewprenger.cursegradle" version "1.4.0"
}

Expand Down
17 changes: 6 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@ group=com.github.glitchfiend
release_channel=beta

# Common
minecraft_version=1.20.4
minecraft_version=1.20.1

# Forge
forge_version=49.0.3
forge_version_range=[49.0.3,)
forge_loader_version_range=[49,)

# NeoForge
neoforge_version=20.4.75-beta
neoforge_version_range=[20.4,)
neoforge_loader_version_range=[1,)
forge_version=47.3.0
forge_version_range=[47.3.0,)
forge_loader_version_range=[47,)

# Fabric
fabric_version=0.91.1+1.20.4
fabric_version=0.92.2+1.20.1
fabric_loader_version=0.15.1

# Mod options
Expand All @@ -40,4 +35,4 @@ org.gradle.daemon=false

# Dependencies
nightconfig_version=3.6.7
glitchcore_version=1.0.0.54
glitchcore_version=0.0.1.1
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
22 changes: 13 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -130,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -198,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
Loading

0 comments on commit ff76e91

Please sign in to comment.