add dynamic texture changing
This commit is contained in:
parent
aea7c5f7a2
commit
b26e405d41
2 changed files with 13 additions and 4 deletions
|
@ -26,7 +26,7 @@ public class WrapperEntity implements Tickable, TrackedEntity {
|
|||
private boolean ticking;
|
||||
protected Location location;
|
||||
private Location preRidingLocation;
|
||||
private final Set<UUID> viewers;
|
||||
protected final Set<UUID> viewers;
|
||||
private boolean onGround;
|
||||
private boolean spawned;
|
||||
private Vector3d velocity;
|
||||
|
|
|
@ -68,10 +68,19 @@ public class WrapperPlayer extends WrapperLivingEntity {
|
|||
|
||||
public void setTextureProperties(List<TextureProperty> textureProperties) {
|
||||
profile.setTextureProperties(textureProperties);
|
||||
despawn();
|
||||
System.out.println("Despawning");
|
||||
EntityLib.getApi().runLater(() -> spawn(getLocation()), 2L);
|
||||
WrapperPlayServerDestroyEntities destroyEntities = new WrapperPlayServerDestroyEntities(getEntityId());
|
||||
WrapperPlayServerPlayerInfoRemove removePacket = new WrapperPlayServerPlayerInfoRemove(getUuid());
|
||||
WrapperPlayServerPlayerInfoUpdate updatePacket = tabListPacket();
|
||||
{
|
||||
sendPacketToViewers(removePacket);
|
||||
sendPacketToViewers(destroyEntities);
|
||||
|
||||
sendPacketToViewers(updatePacket);
|
||||
for (UUID viewer : viewers) {
|
||||
removeViewer(viewer);
|
||||
addViewer(viewer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public GameMode getGameMode() {
|
||||
|
|
Loading…
Reference in a new issue