No need for setActiveClass to return boolean.
This commit is contained in:
+5
-6
@@ -9782,13 +9782,12 @@ public class PlayerInstance extends Playable
|
|||||||
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
|
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
|
||||||
* <font color="00FF00"/>WARNING: Use only on subclase change</font>
|
* <font color="00FF00"/>WARNING: Use only on subclase change</font>
|
||||||
* @param classIndex
|
* @param classIndex
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public boolean setActiveClass(int classIndex)
|
public void setActiveClass(int classIndex)
|
||||||
{
|
{
|
||||||
if (!_subclassLock.tryLock())
|
if (!_subclassLock.tryLock())
|
||||||
{
|
{
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -9796,7 +9795,7 @@ public class PlayerInstance extends Playable
|
|||||||
// Cannot switch or change subclasses while transformed
|
// Cannot switch or change subclasses while transformed
|
||||||
if (isTransformed())
|
if (isTransformed())
|
||||||
{
|
{
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove active item skills before saving char to database
|
// Remove active item skills before saving char to database
|
||||||
@@ -9851,7 +9850,7 @@ public class PlayerInstance extends Playable
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_classIndex = classIndex;
|
_classIndex = classIndex;
|
||||||
@@ -9936,7 +9935,7 @@ public class PlayerInstance extends Playable
|
|||||||
sendPacket(new ExStorageMaxCount(this));
|
sendPacket(new ExStorageMaxCount(this));
|
||||||
|
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
+5
-6
@@ -9789,13 +9789,12 @@ public class PlayerInstance extends Playable
|
|||||||
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
|
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
|
||||||
* <font color="00FF00"/>WARNING: Use only on subclase change</font>
|
* <font color="00FF00"/>WARNING: Use only on subclase change</font>
|
||||||
* @param classIndex
|
* @param classIndex
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public boolean setActiveClass(int classIndex)
|
public void setActiveClass(int classIndex)
|
||||||
{
|
{
|
||||||
if (!_subclassLock.tryLock())
|
if (!_subclassLock.tryLock())
|
||||||
{
|
{
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -9803,7 +9802,7 @@ public class PlayerInstance extends Playable
|
|||||||
// Cannot switch or change subclasses while transformed
|
// Cannot switch or change subclasses while transformed
|
||||||
if (isTransformed())
|
if (isTransformed())
|
||||||
{
|
{
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove active item skills before saving char to database
|
// Remove active item skills before saving char to database
|
||||||
@@ -9858,7 +9857,7 @@ public class PlayerInstance extends Playable
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_classIndex = classIndex;
|
_classIndex = classIndex;
|
||||||
@@ -9943,7 +9942,7 @@ public class PlayerInstance extends Playable
|
|||||||
sendPacket(new ExStorageMaxCount(this));
|
sendPacket(new ExStorageMaxCount(this));
|
||||||
|
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
+5
-6
@@ -9774,13 +9774,12 @@ public class PlayerInstance extends Playable
|
|||||||
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
|
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
|
||||||
* <font color="00FF00"/>WARNING: Use only on subclase change</font>
|
* <font color="00FF00"/>WARNING: Use only on subclase change</font>
|
||||||
* @param classIndex
|
* @param classIndex
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public boolean setActiveClass(int classIndex)
|
public void setActiveClass(int classIndex)
|
||||||
{
|
{
|
||||||
if (!_subclassLock.tryLock())
|
if (!_subclassLock.tryLock())
|
||||||
{
|
{
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -9788,7 +9787,7 @@ public class PlayerInstance extends Playable
|
|||||||
// Cannot switch or change subclasses while transformed
|
// Cannot switch or change subclasses while transformed
|
||||||
if (isTransformed())
|
if (isTransformed())
|
||||||
{
|
{
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove active item skills before saving char to database
|
// Remove active item skills before saving char to database
|
||||||
@@ -9843,7 +9842,7 @@ public class PlayerInstance extends Playable
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_classIndex = classIndex;
|
_classIndex = classIndex;
|
||||||
@@ -9928,7 +9927,7 @@ public class PlayerInstance extends Playable
|
|||||||
sendPacket(new ExStorageMaxCount(this));
|
sendPacket(new ExStorageMaxCount(this));
|
||||||
|
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
+5
-6
@@ -9801,13 +9801,12 @@ public class PlayerInstance extends Playable
|
|||||||
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
|
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
|
||||||
* <font color="00FF00"/>WARNING: Use only on subclase change</font>
|
* <font color="00FF00"/>WARNING: Use only on subclase change</font>
|
||||||
* @param classIndex
|
* @param classIndex
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public boolean setActiveClass(int classIndex)
|
public void setActiveClass(int classIndex)
|
||||||
{
|
{
|
||||||
if (!_subclassLock.tryLock())
|
if (!_subclassLock.tryLock())
|
||||||
{
|
{
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -9815,7 +9814,7 @@ public class PlayerInstance extends Playable
|
|||||||
// Cannot switch or change subclasses while transformed
|
// Cannot switch or change subclasses while transformed
|
||||||
if (isTransformed())
|
if (isTransformed())
|
||||||
{
|
{
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove active item skills before saving char to database
|
// Remove active item skills before saving char to database
|
||||||
@@ -9870,7 +9869,7 @@ public class PlayerInstance extends Playable
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_classIndex = classIndex;
|
_classIndex = classIndex;
|
||||||
@@ -9955,7 +9954,7 @@ public class PlayerInstance extends Playable
|
|||||||
sendPacket(new ExStorageMaxCount(this));
|
sendPacket(new ExStorageMaxCount(this));
|
||||||
|
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
+5
-6
@@ -9801,13 +9801,12 @@ public class PlayerInstance extends Playable
|
|||||||
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
|
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
|
||||||
* <font color="00FF00"/>WARNING: Use only on subclase change</font>
|
* <font color="00FF00"/>WARNING: Use only on subclase change</font>
|
||||||
* @param classIndex
|
* @param classIndex
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public boolean setActiveClass(int classIndex)
|
public void setActiveClass(int classIndex)
|
||||||
{
|
{
|
||||||
if (!_subclassLock.tryLock())
|
if (!_subclassLock.tryLock())
|
||||||
{
|
{
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -9815,7 +9814,7 @@ public class PlayerInstance extends Playable
|
|||||||
// Cannot switch or change subclasses while transformed
|
// Cannot switch or change subclasses while transformed
|
||||||
if (isTransformed())
|
if (isTransformed())
|
||||||
{
|
{
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove active item skills before saving char to database
|
// Remove active item skills before saving char to database
|
||||||
@@ -9870,7 +9869,7 @@ public class PlayerInstance extends Playable
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_classIndex = classIndex;
|
_classIndex = classIndex;
|
||||||
@@ -9955,7 +9954,7 @@ public class PlayerInstance extends Playable
|
|||||||
sendPacket(new ExStorageMaxCount(this));
|
sendPacket(new ExStorageMaxCount(this));
|
||||||
|
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
+5
-6
@@ -9696,13 +9696,12 @@ public class PlayerInstance extends Playable
|
|||||||
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
|
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
|
||||||
* <font color="00FF00"/>WARNING: Use only on subclase change</font>
|
* <font color="00FF00"/>WARNING: Use only on subclase change</font>
|
||||||
* @param classIndex
|
* @param classIndex
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public boolean setActiveClass(int classIndex)
|
public void setActiveClass(int classIndex)
|
||||||
{
|
{
|
||||||
if (!_subclassLock.tryLock())
|
if (!_subclassLock.tryLock())
|
||||||
{
|
{
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -9710,7 +9709,7 @@ public class PlayerInstance extends Playable
|
|||||||
// Cannot switch or change subclasses while transformed
|
// Cannot switch or change subclasses while transformed
|
||||||
if (isTransformed())
|
if (isTransformed())
|
||||||
{
|
{
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove active item skills before saving char to database
|
// Remove active item skills before saving char to database
|
||||||
@@ -9765,7 +9764,7 @@ public class PlayerInstance extends Playable
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_classIndex = classIndex;
|
_classIndex = classIndex;
|
||||||
@@ -9849,7 +9848,7 @@ public class PlayerInstance extends Playable
|
|||||||
sendPacket(new ExStorageMaxCount(this));
|
sendPacket(new ExStorageMaxCount(this));
|
||||||
|
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
+5
-6
@@ -9789,13 +9789,12 @@ public class PlayerInstance extends Playable
|
|||||||
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
|
* An index of zero specifies the character's original (base) class, while indexes 1-3 specifies the character's sub-classes respectively.<br>
|
||||||
* <font color="00FF00"/>WARNING: Use only on subclase change</font>
|
* <font color="00FF00"/>WARNING: Use only on subclase change</font>
|
||||||
* @param classIndex
|
* @param classIndex
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
public boolean setActiveClass(int classIndex)
|
public void setActiveClass(int classIndex)
|
||||||
{
|
{
|
||||||
if (!_subclassLock.tryLock())
|
if (!_subclassLock.tryLock())
|
||||||
{
|
{
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@@ -9803,7 +9802,7 @@ public class PlayerInstance extends Playable
|
|||||||
// Cannot switch or change subclasses while transformed
|
// Cannot switch or change subclasses while transformed
|
||||||
if (isTransformed())
|
if (isTransformed())
|
||||||
{
|
{
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove active item skills before saving char to database
|
// Remove active item skills before saving char to database
|
||||||
@@ -9858,7 +9857,7 @@ public class PlayerInstance extends Playable
|
|||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
|
LOGGER.log(Level.WARNING, "Could not switch " + getName() + "'s sub class to class index " + classIndex + ": " + e.getMessage(), e);
|
||||||
return false;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_classIndex = classIndex;
|
_classIndex = classIndex;
|
||||||
@@ -9943,7 +9942,7 @@ public class PlayerInstance extends Playable
|
|||||||
sendPacket(new ExStorageMaxCount(this));
|
sendPacket(new ExStorageMaxCount(this));
|
||||||
|
|
||||||
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
EventDispatcher.getInstance().notifyEventAsync(new OnPlayerSubChange(this), this);
|
||||||
return true;
|
return;
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user