leash fixes
This commit is contained in:
1 parent
68cb8a509f
commit
8d97b5bf01
4 files changed
+37
-2
No files matched your search
@@ -0,0 +1,34 @@
|
|||||||
|
package carpet.mixins;
|
||||||
|
|
||||||
|
import carpet.settings.CarpetSettings;
|
||||||
|
import net.minecraft.client.network.packet.EntityAttachS2CPacket;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.mob.MobEntity;
|
||||||
|
import net.minecraft.network.Packet;
|
||||||
|
import net.minecraft.server.network.EntityTrackerEntry;
|
||||||
|
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.CallbackInfo;
|
||||||
|
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
@Mixin(EntityTrackerEntry.class)
|
||||||
|
public class EntityTrackerEntry_leashFixMixin
|
||||||
|
{
|
||||||
|
@Shadow @Final private Entity entity;
|
||||||
|
|
||||||
|
@Inject(method = "sendPackets", at = @At("RETURN"))
|
||||||
|
private void sendLeashPackets(Consumer<Packet<?>> consumer_1, CallbackInfo ci)
|
||||||
|
{
|
||||||
|
if (CarpetSettings.leadFix)
|
||||||
|
{
|
||||||
|
if (entity instanceof MobEntity)
|
||||||
|
{
|
||||||
|
consumer_1.accept( new EntityAttachS2CPacket(entity, ((MobEntity) entity).getHoldingEntity()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -230,7 +230,7 @@ public class BlockInfo
|
|||||||
}
|
}
|
||||||
creature.remove();
|
creature.remove();
|
||||||
long total_time = (total_ticks)/1000/20;
|
long total_time = (total_ticks)/1000/20;
|
||||||
return Messenger.s(String.format(" - Wander chance above: %.1f%%%%\n - Average standby above: %s",
|
return Messenger.s(String.format(" - Wander chance above: %.1f%%\n - Average standby above: %s",
|
||||||
(100.0F*success)/1000,
|
(100.0F*success)/1000,
|
||||||
((total_time>5000)?"INFINITY":(Long.toString(total_time)+" s"))
|
((total_time>5000)?"INFINITY":(Long.toString(total_time)+" s"))
|
||||||
));
|
));
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ public class EntityInfo
|
|||||||
public static List<BaseText> entityInfo(Entity e, World source_world)
|
public static List<BaseText> entityInfo(Entity e, World source_world)
|
||||||
{
|
{
|
||||||
List<BaseText> lst = new ArrayList<>();
|
List<BaseText> lst = new ArrayList<>();
|
||||||
lst.add(Messenger.s("w Use /data get entity command"));
|
lst.add(Messenger.c("r Use /data get entity command"));
|
||||||
return lst;
|
return lst;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -26,6 +26,7 @@
|
|||||||
"MobEntityMixin",
|
"MobEntityMixin",
|
||||||
"ServerWorld_unloadedEntityMixin",
|
"ServerWorld_unloadedEntityMixin",
|
||||||
"MobEntity_leashMixin",
|
"MobEntity_leashMixin",
|
||||||
|
"EntityTrackerEntry_leashFixMixin",
|
||||||
|
|
||||||
"VillagerEntity_aiMixin",
|
"VillagerEntity_aiMixin",
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user