cleanLogs rule
This commit is contained in:
1 parent
e759a368b9
commit
046d931770
5 files changed
+56
-3
No files matched your search
@@ -656,4 +656,14 @@ public class CarpetSettings
|
|||||||
validate = Validator.PROBABILITY.class
|
validate = Validator.PROBABILITY.class
|
||||||
)
|
)
|
||||||
public static double creativeFlyDrag = 0.09;
|
public static double creativeFlyDrag = 0.09;
|
||||||
|
|
||||||
|
@Rule(
|
||||||
|
desc = "Removes abnoxious messages from the logs",
|
||||||
|
extra = {
|
||||||
|
"Doesn't display 'Maximum sound pool size 247 reached'",
|
||||||
|
"Which is normal with decent farms and contraptions"
|
||||||
|
},
|
||||||
|
category = {SURVIVAL, CLIENT}
|
||||||
|
)
|
||||||
|
public static boolean cleanLogs = false;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package carpet.mixins;
|
||||||
|
|
||||||
|
import carpet.CarpetSettings;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
|
@Mixin(targets="net.minecraft.client.sound.SoundEngine$SourceSetImpl")
|
||||||
|
public class SoundEngineInt_cleanLogsMixin
|
||||||
|
{
|
||||||
|
@Redirect(method = "createSource", at = @At(
|
||||||
|
value="INVOKE",
|
||||||
|
target = "Lorg/apache/logging/log4j/Logger;warn(Ljava/lang/String;Ljava/lang/Object;)V"
|
||||||
|
))
|
||||||
|
private void doWarnOrNotWarn(Logger logger, String message, Object p0)
|
||||||
|
{
|
||||||
|
if (!CarpetSettings.cleanLogs) logger.warn(message, p0);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package carpet.mixins;
|
||||||
|
|
||||||
|
import carpet.CarpetSettings;
|
||||||
|
import net.minecraft.client.sound.SoundSystem;
|
||||||
|
import org.apache.logging.log4j.Logger;
|
||||||
|
import org.spongepowered.asm.mixin.Mixin;
|
||||||
|
import org.spongepowered.asm.mixin.injection.At;
|
||||||
|
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||||
|
|
||||||
|
@Mixin(SoundSystem.class)
|
||||||
|
public class SoundSystem_cleanLogsMixin
|
||||||
|
{
|
||||||
|
@Redirect(method = "play(Lnet/minecraft/client/sound/SoundInstance;)V", at = @At(
|
||||||
|
value = "INVOKE",
|
||||||
|
target = "Lorg/apache/logging/log4j/Logger;warn(Ljava/lang/String;)V"
|
||||||
|
))
|
||||||
|
private void toWarnOrNotToWarn(Logger logger, String message)
|
||||||
|
{
|
||||||
|
if (!CarpetSettings.cleanLogs) logger.warn(message);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -494,9 +494,8 @@ __handle_entity(e) ->
|
|||||||
put(shapes_to_display, null, abnoxious_to_display, 'extend');
|
put(shapes_to_display, null, abnoxious_to_display, 'extend');
|
||||||
|
|
||||||
if (labels_to_add,
|
if (labels_to_add,
|
||||||
base_pos = [0.5, e~'height'+0.4, 0.5];
|
|
||||||
base_height = 0;
|
base_height = 0;
|
||||||
snap = if(e~'type'=='player', 'xyz', 'dxydz');
|
[snap, base_pos] = if(e~'type'=='player', ['xyz', [0, e~'height', 0]], ['dxydz', [0.5, e~'height'+0.4, 0.5]]);
|
||||||
for (labels_to_add,
|
for (labels_to_add,
|
||||||
if (length(_) == 2,
|
if (length(_) == 2,
|
||||||
[label, text] = _;
|
[label, text] = _;
|
||||||
|
|||||||
@@ -198,7 +198,10 @@
|
|||||||
"WorldRenderer_creativeNoClipMixin",
|
"WorldRenderer_creativeNoClipMixin",
|
||||||
"ClientPlayNetworkHandlerMixin",
|
"ClientPlayNetworkHandlerMixin",
|
||||||
"DebugRenderer_scarpetRenderMixin",
|
"DebugRenderer_scarpetRenderMixin",
|
||||||
"WorldRenderer_scarpetRenderMixin"
|
"WorldRenderer_scarpetRenderMixin",
|
||||||
|
|
||||||
|
"SoundEngineInt_cleanLogsMixin",
|
||||||
|
"SoundSystem_cleanLogsMixin"
|
||||||
],
|
],
|
||||||
"server": [
|
"server": [
|
||||||
],
|
],
|
||||||
|
|||||||
Reference in new issue
Block a user