-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add remaining common standard tag bases, fixes #1919
- Loading branch information
1 parent
7d32cbf
commit 96d072e
Showing
16 changed files
with
456 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
plugin/src/main/java/net/aufdemrand/denizen/tags/core/BiomeTags.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package net.aufdemrand.denizen.tags.core; | ||
|
||
import net.aufdemrand.denizen.Denizen; | ||
import net.aufdemrand.denizen.objects.dBiome; | ||
import net.aufdemrand.denizencore.objects.TagRunnable; | ||
import net.aufdemrand.denizencore.tags.Attribute; | ||
import net.aufdemrand.denizencore.tags.ReplaceableTagEvent; | ||
import net.aufdemrand.denizencore.tags.TagManager; | ||
import net.aufdemrand.denizencore.utilities.CoreUtilities; | ||
|
||
public class BiomeTags { | ||
|
||
public BiomeTags(Denizen denizen) { | ||
TagManager.registerTagHandler(new TagRunnable.RootForm() { | ||
@Override | ||
public void run(ReplaceableTagEvent event) { | ||
biomeTags(event); | ||
} | ||
}, "biome"); | ||
} | ||
|
||
public void biomeTags(ReplaceableTagEvent event) { | ||
|
||
if (!event.matches("biome") || event.replaced()) { | ||
return; | ||
} | ||
|
||
dBiome biome = null; | ||
|
||
if (event.hasNameContext()) { | ||
biome = dBiome.valueOf(event.getNameContext(), event.getAttributes().context); | ||
} | ||
|
||
if (biome == null) { | ||
return; | ||
} | ||
|
||
Attribute attribute = event.getAttributes(); | ||
event.setReplacedObject(CoreUtilities.autoAttrib(biome, attribute.fulfill(1))); | ||
|
||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
plugin/src/main/java/net/aufdemrand/denizen/tags/core/ChunkTags.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package net.aufdemrand.denizen.tags.core; | ||
|
||
import net.aufdemrand.denizen.Denizen; | ||
import net.aufdemrand.denizen.objects.dChunk; | ||
import net.aufdemrand.denizencore.objects.TagRunnable; | ||
import net.aufdemrand.denizencore.tags.Attribute; | ||
import net.aufdemrand.denizencore.tags.ReplaceableTagEvent; | ||
import net.aufdemrand.denizencore.tags.TagManager; | ||
import net.aufdemrand.denizencore.utilities.CoreUtilities; | ||
|
||
public class ChunkTags { | ||
|
||
public ChunkTags(Denizen denizen) { | ||
TagManager.registerTagHandler(new TagRunnable.RootForm() { | ||
@Override | ||
public void run(ReplaceableTagEvent event) { | ||
chunkTags(event); | ||
} | ||
}, "chunk"); | ||
} | ||
|
||
public void chunkTags(ReplaceableTagEvent event) { | ||
|
||
if (!event.matches("chunk") || event.replaced()) { | ||
return; | ||
} | ||
|
||
dChunk chunk = null; | ||
|
||
if (event.hasNameContext()) { | ||
chunk = dChunk.valueOf(event.getNameContext(), event.getAttributes().context); | ||
} | ||
|
||
if (chunk == null) { | ||
return; | ||
} | ||
|
||
Attribute attribute = event.getAttributes(); | ||
event.setReplacedObject(CoreUtilities.autoAttrib(chunk, attribute.fulfill(1))); | ||
|
||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
plugin/src/main/java/net/aufdemrand/denizen/tags/core/ColorTags.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package net.aufdemrand.denizen.tags.core; | ||
|
||
import net.aufdemrand.denizen.Denizen; | ||
import net.aufdemrand.denizen.objects.dColor; | ||
import net.aufdemrand.denizencore.objects.TagRunnable; | ||
import net.aufdemrand.denizencore.tags.Attribute; | ||
import net.aufdemrand.denizencore.tags.ReplaceableTagEvent; | ||
import net.aufdemrand.denizencore.tags.TagManager; | ||
import net.aufdemrand.denizencore.utilities.CoreUtilities; | ||
|
||
public class ColorTags { | ||
|
||
public ColorTags(Denizen denizen) { | ||
TagManager.registerTagHandler(new TagRunnable.RootForm() { | ||
@Override | ||
public void run(ReplaceableTagEvent event) { | ||
colorTags(event); | ||
} | ||
}, "color"); | ||
} | ||
|
||
public void colorTags(ReplaceableTagEvent event) { | ||
|
||
if (!event.matches("color") || event.replaced()) { | ||
return; | ||
} | ||
|
||
dColor color = null; | ||
|
||
if (event.hasNameContext()) { | ||
color = dColor.valueOf(event.getNameContext(), event.getAttributes().context); | ||
} | ||
|
||
if (color == null) { | ||
return; | ||
} | ||
|
||
Attribute attribute = event.getAttributes(); | ||
event.setReplacedObject(CoreUtilities.autoAttrib(color, attribute.fulfill(1))); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
plugin/src/main/java/net/aufdemrand/denizen/tags/core/EllipsoidTags.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package net.aufdemrand.denizen.tags.core; | ||
|
||
import net.aufdemrand.denizen.Denizen; | ||
import net.aufdemrand.denizen.objects.dEllipsoid; | ||
import net.aufdemrand.denizencore.objects.TagRunnable; | ||
import net.aufdemrand.denizencore.tags.Attribute; | ||
import net.aufdemrand.denizencore.tags.ReplaceableTagEvent; | ||
import net.aufdemrand.denizencore.tags.TagManager; | ||
import net.aufdemrand.denizencore.utilities.CoreUtilities; | ||
|
||
public class EllipsoidTags { | ||
|
||
public EllipsoidTags(Denizen denizen) { | ||
TagManager.registerTagHandler(new TagRunnable.RootForm() { | ||
@Override | ||
public void run(ReplaceableTagEvent event) { | ||
ellipsoidTags(event); | ||
} | ||
}, "ellipsoid"); | ||
} | ||
|
||
public void ellipsoidTags(ReplaceableTagEvent event) { | ||
|
||
if (!event.matches("ellipsoid") || event.replaced()) { | ||
return; | ||
} | ||
|
||
dEllipsoid ellipsoid = null; | ||
|
||
if (event.hasNameContext()) { | ||
ellipsoid = dEllipsoid.valueOf(event.getNameContext(), event.getAttributes().context); | ||
} | ||
|
||
if (ellipsoid == null) { | ||
return; | ||
} | ||
|
||
Attribute attribute = event.getAttributes(); | ||
event.setReplacedObject(CoreUtilities.autoAttrib(ellipsoid, attribute.fulfill(1))); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
plugin/src/main/java/net/aufdemrand/denizen/tags/core/InventoryTags.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package net.aufdemrand.denizen.tags.core; | ||
|
||
import net.aufdemrand.denizen.Denizen; | ||
import net.aufdemrand.denizen.objects.dInventory; | ||
import net.aufdemrand.denizencore.objects.TagRunnable; | ||
import net.aufdemrand.denizencore.tags.Attribute; | ||
import net.aufdemrand.denizencore.tags.ReplaceableTagEvent; | ||
import net.aufdemrand.denizencore.tags.TagManager; | ||
import net.aufdemrand.denizencore.utilities.CoreUtilities; | ||
|
||
public class InventoryTags { | ||
|
||
public InventoryTags(Denizen denizen) { | ||
TagManager.registerTagHandler(new TagRunnable.RootForm() { | ||
@Override | ||
public void run(ReplaceableTagEvent event) { | ||
inventoryTags(event); | ||
} | ||
}, "inventory"); | ||
} | ||
|
||
public void inventoryTags(ReplaceableTagEvent event) { | ||
|
||
if (!event.matches("inventory") || event.replaced()) { | ||
return; | ||
} | ||
|
||
dInventory inventory = null; | ||
|
||
if (event.hasNameContext()) { | ||
inventory = dInventory.valueOf(event.getNameContext(), event.getAttributes().context); | ||
} | ||
|
||
if (inventory == null) { | ||
return; | ||
} | ||
|
||
Attribute attribute = event.getAttributes(); | ||
event.setReplacedObject(CoreUtilities.autoAttrib(inventory, attribute.fulfill(1))); | ||
|
||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
plugin/src/main/java/net/aufdemrand/denizen/tags/core/ItemTags.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package net.aufdemrand.denizen.tags.core; | ||
|
||
import net.aufdemrand.denizen.Denizen; | ||
import net.aufdemrand.denizen.objects.dItem; | ||
import net.aufdemrand.denizencore.objects.TagRunnable; | ||
import net.aufdemrand.denizencore.tags.Attribute; | ||
import net.aufdemrand.denizencore.tags.ReplaceableTagEvent; | ||
import net.aufdemrand.denizencore.tags.TagManager; | ||
import net.aufdemrand.denizencore.utilities.CoreUtilities; | ||
|
||
public class ItemTags { | ||
|
||
public ItemTags(Denizen denizen) { | ||
TagManager.registerTagHandler(new TagRunnable.RootForm() { | ||
@Override | ||
public void run(ReplaceableTagEvent event) { | ||
itemTags(event); | ||
} | ||
}, "item"); | ||
} | ||
|
||
public void itemTags(ReplaceableTagEvent event) { | ||
|
||
if (!event.matches("item") || event.replaced()) { | ||
return; | ||
} | ||
|
||
dItem item = null; | ||
|
||
if (event.hasNameContext()) { | ||
item = dItem.valueOf(event.getNameContext(), event.getAttributes().context); | ||
} | ||
|
||
if (item == null) { | ||
return; | ||
} | ||
|
||
Attribute attribute = event.getAttributes(); | ||
event.setReplacedObject(CoreUtilities.autoAttrib(item, attribute.fulfill(1))); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.