lead fix and unloaded entity fix
This commit is contained in:
1 parent
800b26bf18
commit
f9e90ded2a
5 files changed
+60
-6
No files matched your search
@@ -0,0 +1,28 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.settings.CarpetSettings;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.mob.MobEntity;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
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.CallbackInfo;
|
||||
|
||||
@Mixin(MobEntity.class)
|
||||
public abstract class MobEntity_leashMixin
|
||||
{
|
||||
@Shadow /*@Nullable*/ private Entity holdingEntity;
|
||||
|
||||
@Shadow /*@Nullable*/ private CompoundTag leashTag;
|
||||
|
||||
@Inject(method = "writeCustomDataToTag", at = @At("TAIL"))
|
||||
private void addLeashData(CompoundTag compoundTag_1, CallbackInfo ci)
|
||||
{
|
||||
if (holdingEntity == null && CarpetSettings.leadFix && leashTag != null)
|
||||
{
|
||||
compoundTag_1.put("Leash", leashTag);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.settings.CarpetSettings;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(ServerWorld.class)
|
||||
public class ServerWorld_unloadedEntityMixin
|
||||
{
|
||||
@Redirect(method = "checkChunk", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/entity/Entity;teleportRequested()Z"
|
||||
))
|
||||
private boolean addFastEntityCheck(Entity entity)
|
||||
{
|
||||
return CarpetSettings.unloadedEntityFix || entity.teleportRequested();
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ public class CarpetSettings
|
||||
@Rule( desc = "Shulkers will respawn in end cities", category = FEATURE )
|
||||
public static boolean shulkerSpawningInEndCities = false;
|
||||
|
||||
@Rule(desc = "Entities pushed or moved into unloaded chunks no longer disappear", category = {EXPERIMENTAL, BUGFIX}, validate = Validator.WIP.class)
|
||||
@Rule(desc = "Entities pushed or moved into unloaded chunks no longer disappear", category = {EXPERIMENTAL, BUGFIX})
|
||||
public static boolean unloadedEntityFix = false;
|
||||
|
||||
@Rule( desc = "TNT doesn't update when placed against a power source", category = CREATIVE )
|
||||
@@ -164,7 +164,11 @@ public class CarpetSettings
|
||||
@Rule(desc = "Enables /tick command to control game clocks", category = COMMAND)
|
||||
public static boolean commandTick = true;
|
||||
|
||||
@Rule(desc = "Enables /log command to monitor events in the game via chat and overlays", category = COMMAND)
|
||||
@Rule(
|
||||
desc = "Enables /log command to monitor events in the game via chat and overlays",
|
||||
category = COMMAND,
|
||||
validate = Validator.WIP.class
|
||||
)
|
||||
public static boolean commandLog = true;
|
||||
|
||||
@Rule(
|
||||
@@ -388,8 +392,7 @@ public class CarpetSettings
|
||||
@Rule(
|
||||
desc = "Fixes leads breaking/becoming invisible in unloaded chunks",
|
||||
extra = "You may still get visibly broken leash links on the client side, but server side the link is still there.",
|
||||
category = BUGFIX,
|
||||
validate = Validator.WIP.class
|
||||
category = BUGFIX
|
||||
)
|
||||
public static boolean leadFix = false;
|
||||
|
||||
|
||||
@@ -47,13 +47,13 @@ public abstract class Validator<T>
|
||||
if (source != null)
|
||||
try
|
||||
{
|
||||
Messenger.m(source, "r "+currentRule.name+" is not yet fully implemented - we are still working on it.");
|
||||
Messenger.m(source, "r "+currentRule.name+" is missing a few bits - we are still working on it.");
|
||||
}
|
||||
catch (NullPointerException ignored) { }
|
||||
return newValue;
|
||||
}
|
||||
@Override
|
||||
public String description() { return "Its not yet fully implemented - we are working on it";}
|
||||
public String description() { return "A few bits still needs implementing - we are working on it";}
|
||||
}
|
||||
public static class _STRICT<T> extends Validator<T>
|
||||
{
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
"ThreadedAnvilChunkStorage_tickMixin",
|
||||
|
||||
"MobEntityMixin",
|
||||
"ServerWorld_unloadedEntityMixin",
|
||||
"MobEntity_leashMixin",
|
||||
|
||||
"ServerPlayNetworkHandlerMixin",
|
||||
"MinecraftServer_scarpetMixin",
|
||||
|
||||
Reference in new issue
Block a user