Skip to content

Commit

Permalink
adjust to review and add todo
Browse files Browse the repository at this point in the history
  • Loading branch information
Raycoms committed Nov 12, 2024
1 parent 3d798a7 commit 3d94fb0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -767,9 +767,9 @@ public ITickRateStateMachine<IState> getAI()
}

@Override
public String getTeamName()
public int getTeamId()
{
// All raiders are in the same team. You're doomed!
return "raider";
return -1;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public void knockback(double power, double xRatio, double zRatio)
@Override
public boolean hurt(final DamageSource dmgSource, final float dmg)
{
if (dmgSource.getEntity() instanceof AbstractFastMinecoloniesEntity otherFastMinecolEntity && otherFastMinecolEntity.getTeamName().equals(getTeamName()))
if (dmgSource.getEntity() instanceof AbstractFastMinecoloniesEntity otherFastMinecolEntity && otherFastMinecolEntity.getTeamId() == getTeamId())
{
return false;
}
Expand All @@ -365,7 +365,8 @@ public boolean hurt(final DamageSource dmgSource, final float dmg)

/**
* Get the team name of this entity.
* todo sam make colony ids unique across dimensions.
* @return the team name.
*/
public abstract String getTeamName();
public abstract int getTeamId();
}
Original file line number Diff line number Diff line change
Expand Up @@ -1984,8 +1984,8 @@ public void setMaxAir(final int maxAir)
}

@Override
public String getTeamName()
public int getTeamId()
{
return level().dimension().hashCode() + "_" + citizenColonyHandler.getColonyId();
return citizenColonyHandler.getColonyId();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,8 @@ private static boolean isValidSpawnForMercenaries(final LevelAccessor world, fin
}

@Override
public String getTeamName()
public int getTeamId()
{
return level().dimension().hashCode() + "_" + colonyId;
return colonyId;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -691,8 +691,8 @@ public void setRemoved(final RemovalReason reason)
}

@Override
public String getTeamName()
public int getTeamId()
{
return level().dimension().hashCode() + "_" + citizenColonyHandler.getColonyId();
return citizenColonyHandler.getColonyId();
}
}

0 comments on commit 3d94fb0

Please sign in to comment.