Skip to content

Commit 8dfb227

Browse files
1.21.5 (#313)
* Update to 1.21.5 --------- Co-authored-by: Drex <[email protected]>
1 parent c7a5077 commit 8dfb227

29 files changed

+147
-138
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ kotlin.code.style=official
22
org.gradle.jvmargs=-Xmx2G
33

44
# Mod Properties
5-
modVersion = 1.3.7
5+
modVersion = 1.3.9
66
mavenGroup = com.github.quiltservertools
77
modId = ledger
88
modName = Ledger

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.12-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

libs.versions.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
[versions]
2-
minecraft = "1.21.4"
3-
yarn-mappings = "1.21.4+build.1"
4-
fabric-loader = "0.16.9"
2+
minecraft = "1.21.5"
3+
yarn-mappings = "1.21.5+build.1"
4+
fabric-loader = "0.16.10"
55

6-
fabric-api = "0.110.5+1.21.4"
6+
fabric-api = "0.119.5+1.21.5"
77

88
# Kotlin
99
kotlin = "2.1.0"
1010
# Also modrinth version in gradle.properties
1111
fabric-kotlin = "1.13.0+kotlin.2.1.0"
1212

1313
fabric-permissions = "0.3.3"
14-
translations = "2.4.0+1.21.2-rc1"
14+
translations = "2.5.0+1.21.5-rc1"
1515

1616
exposed = "0.58.0"
1717
sqlite-jdbc = "3.47.2.0"
@@ -45,5 +45,5 @@ detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting",
4545
[plugins]
4646
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
4747
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
48-
loom = { id = "fabric-loom", version = "1.9.+" }
48+
loom = { id = "fabric-loom", version = "1.10.+" }
4949
git_hooks = { id = "com.github.jakemarsden.git-hooks", version = "0.0.2" }

src/main/java/com/github/quiltservertools/ledger/mixin/BucketDispenserBehaviorMixin.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@
1515
import org.spongepowered.asm.mixin.injection.Inject;
1616
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
1717

18-
@Mixin(targets = "net/minecraft/block/dispenser/DispenserBehavior$13")
18+
@Mixin(targets = "net/minecraft/block/dispenser/DispenserBehavior$11")
1919
public abstract class BucketDispenserBehaviorMixin extends ItemDispenserBehavior {
2020

2121
@Inject(
2222
method = "dispenseSilently",
2323
at = @At(
2424
value = "INVOKE",
25-
target = "Lnet/minecraft/block/FluidDrainable;tryDrainFluid(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/item/ItemStack;",
25+
target = "Lnet/minecraft/block/FluidDrainable;tryDrainFluid(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/item/ItemStack;",
2626
shift = At.Shift.AFTER
2727
)
2828
)

src/main/java/com/github/quiltservertools/ledger/mixin/BucketItemMixin.java

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.llamalad7.mixinextras.sugar.Local;
88
import net.minecraft.block.BlockState;
99
import net.minecraft.block.Waterloggable;
10+
import net.minecraft.entity.LivingEntity;
1011
import net.minecraft.entity.player.PlayerEntity;
1112
import net.minecraft.fluid.Fluid;
1213
import net.minecraft.item.BucketItem;
@@ -15,7 +16,6 @@
1516
import net.minecraft.util.hit.BlockHitResult;
1617
import net.minecraft.util.math.BlockPos;
1718
import net.minecraft.world.World;
18-
import org.jetbrains.annotations.Nullable;
1919
import org.spongepowered.asm.mixin.Final;
2020
import org.spongepowered.asm.mixin.Mixin;
2121
import org.spongepowered.asm.mixin.Shadow;
@@ -30,25 +30,32 @@ public abstract class BucketItemMixin {
3030
private Fluid fluid;
3131

3232
@Inject(method = "placeFluid", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;breakBlock(Lnet/minecraft/util/math/BlockPos;Z)Z"))
33-
private void logFluidBreak(@Nullable PlayerEntity player, World world, BlockPos pos, @Nullable BlockHitResult hitResult, CallbackInfoReturnable<Boolean> cir) {
33+
private void logFluidBreak(LivingEntity user, World world, BlockPos pos, BlockHitResult hitResult, CallbackInfoReturnable<Boolean> cir) {
3434
var blockstate = world.getBlockState(pos);
35-
if (!blockstate.isAir()) {
35+
if (!blockstate.isAir() && user instanceof PlayerEntity player) {
3636
BlockBreakCallback.EVENT.invoker().breakBlock(world, pos, world.getBlockState(pos), world.getBlockEntity(pos), Sources.FLUID, player);
3737
}
3838
}
39-
40-
@Inject(method = "placeFluid", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/BucketItem;playEmptyingSound(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;)V", ordinal = 1))
41-
private void logFluidPlace(@Nullable PlayerEntity player, World world, BlockPos pos, @Nullable BlockHitResult hitResult, CallbackInfoReturnable<Boolean> cir) {
42-
if (player != null) {
39+
40+
@Inject(method = "placeFluid", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/BucketItem;playEmptyingSound(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;)V"))
41+
private void logFluidPlace(LivingEntity user, World world, BlockPos pos, BlockHitResult hitResult, CallbackInfoReturnable<Boolean> cir) {
42+
if (user instanceof PlayerEntity player) {
4343
BlockPlaceCallback.EVENT.invoker().place(world, pos, this.fluid.getDefaultState().getBlockState(), null, player);
4444
} else {
4545
BlockPlaceCallback.EVENT.invoker().place(world, pos, this.fluid.getDefaultState().getBlockState(), null, Sources.REDSTONE);
4646
}
4747
}
4848

49-
@Inject(method = "placeFluid", at = @At(value = "INVOKE", target = "Lnet/minecraft/item/BucketItem;playEmptyingSound(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;)V", ordinal = 0))
50-
private void logWaterlog(PlayerEntity player, World world, BlockPos pos, BlockHitResult hitResult, CallbackInfoReturnable<Boolean> cir, @Local BlockState blockState) {
51-
if (player != null) {
49+
@Inject(
50+
method = "placeFluid",
51+
at = @At(
52+
value = "INVOKE",
53+
target = "Lnet/minecraft/item/BucketItem;playEmptyingSound(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;)V",
54+
ordinal = 0
55+
)
56+
)
57+
private void logWaterlog(LivingEntity user, World world, BlockPos pos, BlockHitResult hitResult, CallbackInfoReturnable<Boolean> cir, @Local BlockState blockState) {
58+
if (user instanceof PlayerEntity player) {
5259
BlockChangeCallback.EVENT.invoker().changeBlock(
5360
world,
5461
pos,

src/main/java/com/github/quiltservertools/ledger/mixin/FillCommandMixin.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import net.minecraft.server.world.ServerWorld;
1616
import net.minecraft.util.math.BlockBox;
1717
import net.minecraft.util.math.BlockPos;
18+
import org.jetbrains.annotations.Nullable;
1819
import org.spongepowered.asm.mixin.Mixin;
1920
import org.spongepowered.asm.mixin.injection.At;
2021
import org.spongepowered.asm.mixin.injection.Coerce;
@@ -38,6 +39,7 @@ private static void logFillChanges(
3839
BlockStateArgument block,
3940
@Coerce Object mode,
4041
Predicate<CachedBlockPosition> filter,
42+
boolean strict,
4143
CallbackInfoReturnable<Integer> cir,
4244
@Local BlockPos pos) {
4345
ServerWorld world = source.getWorld();

src/main/java/com/github/quiltservertools/ledger/mixin/SetBlockCommandMixin.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@
2222

2323
@Mixin(SetBlockCommand.class)
2424
public abstract class SetBlockCommandMixin {
25-
@ModifyArgs(method = "execute", at = @At(value = "INVOKE", target = "Lnet/minecraft/command/argument/BlockStateArgument;setBlockState(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;I)Z"))
26-
private static void logSetBlockChange(Args args, ServerCommandSource source, BlockPos pos, BlockStateArgument block, SetBlockCommand.Mode mode, @Nullable Predicate<CachedBlockPosition> condition) {
25+
@ModifyArgs(
26+
method = "execute",
27+
at = @At(
28+
value = "INVOKE",
29+
target = "Lnet/minecraft/command/argument/BlockStateArgument;setBlockState(Lnet/minecraft/server/world/ServerWorld;Lnet/minecraft/util/math/BlockPos;I)Z"
30+
)
31+
)
32+
private static void logSetBlockChange(Args args, ServerCommandSource source, BlockPos pos, BlockStateArgument block, SetBlockCommand.Mode mode, @Nullable Predicate<CachedBlockPosition> condition, boolean strict) {
2733
ServerWorld world = args.get(0);
2834

2935
BlockState oldState = world.getBlockState(pos);

src/main/java/com/github/quiltservertools/ledger/mixin/blocks/LilyPadBlockMixin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import net.minecraft.block.BlockState;
66
import net.minecraft.block.LilyPadBlock;
77
import net.minecraft.entity.Entity;
8+
import net.minecraft.entity.EntityCollisionHandler;
89
import net.minecraft.entity.player.PlayerEntity;
910
import net.minecraft.entity.vehicle.AbstractBoatEntity;
1011
import net.minecraft.util.math.BlockPos;
@@ -17,7 +18,7 @@
1718
@Mixin(LilyPadBlock.class)
1819
public abstract class LilyPadBlockMixin {
1920
@Inject(method = "onEntityCollision", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/World;breakBlock(Lnet/minecraft/util/math/BlockPos;ZLnet/minecraft/entity/Entity;)Z"))
20-
private void ledgerLogLilyPadBreak(BlockState state, World world, BlockPos pos, Entity entity, CallbackInfo ci) {
21+
private void ledgerLogLilyPadBreak(BlockState state, World world, BlockPos pos, Entity entity, EntityCollisionHandler handler, CallbackInfo ci) {
2122
AbstractBoatEntity boat = (AbstractBoatEntity) entity;
2223
if (boat.getFirstPassenger() instanceof PlayerEntity player) {
2324
BlockBreakCallback.EVENT.invoker().breakBlock(world, new BlockPos(pos), state, null, Sources.VEHICLE, player);

src/main/java/com/github/quiltservertools/ledger/mixin/blocks/SpongeBlockMixin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ private static void logWaterDrainNonSource(BlockPos actorBlockPos, World world,
2828
}
2929

3030
@Inject(method = "method_49829", at = @At(value = "INVOKE",
31-
target = "Lnet/minecraft/block/FluidDrainable;tryDrainFluid(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/item/ItemStack;"))
31+
target = "Lnet/minecraft/block/FluidDrainable;tryDrainFluid(Lnet/minecraft/entity/LivingEntity;Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/BlockState;)Lnet/minecraft/item/ItemStack;"))
3232
private static void logWaterDrainSource(BlockPos actorBlockPos, World world, BlockPos pos, CallbackInfoReturnable<Boolean> cir) {
3333
BlockBreakCallback.EVENT.invoker().breakBlock(world, pos, world.getBlockState(pos), null, Sources.SPONGE);
3434
}

src/main/java/com/github/quiltservertools/ledger/mixin/blocks/cauldron/LeveledCauldronBlockMixin.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import net.minecraft.block.BlockState;
66
import net.minecraft.block.LeveledCauldronBlock;
77
import net.minecraft.entity.Entity;
8+
import net.minecraft.entity.EntityCollisionHandler;
89
import net.minecraft.entity.player.PlayerEntity;
910
import net.minecraft.fluid.Fluid;
1011
import net.minecraft.util.math.BlockPos;
@@ -52,7 +53,7 @@ private static void ledgerLogDecrementLevelCauldron(BlockState state, World worl
5253

5354
@Inject(method = "onEntityCollision", at = @At(value = "INVOKE",
5455
target = "Lnet/minecraft/block/LeveledCauldronBlock;onFireCollision(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;)V"))
55-
private void ledgerLogPlayerExtinguish(BlockState state, World world, BlockPos pos, Entity entity, CallbackInfo ci) {
56+
private void ledgerLogPlayerExtinguish(BlockState state, World world, BlockPos pos, Entity entity, EntityCollisionHandler handler, CallbackInfo ci) {
5657
if (entity instanceof PlayerEntity) {
5758
playerEntity = (PlayerEntity) entity;
5859
}

0 commit comments

Comments
 (0)