forked from MagicBane/Server
Equipment slot refactor started.
This commit is contained in:
@@ -9,10 +9,10 @@
|
||||
|
||||
package engine.objects;
|
||||
|
||||
import engine.Enum;
|
||||
import engine.Enum.ItemContainerType;
|
||||
import engine.Enum.OwnerType;
|
||||
import engine.gameManager.DbManager;
|
||||
import engine.server.MBServerStatics;
|
||||
import org.pmw.tinylog.Logger;
|
||||
|
||||
import java.net.UnknownHostException;
|
||||
@@ -111,13 +111,13 @@ public class Kit extends AbstractGameObject {
|
||||
* Getters
|
||||
*/
|
||||
|
||||
private static boolean kitItemCreator(PlayerCharacter pc, int itemBase, int slot) {
|
||||
private static boolean kitItemCreator(PlayerCharacter pc, int itemBase, Enum.EquipSlotType slot) {
|
||||
|
||||
Item item = new Item(itemBase);
|
||||
item.ownerID = pc.getObjectUUID();
|
||||
item.ownerType = OwnerType.PlayerCharacter;
|
||||
item.containerType = ItemContainerType.EQUIPPED;
|
||||
item.equipSlot = (byte) slot;
|
||||
item.equipSlot = slot;
|
||||
|
||||
try {
|
||||
item = DbManager.ItemQueries.PERSIST(item);
|
||||
@@ -409,15 +409,15 @@ public class Kit extends AbstractGameObject {
|
||||
|
||||
public void equipPCwithKit(PlayerCharacter pc) {
|
||||
if (weapon != 0)
|
||||
kitItemCreator(pc, weapon, MBServerStatics.SLOT_MAINHAND);
|
||||
kitItemCreator(pc, weapon, Enum.EquipSlotType.RHELD);
|
||||
if (offhand != 0)
|
||||
kitItemCreator(pc, offhand, MBServerStatics.SLOT_OFFHAND);
|
||||
kitItemCreator(pc, offhand, Enum.EquipSlotType.LHELD);
|
||||
if (chest != 0)
|
||||
kitItemCreator(pc, chest, MBServerStatics.SLOT_CHEST);
|
||||
kitItemCreator(pc, chest, Enum.EquipSlotType.CHEST);
|
||||
if (legs != 0)
|
||||
kitItemCreator(pc, legs, MBServerStatics.SLOT_LEGGINGS);
|
||||
kitItemCreator(pc, legs, Enum.EquipSlotType.LEGS);
|
||||
if (feet != 0)
|
||||
kitItemCreator(pc, feet, MBServerStatics.SLOT_FEET);
|
||||
kitItemCreator(pc, feet, Enum.EquipSlotType.FEET);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user