Begin work on 1.13.2
This commit is contained in:
parent
6fe13d6a4b
commit
5d889b0e77
6
pom.xml
6
pom.xml
|
@ -25,19 +25,19 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.spigotmc</groupId>
|
<groupId>org.spigotmc</groupId>
|
||||||
<artifactId>spigot-api</artifactId>
|
<artifactId>spigot-api</artifactId>
|
||||||
<version>1.12-R0.1-SNAPSHOT</version>
|
<version>1.13.2-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>craftbukkit</artifactId>
|
<artifactId>craftbukkit</artifactId>
|
||||||
<version>1.12.2-R0.1-SNAPSHOT</version>
|
<version>1.13.2-R0.1-SNAPSHOT</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.bukkit</groupId>
|
<groupId>org.bukkit</groupId>
|
||||||
<artifactId>bukkit</artifactId>
|
<artifactId>bukkit</artifactId>
|
||||||
<version>1.12.2-R0.1-SNAPSHOT</version>
|
<version>1.13.2-R0.1-SNAPSHOT</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.tr7zw</groupId>
|
<groupId>de.tr7zw</groupId>
|
||||||
|
|
|
@ -108,7 +108,7 @@ public class SwingEvent implements Listener{
|
||||||
if(Storage.swingers.contains(p) && ClassicSword.isCShield(p.getInventory().getItemInMainHand())) {
|
if(Storage.swingers.contains(p) && ClassicSword.isCShield(p.getInventory().getItemInMainHand())) {
|
||||||
p.getInventory().setItemInMainHand(ClassicSword.toBlockShield(p.getInventory().getItemInMainHand(), CItemType.getType(ClassicSword.getCShieldShortName(p.getInventory().getItemInMainHand()))));
|
p.getInventory().setItemInMainHand(ClassicSword.toBlockShield(p.getInventory().getItemInMainHand(), CItemType.getType(ClassicSword.getCShieldShortName(p.getInventory().getItemInMainHand()))));
|
||||||
//p.playSound(p.getLocation(), Sound.ENTITY_IRONGOLEM_STEP, 10.0F, 1.0F);
|
//p.playSound(p.getLocation(), Sound.ENTITY_IRONGOLEM_STEP, 10.0F, 1.0F);
|
||||||
p.playSound(p.getLocation(), Sound.ENTITY_IRONGOLEM_STEP, 10.0F, 1.0F);
|
p.playSound(p.getLocation(), Sound.ENTITY_IRON_GOLEM_STEP, 10.0F, 1.0F);
|
||||||
|
|
||||||
if(Storage.recent.containsKey(p)) {
|
if(Storage.recent.containsKey(p)) {
|
||||||
final Player damaged = Storage.recent.get(p);
|
final Player damaged = Storage.recent.get(p);
|
||||||
|
@ -177,20 +177,20 @@ public class SwingEvent implements Listener{
|
||||||
}, 14L);
|
}, 14L);
|
||||||
|
|
||||||
|
|
||||||
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BELL, 1.0F, 1.4F);
|
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_BELL, 1.0F, 1.4F);
|
||||||
Storage.perfect.remove(p);
|
Storage.perfect.remove(p);
|
||||||
Storage.great.remove(p);
|
Storage.great.remove(p);
|
||||||
Storage.kb.add(damaged);
|
Storage.kb.add(damaged);
|
||||||
ClassicSwordsMain.runKB(damaged);
|
ClassicSwordsMain.runKB(damaged);
|
||||||
}else if(Storage.great.contains(p)) {
|
}else if(Storage.great.contains(p)) {
|
||||||
ClassicSword.sendActionbar(p, "§eGreat!");
|
ClassicSword.sendActionbar(p, "§eGreat!");
|
||||||
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BELL, 1.0F, 1.2F);
|
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_BELL, 1.0F, 1.2F);
|
||||||
Storage.perfect.add(p);
|
Storage.perfect.add(p);
|
||||||
Storage.kb.add(damaged);
|
Storage.kb.add(damaged);
|
||||||
ClassicSwordsMain.runKB(damaged);
|
ClassicSwordsMain.runKB(damaged);
|
||||||
}else {
|
}else {
|
||||||
ClassicSword.sendActionbar(p, "§cGood!");
|
ClassicSword.sendActionbar(p, "§cGood!");
|
||||||
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BELL, 1.0F, 1.0F);
|
p.playSound(p.getLocation(), Sound.BLOCK_NOTE_BLOCK_BELL, 1.0F, 1.0F);
|
||||||
ClassicSwordsMain.streakTimer(p);
|
ClassicSwordsMain.streakTimer(p);
|
||||||
Storage.great.add(p);
|
Storage.great.add(p);
|
||||||
Storage.kb.add(damaged);
|
Storage.kb.add(damaged);
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
package com.fpghoti.classicswords.item;
|
package com.fpghoti.classicswords.item;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack;
|
import org.bukkit.craftbukkit.v1_13_R2.inventory.CraftItemStack;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemFlag;
|
import org.bukkit.inventory.ItemFlag;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.meta.ItemMeta;
|
import org.bukkit.inventory.meta.ItemMeta;
|
||||||
|
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.minecraft.server.v1_12_R1.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_12_R1.NBTTagDouble;
|
import net.minecraft.server.v1_13_R2.NBTTagDouble;
|
||||||
import net.minecraft.server.v1_12_R1.NBTTagInt;
|
import net.minecraft.server.v1_13_R2.NBTTagInt;
|
||||||
import net.minecraft.server.v1_12_R1.NBTTagList;
|
import net.minecraft.server.v1_13_R2.NBTTagList;
|
||||||
import net.minecraft.server.v1_12_R1.NBTTagString;
|
import net.minecraft.server.v1_13_R2.NBTTagString;
|
||||||
|
|
||||||
public class CItem {
|
public class CItem {
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ public class CItem {
|
||||||
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
||||||
meta.setDisplayName("Classic Diamond Sword");
|
meta.setDisplayName("Classic Diamond Sword");
|
||||||
csword.setItemMeta(meta);
|
csword.setItemMeta(meta);
|
||||||
net.minecraft.server.v1_12_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
net.minecraft.server.v1_13_R2.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
||||||
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
||||||
NBTTagList modifiers = new NBTTagList();
|
NBTTagList modifiers = new NBTTagList();
|
||||||
NBTTagCompound damage = new NBTTagCompound();
|
NBTTagCompound damage = new NBTTagCompound();
|
||||||
|
@ -73,7 +73,7 @@ public class CItem {
|
||||||
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
||||||
meta.setDisplayName("Classic Wood Sword");
|
meta.setDisplayName("Classic Wood Sword");
|
||||||
csword.setItemMeta(meta);
|
csword.setItemMeta(meta);
|
||||||
net.minecraft.server.v1_12_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
net.minecraft.server.v1_13_R2.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
||||||
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
||||||
NBTTagList modifiers = new NBTTagList();
|
NBTTagList modifiers = new NBTTagList();
|
||||||
NBTTagCompound damage = new NBTTagCompound();
|
NBTTagCompound damage = new NBTTagCompound();
|
||||||
|
@ -123,7 +123,7 @@ public class CItem {
|
||||||
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
||||||
meta.setDisplayName("Classic Stone Sword");
|
meta.setDisplayName("Classic Stone Sword");
|
||||||
csword.setItemMeta(meta);
|
csword.setItemMeta(meta);
|
||||||
net.minecraft.server.v1_12_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
net.minecraft.server.v1_13_R2.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
||||||
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
||||||
NBTTagList modifiers = new NBTTagList();
|
NBTTagList modifiers = new NBTTagList();
|
||||||
NBTTagCompound damage = new NBTTagCompound();
|
NBTTagCompound damage = new NBTTagCompound();
|
||||||
|
@ -173,7 +173,7 @@ public class CItem {
|
||||||
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
||||||
meta.setDisplayName("Classic Iron Sword");
|
meta.setDisplayName("Classic Iron Sword");
|
||||||
csword.setItemMeta(meta);
|
csword.setItemMeta(meta);
|
||||||
net.minecraft.server.v1_12_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
net.minecraft.server.v1_13_R2.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
||||||
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
||||||
NBTTagList modifiers = new NBTTagList();
|
NBTTagList modifiers = new NBTTagList();
|
||||||
NBTTagCompound damage = new NBTTagCompound();
|
NBTTagCompound damage = new NBTTagCompound();
|
||||||
|
@ -223,7 +223,7 @@ public class CItem {
|
||||||
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
||||||
meta.setDisplayName("Classic Gold Sword");
|
meta.setDisplayName("Classic Gold Sword");
|
||||||
csword.setItemMeta(meta);
|
csword.setItemMeta(meta);
|
||||||
net.minecraft.server.v1_12_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
net.minecraft.server.v1_13_R2.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
||||||
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
||||||
NBTTagList modifiers = new NBTTagList();
|
NBTTagList modifiers = new NBTTagList();
|
||||||
NBTTagCompound damage = new NBTTagCompound();
|
NBTTagCompound damage = new NBTTagCompound();
|
||||||
|
|
|
@ -5,7 +5,7 @@ import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import com.fpghoti.classicswords.util.Storage;
|
import com.fpghoti.classicswords.util.Storage;
|
||||||
|
|
||||||
import net.minecraft.server.v1_12_R1.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
|
|
||||||
public class CItemType {
|
public class CItemType {
|
||||||
|
|
||||||
|
@ -136,7 +136,7 @@ public class CItemType {
|
||||||
public static Material getMaterial(SwordType type) {
|
public static Material getMaterial(SwordType type) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case WOOD:
|
case WOOD:
|
||||||
return Material.WOOD_SWORD;
|
return Material.WOODEN_SWORD;
|
||||||
|
|
||||||
case STONE:
|
case STONE:
|
||||||
return Material.STONE_SWORD;
|
return Material.STONE_SWORD;
|
||||||
|
@ -145,7 +145,7 @@ public class CItemType {
|
||||||
return Material.IRON_SWORD;
|
return Material.IRON_SWORD;
|
||||||
|
|
||||||
case GOLD:
|
case GOLD:
|
||||||
return Material.GOLD_SWORD;
|
return Material.GOLDEN_SWORD;
|
||||||
|
|
||||||
case DIAMOND:
|
case DIAMOND:
|
||||||
return Material.DIAMOND_SWORD;
|
return Material.DIAMOND_SWORD;
|
||||||
|
@ -163,7 +163,7 @@ public class CItemType {
|
||||||
|
|
||||||
public static SwordType getSwordType(Material mat) {
|
public static SwordType getSwordType(Material mat) {
|
||||||
switch (mat) {
|
switch (mat) {
|
||||||
case WOOD_SWORD:
|
case WOODEN_SWORD:
|
||||||
return SwordType.WOOD;
|
return SwordType.WOOD;
|
||||||
|
|
||||||
case STONE_SWORD:
|
case STONE_SWORD:
|
||||||
|
@ -172,7 +172,7 @@ public class CItemType {
|
||||||
case IRON_SWORD:
|
case IRON_SWORD:
|
||||||
return SwordType.IRON;
|
return SwordType.IRON;
|
||||||
|
|
||||||
case GOLD_SWORD:
|
case GOLDEN_SWORD:
|
||||||
return SwordType.GOLD;
|
return SwordType.GOLD;
|
||||||
|
|
||||||
case DIAMOND_SWORD:
|
case DIAMOND_SWORD:
|
||||||
|
@ -188,7 +188,7 @@ public class CItemType {
|
||||||
|
|
||||||
|
|
||||||
public static Boolean isSword(Material mat) {
|
public static Boolean isSword(Material mat) {
|
||||||
return mat == Material.WOOD_SWORD || mat == Material.STONE_SWORD || mat == Material.IRON_SWORD || mat == Material.GOLD_SWORD || mat == Material.DIAMOND_SWORD;
|
return mat == Material.WOODEN_SWORD || mat == Material.STONE_SWORD || mat == Material.IRON_SWORD || mat == Material.GOLDEN_SWORD || mat == Material.DIAMOND_SWORD;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ import java.util.Random;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.Sound;
|
import org.bukkit.Sound;
|
||||||
import org.bukkit.craftbukkit.v1_12_R1.inventory.CraftItemStack;
|
import org.bukkit.craftbukkit.v1_13_R2.inventory.CraftItemStack;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.Inventory;
|
import org.bukkit.inventory.Inventory;
|
||||||
|
@ -17,11 +17,11 @@ import org.bukkit.inventory.meta.ItemMeta;
|
||||||
import com.fpghoti.classicswords.item.CItemType.SwordType;
|
import com.fpghoti.classicswords.item.CItemType.SwordType;
|
||||||
import com.fpghoti.classicswords.util.Storage;
|
import com.fpghoti.classicswords.util.Storage;
|
||||||
|
|
||||||
import net.minecraft.server.v1_12_R1.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_12_R1.NBTTagDouble;
|
import net.minecraft.server.v1_13_R2.NBTTagDouble;
|
||||||
import net.minecraft.server.v1_12_R1.NBTTagInt;
|
import net.minecraft.server.v1_13_R2.NBTTagInt;
|
||||||
import net.minecraft.server.v1_12_R1.NBTTagList;
|
import net.minecraft.server.v1_13_R2.NBTTagList;
|
||||||
import net.minecraft.server.v1_12_R1.NBTTagString;
|
import net.minecraft.server.v1_13_R2.NBTTagString;
|
||||||
|
|
||||||
public class ClassicSword {
|
public class ClassicSword {
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public class ClassicSword {
|
||||||
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
||||||
meta.setDisplayName(name);
|
meta.setDisplayName(name);
|
||||||
csword.setItemMeta(meta);
|
csword.setItemMeta(meta);
|
||||||
net.minecraft.server.v1_12_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
net.minecraft.server.v1_13_R2.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
||||||
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
||||||
NBTTagList modifiers = new NBTTagList();
|
NBTTagList modifiers = new NBTTagList();
|
||||||
NBTTagCompound damage = CItemType.getSwordType(type);
|
NBTTagCompound damage = CItemType.getSwordType(type);
|
||||||
|
@ -109,7 +109,7 @@ public class ClassicSword {
|
||||||
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
||||||
meta.setDisplayName(name);
|
meta.setDisplayName(name);
|
||||||
csword.setItemMeta(meta);
|
csword.setItemMeta(meta);
|
||||||
net.minecraft.server.v1_12_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
net.minecraft.server.v1_13_R2.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
||||||
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
||||||
NBTTagList modifiers = new NBTTagList();
|
NBTTagList modifiers = new NBTTagList();
|
||||||
NBTTagCompound damage = CItemType.getSwordType(type);
|
NBTTagCompound damage = CItemType.getSwordType(type);
|
||||||
|
@ -178,7 +178,7 @@ public class ClassicSword {
|
||||||
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
|
||||||
meta.setDisplayName(name);
|
meta.setDisplayName(name);
|
||||||
csword.setItemMeta(meta);
|
csword.setItemMeta(meta);
|
||||||
net.minecraft.server.v1_12_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
net.minecraft.server.v1_13_R2.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
||||||
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
||||||
NBTTagList modifiers = new NBTTagList();
|
NBTTagList modifiers = new NBTTagList();
|
||||||
NBTTagCompound damage = CItemType.getSwordType(type);
|
NBTTagCompound damage = CItemType.getSwordType(type);
|
||||||
|
@ -243,7 +243,7 @@ public class ClassicSword {
|
||||||
meta.setUnbreakable(false);
|
meta.setUnbreakable(false);
|
||||||
meta.setDisplayName(name);
|
meta.setDisplayName(name);
|
||||||
csword.setItemMeta(meta);
|
csword.setItemMeta(meta);
|
||||||
net.minecraft.server.v1_12_R1.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
net.minecraft.server.v1_13_R2.ItemStack nmsStack = CraftItemStack.asNMSCopy(csword);
|
||||||
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
NBTTagCompound compound = (nmsStack.hasTag()) ? nmsStack.getTag() : new NBTTagCompound();
|
||||||
NBTTagList modifiers = new NBTTagList();
|
NBTTagList modifiers = new NBTTagList();
|
||||||
NBTTagCompound damage = CItemType.getSwordType(type);
|
NBTTagCompound damage = CItemType.getSwordType(type);
|
||||||
|
@ -280,7 +280,7 @@ public class ClassicSword {
|
||||||
if(item.getType() != Material.SHIELD) {
|
if(item.getType() != Material.SHIELD) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
net.minecraft.server.v1_12_R1.ItemStack nms = CraftItemStack.asNMSCopy(item);
|
net.minecraft.server.v1_13_R2.ItemStack nms = CraftItemStack.asNMSCopy(item);
|
||||||
if(!nms.hasTag() || nms.getTag() == null) {
|
if(!nms.hasTag() || nms.getTag() == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -292,7 +292,7 @@ public class ClassicSword {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Boolean isCBlockShield(ItemStack item) {
|
public static Boolean isCBlockShield(ItemStack item) {
|
||||||
net.minecraft.server.v1_12_R1.ItemStack nms = CraftItemStack.asNMSCopy(item);
|
net.minecraft.server.v1_13_R2.ItemStack nms = CraftItemStack.asNMSCopy(item);
|
||||||
return nms.getTag() != null && isCShield(item) && nms.getTag().hasKey("ClassicSwords");
|
return nms.getTag() != null && isCShield(item) && nms.getTag().hasKey("ClassicSwords");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -301,10 +301,10 @@ public class ClassicSword {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Boolean isCSword(ItemStack item) {
|
public static Boolean isCSword(ItemStack item) {
|
||||||
if(!(item.getType() == Material.WOOD_SWORD || item.getType() == Material.STONE_SWORD ||item.getType() == Material.IRON_SWORD || item.getType() == Material.GOLD_SWORD || item.getType() == Material.DIAMOND_SWORD)) {
|
if(!(item.getType() == Material.WOODEN_SWORD || item.getType() == Material.STONE_SWORD ||item.getType() == Material.IRON_SWORD || item.getType() == Material.GOLDEN_SWORD || item.getType() == Material.DIAMOND_SWORD)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
net.minecraft.server.v1_12_R1.ItemStack nms = CraftItemStack.asNMSCopy(item);
|
net.minecraft.server.v1_13_R2.ItemStack nms = CraftItemStack.asNMSCopy(item);
|
||||||
if(!nms.hasTag() || nms.getTag() == null) {
|
if(!nms.hasTag() || nms.getTag() == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -398,7 +398,7 @@ public class ClassicSword {
|
||||||
if(!isCItem(item)) {
|
if(!isCItem(item)) {
|
||||||
return null;
|
return null;
|
||||||
}else {
|
}else {
|
||||||
net.minecraft.server.v1_12_R1.ItemStack nms = CraftItemStack.asNMSCopy(item);
|
net.minecraft.server.v1_13_R2.ItemStack nms = CraftItemStack.asNMSCopy(item);
|
||||||
NBTTagCompound cstag = (NBTTagCompound) nms.getTag().get("ClassicSwords");
|
NBTTagCompound cstag = (NBTTagCompound) nms.getTag().get("ClassicSwords");
|
||||||
return cstag;
|
return cstag;
|
||||||
}
|
}
|
||||||
|
@ -406,7 +406,7 @@ public class ClassicSword {
|
||||||
|
|
||||||
public static ItemStack updateCSTag(ItemStack item, NBTTagCompound tag) {
|
public static ItemStack updateCSTag(ItemStack item, NBTTagCompound tag) {
|
||||||
if(isCItem(item)) {
|
if(isCItem(item)) {
|
||||||
net.minecraft.server.v1_12_R1.ItemStack nms = CraftItemStack.asNMSCopy(item);
|
net.minecraft.server.v1_13_R2.ItemStack nms = CraftItemStack.asNMSCopy(item);
|
||||||
nms.getTag().set("ClassicSwords", tag);
|
nms.getTag().set("ClassicSwords", tag);
|
||||||
return CraftItemStack.asBukkitCopy(nms);
|
return CraftItemStack.asBukkitCopy(nms);
|
||||||
}else {
|
}else {
|
||||||
|
|
|
@ -2,9 +2,9 @@ package com.fpghoti.classicswords.item;
|
||||||
|
|
||||||
import com.fpghoti.classicswords.util.Storage;
|
import com.fpghoti.classicswords.util.Storage;
|
||||||
|
|
||||||
import net.minecraft.server.v1_12_R1.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
import net.minecraft.server.v1_12_R1.NBTTagInt;
|
import net.minecraft.server.v1_13_R2.NBTTagInt;
|
||||||
import net.minecraft.server.v1_12_R1.NBTTagString;
|
import net.minecraft.server.v1_13_R2.NBTTagString;
|
||||||
|
|
||||||
public class SetAttributes {
|
public class SetAttributes {
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,12 @@ public class Functions {
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean cModeEnabled(Player p) {
|
||||||
|
Boolean enabled = false;
|
||||||
|
//TO DO Work on resource pack detection
|
||||||
|
return enabled;
|
||||||
|
}
|
||||||
|
|
||||||
public static Player getEP(String playername){
|
public static Player getEP(String playername){
|
||||||
Player p = null;
|
Player p = null;
|
||||||
for(Player item : Bukkit.getOnlinePlayers()){
|
for(Player item : Bukkit.getOnlinePlayers()){
|
||||||
|
|
|
@ -13,7 +13,7 @@ import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import io.netty.util.internal.ConcurrentSet;
|
import io.netty.util.internal.ConcurrentSet;
|
||||||
import net.minecraft.server.v1_12_R1.NBTTagCompound;
|
import net.minecraft.server.v1_13_R2.NBTTagCompound;
|
||||||
|
|
||||||
public class Storage {
|
public class Storage {
|
||||||
public static ConcurrentHashMap<String, Boolean> bools = new ConcurrentHashMap<>();
|
public static ConcurrentHashMap<String, Boolean> bools = new ConcurrentHashMap<>();
|
||||||
|
|
Loading…
Reference in New Issue