Skip to content

Commit ab86158

Browse files
committed
[Fabric] Add 1.20.3-pre1 support
1 parent 300198f commit ab86158

File tree

12 files changed

+44
-25
lines changed

12 files changed

+44
-25
lines changed

buildSrc/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ dependencies {
5252
implementation("org.jfrog.buildinfo:build-info-extractor-gradle:4.32.0")
5353
implementation("org.spongepowered:spongegradle-plugin-development:2.1.1")
5454
implementation("org.spongepowered:vanillagradle:0.2.1-20230603.203956-54")
55-
implementation("net.minecraftforge.gradle:ForgeGradle:6.0.13")
55+
implementation("net.minecraftforge.gradle:ForgeGradle:6.0.16")
5656
implementation("net.fabricmc:fabric-loom:$loomVersion")
5757
implementation("net.fabricmc:sponge-mixin:$mixinVersion")
5858
implementation("org.enginehub.gradle:gradle-codecov-plugin:0.2.0")

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ version=7.2.18-SNAPSHOT
44
org.gradle.jvmargs=-Xmx2G
55
org.gradle.parallel=true
66

7-
loom.version=1.3.9
7+
loom.version=1.4.4
88
mixin.version=0.12.5+mixin.0.8.5

gradle/wrapper/gradle-wrapper.jar

2.1 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

gradlew

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ done
8383
# This is normally unused
8484
# shellcheck disable=SC2034
8585
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
87-
88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
9088

9189
# Use the maximum available, or set MAX_FD != -1 to use that value.
9290
MAX_FD=maximum
@@ -133,26 +131,29 @@ location of your Java installation."
133131
fi
134132
else
135133
JAVACMD=java
136-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134+
if ! command -v java >/dev/null 2>&1
135+
then
136+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137137
138138
Please set the JAVA_HOME variable in your environment to match the
139139
location of your Java installation."
140+
fi
140141
fi
141142

142143
# Increase the maximum file descriptors if we can.
143144
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144145
case $MAX_FD in #(
145146
max*)
146147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
148149
MAX_FD=$( ulimit -H -n ) ||
149150
warn "Could not query maximum file descriptor limit"
150151
esac
151152
case $MAX_FD in #(
152153
'' | soft) :;; #(
153154
*)
154155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
156157
ulimit -n "$MAX_FD" ||
157158
warn "Could not set maximum file descriptor limit to $MAX_FD"
158159
esac
@@ -197,11 +198,15 @@ if "$cygwin" || "$msys" ; then
197198
done
198199
fi
199200

200-
# Collect all arguments for the java command;
201-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202-
# shell script including quotes and variable substitutions, so put them in
203-
# double quotes to make sure that they get re-expanded; and
204-
# * put everything else in single quotes, so that it's not re-expanded.
201+
202+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204+
205+
# Collect all arguments for the java command:
206+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207+
# and any embedded shellness will be escaped.
208+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209+
# treated as '${Hostname}' itself on the command line.
205210

206211
set -- \
207212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

