Skip to content
This repository was archived by the owner on Jul 19, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<skipTests>true</skipTests>
</properties>

<repositories>
Expand Down Expand Up @@ -39,6 +40,7 @@
<configuration>
<source>1.8</source>
<target>1.8</target>
<skipTests>${skipTests}</skipTests>
</configuration>
</plugin>
</plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.bukkit.NamespacedKey;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
import org.bukkit.persistence.PersistentDataType;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;

Expand All @@ -34,16 +35,19 @@
public class ArmorStandEditorPlugin extends JavaPlugin{
private NamespacedKey iconKey;
private static ArmorStandEditorPlugin instance;
public final PersistentDataType<Byte,Byte> editToolKeyType = PersistentDataType.BYTE;
public final NamespacedKey editToolKey = new NamespacedKey(this, "ASE");
private CommandEx execute;
private Language lang;
public boolean hasSpigot;
public PlayerEditorManager editorManager;
public Material editTool = Material.FLINT;
boolean requireToolData = false;
boolean sendToActionBar = true;
int editToolData = Integer.MIN_VALUE;
boolean requireToolLore = false;
String editToolLore = null;
public boolean requireToolData = false;
public boolean sendToActionBar = true;
public int editToolData = Integer.MIN_VALUE;
public boolean requireToolLore = false;
public String editToolLore = null;
public boolean requireToolKey = false; // Not configurable through config, since it's up to plugin to hook into
boolean debug = false; //weather or not to broadcast messages via print(String message)
double coarseRot;
double fineRot;
Expand Down Expand Up @@ -76,7 +80,7 @@ public void onEnable(){
if(requireToolData) editToolData = getConfig().getInt("toolData", Integer.MIN_VALUE);
requireToolLore = getConfig().getBoolean("requireToolLore", false);
if(requireToolLore) editToolLore= getConfig().getString("toolLore", null);
debug = getConfig().getBoolean("debug", true);
debug = getConfig().getBoolean("debug", false);
sendToActionBar = getConfig().getBoolean("sendMessagesToActionBar", true);

editorManager = new PlayerEditorManager(this);
Expand Down Expand Up @@ -145,6 +149,10 @@ public boolean isEditTool(ItemStack item){
if(item.getItemMeta().getLore().isEmpty()) return false;
if(!item.getItemMeta().getLore().get(0).equals(editToolLore)) return false;
}
if(requireToolKey) {
if(!item.hasItemMeta()) return false;
if(item.getItemMeta().getPersistentDataContainer().get(editToolKey, editToolKeyType) == null) return false;
}
return true;
}

Expand All @@ -155,4 +163,4 @@ public NamespacedKey getIconKey() {
}
//todo:
//Access to "DisabledSlots" data (probably simplified just a toggle enable/disable)
//Access to the "Marker" switch (so you can make the hitbox super small)
//Access to the "Marker" switch (so you can make the hitbox super small)
2 changes: 1 addition & 1 deletion src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ lang: en_US.yml
sendMessagesToActionBar: true

#Don't set to true unless you want players to see random messages or other undesirable behavior
debug: false
debug: false