Skip to content

Commit

Permalink
minor patches (playeffect, horse jump, item.display)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Oct 31, 2020
1 parent efd6464 commit 9495c8b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Expand Up @@ -51,6 +51,9 @@ public boolean couldMatch(ScriptPath path) {
if (!path.eventLower.equals("horse jumps") && !path.eventLower.endsWith("jumps")) {
return false;
}
if (path.eventLower.startsWith("player")) {
return false;
}
return true;
}

Expand Down
Expand Up @@ -56,7 +56,7 @@ public ObjectTag getObjectAttribute(Attribute attribute) {
// <--[tag]
// @attribute <ItemTag.display>
// @returns ElementTag
// @mechanism ItemTag.display_name
// @mechanism ItemTag.display
// @group properties
// @description
// Returns the display name of the item, as set by plugin or an anvil.
Expand All @@ -71,7 +71,7 @@ public ObjectTag getObjectAttribute(Attribute attribute) {
// <--[tag]
// @attribute <ItemTag.has_display>
// @returns ElementTag(Boolean)
// @mechanism ItemTag.display_name
// @mechanism ItemTag.display
// @group properties
// @description
// Returns whether the item has a custom set display name.
Expand Down
Expand Up @@ -296,20 +296,17 @@ else if (special_data != null) {
Debug.echoError("Particles of type '" + particleEffect.getName() + "' cannot take special_data as input.");
}
Random random = CoreUtilities.getRandom();
float osX = (float) offset.getX();
float osY = (float) offset.getY();
float osZ = (float) offset.getZ();
int quantity = qty.asInt();
for (Player player : players) {
if (velocity == null) {
particleEffect.playFor(player, location, quantity, offset.toVector(), data.asFloat(), dataObject);
particleEffect.playFor(player, location, quantity, offset.toVector(), data.asDouble(), dataObject);
}
else {
Vector velocityVector = velocity.toVector();
for (int i = 0; i < quantity; i++) {
LocationTag singleLocation = location.clone().add(random.nextDouble() * osX - osX * 0.5,
random.nextDouble() * osY - osY * 0.5,
random.nextDouble() * osZ - osZ * 0.5);
LocationTag singleLocation = location.clone().add((random.nextDouble() - 0.5) * offset.getX(),
(random.nextDouble() - 0.5) * offset.getY(),
(random.nextDouble() - 0.5) * offset.getZ());
particleEffect.playFor(player, singleLocation, 0, velocityVector, 1f, dataObject);
}
}
Expand Down

0 comments on commit 9495c8b

Please sign in to comment.