Skip to content

Commit 8f078a2

Browse files
authored
Update to 1.21.2 (#57)
* Update to 24w33a * Update mappings to 24w33a+build.27 by sakuraryoko * Update to 24w39a * Update workflow actions * Update missing actions
1 parent 276a9c0 commit 8f078a2

15 files changed

Lines changed: 53 additions & 33 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,21 @@ jobs:
1919
runs-on: ${{ matrix.os }}
2020
steps:
2121
- name: checkout repository
22-
uses: actions/checkout@v2
22+
uses: actions/checkout@v4
2323
- name: validate gradle wrapper
24-
uses: gradle/wrapper-validation-action@v1
24+
uses: gradle/actions/wrapper-validation@v3
2525
- name: setup jdk ${{ matrix.java }}
26-
uses: actions/setup-java@v1
26+
uses: actions/setup-java@v4
2727
with:
2828
java-version: ${{ matrix.java }}
29+
distribution: 'microsoft'
2930
- name: make gradle wrapper executable
3031
if: ${{ runner.os != 'Windows' }}
3132
run: chmod +x ./gradlew
3233
- name: build
3334
run: ./gradlew build
3435
- name: capture build artifacts
35-
uses: actions/upload-artifact@v2
36+
uses: actions/upload-artifact@v4
3637
with:
3738
name: Artifacts
3839
path: build/libs/

.github/workflows/docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
steps:
13-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1414
with:
1515
fetch-depth: 0
1616

17-
- uses: actions/setup-python@v2
17+
- uses: actions/setup-python@v5
1818
with:
1919
python-version: 3.x
2020

21-
- uses: actions/cache@v2
21+
- uses: actions/cache@v4
2222
with:
2323
key: ${{ github.ref }}
2424
path: .cache

.github/workflows/release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- uses: actions/cache@v2
14+
- uses: actions/cache@v4
1515
with:
1616
path: |
1717
~/.gradle/loom-cache
@@ -20,11 +20,12 @@ jobs:
2020
key: gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
2121
restore-keys: |
2222
gradle-
23-
- uses: actions/checkout@v2
23+
- uses: actions/checkout@v4
2424
- name: Set up JDK
25-
uses: actions/setup-java@v1
25+
uses: actions/setup-java@v4
2626
with:
2727
java-version: 21
28+
distribution: 'microsoft'
2829

2930
- name: Grant execute permission for gradlew
3031
run: chmod +x gradlew
@@ -39,7 +40,7 @@ jobs:
3940
CURSEFORGE: ${{ secrets.CURSEFORGE }}
4041
CHANGELOG: ${{ github.event.release.body }}
4142
- name: Upload GitHub release
42-
uses: AButler/upload-release-assets@v2.0
43+
uses: AButler/upload-release-assets@v3.0
4344
with:
4445
files: 'build/libs/*.jar;!build/libs/*-sources.jar;!build/libs/*-dev.jar'
4546
repo-token: ${{ secrets.GITHUB_TOKEN }}

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'fabric-loom' version '1.6.+'
2+
id 'fabric-loom' version '1.7.+'
33
id 'maven-publish'
44
id "com.modrinth.minotaur" version "2.+"
55
id 'com.matthewprenger.cursegradle' version '1.4.0'

gradle.properties

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ org.gradle.jvmargs=-Xmx1G
33

44
# Fabric Properties
55
# check these on https://fabricmc.net/use
6-
minecraft_version=1.21
7-
yarn_mappings=1.21+build.2
8-
loader_version=0.15.11
6+
minecraft_version=24w39a
7+
yarn_mappings=24w39a+build.8
8+
loader_version=0.16.5
99

1010
#Fabric api
11-
fabric_version=0.100.1+1.21
11+
fabric_version=0.105.1+1.21.2
1212

1313
# Mod Properties
14-
mod_version = 2.4.1+1.21
14+
mod_version = 2.4.1+1.21.2
1515
maven_group = eu.pb4
1616
archives_base_name = placeholder-api
1717

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

src/main/java/eu/pb4/placeholders/api/PlaceholderContext.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ public static PlaceholderContext of(Entity entity, ViewObject view) {
122122
if (entity instanceof ServerPlayerEntity player) {
123123
return of(player, view);
124124
} else {
125-
return new PlaceholderContext(entity.getServer(), entity::getCommandSource, (ServerWorld) entity.getWorld(), null, entity, null, view);
125+
var world = (ServerWorld) entity.getWorld();
126+
return new PlaceholderContext(entity.getServer(), () -> entity.getCommandSource(world), world, null, entity, null, view);
126127
}
127128
}
128129

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
package eu.pb4.placeholders.api.node;
22

3+
import com.mojang.datafixers.util.Either;
34
import eu.pb4.placeholders.api.ParserContext;
5+
import net.minecraft.text.ParsedSelector;
46
import net.minecraft.text.Text;
57

6-
public record ScoreNode(String name, String objective) implements TextNode {
8+
public record ScoreNode(Either<ParsedSelector, String> name, String objective) implements TextNode {
9+
10+
public ScoreNode(String name, String objective) {
11+
this(ParsedSelector.parse(name).result()
12+
.map(Either::<ParsedSelector, String>left).orElse(Either.right(name)), objective);
13+
}
14+
715
@Override
816
public Text toText(ParserContext context, boolean removeBackslashes) {
9-
return Text.score(name, objective);
17+
return name.map(selector -> Text.score(selector, objective), name -> Text.score(name, objective));
1018
}
1119
}

src/main/java/eu/pb4/placeholders/api/node/SelectorNode.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
package eu.pb4.placeholders.api.node;
22

33
import eu.pb4.placeholders.api.ParserContext;
4+
import net.minecraft.text.ParsedSelector;
45
import net.minecraft.text.Text;
56

67
import java.util.Optional;
78

8-
public record SelectorNode(String pattern, Optional<TextNode> separator) implements TextNode {
9+
public record SelectorNode(ParsedSelector selector, Optional<TextNode> separator) implements TextNode {
910
@Override
1011
public Text toText(ParserContext context, boolean removeBackslashes) {
11-
return Text.selector(pattern, separator.map(x -> x.toText(context, removeBackslashes)));
12+
return Text.selector(selector, separator.map(x -> x.toText(context, removeBackslashes)));
1213
}
1314

1415
@Override

src/main/java/eu/pb4/placeholders/impl/GeneralUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,11 @@ public static ParentNode convertToNodes(Text input) {
225225

226226
list.add(TranslatedNode.ofFallback(content.getKey(), content.getFallback(), args.toArray()));
227227
} else if (input.getContent() instanceof ScoreTextContent content) {
228-
list.add(new ScoreNode(content.getName(), content.getObjective()));
228+
list.add(new ScoreNode(content.name(), content.objective()));
229229
} else if (input.getContent() instanceof KeybindTextContent content) {
230230
list.add(new KeybindNode(content.getKey()));
231231
} else if (input.getContent() instanceof SelectorTextContent content) {
232-
list.add(new SelectorNode(content.getPattern(), content.getSeparator().map(GeneralUtils::convertToNodes)));
232+
list.add(new SelectorNode(content.selector(), content.separator().map(GeneralUtils::convertToNodes)));
233233
} else if (input.getContent() instanceof NbtTextContent content) {
234234
list.add(new NbtNode(content.getPath(), content.shouldInterpret(), content.getSeparator().map(GeneralUtils::convertToNodes), content.getDataSource()));
235235
}

0 commit comments

Comments
 (0)