diff --git a/build.gradle b/build.gradle index 5800a94..dd19b14 100644 --- a/build.gradle +++ b/build.gradle @@ -32,7 +32,7 @@ dependencies { // Local dependencies modLocalRuntime "com.terraformersmc:modmenu:${project.mod_menu}" modLocalRuntime "maven.modrinth:lithium:${project.lithium}" - modLocalRuntime "dev.lambdaurora:lambdynamiclights:${project.lambdynamiclights}" +// modLocalRuntime "dev.lambdaurora:lambdynamiclights:${project.lambdynamiclights}" // modLocalRuntime "vazkii.patchouli:Patchouli:${project.patchouli}" // modLocalRuntime "me.shedaniel:RoughlyEnoughItems-fabric:${project.rei}" // modLocalRuntime "dev.emi:emi:${project.emi}" diff --git a/gradle.properties b/gradle.properties index 085e7b2..b720c9d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,21 +1,21 @@ org.gradle.jvmargs=-Xmx1G # Required dependencies -minecraft=1.20.4 -mappings=1.20.4+build.3 -fabric_loader=0.15.9 -fabric_api=0.96.11+1.20.4 -owo_lib=0.12.6+1.20.3 +minecraft=1.20.1 +mappings=1.20.1+build.10 +fabric_loader=0.15.10 +fabric_api=0.92.1+1.20.1 +owo_lib=0.11.2+1.20 # Local dependencies -mod_menu=9.0.0 -lithium=mc1.20.4-0.12.1 -lambdynamiclights=2.3.4+1.20.4-local +mod_menu=7.2.2 +lithium=mc1.20.1-0.11.2 +lambdynamiclights=2.3.2+1.20.1 patchouli=1.20.1-83-FABRIC rei=13.0.678 emi=1.0.24+1.20.2+fabric # Project details -mod_version=0.13.6+1.20.4 +mod_version=0.13.6+1.20.1 maven_group=io.github.realguyman archives_base_name=totally_lit diff --git a/src/main/java/io/github/realguyman/totally_lit/api/block/NoParticleTorchBlock.java b/src/main/java/io/github/realguyman/totally_lit/api/block/NoParticleTorchBlock.java index 0e0cfa4..2b32a1d 100644 --- a/src/main/java/io/github/realguyman/totally_lit/api/block/NoParticleTorchBlock.java +++ b/src/main/java/io/github/realguyman/totally_lit/api/block/NoParticleTorchBlock.java @@ -11,7 +11,7 @@ */ public class NoParticleTorchBlock extends TorchBlock { public NoParticleTorchBlock(Settings settings) { - super(null, settings); + super(settings, null); } @Override diff --git a/src/main/java/io/github/realguyman/totally_lit/api/block/NoParticleWallTorchBlock.java b/src/main/java/io/github/realguyman/totally_lit/api/block/NoParticleWallTorchBlock.java index 52633b5..e69b7ab 100644 --- a/src/main/java/io/github/realguyman/totally_lit/api/block/NoParticleWallTorchBlock.java +++ b/src/main/java/io/github/realguyman/totally_lit/api/block/NoParticleWallTorchBlock.java @@ -11,7 +11,7 @@ */ public class NoParticleWallTorchBlock extends WallTorchBlock { public NoParticleWallTorchBlock(Settings settings) { - super(null, settings); + super(settings, null); } @Override diff --git a/src/main/java/io/github/realguyman/totally_lit/mixin/campfire/ExtinguishInRainMixin.java b/src/main/java/io/github/realguyman/totally_lit/mixin/campfire/ExtinguishInRainMixin.java index afa1cc5..830bef2 100644 --- a/src/main/java/io/github/realguyman/totally_lit/mixin/campfire/ExtinguishInRainMixin.java +++ b/src/main/java/io/github/realguyman/totally_lit/mixin/campfire/ExtinguishInRainMixin.java @@ -2,6 +2,7 @@ import io.github.realguyman.totally_lit.TotallyLit; import io.github.realguyman.totally_lit.access.CampfireBlockEntityAccess; +import java.util.List; import net.minecraft.block.AbstractBlock; import net.minecraft.block.BlockState; import net.minecraft.block.CampfireBlock; @@ -48,6 +49,8 @@ private void extinguish(BlockState state, ServerWorld world, BlockPos pos, Rando world.playSound(null, pos, SoundEvents.ENTITY_GENERIC_EXTINGUISH_FIRE, SoundCategory.BLOCKS, 1.0F, 1.0F); ((CampfireBlockEntityAccess) blockEntity).totally_lit$setTicksBurntFor(0); } + + ci.cancel(); } } } diff --git a/src/main/java/io/github/realguyman/totally_lit/mixin/campfire/TrackTicksBurntForMixin.java b/src/main/java/io/github/realguyman/totally_lit/mixin/campfire/TrackTicksBurntForMixin.java index de63e04..73dbcb1 100644 --- a/src/main/java/io/github/realguyman/totally_lit/mixin/campfire/TrackTicksBurntForMixin.java +++ b/src/main/java/io/github/realguyman/totally_lit/mixin/campfire/TrackTicksBurntForMixin.java @@ -3,6 +3,7 @@ import io.github.realguyman.totally_lit.TotallyLit; import io.github.realguyman.totally_lit.access.CampfireBlockEntityAccess; import io.github.realguyman.totally_lit.registry.TagRegistry; +import java.util.List; import net.minecraft.block.BlockState; import net.minecraft.block.CampfireBlock; import net.minecraft.block.entity.CampfireBlockEntity; diff --git a/src/main/java/io/github/realguyman/totally_lit/mixin/candle/ClearAndCanScheduleMixin.java b/src/main/java/io/github/realguyman/totally_lit/mixin/candle/ClearAndCanScheduleMixin.java index e98c157..cb8590e 100644 --- a/src/main/java/io/github/realguyman/totally_lit/mixin/candle/ClearAndCanScheduleMixin.java +++ b/src/main/java/io/github/realguyman/totally_lit/mixin/candle/ClearAndCanScheduleMixin.java @@ -10,6 +10,7 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(Block.class) @@ -29,7 +30,7 @@ private void canSchedule(BlockState state, CallbackInfoReturnable cir) } @Inject(method = "onBreak", at = @At("HEAD")) - private void clearNextScheduledExtinguish(World world, BlockPos pos, BlockState state, PlayerEntity player, CallbackInfoReturnable cir) { + private void clearNextScheduledExtinguish(World world, BlockPos pos, BlockState state, PlayerEntity player, CallbackInfo ci) { if (!world.isClient() && AbstractCandleBlock.isLitCandle(state)) { ((ServerWorld) world).getBlockTickScheduler().clearNextTicks(new BlockBox(pos)); } diff --git a/src/main/java/io/github/realguyman/totally_lit/mixin/candle/ScheduleMixin.java b/src/main/java/io/github/realguyman/totally_lit/mixin/candle/ScheduleMixin.java index 0a976de..a59b44b 100644 --- a/src/main/java/io/github/realguyman/totally_lit/mixin/candle/ScheduleMixin.java +++ b/src/main/java/io/github/realguyman/totally_lit/mixin/candle/ScheduleMixin.java @@ -1,6 +1,7 @@ package io.github.realguyman.totally_lit.mixin.candle; import io.github.realguyman.totally_lit.TotallyLit; +import java.util.List; import net.minecraft.block.*; import net.minecraft.entity.passive.VillagerEntity; import net.minecraft.predicate.entity.EntityPredicates; @@ -21,7 +22,7 @@ public abstract class ScheduleMixin { @Shadow public abstract void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Random random); - @Inject(method = "randomTick", at = @At("HEAD")) + @Inject(method = "randomTick", at = @At("HEAD"), cancellable = true) private void schedule(BlockState state, ServerWorld world, BlockPos pos, Random random, CallbackInfo ci) { if (!AbstractCandleBlock.isLitCandle(state)) { return; @@ -45,6 +46,8 @@ private void schedule(BlockState state, ServerWorld world, BlockPos pos, Random world.scheduleBlockTick(pos, block, TotallyLit.CONFIG.candles.burnDuration()); } } + + ci.cancel(); } @Inject(method = "scheduledTick", at = @At("HEAD")) diff --git a/src/main/java/io/github/realguyman/totally_lit/mixin/jack_o_lantern/ClearAndCanScheduleMixin.java b/src/main/java/io/github/realguyman/totally_lit/mixin/jack_o_lantern/ClearAndCanScheduleMixin.java index 99c40cf..209a88d 100644 --- a/src/main/java/io/github/realguyman/totally_lit/mixin/jack_o_lantern/ClearAndCanScheduleMixin.java +++ b/src/main/java/io/github/realguyman/totally_lit/mixin/jack_o_lantern/ClearAndCanScheduleMixin.java @@ -10,6 +10,7 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(Block.class) @@ -29,7 +30,7 @@ private void canSchedule(BlockState state, CallbackInfoReturnable cir) } @Inject(method = "onBreak", at = @At("HEAD")) - private void clearNextScheduledExtinguish(World world, BlockPos pos, BlockState state, PlayerEntity player, CallbackInfoReturnable cir) { + private void clearNextScheduledExtinguish(World world, BlockPos pos, BlockState state, PlayerEntity player, CallbackInfo ci) { if (!world.isClient() && TotallyLit.JACK_O_LANTERN_MAP.containsKey(state.getBlock())) { ((ServerWorld) world).getBlockTickScheduler().clearNextTicks(new BlockBox(pos)); } diff --git a/src/main/java/io/github/realguyman/totally_lit/mixin/jack_o_lantern/ScheduleMixin.java b/src/main/java/io/github/realguyman/totally_lit/mixin/jack_o_lantern/ScheduleMixin.java index 8214aa7..d2eb5d3 100644 --- a/src/main/java/io/github/realguyman/totally_lit/mixin/jack_o_lantern/ScheduleMixin.java +++ b/src/main/java/io/github/realguyman/totally_lit/mixin/jack_o_lantern/ScheduleMixin.java @@ -1,6 +1,7 @@ package io.github.realguyman.totally_lit.mixin.jack_o_lantern; import io.github.realguyman.totally_lit.TotallyLit; +import java.util.List; import net.minecraft.block.*; import net.minecraft.entity.passive.VillagerEntity; import net.minecraft.predicate.entity.EntityPredicates; @@ -22,7 +23,7 @@ public abstract class ScheduleMixin { @Shadow public abstract void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, net.minecraft.util.math.random.Random random); - @Inject(method = "randomTick", at = @At("HEAD")) + @Inject(method = "randomTick", at = @At("HEAD"), cancellable = true) private void schedule(BlockState state, ServerWorld world, BlockPos pos, Random random, CallbackInfo ci) { if (!TotallyLit.JACK_O_LANTERN_MAP.containsKey(state.getBlock())) { return; @@ -42,6 +43,8 @@ private void schedule(BlockState state, ServerWorld world, BlockPos pos, Random world.scheduleBlockTick(pos, block, TotallyLit.CONFIG.jackOLanterns.burnDuration()); } } + + ci.cancel(); } @Inject(method = "scheduledTick", at = @At("HEAD")) diff --git a/src/main/java/io/github/realguyman/totally_lit/mixin/lantern/ClearAndCanScheduleMixin.java b/src/main/java/io/github/realguyman/totally_lit/mixin/lantern/ClearAndCanScheduleMixin.java index cdc9616..3373c8f 100644 --- a/src/main/java/io/github/realguyman/totally_lit/mixin/lantern/ClearAndCanScheduleMixin.java +++ b/src/main/java/io/github/realguyman/totally_lit/mixin/lantern/ClearAndCanScheduleMixin.java @@ -50,7 +50,7 @@ private void extinguishWhenPlacedInWater(World world, BlockPos pos, BlockState s } @Inject(method = "onBreak", at = @At("HEAD")) - private void clearNextScheduledExtinguish(World world, BlockPos pos, BlockState state, PlayerEntity player, CallbackInfoReturnable cir) { + private void clearNextScheduledExtinguish(World world, BlockPos pos, BlockState state, PlayerEntity player, CallbackInfo ci) { if (!world.isClient() && TotallyLit.LANTERN_MAP.containsKey(state.getBlock())) { ((ServerWorld) world).getBlockTickScheduler().clearNextTicks(new BlockBox(pos)); } diff --git a/src/main/java/io/github/realguyman/totally_lit/mixin/lantern/ScheduleMixin.java b/src/main/java/io/github/realguyman/totally_lit/mixin/lantern/ScheduleMixin.java index 1763c56..f38cea7 100644 --- a/src/main/java/io/github/realguyman/totally_lit/mixin/lantern/ScheduleMixin.java +++ b/src/main/java/io/github/realguyman/totally_lit/mixin/lantern/ScheduleMixin.java @@ -2,6 +2,7 @@ import io.github.realguyman.totally_lit.TotallyLit; import io.github.realguyman.totally_lit.registry.TagRegistry; +import java.util.List; import net.minecraft.block.*; import net.minecraft.entity.EntityType; import net.minecraft.entity.passive.VillagerEntity; @@ -25,7 +26,7 @@ public abstract class ScheduleMixin { @Shadow public abstract void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, net.minecraft.util.math.random.Random random); - @Inject(method = "randomTick", at = @At("HEAD")) + @Inject(method = "randomTick", at = @At("HEAD"), cancellable = true) private void schedule(BlockState state, ServerWorld world, BlockPos pos, Random random, CallbackInfo ci) { if (!TotallyLit.LANTERN_MAP.containsKey(state.getBlock())) { return; @@ -45,6 +46,8 @@ private void schedule(BlockState state, ServerWorld world, BlockPos pos, Random world.scheduleBlockTick(pos, block, TotallyLit.CONFIG.lanterns.burnDuration()); } } + + ci.cancel(); } @Inject(method = "scheduledTick", at = @At("HEAD")) diff --git a/src/main/java/io/github/realguyman/totally_lit/mixin/torch/ClearAndCanScheduleMixin.java b/src/main/java/io/github/realguyman/totally_lit/mixin/torch/ClearAndCanScheduleMixin.java index af70bd3..ff565c4 100644 --- a/src/main/java/io/github/realguyman/totally_lit/mixin/torch/ClearAndCanScheduleMixin.java +++ b/src/main/java/io/github/realguyman/totally_lit/mixin/torch/ClearAndCanScheduleMixin.java @@ -11,6 +11,7 @@ import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @Mixin(Block.class) @@ -30,7 +31,7 @@ private void canSchedule(BlockState state, CallbackInfoReturnable cir) } @Inject(method = "onBreak", at = @At("HEAD")) - private void clearNextScheduledExtinguish(World world, BlockPos pos, BlockState state, PlayerEntity player, CallbackInfoReturnable cir) { + private void clearNextScheduledExtinguish(World world, BlockPos pos, BlockState state, PlayerEntity player, CallbackInfo ci) { if (!world.isClient() && TotallyLit.TORCH_MAP.containsKey(state.getBlock())) { ((ServerWorld) world).getBlockTickScheduler().clearNextTicks(new BlockBox(pos)); } diff --git a/src/main/java/io/github/realguyman/totally_lit/mixin/torch/ScheduleMixin.java b/src/main/java/io/github/realguyman/totally_lit/mixin/torch/ScheduleMixin.java index 1aea343..8f6e01f 100644 --- a/src/main/java/io/github/realguyman/totally_lit/mixin/torch/ScheduleMixin.java +++ b/src/main/java/io/github/realguyman/totally_lit/mixin/torch/ScheduleMixin.java @@ -2,6 +2,7 @@ import io.github.realguyman.totally_lit.TotallyLit; import io.github.realguyman.totally_lit.registry.TagRegistry; +import java.util.List; import net.minecraft.block.*; import net.minecraft.entity.passive.VillagerEntity; import net.minecraft.predicate.entity.EntityPredicates; @@ -23,7 +24,7 @@ public abstract class ScheduleMixin { @Shadow public abstract void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, net.minecraft.util.math.random.Random random); - @Inject(method = "randomTick", at = @At("HEAD")) + @Inject(method = "randomTick", at = @At("HEAD"), cancellable = true) private void schedule(BlockState state, ServerWorld world, BlockPos pos, Random random, CallbackInfo ci) { if (!TotallyLit.TORCH_MAP.containsKey(state.getBlock())) { return; @@ -43,6 +44,8 @@ private void schedule(BlockState state, ServerWorld world, BlockPos pos, Random world.scheduleBlockTick(pos, block, TotallyLit.CONFIG.torches.burnDuration()); } } + + ci.cancel(); } @Inject(method = "scheduledTick", at = @At("HEAD")) diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index ca1f99e..98e00d3 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -21,10 +21,10 @@ }, "depends": { "java": ">=17", - "minecraft": "1.20.4", + "minecraft": "1.20.1", "fabricloader": ">=0.15.0", "fabric-api": "*", - "owo-lib": ">=0.12.0" + "owo-lib": ">=0.11.0" }, "breaks": { "hardcore_torches": "*"