-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIceBlockMixin.java
More file actions
22 lines (20 loc) · 869 Bytes
/
IceBlockMixin.java
File metadata and controls
22 lines (20 loc) · 869 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package westeroscraft.mixin;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.block.IceBlock;
import net.minecraft.world.level.block.state.BlockState;
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 westeroscraft.config.WesterosCraftConfig;
@Mixin(IceBlock.class)
public abstract class IceBlockMixin {
@Inject(method = "randomTick", at = @At("HEAD"), cancellable = true)
private void onRandomTick(BlockState state, ServerLevel level, BlockPos pos, RandomSource random, CallbackInfo ci) {
if (WesterosCraftConfig.disableIceMelt) {
ci.cancel();
}
}
}