Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,13 @@ public abstract class ExplosionMixin implements ExplosionBridge {
this.radius = Math.max(sizeIn, 0F);
}

/**
* @author IzzelAliz
* @reason
*/
@Overwrite
public void explode() {
@Inject(method = "explode", at = @At("HEAD"), cancellable = true)
public void arclight$explode(CallbackInfo ci) {
ci.cancel();
this.arclight$explodeImpl();
}

private void arclight$explodeImpl() {
if (this.radius < 0.1F) {
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import org.bukkit.craftbukkit.v.event.CraftEventFactory;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Overwrite;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
Expand All @@ -36,12 +35,14 @@ public abstract class ChorusFlowerBlockMixin extends BlockMixin {
@Shadow protected abstract void placeDeadFlower(Level worldIn, BlockPos pos);
// @formatter:on

/**
* @author IzzelAliz
* @reason
*/
@Overwrite
public void randomTick(BlockState state, ServerLevel worldIn, BlockPos pos, RandomSource random) {
@Inject(method = "randomTick", at = @At("HEAD"), cancellable = true)
public void arclight$randomTick(BlockState state, ServerLevel worldIn, BlockPos pos, RandomSource random, CallbackInfo ci) {
// Call the original logic but make it cancellable for compatibility
this.arclight$performRandomTick(state, worldIn, pos, random);
ci.cancel(); // Prevent original method execution
}

private void arclight$performRandomTick(BlockState state, ServerLevel worldIn, BlockPos pos, RandomSource random) {
BlockPos blockpos = pos.above();
if (worldIn.isEmptyBlock(blockpos) && blockpos.getY() < 256) {
int i = state.getValue(AGE);
Expand Down
2 changes: 1 addition & 1 deletion arclight-forge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import java.security.MessageDigest

plugins {
id 'com.github.johnrengelman.shadow' version '7.0.0' apply false
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
}

apply plugin: 'java'
Expand Down