1 parent
330fd6f466
commit
5e9b391ac4
3 files changed
+41
-1
No files matched your search
@@ -1102,4 +1102,13 @@ public class CarpetSettings
|
|||||||
)
|
)
|
||||||
public static boolean creativePlayersLoadChunks = true;
|
public static boolean creativePlayersLoadChunks = true;
|
||||||
|
|
||||||
|
@Rule(
|
||||||
|
desc = "Customizable sculk sensor range",
|
||||||
|
options = {"8", "16", "32"},
|
||||||
|
category = CREATIVE,
|
||||||
|
strict = false,
|
||||||
|
validate = PushLimitLimits.class
|
||||||
|
)
|
||||||
|
public static int sculkSensorRange = 8;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
package carpet.mixins;
|
||||||
|
|
||||||
|
import carpet.CarpetSettings;
|
||||||
|
import net.minecraft.world.level.block.SculkSensorBlock;
|
||||||
|
import org.spongepowered.asm.mixin.Final;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.Shadow;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Inject;
|
||||||
|
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
|
@Mixin(SculkSensorBlock.class)
|
||||||
|
public class SculkSensorBlock_rangeMixin {
|
||||||
|
|
||||||
|
@Shadow
|
||||||
|
@Final
|
||||||
|
private int listenerRange;
|
||||||
|
|
||||||
|
|
||||||
|
@Inject(
|
||||||
|
method = "getListenerRange()I",
|
||||||
|
at = @At("HEAD"),
|
||||||
|
cancellable = true
|
||||||
|
)
|
||||||
|
public void getListenerRange(CallbackInfoReturnable<Integer> cir) {
|
||||||
|
if (CarpetSettings.sculkSensorRange != this.listenerRange) {
|
||||||
|
cir.setReturnValue(CarpetSettings.sculkSensorRange);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -194,7 +194,8 @@
|
|||||||
"Level_updateSuppressionCrashFixMixin",
|
"Level_updateSuppressionCrashFixMixin",
|
||||||
"MinecraftServer_updateSuppressionCrashFixMixin",
|
"MinecraftServer_updateSuppressionCrashFixMixin",
|
||||||
"ServerPlayer_updateSuppressionCrashFixMixin",
|
"ServerPlayer_updateSuppressionCrashFixMixin",
|
||||||
"ChunkMap_creativePlayersLoadChunksMixin"
|
"ChunkMap_creativePlayersLoadChunksMixin",
|
||||||
|
"SculkSensorBlock_rangeMixin"
|
||||||
],
|
],
|
||||||
"client": [
|
"client": [
|
||||||
"Timer_tickSpeedMixin",
|
"Timer_tickSpeedMixin",
|
||||||
|
|||||||
Reference in new issue
Block a user