Merge branch 'master' into 1.17
# Conflicts: # src/main/java/carpet/network/ClientNetworkHandler.java # src/main/resources/assets/carpet/scripts/ai_tracker.sc
This commit is contained in:
commit
8f2c935fe6
6 files changed
+96
-98
No files matched your search
@@ -0,0 +1,21 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.world.biome.source.BiomeArray;
|
||||
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(BiomeArray.class)
|
||||
public class BiomeArray_cleanLogsMixin
|
||||
{
|
||||
@Redirect(method = "<init>(Lnet/minecraft/util/collection/IndexedIterable;[I)V", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lorg/apache/logging/log4j/Logger;warn(Ljava/lang/String;)V")
|
||||
)
|
||||
private void skipLog(Logger logger, String message)
|
||||
{
|
||||
if (!CarpetSettings.cleanLogs) logger.warn(message);
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import java.util.function.BiConsumer;
|
||||
|
||||
public class ClientNetworkHandler
|
||||
{
|
||||
private static Map<String, BiConsumer<ClientPlayerEntity, NbtElement>> dataHandlers = new HashMap<String, BiConsumer<ClientPlayerEntity, NbtElement>>();
|
||||
private static final Map<String, BiConsumer<ClientPlayerEntity, NbtElement>> dataHandlers = new HashMap<String, BiConsumer<ClientPlayerEntity, NbtElement>>();
|
||||
static
|
||||
{
|
||||
dataHandlers.put("Rules", (p, t) -> {
|
||||
@@ -61,7 +61,7 @@ public class ClientNetworkHandler
|
||||
if (rule != null)
|
||||
{
|
||||
String value = ruleNBT.getString("Value");
|
||||
rule.set(null, value);
|
||||
try { rule.set(null, value); } catch (Exception ignored) { }
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -133,8 +133,15 @@ public class ClientNetworkHandler
|
||||
if (compound == null) return;
|
||||
for (String key: compound.getKeys())
|
||||
{
|
||||
if (dataHandlers.containsKey(key))
|
||||
dataHandlers.get(key).accept(player, compound.get(key));
|
||||
if (dataHandlers.containsKey(key)) {
|
||||
try {
|
||||
dataHandlers.get(key).accept(player, compound.get(key));
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
CarpetSettings.LOG.info("Corrupt carpet data for "+key);
|
||||
}
|
||||
}
|
||||
else
|
||||
CarpetSettings.LOG.error("Unknown carpet data: "+key);
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class FixedCommandSource extends ServerCommandSource
|
||||
public FixedCommandSource(ServerCommandSource original, Vec3d pos, Value[] error, List<Value> chatOutput)
|
||||
{
|
||||
super(CommandOutput.DUMMY, pos, Vec2f.ZERO, original.getWorld(), CarpetSettings.runPermissionLevel,
|
||||
original.getName(), original.getDisplayName(), original.getMinecraftServer(), original.getEntity(), true,
|
||||
original.getName(), original.getDisplayName(), original.getMinecraftServer(), original.getEntity(), false,
|
||||
(ctx, succ, res) -> { }, EntityAnchorArgumentType.EntityAnchor.FEET);
|
||||
position = pos;
|
||||
world = original.getWorld();
|
||||
@@ -80,11 +80,9 @@ public class FixedCommandSource extends ServerCommandSource
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ServerCommandSource withSilent()
|
||||
{
|
||||
return this;
|
||||
}
|
||||
//@Override // only used in fuctions and we really don't care to track these actually, besides the basic output
|
||||
// also other overrides target ONLY execute command, which withSilent doesn't care bout.
|
||||
//public ServerCommandSource withSilent() { return this; }
|
||||
|
||||
@Override
|
||||
public ServerCommandSource withLevel(int level)
|
||||
|
||||
Reference in new issue
Block a user