fix crash with Abnormals Core
change random display tick mixin injection type from @Redirect to @Inject
This commit is contained in:
@@ -4,7 +4,7 @@ org.gradle.daemon=false
|
|||||||
group = com.github.octarine-noise
|
group = com.github.octarine-noise
|
||||||
jarName = BetterFoliage-Forge
|
jarName = BetterFoliage-Forge
|
||||||
|
|
||||||
version = 2.6.1
|
version = 2.6.2
|
||||||
|
|
||||||
mcVersion = 1.16.5
|
mcVersion = 1.16.5
|
||||||
forgeVersion = 36.1.17
|
forgeVersion = 36.1.17
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
package mods.betterfoliage.mixin;
|
package mods.betterfoliage.mixin;
|
||||||
|
|
||||||
import mods.betterfoliage.Hooks;
|
import mods.betterfoliage.Hooks;
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.BlockState;
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.client.renderer.WorldRenderer;
|
import net.minecraft.client.renderer.WorldRenderer;
|
||||||
import net.minecraft.client.world.ClientWorld;
|
import net.minecraft.client.world.ClientWorld;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.IBlockReader;
|
import net.minecraft.world.IBlockReader;
|
||||||
import net.minecraft.world.World;
|
|
||||||
import org.spongepowered.asm.mixin.Mixin;
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
import org.spongepowered.asm.mixin.injection.At;
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@@ -26,10 +26,9 @@ public class MixinClientWorld {
|
|||||||
/**
|
/**
|
||||||
* Inject a callback to call for every random display tick. Used for adding custom particle effects to blocks.
|
* Inject a callback to call for every random display tick. Used for adding custom particle effects to blocks.
|
||||||
*/
|
*/
|
||||||
@Redirect(method = worldAnimateTick, at = @At(value = "INVOKE", target = blockAnimateTick))
|
@Inject(method = worldAnimateTick, at = @At(value = "INVOKE", target = blockAnimateTick))
|
||||||
void onAnimateTick(Block block, BlockState state, World world, BlockPos pos, Random random) {
|
void onAnimateTick(int x, int y, int z, int range, Random random, boolean doBarrier, BlockPos.Mutable pos, CallbackInfo ci) {
|
||||||
Hooks.onRandomDisplayTick(block, state, (ClientWorld) world, pos, random);
|
Hooks.onRandomDisplayTick((ClientWorld) (Object) this, pos, random);
|
||||||
block.animateTick(state, world, pos, random);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ fun onClientBlockChanged(worldClient: ClientWorld, pos: BlockPos, oldState: Bloc
|
|||||||
ChunkOverlayManager.onBlockChange(worldClient, pos)
|
ChunkOverlayManager.onBlockChange(worldClient, pos)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onRandomDisplayTick(block: Block, state: BlockState, world: ClientWorld, pos: BlockPos, random: Random) {
|
fun onRandomDisplayTick(world: ClientWorld, pos: BlockPos, random: Random) {
|
||||||
|
val state = world.getBlockState(pos)
|
||||||
if (Config.enabled &&
|
if (Config.enabled &&
|
||||||
Config.risingSoul.enabled &&
|
Config.risingSoul.enabled &&
|
||||||
state.block == Blocks.SOUL_SAND &&
|
state.block == Blocks.SOUL_SAND &&
|
||||||
|
|||||||
Reference in New Issue
Block a user