1.8.3
This commit is contained in:
parent
ed846f19ee
commit
f6a5883702
11 changed files with 83 additions and 10 deletions
|
|
@ -241,7 +241,7 @@ public class KitsManager {
|
|||
String id = item.getId();
|
||||
|
||||
//Check if the item must be put in the player equipment
|
||||
if((id.contains("_HELMET") || id.contains("PLAYER_HELMET") || id.contains("SKULL_ITEM")) && itemHelmet == null && (playerInventory.getHelmet() == null
|
||||
if((id.contains("_HELMET") || id.contains("PLAYER_HEAD") || id.contains("SKULL_ITEM")) && itemHelmet == null && (playerInventory.getHelmet() == null
|
||||
|| playerInventory.getHelmet().getType().equals(Material.AIR))){
|
||||
itemHelmet = item;
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -156,13 +156,25 @@ public class Kit {
|
|||
cooldown = defaultKit.getCooldown();
|
||||
oneTime = defaultKit.isOneTime();
|
||||
permissionRequired = defaultKit.isPermissionRequired();
|
||||
claimActions = defaultKit.getClaimActions();
|
||||
errorActions = defaultKit.getErrorActions();
|
||||
displayItemDefault = defaultKit.getDisplayItemDefault();
|
||||
displayItemNoPermission = defaultKit.getDisplayItemNoPermission();
|
||||
displayItemCooldown = defaultKit.getDisplayItemCooldown();
|
||||
displayItemOneTime = defaultKit.getDisplayItemOneTime();
|
||||
displayItemOneTimeRequirements = defaultKit.getDisplayItemOneTimeRequirements();
|
||||
if(defaultKit.getClaimActions() != null){
|
||||
ArrayList<KitAction> actions = new ArrayList<>();
|
||||
for(KitAction action : defaultKit.getClaimActions()){
|
||||
actions.add(action.clone());
|
||||
}
|
||||
claimActions = actions;
|
||||
}
|
||||
if(defaultKit.getErrorActions() != null){
|
||||
ArrayList<KitAction> actions = new ArrayList<>();
|
||||
for(KitAction action : defaultKit.getErrorActions()){
|
||||
actions.add(action.clone());
|
||||
}
|
||||
errorActions = actions;
|
||||
}
|
||||
displayItemDefault = defaultKit.getDisplayItemDefault() != null ? defaultKit.getDisplayItemDefault().clone() : null;
|
||||
displayItemNoPermission = defaultKit.getDisplayItemNoPermission() != null ? defaultKit.getDisplayItemNoPermission().clone() : null;
|
||||
displayItemCooldown = defaultKit.getDisplayItemCooldown() != null ? defaultKit.getDisplayItemCooldown().clone() : null;
|
||||
displayItemOneTime = defaultKit.getDisplayItemOneTime() != null ? defaultKit.getDisplayItemOneTime().clone() : null;
|
||||
displayItemOneTimeRequirements = defaultKit.getDisplayItemOneTimeRequirements() != null ? defaultKit.getDisplayItemOneTimeRequirements().clone() : null;
|
||||
autoArmor = defaultKit.isAutoArmor();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,4 +46,9 @@ public class KitAction {
|
|||
public void setCountAsItem(boolean countAsItem) {
|
||||
this.countAsItem = countAsItem;
|
||||
}
|
||||
|
||||
public KitAction clone(){
|
||||
KitItem item = displayItem != null ? displayItem.clone() : null;
|
||||
return new KitAction(action,item,executeBeforeItems,countAsItem);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package pk.ajneb97.model.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class KitItem{
|
||||
|
|
@ -209,4 +210,31 @@ public class KitItem {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public KitItem clone(){
|
||||
KitItem kitItem = new KitItem(id);
|
||||
kitItem.setAmount(amount);
|
||||
kitItem.setName(name);
|
||||
kitItem.setLore(lore != null ? new ArrayList<>(lore) : null);
|
||||
kitItem.setDurability(durability);
|
||||
kitItem.setCustomModelData(customModelData);
|
||||
kitItem.setEnchants(enchants != null ? new ArrayList<>(enchants) : null);
|
||||
kitItem.setFlags(flags != null ? new ArrayList<>(flags) : null);
|
||||
kitItem.setBookEnchants(bookEnchants != null ? new ArrayList<>(bookEnchants) : null);
|
||||
kitItem.setColor(color);
|
||||
kitItem.setNbt(nbt != null ? new ArrayList<>(nbt) : null);
|
||||
kitItem.setAttributes(attributes != null ? new ArrayList<>(attributes) : null);
|
||||
|
||||
kitItem.setSkullData(skullData != null ? skullData.clone() : null);
|
||||
kitItem.setPotionData(potionData != null ? potionData.clone() : null);
|
||||
kitItem.setFireworkData(fireworkData != null ? fireworkData.clone() : null);
|
||||
kitItem.setBannerData(bannerData != null ? bannerData.clone() : null);
|
||||
kitItem.setBookData(bookData != null ? bookData.clone() : null);
|
||||
kitItem.setTrimData(trimData != null ? trimData.clone() : null);
|
||||
|
||||
kitItem.setPreviewSlot(previewSlot);
|
||||
kitItem.setOffhand(offhand);
|
||||
|
||||
return kitItem;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package pk.ajneb97.model.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class KitItemBannerData {
|
||||
|
|
@ -23,4 +24,8 @@ public class KitItemBannerData {
|
|||
public void setBaseColor(String baseColor) {
|
||||
this.baseColor = baseColor;
|
||||
}
|
||||
|
||||
public KitItemBannerData clone(){
|
||||
return new KitItemBannerData(new ArrayList<>(patterns),baseColor);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package pk.ajneb97.model.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class KitItemBookData {
|
||||
|
|
@ -39,4 +40,8 @@ public class KitItemBookData {
|
|||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public KitItemBookData clone(){
|
||||
return new KitItemBookData(new ArrayList<>(pages),author,generation,title);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package pk.ajneb97.model.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class KitItemFireworkData {
|
||||
|
|
@ -31,4 +32,8 @@ public class KitItemFireworkData {
|
|||
public void setFireworkPower(int fireworkPower) {
|
||||
this.fireworkPower = fireworkPower;
|
||||
}
|
||||
|
||||
public KitItemFireworkData clone(){
|
||||
return new KitItemFireworkData(new ArrayList<>(fireworkRocketEffects),fireworkStarEffect,fireworkPower);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package pk.ajneb97.model.item;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class KitItemPotionData {
|
||||
|
|
@ -48,4 +49,8 @@ public class KitItemPotionData {
|
|||
public void setPotionEffects(List<String> potionEffects) {
|
||||
this.potionEffects = potionEffects;
|
||||
}
|
||||
|
||||
public KitItemPotionData clone(){
|
||||
return new KitItemPotionData(upgraded,extended,potionType,potionColor,new ArrayList<>(potionEffects));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,4 +29,8 @@ public class KitItemSkullData {
|
|||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public KitItemSkullData clone(){
|
||||
return new KitItemSkullData(owner,texture,id);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,4 +25,8 @@ public class KitItemTrimData {
|
|||
public void setMaterial(String material) {
|
||||
this.material = material;
|
||||
}
|
||||
|
||||
public KitItemTrimData clone(){
|
||||
return new KitItemTrimData(pattern,material);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
main: pk.ajneb97.PlayerKits2
|
||||
version: 1.8.2
|
||||
version: 1.8.3
|
||||
name: PlayerKits2
|
||||
api-version: 1.13
|
||||
softdepend: [Vault,PlaceholderAPI]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue