This commit is contained in:
rockyhawk64 2023-10-04 18:50:07 +11:00
parent 0de82db750
commit e8a5dbc1cd
5 changed files with 19 additions and 19 deletions

View File

@ -1,4 +1,3 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="EntryPointsManager">
<list size="1">

View File

@ -12,9 +12,6 @@ import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.inventory.meta.SkullMeta;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.URL;
@ -119,16 +116,11 @@ public class GetCustomHeads {
return itemStack;
}
private String inputStreamToString(InputStream inputStream) {
Scanner scanner = new Scanner(inputStream, StandardCharsets.UTF_8.name()).useDelimiter("\\A");
return scanner.hasNext() ? scanner.next() : "";
}
//used to get heads from Base64 Textures
@SuppressWarnings("deprecation")
public ItemStack getCustomHead(String b64stringtexture) {
//get head from base64
GameProfile profile = new GameProfile(UUID.randomUUID(), "");
GameProfile profile = new GameProfile(UUID.randomUUID(), null);
PropertyMap propertyMap = profile.getProperties();
if (propertyMap == null) {
throw new IllegalStateException("Profile doesn't contain a property map");

View File

@ -21,11 +21,14 @@ public class Commandpanelsdata implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (sender.hasPermission("commandpanel.data")) {
boolean sendPlayerMessage = true;
//check to make sure args isn't empty first
//if the first argument is -s it will not send a message to the sender
if(args.length != 0) {
if (args[0].equalsIgnoreCase("-s")) {
args = Arrays.copyOfRange(args, 1, args.length);
sendPlayerMessage = false;
}
}
int count = 0;
if (args.length == 2) {
//for the clear command

View File

@ -111,7 +111,6 @@ public class CommandTags {
break;
}
case "rightshift=": {
//if commands is for right clicking, remove the 'right=' and continue
command = command.replace("rightshift= ", "");
if (click != ClickType.SHIFT_RIGHT) {
return "";
@ -119,7 +118,6 @@ public class CommandTags {
break;
}
case "left=": {
//if commands is for right clicking, remove the 'right=' and continue
command = command.replace("left= ", "");
if (click != ClickType.LEFT) {
return "";
@ -127,7 +125,6 @@ public class CommandTags {
break;
}
case "leftshift=": {
//if commands is for right clicking, remove the 'right=' and continue
command = command.replace("leftshift= ", "");
if (click != ClickType.SHIFT_LEFT) {
return "";

View File

@ -10,14 +10,14 @@ import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityPickupItemEvent;
import org.bukkit.event.entity.PlayerDeathEvent;
import org.bukkit.event.player.PlayerDropItemEvent;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.inventory.ItemStack;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.*;
public class InventorySaver implements Listener {
public YamlConfiguration inventoryConfig;
@ -43,6 +43,15 @@ public class InventorySaver implements Listener {
}
}
//do not allow INTERACTIONS while panel is open
@EventHandler
public void onInteract(PlayerInteractEvent e){
if(inventoryConfig.contains(e.getPlayer().getUniqueId().toString())){
e.setCancelled(true);
}
}
@EventHandler
public void onDeath(PlayerDeathEvent e){
//drop the players inventory if a panel is open in the inventory