Begin work on 1.13.2

This commit is contained in:
Ghoti 2019-01-23 14:19:23 -06:00
parent 6fe13d6a4b
commit 5d889b0e77
8 changed files with 50 additions and 44 deletions

View File

@ -25,19 +25,19 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.12-R0.1-SNAPSHOT</version>
<version>1.13.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<version>1.13.2-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>bukkit</artifactId>
<version>1.12.2-R0.1-SNAPSHOT</version>
<version>1.13.2-R0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>de.tr7zw</groupId>

View File

@ -108,7 +108,7 @@ public class SwingEvent implements Listener{
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.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)) {
final Player damaged = Storage.recent.get(p);
@ -177,20 +177,20 @@ public class SwingEvent implements Listener{
}, 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.great.remove(p);
Storage.kb.add(damaged);
ClassicSwordsMain.runKB(damaged);
}else if(Storage.great.contains(p)) {
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.kb.add(damaged);
ClassicSwordsMain.runKB(damaged);
}else {
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);
Storage.great.add(p);
Storage.kb.add(damaged);

View File

@ -1,18 +1,18 @@
package com.fpghoti.classicswords.item;
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.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import net.md_5.bungee.api.ChatColor;
import net.minecraft.server.v1_12_R1.NBTTagCompound;
import net.minecraft.server.v1_12_R1.NBTTagDouble;
import net.minecraft.server.v1_12_R1.NBTTagInt;
import net.minecraft.server.v1_12_R1.NBTTagList;
import net.minecraft.server.v1_12_R1.NBTTagString;
import net.minecraft.server.v1_13_R2.NBTTagCompound;
import net.minecraft.server.v1_13_R2.NBTTagDouble;
import net.minecraft.server.v1_13_R2.NBTTagInt;
import net.minecraft.server.v1_13_R2.NBTTagList;
import net.minecraft.server.v1_13_R2.NBTTagString;
public class CItem {
@ -23,7 +23,7 @@ public class CItem {
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
meta.setDisplayName("Classic Diamond Sword");
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();
NBTTagList modifiers = new NBTTagList();
NBTTagCompound damage = new NBTTagCompound();
@ -73,7 +73,7 @@ public class CItem {
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
meta.setDisplayName("Classic Wood Sword");
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();
NBTTagList modifiers = new NBTTagList();
NBTTagCompound damage = new NBTTagCompound();
@ -123,7 +123,7 @@ public class CItem {
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
meta.setDisplayName("Classic Stone Sword");
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();
NBTTagList modifiers = new NBTTagList();
NBTTagCompound damage = new NBTTagCompound();
@ -173,7 +173,7 @@ public class CItem {
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
meta.setDisplayName("Classic Iron Sword");
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();
NBTTagList modifiers = new NBTTagList();
NBTTagCompound damage = new NBTTagCompound();
@ -223,7 +223,7 @@ public class CItem {
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
meta.setDisplayName("Classic Gold Sword");
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();
NBTTagList modifiers = new NBTTagList();
NBTTagCompound damage = new NBTTagCompound();

View File

@ -5,7 +5,7 @@ import org.bukkit.inventory.ItemStack;
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 {
@ -136,7 +136,7 @@ public class CItemType {
public static Material getMaterial(SwordType type) {
switch (type) {
case WOOD:
return Material.WOOD_SWORD;
return Material.WOODEN_SWORD;
case STONE:
return Material.STONE_SWORD;
@ -145,7 +145,7 @@ public class CItemType {
return Material.IRON_SWORD;
case GOLD:
return Material.GOLD_SWORD;
return Material.GOLDEN_SWORD;
case DIAMOND:
return Material.DIAMOND_SWORD;
@ -163,7 +163,7 @@ public class CItemType {
public static SwordType getSwordType(Material mat) {
switch (mat) {
case WOOD_SWORD:
case WOODEN_SWORD:
return SwordType.WOOD;
case STONE_SWORD:
@ -172,7 +172,7 @@ public class CItemType {
case IRON_SWORD:
return SwordType.IRON;
case GOLD_SWORD:
case GOLDEN_SWORD:
return SwordType.GOLD;
case DIAMOND_SWORD:
@ -188,7 +188,7 @@ public class CItemType {
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;
}

View File

@ -6,7 +6,7 @@ import java.util.Random;
import org.bukkit.Bukkit;
import org.bukkit.Material;
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.entity.Player;
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.util.Storage;
import net.minecraft.server.v1_12_R1.NBTTagCompound;
import net.minecraft.server.v1_12_R1.NBTTagDouble;
import net.minecraft.server.v1_12_R1.NBTTagInt;
import net.minecraft.server.v1_12_R1.NBTTagList;
import net.minecraft.server.v1_12_R1.NBTTagString;
import net.minecraft.server.v1_13_R2.NBTTagCompound;
import net.minecraft.server.v1_13_R2.NBTTagDouble;
import net.minecraft.server.v1_13_R2.NBTTagInt;
import net.minecraft.server.v1_13_R2.NBTTagList;
import net.minecraft.server.v1_13_R2.NBTTagString;
public class ClassicSword {
@ -49,7 +49,7 @@ public class ClassicSword {
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
meta.setDisplayName(name);
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();
NBTTagList modifiers = new NBTTagList();
NBTTagCompound damage = CItemType.getSwordType(type);
@ -109,7 +109,7 @@ public class ClassicSword {
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
meta.setDisplayName(name);
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();
NBTTagList modifiers = new NBTTagList();
NBTTagCompound damage = CItemType.getSwordType(type);
@ -178,7 +178,7 @@ public class ClassicSword {
meta.addItemFlags(ItemFlag.HIDE_UNBREAKABLE);
meta.setDisplayName(name);
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();
NBTTagList modifiers = new NBTTagList();
NBTTagCompound damage = CItemType.getSwordType(type);
@ -243,7 +243,7 @@ public class ClassicSword {
meta.setUnbreakable(false);
meta.setDisplayName(name);
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();
NBTTagList modifiers = new NBTTagList();
NBTTagCompound damage = CItemType.getSwordType(type);
@ -280,7 +280,7 @@ public class ClassicSword {
if(item.getType() != Material.SHIELD) {
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) {
return false;
}
@ -292,7 +292,7 @@ public class ClassicSword {
}
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");
}
@ -301,10 +301,10 @@ public class ClassicSword {
}
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;
}
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) {
return false;
}
@ -398,7 +398,7 @@ public class ClassicSword {
if(!isCItem(item)) {
return null;
}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");
return cstag;
}
@ -406,7 +406,7 @@ public class ClassicSword {
public static ItemStack updateCSTag(ItemStack item, NBTTagCompound tag) {
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);
return CraftItemStack.asBukkitCopy(nms);
}else {

View File

@ -2,9 +2,9 @@ package com.fpghoti.classicswords.item;
import com.fpghoti.classicswords.util.Storage;
import net.minecraft.server.v1_12_R1.NBTTagCompound;
import net.minecraft.server.v1_12_R1.NBTTagInt;
import net.minecraft.server.v1_12_R1.NBTTagString;
import net.minecraft.server.v1_13_R2.NBTTagCompound;
import net.minecraft.server.v1_13_R2.NBTTagInt;
import net.minecraft.server.v1_13_R2.NBTTagString;
public class SetAttributes {

View File

@ -13,6 +13,12 @@ public class Functions {
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){
Player p = null;
for(Player item : Bukkit.getOnlinePlayers()){

View File

@ -13,7 +13,7 @@ import org.bukkit.Material;
import org.bukkit.entity.Player;
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 static ConcurrentHashMap<String, Boolean> bools = new ConcurrentHashMap<>();