worldedit-core/src/main/java/com/sk89q/worldedit/LocalConfiguration.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,9 @@ protected String[] getDefaultDisallowedBlocks() {
121121
BlockTypes.YELLOW_BED,
122122
BlockTypes.POWERED_RAIL,
123123
BlockTypes.DETECTOR_RAIL,
124+
// Keep grass for <1.20.3 compat
124125
BlockTypes.GRASS,
126+
BlockTypes.SHORT_GRASS,
125127
BlockTypes.DEAD_BUSH,
126128
BlockTypes.MOVING_PISTON,
127129
BlockTypes.PISTON_HEAD,

worldedit-core/src/main/java/com/sk89q/worldedit/extent/reorder/MultiStageReorder.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ public class MultiStageReorder extends AbstractBufferingExtent implements Reorde
8585
priorityMap.put(BlockTypes.RED_BED, PlacementPriority.LAST);
8686
priorityMap.put(BlockTypes.WHITE_BED, PlacementPriority.LAST);
8787
priorityMap.put(BlockTypes.YELLOW_BED, PlacementPriority.LAST);
88-
priorityMap.put(BlockTypes.GRASS, PlacementPriority.LAST);
88+
// Keep "grass" for <1.20.3 compat
89+
@SuppressWarnings("deprecation")
90+
BlockType grass = BlockTypes.GRASS;
91+
priorityMap.put(grass, PlacementPriority.LAST);
92+
priorityMap.put(BlockTypes.SHORT_GRASS, PlacementPriority.LAST);
8993
priorityMap.put(BlockTypes.TALL_GRASS, PlacementPriority.LAST);
9094
priorityMap.put(BlockTypes.ROSE_BUSH, PlacementPriority.LAST);
9195
priorityMap.put(BlockTypes.DANDELION, PlacementPriority.LAST);

worldedit-core/src/main/java/com/sk89q/worldedit/function/generator/FloraGenerator.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.sk89q.worldedit.function.pattern.RandomPattern;
2727
import com.sk89q.worldedit.math.BlockVector3;
2828
import com.sk89q.worldedit.world.block.BlockState;
29+
import com.sk89q.worldedit.world.block.BlockType;
2930
import com.sk89q.worldedit.world.block.BlockTypes;
3031

3132
/**
@@ -95,7 +96,12 @@ public static Pattern getDesertPattern() {
9596
*/
9697
public static Pattern getTemperatePattern() {
9798
RandomPattern pattern = new RandomPattern();
98-
pattern.add(BlockTypes.GRASS.getDefaultState(), 300);
99+
BlockType grass = BlockTypes.SHORT_GRASS;
100+
if (grass == null) {
101+
// Fallback for <1.20.3 compat
102+
grass = BlockTypes.GRASS;
103+
}
104+
pattern.add(grass.getDefaultState(), 300);
99105
pattern.add(BlockTypes.POPPY.getDefaultState(), 5);
100106
pattern.add(BlockTypes.DANDELION.getDefaultState(), 5);
101107
return pattern;

worldedit-core/src/main/java/com/sk89q/worldedit/world/block/BlockTypes.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ public final class BlockTypes {
410410
@Nullable public static final BlockType GRANITE_SLAB = get("minecraft:granite_slab");
411411
@Nullable public static final BlockType GRANITE_STAIRS = get("minecraft:granite_stairs");
412412
@Nullable public static final BlockType GRANITE_WALL = get("minecraft:granite_wall");
413-
@Nullable public static final BlockType GRASS = get("minecraft:grass");
413+
@Deprecated @Nullable public static final BlockType GRASS = get("minecraft:grass");
414414
@Nullable public static final BlockType GRASS_BLOCK = get("minecraft:grass_block");
415415
@Deprecated @Nullable public static final BlockType GRASS_PATH = get("minecraft:grass_path");
416416
@Nullable public static final BlockType GRAVEL = get("minecraft:gravel");
@@ -839,6 +839,7 @@ public final class BlockTypes {
839839
@Nullable public static final BlockType SEA_LANTERN = get("minecraft:sea_lantern");
840840
@Nullable public static final BlockType SEA_PICKLE = get("minecraft:sea_pickle");
841841
@Nullable public static final BlockType SEAGRASS = get("minecraft:seagrass");
842+
@Nullable public static final BlockType SHORT_GRASS = get("minecraft:short_grass");
842843
@Nullable public static final BlockType SHROOMLIGHT = get("minecraft:shroomlight");
843844
@Nullable public static final BlockType SHULKER_BOX = get("minecraft:shulker_box");
844845
@Deprecated @Nullable public static final BlockType SIGN = get("minecraft:sign");

worldedit-fabric/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ applyShadowConfiguration()
2222
apply(plugin = "fabric-loom")
2323
apply(plugin = "java-library")
2424

25-
val minecraftVersion = "1.20.2"
26-
val loaderVersion = "0.14.22"
25+
val minecraftVersion = "1.20.3-pre1"
26+
val loaderVersion = "0.14.24"
2727

2828
val fabricApiConfiguration: Configuration = configurations.create("fabricApi")
2929

@@ -64,7 +64,7 @@ dependencies {
6464
.toSet()
6565
// [2] Request the matching dependency from fabric-loom
6666
for (wantedDependency in wantedDependencies) {
67-
val dep = project.the<FabricApiExtension>().module(wantedDependency, "0.89.1+1.20.2")
67+
val dep = project.the<FabricApiExtension>().module(wantedDependency, "0.90.11+1.20.3")
6868
"include"(dep)
6969
"modImplementation"(dep)
7070
}

0 commit comments

Comments
 (0)