Skip to content

Commit

Permalink
Merge pull request #32 from Patbox/master
Browse files Browse the repository at this point in the history
Fix crashes
  • Loading branch information
samolego authored Dec 29, 2022
2 parents 83377c1 + db6c5a8 commit 1e5ab93
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,7 @@ private void disguiseEntity(Packet<?> packet, PacketCallbacks callbacks, Callbac
if (!this.disguiselib$skipCheck) {
World world = this.player.getEntityWorld();
Entity entity = null;
if (packet instanceof PlayerListS2CPacket && ((PlayerListS2CPacket) packet).getActions().stream().toList().get(0).equals(PlayerListS2CPacket.Action.ADD_PLAYER)) {
Entry entry = ((PlayerListS2CPacketAccessor) packet).getEntries().get(0);
if (this.player.getGameProfile().getId().equals(entry.profileId()) && ((EntityDisguise) this.player).isDisguised()) {
entity = this.player;
}
} else if (packet instanceof PlayerSpawnS2CPacket) {
if (packet instanceof PlayerSpawnS2CPacket) {
entity = world.getEntityById(((PlayerSpawnS2CPacketAccessor) packet).getId());
} else if (packet instanceof EntitySpawnS2CPacket) {
entity = world.getEntityById(((EntitySpawnS2CPacketAccessor) packet).getEntityId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static Packet<?> universalSpawnPacket(Entity entity) {
*/
public static EntitySpawnS2CPacket fakeMobSpawnS2CPacket(Entity entity) {
EntityDisguise disguise = (EntityDisguise) entity;
EntitySpawnS2CPacket packet = new EntitySpawnS2CPacket((LivingEntity) disguise.getDisguiseEntity());
EntitySpawnS2CPacket packet = new EntitySpawnS2CPacket(disguise.getDisguiseEntity());

EntitySpawnS2CPacketAccessor accessor = (EntitySpawnS2CPacketAccessor) packet;
accessor.setEntityId(entity.getId());
Expand Down
1 change: 1 addition & 0 deletions fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

"depends": {
"fabricloader": ">=0.7.4",
"minecraft": ">=1.19.3",
"fabric": "*"
}
}
2 changes: 1 addition & 1 deletion forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ side = "SERVER"
[[dependencies.disguiselib]]
modId = "minecraft"
mandatory = true
versionRange = "[1.16.5,)"
versionRange = "[1.19.3,)"
ordering = "NONE"
side = "SERVER"
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ loader_version=0.14.11
#Fabric api
fabric_version=0.69.1+1.19.3
#Forge
forge_version=41.0.87
forge_enabled=false
forge_version=44.0.41
forge_enabled=true
# Mod Properties
mod_version=1.3.2
mod_version=1.3.3
maven_group=xyz.nucleoid
archives_base_name = disguiselib

0 comments on commit 1e5ab93

Please sign in to comment.