Proper naming for various methods and variables.

This commit is contained in:
MobiusDevelopment
2021-12-26 22:17:47 +00:00
parent f5f80399c5
commit 3e61211e14
369 changed files with 1098 additions and 1099 deletions

View File

@@ -432,7 +432,7 @@ public class InstanceManager implements IXmlReader
* @param isInside when {@code true} find world where player is currently located, otherwise find world where player can enter
* @return instance if found, otherwise {@code null}
*/
public Instance getPlayer(Player player, boolean isInside)
public Instance getPlayerInstance(Player player, boolean isInside)
{
for (Instance instance : _instanceWorlds.values())
{

View File

@@ -421,12 +421,12 @@ public abstract class ItemContainer
*/
public Item detachItem(String process, int itemObjectId, long count, ItemLocation newLocation, Player actor, Object reference)
{
final Item Item = getItemByObjectId(itemObjectId);
if (Item == null)
final Item item = getItemByObjectId(itemObjectId);
if (item == null)
{
return null;
}
return detachItem(process, Item, count, newLocation, actor, reference);
return detachItem(process, item, count, newLocation, actor, reference);
}
/**

View File

@@ -984,21 +984,21 @@ public class Formulas
*/
public static double calcAttributeBonus(Creature attacker, Creature target, Skill skill)
{
int attack_attribute;
int defence_attribute;
int attackAttribute;
int defenceAttribute;
if ((skill != null) && (skill.getAttributeType() != AttributeType.NONE))
{
attack_attribute = attacker.getAttackElementValue(skill.getAttributeType()) + skill.getAttributeValue();
defence_attribute = target.getDefenseElementValue(skill.getAttributeType());
attackAttribute = attacker.getAttackElementValue(skill.getAttributeType()) + skill.getAttributeValue();
defenceAttribute = target.getDefenseElementValue(skill.getAttributeType());
}
else
{
attack_attribute = attacker.getAttackElementValue(attacker.getAttackElement());
defence_attribute = target.getDefenseElementValue(attacker.getAttackElement());
attackAttribute = attacker.getAttackElementValue(attacker.getAttackElement());
defenceAttribute = target.getDefenseElementValue(attacker.getAttackElement());
}
final int diff = attack_attribute - defence_attribute;
final int diff = attackAttribute - defenceAttribute;
if (diff > 0)
{
return Math.min(1.025 + (Math.sqrt(Math.pow(diff, 3) / 2) * 0.0001), 1.25);

View File

@@ -171,7 +171,7 @@ public class EnterWorld implements IClientIncomingPacket
if (Config.RESTORE_PLAYER_INSTANCE)
{
final PlayerVariables vars = player.getVariables();
final Instance instance = InstanceManager.getInstance().getPlayer(player, false);
final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false);
if ((instance != null) && (instance.getId() == vars.getInt("INSTANCE_RESTORE", 0)))
{
player.setInstance(instance);

View File

@@ -37,7 +37,7 @@ public class ExInzoneWaiting implements IClientOutgoingPacket
public ExInzoneWaiting(Player player)
{
final Instance instance = InstanceManager.getInstance().getPlayer(player, false);
final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false);
_currentTemplateId = ((instance != null) && (instance.getTemplateId() >= 0)) ? instance.getTemplateId() : -1;
_instanceTimes = InstanceManager.getInstance().getAllInstanceTimes(player);
}

View File

@@ -68,7 +68,7 @@ public class ExListPartyMatchingWaitingRoom implements IClientOutgoingPacket
packet.writeS(player.getName());
packet.writeD(player.getClassId().getId());
packet.writeD(player.getLevel());
final Instance instance = InstanceManager.getInstance().getPlayer(player, false);
final Instance instance = InstanceManager.getInstance().getPlayerInstance(player, false);
packet.writeD((instance != null) && (instance.getTemplateId() >= 0) ? instance.getTemplateId() : -1);
final Map<Integer, Long> instanceTimes = InstanceManager.getInstance().getAllInstanceTimes(player);
packet.writeD(instanceTimes.size());