Skip to content

Commit

Permalink
Fix coruptions; 1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
samolego committed Oct 28, 2021
1 parent 0891a8a commit cbafa88
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ public abstract class EntityMixin_Disguise implements EntityDisguise, DisguiseUt

@Shadow public abstract boolean isOnFire();

@Shadow public abstract Text getDisplayName();

/**
* Tells you the disguised status.
*
Expand Down Expand Up @@ -136,7 +138,7 @@ public void disguiseAs(EntityType<?> entityType) {

if(entityType == PLAYER) {
if(this.disguiselib$profile == null)
this.setGameProfile(new GameProfile(this.uuid, this.getName().getString()));
this.setGameProfile(new GameProfile(this.uuid, this.getDisplayName().getString()));
this.disguiselib$constructFakePlayer(this.disguiselib$profile);
} else {
// Why null check? Well, if entity was disguised via EntityDisguise#disguiseAs(Entity), this field is already set
Expand Down Expand Up @@ -205,7 +207,9 @@ public void removeDisguise() {
this.disguiselib$hideSelfView();
}
// Disguising entity as itself
this.disguiselib$disguiseEntity = null;
this.disguiselib$disguiseEntity = this.disguiselib$entity;
this.disguiselib$disguiseType =this.getType();

this.disguiseAs(this.getType());

// Setting as not-disguised
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public class FakePackets {
* @return fake entity spawn packet (Either player)
*/
public static Packet<?> universalSpawnPacket(Entity entity) {
// fixme - disguising non-living kicks you (just upon disguise)
Entity disguise = ((EntityDisguise) entity).getDisguiseEntity();
if(disguise == null) {
disguise = entity;
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ fabric_version=0.40.1+1.17
forge_version=37.0.69

# Mod Properties
mod_version = 1.0.10
mod_version = 1.1.0
maven_group = xyz.nucleoid
archives_base_name = disguiselib

0 comments on commit cbafa88

Please sign in to comment.