Skip to content

Commit b99efa4

Browse files
committed
Port to 1.21.5
1 parent 55ffbef commit b99efa4

File tree

7 files changed

+31
-22
lines changed

7 files changed

+31
-22
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package com.blamejared
22

33
object Versions {
4-
const val MOD = "22.0.0"
4+
const val MOD = "23.0.0"
55
const val JAVA = "21"
6-
const val MINECRAFT = "1.21.4"
7-
const val FABRIC_LOADER = "0.16.9"
8-
const val FABRIC = "0.112.2+1.21.4"
9-
const val FORGE = "54.0.10"
10-
const val FORGE_LOADER = "[54,)"
11-
const val NEO_FORGE = "21.4.33-beta"
6+
const val MINECRAFT = "1.21.5"
7+
const val FABRIC_LOADER = "0.16.10"
8+
const val FABRIC = "0.119.5+1.21.5"
9+
const val FORGE = "55.0.1"
10+
const val FORGE_LOADER = "[55,)"
11+
const val NEO_FORGE = "21.5.4-beta"
1212
const val NEO_FORGE_LOADER= "[4,)"
1313
}

common/src/main/java/com/blamejared/clumps/mixin/MixinExperienceOrb.java

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ public abstract class MixinExperienceOrb extends Entity implements IClumpedOrb {
4949
@Shadow
5050
private int age;
5151

52-
@Shadow
53-
private int value;
54-
5552
@Shadow
5653
protected abstract int repairPlayerItems(ServerPlayer player, int i);
5754

@@ -61,6 +58,12 @@ private static boolean canMerge(ExperienceOrb experienceOrb, int id, int value)
6158
return false;
6259
}
6360

61+
@Shadow
62+
public abstract int getValue();
63+
64+
@Shadow
65+
protected abstract void setValue(int p_396669_);
66+
6467
@Unique
6568
public Map<Integer, Integer> clumps$clumpedMap;
6669

@@ -96,7 +99,7 @@ public void playerTouch(Player rawPlayer, CallbackInfo ci) {
9699
player.takeXpDelay = 0;
97100
player.take(this, 1);
98101

99-
if(this.value != 0 || clumps$resolve()) {
102+
if(this.getValue() != 0 || clumps$resolve()) {
100103
AtomicInteger toGive = new AtomicInteger();
101104
clumps$getClumpedMap().forEach((value, amount) -> {
102105
Either<IValueEvent, Integer> result = Services.EVENT.fireValueEvent(player, value);
@@ -202,12 +205,14 @@ public void readAdditionalSaveData(CompoundTag compoundTag, CallbackInfo ci) {
202205

203206
Map<Integer, Integer> map = new HashMap<>();
204207
if(compoundTag.contains("clumpedMap")) {
205-
CompoundTag clumpedMap = compoundTag.getCompound("clumpedMap");
206-
for(String s : clumpedMap.getAllKeys()) {
207-
map.put(Integer.parseInt(s), clumpedMap.getInt(s));
208+
CompoundTag clumpedMap = compoundTag.getCompoundOrEmpty("clumpedMap");
209+
for(String s : clumpedMap.keySet()) {
210+
clumpedMap.getInt(s).ifPresent(value -> {
211+
map.put(Integer.parseInt(s), value);
212+
});
208213
}
209214
} else {
210-
map.put(value, count);
215+
map.put(getValue(), count);
211216
}
212217

213218
clumps$setClumpedMap(map);
@@ -219,7 +224,7 @@ public void readAdditionalSaveData(CompoundTag compoundTag, CallbackInfo ci) {
219224

220225
if(clumps$clumpedMap == null) {
221226
clumps$clumpedMap = new HashMap<>();
222-
clumps$clumpedMap.put(this.value, 1);
227+
clumps$clumpedMap.put(getValue(), 1);
223228
}
224229
return clumps$clumpedMap;
225230
}
@@ -234,12 +239,12 @@ public void readAdditionalSaveData(CompoundTag compoundTag, CallbackInfo ci) {
234239
@Override
235240
public boolean clumps$resolve() {
236241

237-
value = clumps$getClumpedMap().entrySet()
242+
setValue(clumps$getClumpedMap().entrySet()
238243
.stream()
239244
.map(entry -> entry.getKey() * entry.getValue())
240245
.reduce(Integer::sum)
241-
.orElse(1);
242-
return value > 0;
246+
.orElse(1));
247+
return getValue() > 0;
243248
}
244249

245250
}

fabric/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import net.darkhax.curseforgegradle.Constants as CFG_Constants
66

77
plugins {
88
id("blamejared-modloader-conventions")
9-
id("fabric-loom") version "1.7-SNAPSHOT"
9+
id("fabric-loom") version "1.10-SNAPSHOT"
1010
id("com.modrinth.minotaur")
1111
}
1212

gradle/wrapper/gradle-wrapper.jar

130 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -84,7 +86,7 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# 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
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
8890

8991
# Use the maximum available, or set MAX_FD != -1 to use that value.
9092
MAX_FD=maximum

gradlew.bat

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################

0 commit comments

Comments
 (0)