Skip to content

Commit

Permalink
Making portal_timer and portal_cooldown return portal timer and porta…
Browse files Browse the repository at this point in the history
…l cooldown in that order (gnembon#1476)

* This error is so dumb I must have done it

* Update ai_tracker.sc
  • Loading branch information
Ghoulboy78 authored Jun 27, 2022
1 parent ee4bc33 commit 6019f81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/main/java/carpet/script/value/EntityValue.java
Original file line number Diff line number Diff line change
Expand Up @@ -523,8 +523,8 @@ public Value get(String what, Value arg)
put("item", (e, a) -> (e instanceof ItemEntity)?ValueConversions.of(((ItemEntity) e).getItem()):Value.NULL);
put("count", (e, a) -> (e instanceof ItemEntity)?new NumericValue(((ItemEntity) e).getItem().getCount()):Value.NULL);
put("pickup_delay", (e, a) -> (e instanceof ItemEntity)?new NumericValue(((ItemEntityInterface) e).getPickupDelayCM()):Value.NULL);
put("portal_cooldown", (e , a) ->new NumericValue(((EntityInterface)e).getPortalTimer()));
put("portal_timer", (e , a) ->new NumericValue(((EntityInterface)e).getPublicNetherPortalCooldown()));
put("portal_cooldown", (e , a) ->new NumericValue(((EntityInterface)e).getPublicNetherPortalCooldown()));
put("portal_timer", (e , a) ->new NumericValue(((EntityInterface)e).getPortalTimer()));
// ItemEntity -> despawn timer via ssGetAge
put("is_baby", (e, a) -> (e instanceof LivingEntity)?BooleanValue.of(((LivingEntity) e).isBaby()):Value.NULL);
put("target", (e, a) -> {
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/assets/carpet/scripts/ai_tracker.sc
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,9 @@ global_functions = {
'portal_cooldown' -> {
'*' -> [
_(arg) -> _(e) -> (
portal_timer = e~'portal_timer';
if (portal_timer,
[[], [], [['portal', 'portal cooldown:', portal_timer]]]
portal_cooldown = e~'portal_cooldown';
if (portal_cooldown,
[[], [], [['portal', 'portal cooldown:', portal_cooldown]]]
,
[[], [], []]
)
Expand Down

0 comments on commit 6019f81

Please sign in to comment.