Fix commands brought with ThirdPersonRemoteClientSystem. Were not working, did redundant checks.
@@ -121,39 +121,30 @@ public void ensureHeldItemIsMountedOnLoad(OnChangedComponent event, EntityRef cl
@Command(shortDescription = "Sets the held item mount point translation for remote characters")
public void setRemotePlayersHeldItemMountPointTranslations(@CommandParam("x") float x, @CommandParam("y") float y, @CommandParam("z") float z) {
- for (EntityRef remotePlayer : entityManager.getEntitiesWith(CharacterComponent.class, PlayerCharacterComponent.class)) {
- if (relatesToLocalPlayer(remotePlayer)) {
- RemotePersonHeldItemMountPointComponent newComponent = remotePlayer.getComponent(RemotePersonHeldItemMountPointComponent.class);
- if (newComponent != null) {
- newComponent.translate = new Vector3f(x, y, z);
- ensureClientSideEntityOnHeldItemMountPoint(OnActivatedComponent.newInstance(), remotePlayer, newComponent);
- }
+ for (EntityRef remotePlayer : entityManager.getEntitiesWith(RemotePersonHeldItemMountPointComponent.class)) {
+ RemotePersonHeldItemMountPointComponent remoteMountPointComponent = remotePlayer.getComponent(RemotePersonHeldItemMountPointComponent.class);
+ if (remoteMountPointComponent != null) {
+ remoteMountPointComponent.translate.set(x, y, z);
}
}
}
@Command(shortDescription = "Sets the held item mount point rotation for remote characters")
public void setRemotePlayersHeldItemMountPointRotations(@CommandParam("x") float x, @CommandParam("y") float y, @CommandParam("z") float z) {
- for (EntityRef remotePlayer : entityManager.getEntitiesWith(CharacterComponent.class, PlayerCharacterComponent.class)) {
- if (relatesToLocalPlayer(remotePlayer)) {
- RemotePersonHeldItemMountPointComponent newComponent = remotePlayer.getComponent(RemotePersonHeldItemMountPointComponent.class);
- if (newComponent != null) {
- newComponent.rotateDegrees = new Vector3f(x, y, z);
- ensureClientSideEntityOnHeldItemMountPoint(OnActivatedComponent.newInstance(), remotePlayer, newComponent);
- }
+ for (EntityRef remotePlayer : entityManager.getEntitiesWith(RemotePersonHeldItemMountPointComponent.class)) {
+ RemotePersonHeldItemMountPointComponent remoteMountPointComponent = remotePlayer.getComponent(RemotePersonHeldItemMountPointComponent.class);
+ if (remoteMountPointComponent != null) {
+ remoteMountPointComponent.rotateDegrees.set(x, y, z);
}
}
}
@Command(shortDescription = "Sets the held item mount point scale for remote characters")
public void setRemotePlayersHeldItemMountPointScale(@CommandParam("scale") float scale) {
- for (EntityRef remotePlayer : entityManager.getEntitiesWith(CharacterComponent.class, PlayerCharacterComponent.class)) {
- if (relatesToLocalPlayer(remotePlayer)) {
- RemotePersonHeldItemMountPointComponent newComponent = remotePlayer.getComponent(RemotePersonHeldItemMountPointComponent.class);
- if (newComponent != null) {
- newComponent.scale = scale;
- ensureClientSideEntityOnHeldItemMountPoint(OnActivatedComponent.newInstance(), remotePlayer, newComponent);
- }
+ for (EntityRef remotePlayer : entityManager.getEntitiesWith(RemotePersonHeldItemMountPointComponent.class)) {
+ RemotePersonHeldItemMountPointComponent remoteMountPointComponent = remotePlayer.getComponent(RemotePersonHeldItemMountPointComponent.class);
+ if (remoteMountPointComponent != null) {
+ remoteMountPointComponent.scale = scale;
}
}
}
