傻逼UUID😅
This commit is contained in:
parent
d57bd9016a
commit
b4ea5bb23a
6 changed files with 59 additions and 26 deletions
|
@ -1,5 +1,6 @@
|
|||
package com.atsuishio.superbwarfare.entity;
|
||||
|
||||
import com.atsuishio.superbwarfare.Mod;
|
||||
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
|
||||
import com.atsuishio.superbwarfare.init.ModDamageTypes;
|
||||
import com.atsuishio.superbwarfare.init.ModEntities;
|
||||
|
@ -125,11 +126,16 @@ public class Blu43Entity extends Entity implements GeoEntity, OwnableEntity {
|
|||
} else {
|
||||
String s = compound.getString("Owner");
|
||||
|
||||
try {
|
||||
if (this.getServer() == null) {
|
||||
uuid = UUID.fromString(s);
|
||||
} else {
|
||||
uuid = OldUsersConverter.convertMobOwnerIfNecessary(this.getServer(), s);
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
Mod.LOGGER.error("Couldn't load owner UUID of {}: {}", this, exception);
|
||||
uuid = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (uuid != null) {
|
||||
|
|
|
@ -130,11 +130,16 @@ public class ClaymoreEntity extends Entity implements GeoEntity, OwnableEntity {
|
|||
} else {
|
||||
String s = compound.getString("Owner");
|
||||
|
||||
try {
|
||||
if (this.getServer() == null) {
|
||||
uuid = UUID.fromString(s);
|
||||
} else {
|
||||
uuid = OldUsersConverter.convertMobOwnerIfNecessary(this.getServer(), s);
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
Mod.LOGGER.error("Couldn't load owner UUID of {}: {}", this, exception);
|
||||
uuid = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (uuid != null) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.atsuishio.superbwarfare.entity;
|
||||
|
||||
import com.atsuishio.superbwarfare.Mod;
|
||||
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
||||
import com.atsuishio.superbwarfare.entity.vehicle.damage.DamageModifier;
|
||||
import com.atsuishio.superbwarfare.init.ModDamageTypes;
|
||||
|
@ -134,11 +135,16 @@ public class Tm62Entity extends Entity implements GeoEntity, OwnableEntity {
|
|||
} else {
|
||||
String s = compound.getString("Owner");
|
||||
|
||||
try {
|
||||
if (this.getServer() == null) {
|
||||
uuid = UUID.fromString(s);
|
||||
} else {
|
||||
uuid = OldUsersConverter.convertMobOwnerIfNecessary(this.getServer(), s);
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
Mod.LOGGER.error("Couldn't load owner UUID of {}: {}", this, exception);
|
||||
uuid = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (uuid != null) {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.atsuishio.superbwarfare.entity.projectile;
|
||||
|
||||
import com.atsuishio.superbwarfare.Mod;
|
||||
import com.atsuishio.superbwarfare.config.server.ExplosionConfig;
|
||||
import com.atsuishio.superbwarfare.init.ModDamageTypes;
|
||||
import com.atsuishio.superbwarfare.init.ModEntities;
|
||||
|
@ -144,11 +145,16 @@ public class C4Entity extends Entity implements GeoEntity, OwnableEntity {
|
|||
} else {
|
||||
String s = compound.getString("Owner");
|
||||
|
||||
try {
|
||||
if (this.getServer() == null) {
|
||||
uuid = UUID.fromString(s);
|
||||
} else {
|
||||
uuid = OldUsersConverter.convertMobOwnerIfNecessary(this.getServer(), s);
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
Mod.LOGGER.error("Couldn't load owner UUID of {}: {}", this, exception);
|
||||
uuid = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (uuid != null) {
|
||||
|
|
|
@ -110,7 +110,7 @@ public class Hpj11Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
|||
}
|
||||
|
||||
@Override
|
||||
public void addAdditionalSaveData(CompoundTag compound) {
|
||||
public void addAdditionalSaveData(@NotNull CompoundTag compound) {
|
||||
super.addAdditionalSaveData(compound);
|
||||
compound.putInt("AnimTime", this.entityData.get(ANIM_TIME));
|
||||
compound.putBoolean("Active", this.entityData.get(ACTIVE));
|
||||
|
@ -120,7 +120,7 @@ public class Hpj11Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
|||
}
|
||||
|
||||
@Override
|
||||
public void readAdditionalSaveData(CompoundTag compound) {
|
||||
public void readAdditionalSaveData(@NotNull CompoundTag compound) {
|
||||
super.readAdditionalSaveData(compound);
|
||||
this.entityData.set(ANIM_TIME, compound.getInt("AnimTime"));
|
||||
this.entityData.set(ACTIVE, compound.getBoolean("Active"));
|
||||
|
@ -131,11 +131,16 @@ public class Hpj11Entity extends ContainerMobileVehicleEntity implements GeoEnti
|
|||
} else {
|
||||
String s = compound.getString("Owner");
|
||||
|
||||
try {
|
||||
if (this.getServer() == null) {
|
||||
uuid = UUID.fromString(s);
|
||||
} else {
|
||||
uuid = OldUsersConverter.convertMobOwnerIfNecessary(this.getServer(), s);
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
Mod.LOGGER.error("Couldn't load owner UUID of {}: {}", this, exception);
|
||||
uuid = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (uuid != null) {
|
||||
|
|
|
@ -110,11 +110,16 @@ public class LaserTowerEntity extends VehicleEntity implements GeoEntity, Ownabl
|
|||
} else {
|
||||
String s = compound.getString("Owner");
|
||||
|
||||
try {
|
||||
if (this.getServer() == null) {
|
||||
uuid = UUID.fromString(s);
|
||||
} else {
|
||||
uuid = OldUsersConverter.convertMobOwnerIfNecessary(this.getServer(), s);
|
||||
}
|
||||
} catch (Exception exception) {
|
||||
Mod.LOGGER.error("Couldn't load owner UUID of {}: {}", this, exception);
|
||||
uuid = null;
|
||||
}
|
||||
}
|
||||
|
||||
if (uuid != null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue