-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
192 additions
and
62 deletions.
There are no files selected for viewing
27 changes: 27 additions & 0 deletions
27
src/main/java/lol/aabss/skuishy/elements/entities/conditions/CondHasGoatHorn.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,27 @@ | ||
package lol.aabss.skuishy.elements.entities.conditions; | ||
|
||
import ch.njol.skript.doc.Description; | ||
import ch.njol.skript.doc.Examples; | ||
import ch.njol.skript.doc.Name; | ||
import ch.njol.skript.doc.Since; | ||
import lol.aabss.skuishy.other.skript.EntityCondition; | ||
import org.bukkit.entity.Goat; | ||
|
||
@Name("Goat - Has Horn") | ||
@Description("True if the goat has the horn:") | ||
@Examples({ | ||
"if {_goat} has left horn:", | ||
"\tset left horn of {_goat} to false" | ||
}) | ||
@Since("2.8") | ||
public class CondHasGoatHorn extends EntityCondition<Goat> { | ||
|
||
static { | ||
register(CondHasGoatHorn.class, PropertyType.HAVE, "[goat] (:left|right) horn", "entities"); | ||
} | ||
|
||
@Override | ||
protected boolean run(Goat goat) { | ||
return tags.contains("left") ? goat.hasLeftHorn() : goat.hasRightHorn(); | ||
} | ||
} |
27 changes: 0 additions & 27 deletions
27
src/main/java/lol/aabss/skuishy/elements/entities/conditions/CondIsEndermanScreaming.java
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
src/main/java/lol/aabss/skuishy/elements/entities/conditions/CondIsScreaming.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,34 @@ | ||
package lol.aabss.skuishy.elements.entities.conditions; | ||
|
||
import ch.njol.skript.doc.Description; | ||
import ch.njol.skript.doc.Examples; | ||
import ch.njol.skript.doc.Name; | ||
import ch.njol.skript.doc.Since; | ||
import lol.aabss.skuishy.other.skript.EntityCondition; | ||
import org.bukkit.entity.Enderman; | ||
import org.bukkit.entity.Goat; | ||
import org.bukkit.entity.LivingEntity; | ||
|
||
@Name("Enderman/Goat - Is Screaming") | ||
@Description("True if the enderman or goat is screaming.") | ||
@Examples({ | ||
"if {_enderman} is screaming:", | ||
"\tset screaming state of {_enderman} to false" | ||
}) | ||
@Since("2.8") | ||
public class CondIsScreaming extends EntityCondition<LivingEntity> { | ||
|
||
static { | ||
register(CondIsScreaming.class, "[enderman|goat] screaming", "entities"); | ||
} | ||
|
||
@Override | ||
protected boolean run(LivingEntity entity) { | ||
if (entity instanceof Enderman) { | ||
return ((Enderman) entity).isScreaming(); | ||
} else if (entity instanceof Goat) { | ||
return ((Goat) entity).isScreaming(); | ||
} | ||
return false; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/lol/aabss/skuishy/elements/entities/effects/EffGoatRam.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,33 @@ | ||
package lol.aabss.skuishy.elements.entities.effects; | ||
|
||
import ch.njol.skript.Skript; | ||
import ch.njol.skript.doc.Description; | ||
import ch.njol.skript.doc.Examples; | ||
import ch.njol.skript.doc.Name; | ||
import ch.njol.skript.doc.Since; | ||
import lol.aabss.skuishy.other.skript.EntityEffect; | ||
import org.bukkit.entity.Goat; | ||
import org.bukkit.entity.LivingEntity; | ||
import org.bukkit.event.Event; | ||
|
||
@Name("Goat - Ram") | ||
@Description("Makes a goat ram into a living entity.") | ||
@Examples({ | ||
"make {_goat} ram into player" | ||
}) | ||
@Since("2.8") | ||
public class EffGoatRam extends EntityEffect<Goat> { | ||
|
||
static { | ||
Skript.registerEffect(EffJump.class, "make %livingentities% ram into %livingentities%"); | ||
} | ||
|
||
@Override | ||
protected void execute(Goat goat, Event event) { | ||
if (exprs.length >= 2 && exprs[1].getSingle(event) != null) { | ||
LivingEntity entity = (LivingEntity) exprs[1].getSingle(event); | ||
if (entity == null) return; | ||
goat.ram(entity); | ||
} | ||
} | ||
} |
35 changes: 0 additions & 35 deletions
35
src/main/java/lol/aabss/skuishy/elements/entities/expressions/ExprEndermanIsScreaming.java
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
src/main/java/lol/aabss/skuishy/elements/entities/expressions/ExprGoatHorn.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,39 @@ | ||
package lol.aabss.skuishy.elements.entities.expressions; | ||
|
||
import ch.njol.skript.classes.Changer; | ||
import ch.njol.skript.doc.Description; | ||
import ch.njol.skript.doc.Examples; | ||
import ch.njol.skript.doc.Name; | ||
import ch.njol.skript.doc.Since; | ||
import lol.aabss.skuishy.other.skript.EntityExpression; | ||
import org.bukkit.entity.Goat; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
@Name("Goat - Horn") | ||
@Description("Gets/sets the horn state of a goat.") | ||
@Examples({ | ||
"set left horn state of {_goat} to true" | ||
}) | ||
@Since("2.8") | ||
public class ExprGoatHorn extends EntityExpression<Goat, Boolean> { | ||
|
||
static { | ||
register(ExprGoatHorn.class, Boolean.class, "[goat] (:left|right) horn [mode|state]", "entities"); | ||
} | ||
|
||
@Override | ||
public Boolean get(Goat goat) { | ||
return tags.contains("left") ? goat.hasLeftHorn() : goat.hasRightHorn(); | ||
} | ||
|
||
@Override | ||
public void change(Goat goat, @Nullable Boolean aBoolean, Changer.ChangeMode mode) { | ||
if (aBoolean != null && mode == Changer.ChangeMode.SET) { | ||
if (tags.contains("left")) { | ||
goat.setLeftHorn(aBoolean); | ||
} else { | ||
goat.setRightHorn(aBoolean); | ||
} | ||
} | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
src/main/java/lol/aabss/skuishy/elements/entities/expressions/multiple/ExprIsScreaming.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,46 @@ | ||
package lol.aabss.skuishy.elements.entities.expressions.multiple; | ||
|
||
import ch.njol.skript.classes.Changer; | ||
import ch.njol.skript.doc.Description; | ||
import ch.njol.skript.doc.Examples; | ||
import ch.njol.skript.doc.Name; | ||
import ch.njol.skript.doc.Since; | ||
import lol.aabss.skuishy.other.skript.EntityExpression; | ||
import org.bukkit.entity.Enderman; | ||
import org.bukkit.entity.Goat; | ||
import org.bukkit.entity.LivingEntity; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
@Name("Enderman/Goat - Is Screaming") | ||
@Description("Gets/sets the is screaming state of an enderman or goat.") | ||
@Examples({ | ||
"set screaming state of {_enderman} to true" | ||
}) | ||
@Since("2.8") | ||
public class ExprIsScreaming extends EntityExpression<LivingEntity, Boolean> { | ||
|
||
static { | ||
register(ExprIsScreaming.class, Boolean.class, "[enderman|goat] screaming [state|mode]", "entities"); | ||
} | ||
|
||
@Override | ||
public Boolean get(LivingEntity entity) { | ||
if (entity instanceof Enderman) { | ||
return ((Enderman) entity).isScreaming(); | ||
} else if (entity instanceof Goat) { | ||
return ((Goat) entity).isScreaming(); | ||
} | ||
return null; | ||
} | ||
|
||
@Override | ||
public void change(LivingEntity entity, @Nullable Boolean aBoolean, Changer.ChangeMode mode) { | ||
if (aBoolean != null && mode == Changer.ChangeMode.SET) { | ||
if (entity instanceof Enderman) { | ||
((Enderman) entity).setScreaming(aBoolean); | ||
} else if (entity instanceof Goat) { | ||
((Goat) entity).setScreaming(aBoolean); | ||
} | ||
} | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/lol/aabss/skuishy/other/skript/EntityCondition.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