Skip to content

Commit 245e08d

Browse files
committed
Port to 1.21.6
1 parent b99efa4 commit 245e08d

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
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 = "23.0.0"
4+
const val MOD = "24.0.0"
55
const val JAVA = "21"
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"
6+
const val MINECRAFT = "1.21.6"
7+
const val FABRIC_LOADER = "0.16.14"
8+
const val FABRIC = "0.128.1+1.21.6"
9+
const val FORGE = "56.0.9"
10+
const val FORGE_LOADER = "[56,)"
11+
const val NEO_FORGE = "21.6.20-beta"
1212
const val NEO_FORGE_LOADER= "[4,)"
1313
}

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

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
import net.minecraft.world.item.enchantment.EnchantmentHelper;
1919
import net.minecraft.world.level.Level;
2020
import net.minecraft.world.level.entity.EntityTypeTest;
21+
import net.minecraft.world.level.storage.ValueInput;
22+
import net.minecraft.world.level.storage.ValueOutput;
2123
import net.minecraft.world.phys.AABB;
2224
import net.minecraft.world.phys.Vec3;
2325
import org.spongepowered.asm.mixin.Mixin;
@@ -138,7 +140,7 @@ public void playerTouch(Player rawPlayer, CallbackInfo ci) {
138140
cir.setReturnValue(clumps$currentEntry
139141
.map(foundItem -> {
140142
ItemStack itemstack = foundItem.itemStack();
141-
int xpToRepair = EnchantmentHelper.modifyDurabilityToRepairFromXp(player.serverLevel(), itemstack, (int) (actualValue * Services.PLATFORM.getRepairRatio(itemstack)));
143+
int xpToRepair = EnchantmentHelper.modifyDurabilityToRepairFromXp(player.level(), itemstack, (int) (actualValue * Services.PLATFORM.getRepairRatio(itemstack)));
142144
int toRepair = Math.min(xpToRepair, itemstack.getDamageValue());
143145
itemstack.setDamageValue(itemstack.getDamageValue() - toRepair);
144146
if(toRepair > 0) {
@@ -191,29 +193,26 @@ private static void tryMergeToExisting(ServerLevel serverLevel, Vec3 vec3, int v
191193

192194

193195
@Inject(method = "addAdditionalSaveData", at = @At("TAIL"))
194-
public void addAdditionalSaveData(CompoundTag compoundTag, CallbackInfo ci) {
196+
public void addAdditionalSaveData(ValueOutput valueOutput, CallbackInfo ci) {
195197

196198
if(clumps$clumpedMap != null) {
197199
CompoundTag map = new CompoundTag();
198200
clumps$getClumpedMap().forEach((value, count) -> map.putInt(String.valueOf(value), count));
199-
compoundTag.put("clumpedMap", map);
201+
valueOutput.store("clumpedMap", CompoundTag.CODEC, map);
200202
}
201203
}
202204

203205
@Inject(method = "readAdditionalSaveData", at = @At("TAIL"))
204-
public void readAdditionalSaveData(CompoundTag compoundTag, CallbackInfo ci) {
206+
public void readAdditionalSaveData(ValueInput valueInput, CallbackInfo ci) {
205207

206208
Map<Integer, Integer> map = new HashMap<>();
207-
if(compoundTag.contains("clumpedMap")) {
208-
CompoundTag clumpedMap = compoundTag.getCompoundOrEmpty("clumpedMap");
209+
valueInput.read("clumpedMap", CompoundTag.CODEC).ifPresentOrElse(clumpedMap -> {
209210
for(String s : clumpedMap.keySet()) {
210211
clumpedMap.getInt(s).ifPresent(value -> {
211212
map.put(Integer.parseInt(s), value);
212213
});
213214
}
214-
} else {
215-
map.put(getValue(), count);
216-
}
215+
}, () -> map.put(getValue(), count));
217216

218217
clumps$setClumpedMap(map);
219218
}

0 commit comments

Comments
 (0)