Skip to content

Commit

Permalink
impl getJavaObject
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 3, 2022
1 parent a2cd344 commit 9bbf8f3
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,11 @@ public String toString() {
return identify();
}

@Override
public Object getJavaObject() {
return getChunk();
}

public boolean isLoaded() {
if (getBukkitWorld() == null) {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ public String toString() {
return identify();
}

@Override
public Object getJavaObject() {
return enchantment;
}

@Override
public EnchantmentTag setPrefix(String prefix) {
this.prefix = prefix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,11 @@ public String toString() {
return identify();
}

@Override
public Object getJavaObject() {
return entity == null ? getBukkitEntityType() : entity;
}

@Override
public boolean isUnique() {
return entity != null || uuid != null || isFake || npc != null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1174,6 +1174,11 @@ public String toString() {
return identify();
}

@Override
public Object getJavaObject() {
return inventory;
}

public static void registerTags() {

AbstractFlagTracker.registerFlagHandlers(tagProcessor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -484,6 +484,11 @@ public String toString() {
return identify();
}

@Override
public Object getJavaObject() {
return getItemStack();
}

@Override
public boolean isUnique() {
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,11 @@ public String toString() {
return identify();
}

@Override
public Object getJavaObject() {
return clone();
}

public static void registerTags() {

AbstractFlagTracker.registerFlagHandlers(tagProcessor);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,11 @@ public String toString() {
return identify();
}

@Override
public Object getJavaObject() {
return modernData == null ? material : modernData;
}

@Override
public ObjectTag setPrefix(String prefix) {
if (prefix != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,11 @@ public String toString() {
return identify();
}

@Override
public Object getJavaObject() {
return getCitizen();
}

public boolean isSpawned() {
return npc.isSpawned();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -607,6 +607,11 @@ public String toString() {
return identify();
}

@Override
public Object getJavaObject() {
return getOfflinePlayer();
}

@Override
public int hashCode() {
return getUUID().hashCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,11 @@ public String toString() {
return identify();
}

@Override
public Object getJavaObject() {
return plugin;
}

@Override
public PluginTag setPrefix(String prefix) {
this.prefix = prefix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ public String identifySimple() {
return identify();
}

@Override
public Object getJavaObject() {
return recipe;
}

public static void registerTags() {
PropertyParser.registerPropertyTagHandlers(TradeTag.class, tagProcessor);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,11 @@ public String toString() {
return identify();
}

@Override
public Object getJavaObject() {
return getWorld();
}

@Override
public ObjectTag setPrefix(String prefix) {
this.prefix = prefix;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@
import com.denizenscript.denizencore.utilities.CoreConfiguration;
import com.denizenscript.denizencore.objects.core.DurationTag;
import com.denizenscript.denizencore.utilities.CoreUtilities;
import com.denizenscript.denizencore.utilities.ReflectionRefuse;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.configuration.file.FileConfiguration;

import java.nio.charset.Charset;

@ReflectionRefuse
public class Settings {

public static void refillCache() {
Expand Down

0 comments on commit 9bbf8f3

Please sign in to comment.