Skip to content

Commit 3998c00

Browse files
committed
4.54.1
1 parent 1beccee commit 3998c00

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

src/main/java/ce/ajneb97/model/actions/ActionType.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ public enum ActionType {
3232
SET_ON_FIRE,
3333
FREEZE,
3434
HEAL,
35+
SET_FOOD_LEVEL,
3536
GIVE_ITEM,
3637
DROP_ITEM,
3738
SET_ITEM,
3839
SET_BLOCK,
3940
SUMMON,
4041
VECTOR,
42+
LIGHTNING_STRIKE,
4143
WAIT,
4244
WAIT_TICKS,
4345
KEEP_ITEMS,

src/main/java/ce/ajneb97/model/internal/ExecutedEvent.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ private void executeAction(Player player,ActionType type,String apiType,String a
275275
case SUMMON:
276276
ActionUtils.summon(actionLine);
277277
return;
278+
case LIGHTNING_STRIKE:
279+
ActionUtils.lightningStrike(actionLine);
280+
return;
278281
// Could or could not be a player event
279282
case FIREWORK:
280283
ActionUtils.firework(player, actionLine, plugin);
@@ -373,6 +376,9 @@ private void executeAction(Player player,ActionType type,String apiType,String a
373376
case HEAL:
374377
ActionUtils.heal(player, actionLine);
375378
return;
379+
case SET_FOOD_LEVEL:
380+
ActionUtils.setFoodLevel(player, actionLine);
381+
return;
376382
case GIVE_ITEM:
377383
ActionUtils.giveItem(player, actionLine);
378384
return;

src/main/java/ce/ajneb97/utils/ActionUtils.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,18 @@ public static void setBlock(String actionLine){
445445
}
446446
}
447447

448+
public static void lightningStrike(String actionLine) {
449+
// lightning_strike: <world>;<x>;<y>;<z>
450+
String[] sep = actionLine.split(";");
451+
World world = Bukkit.getWorld(sep[0]);
452+
double x = Double.parseDouble(sep[1]);
453+
double y = Double.parseDouble(sep[2]);
454+
double z = Double.parseDouble(sep[3]);
455+
Location l = new Location(world,x,y,z);
456+
457+
l.getWorld().strikeLightningEffect(l);
458+
}
459+
448460
public static void summon(String actionLine) {
449461
// summon: location:<x>,<y>,<z>,<world>;entity:<id>,<property>:<value>
450462
// custom_name:<value>
@@ -566,7 +578,6 @@ public static void vector(Player player,String actionLine){
566578
Vector newDirection = new Vector(direction.getX()*front,height,direction.getZ()*front);
567579
player.setVelocity(player.getVelocity().add(newDirection));
568580
}*/
569-
570581
public static void firework(Player player,String actionLine,ConditionalEvents plugin){
571582
// firework: colors:<color1>,<color2> type:<type> fade:<color1>,<color2> power:<power> location(optional):<x>;<y>;<z>;<world>
572583
ArrayList<Color> colors = new ArrayList<Color>();
@@ -726,6 +737,10 @@ public static void heal(Player player,String actionLine){
726737
}
727738
}
728739

740+
public static void setFoodLevel(Player player,String actionLine){
741+
player.setFoodLevel(Integer.parseInt(actionLine));
742+
}
743+
729744
public static void wait(String actionLine, ExecutedEvent executedEvent){
730745
executedEvent.setOnWait(true);
731746
int timeSeconds = Integer.valueOf(actionLine);

src/main/resources/plugin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
main: ce.ajneb97.ConditionalEvents
2-
version: 4.53.2
2+
version: 4.54.1
33
name: ConditionalEvents
44
api-version: 1.13
55
softdepend: [PlaceholderAPI,Citizens,WorldGuardEvents,WorldGuard,ProtocolLib,DiscordSRV]

0 commit comments

Comments
 (0)