Skip to content

Commit

Permalink
Update for 117
Browse files Browse the repository at this point in the history
  • Loading branch information
ShakeforProtein committed Oct 22, 2021
1 parent f498ccb commit 6a52f6b
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 26 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>me.ShakeforProtein</groupId>
<artifactId>TreeboTimed</artifactId>
<version>1.0.1 - SpMc1.16.1 - WE7.2.0</version>
<version>1.0.2 - SpMc1.17.1 - WE7.2.0</version>
<packaging>jar</packaging>

<name>TreeboTimed</name>
Expand Down Expand Up @@ -97,13 +97,13 @@
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.spigotmc</groupId>
<artifactId>spigot-api</artifactId>
<version>1.16.1-R0.1-SNAPSHOT</version>
<version>1.17.1-R0.1-SNAPSHOT</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package me.shakeforprotein.treebotimed.Commands;

import me.shakeforprotein.treebotimed.TreeboTimed;
import net.minecraft.server.v1_16_R1.NBTTagCompound;
import net.minecraft.server.v1_16_R1.NBTTagString;
import net.minecraft.nbt.NBTTagCompound;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
import org.bukkit.Material;
Expand All @@ -11,7 +10,7 @@
import org.bukkit.command.CommandSender;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.craftbukkit.v1_16_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_17_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
Expand Down Expand Up @@ -72,7 +71,7 @@ else if (args.length > 2){
itemMeta.setLore(list);
blueprint.setItemMeta(itemMeta);

net.minecraft.server.v1_16_R1.ItemStack nmsItem = getNMSItem(blueprint);
net.minecraft.world.item.ItemStack nmsItem = getNMSItem(blueprint);
NBTTagCompound nbtCompound = getCompound(nmsItem);
Set<String> compoundSet = nbtCompound.getKeys();
StringBuilder sb = new StringBuilder();
Expand All @@ -88,17 +87,17 @@ else if (args.length > 2){
}


public net.minecraft.server.v1_16_R1.ItemStack getNMSItem(ItemStack item) {
net.minecraft.server.v1_16_R1.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
public net.minecraft.world.item.ItemStack getNMSItem(ItemStack item) {
net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
return nmsItem;
}

public NBTTagCompound getCompound(net.minecraft.server.v1_16_R1.ItemStack nmsItem) {
public NBTTagCompound getCompound(net.minecraft.world.item.ItemStack nmsItem) {
NBTTagCompound nmsCompound = (nmsItem.hasTag()) ? nmsItem.getTag() : new NBTTagCompound();
return nmsCompound;
}

public ItemStack getBukkitItem(net.minecraft.server.v1_16_R1.ItemStack nmsItem) {
public ItemStack getBukkitItem(net.minecraft.world.item.ItemStack nmsItem) {
ItemStack bukkitItem = CraftItemStack.asBukkitCopy(nmsItem);
return bukkitItem;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@
import com.sk89q.worldedit.session.ClipboardHolder;
import me.shakeforprotein.treebotimed.TreeboTimed;
import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.Material;

import org.bukkit.World;
import org.bukkit.block.Block;
import org.bukkit.block.data.BlockData;

import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
import com.sk89q.worldedit.math.BlockVector3;
import com.sk89q.worldedit.session.ClipboardHolder;
import me.shakeforprotein.treebotimed.TreeboTimed;
import net.minecraft.server.v1_16_R1.NBTTagCompound;
import net.minecraft.nbt.NBTTagCompound;
import org.bukkit.*;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.craftbukkit.v1_16_R1.inventory.CraftItemStack;
import org.bukkit.craftbukkit.v1_17_R1.inventory.CraftItemStack;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand All @@ -44,7 +44,7 @@ private void placeSchem(PlayerInteractEvent e) {
if (e.getItem() != null && (e.getItem().getType() == Material.PAPER || e.getItem().getType() == Material.FILLED_MAP)) {
if (e.getItem().hasItemMeta() && e.getItem().getItemMeta().hasDisplayName() && ChatColor.stripColor(e.getItem().getItemMeta().getDisplayName().toLowerCase()).startsWith("blueprint")) {
ItemStack blueprint = e.getItem();
net.minecraft.server.v1_16_R1.ItemStack nmsBlueprint = getNMSItem(blueprint);
net.minecraft.world.item.ItemStack nmsBlueprint = getNMSItem(blueprint);
NBTTagCompound nbtBlueprint = getCompound(nmsBlueprint);
if (nbtBlueprint.hasKey("ShakeBlueprint")) {
String scmName = nbtBlueprint.getString("ShakeBlueprint");
Expand All @@ -58,21 +58,16 @@ private void placeSchem(PlayerInteractEvent e) {
}


public net.minecraft.server.v1_16_R1.ItemStack getNMSItem(ItemStack item) {
net.minecraft.server.v1_16_R1.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
public net.minecraft.world.item.ItemStack getNMSItem(ItemStack item) {
net.minecraft.world.item.ItemStack nmsItem = CraftItemStack.asNMSCopy(item);
return nmsItem;
}

public NBTTagCompound getCompound(net.minecraft.server.v1_16_R1.ItemStack nmsItem) {
public NBTTagCompound getCompound(net.minecraft.world.item.ItemStack nmsItem) {
NBTTagCompound nmsCompound = (nmsItem.hasTag()) ? nmsItem.getTag() : new NBTTagCompound();
return nmsCompound;
}

public ItemStack getBukkitItem(net.minecraft.server.v1_16_R1.ItemStack nmsItem) {
ItemStack bukkitItem = CraftItemStack.asBukkitCopy(nmsItem);
return bukkitItem;
}

public boolean placeAtPlayer(Player p, String nbtString) {

File detailsFile = new File(pl.getDataFolder() + File.separator + "blueprints", nbtString + ".yml");
Expand Down

0 comments on commit 6a52f6b

Please sign in to comment.