Skip to content

Commit 2f94167

Browse files
committed
Update WorldGuard, add glowing expression (#91)
1 parent 58b8a1a commit 2f94167

File tree

4 files changed

+80
-3
lines changed

4 files changed

+80
-3
lines changed

lib/worldguard-6.1.2.jar

1.19 MB
Binary file not shown.

lib/worldguard-6.1.jar

-1.26 MB
Binary file not shown.

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<modelVersion>4.0.0</modelVersion>
33
<groupId>ch.njol</groupId>
44
<artifactId>skript</artifactId>
5-
<version>2.2-dev17</version>
5+
<version>2.2-dev18</version>
66
<name>Skript</name>
77
<description>A plugin for the Minecraft server API Bukkit that allows to create scripts in natural language.</description>
88
<url>http://njol.ch/projects/skript/</url>
@@ -51,9 +51,9 @@
5151
<dependency>
5252
<groupId>com.sk89q</groupId>
5353
<artifactId>worldguard</artifactId>
54-
<version>6.1.1-SNAPSHOT</version>
54+
<version>6.1.2-SNAPSHOT</version>
5555
<scope>system</scope>
56-
<systemPath>${project.basedir}/lib/worldguard-6.1.jar</systemPath>
56+
<systemPath>${project.basedir}/lib/worldguard-6.1.2.jar</systemPath>
5757
</dependency>
5858

5959
<dependency>
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
/*
2+
* This file is part of Skript.
3+
*
4+
* Skript is free software: you can redistribute it and/or modify
5+
* it under the terms of the GNU General Public License as published by
6+
* the Free Software Foundation, either version 3 of the License, or
7+
* (at your option) any later version.
8+
*
9+
* Skript is distributed in the hope that it will be useful,
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
* GNU General Public License for more details.
13+
*
14+
* You should have received a copy of the GNU General Public License
15+
* along with Skript. If not, see <http://www.gnu.org/licenses/>.
16+
*
17+
*
18+
* Copyright 2011-2016 Peter Güttinger and contributors
19+
*
20+
*/
21+
22+
package ch.njol.skript.expressions;
23+
24+
import org.bukkit.Location;
25+
import org.bukkit.entity.Entity;
26+
import org.bukkit.entity.Player;
27+
import org.bukkit.event.Event;
28+
import org.eclipse.jdt.annotation.Nullable;
29+
30+
import ch.njol.skript.classes.Changer.ChangeMode;
31+
import ch.njol.skript.doc.Description;
32+
import ch.njol.skript.doc.Events;
33+
import ch.njol.skript.doc.Examples;
34+
import ch.njol.skript.doc.Name;
35+
import ch.njol.skript.doc.Since;
36+
import ch.njol.skript.expressions.base.SimplePropertyExpression;
37+
38+
@Name("Glowing")
39+
@Description("Indicates if targeted entity is glowing (new 1.9 effect) or not. Glowing entities can be seen through walls.")
40+
@Examples({"set glowing of player on"})
41+
@Since("2.2-dev18")
42+
public class ExprGlowing extends SimplePropertyExpression<Entity, Boolean> {
43+
44+
static {
45+
register(ExprGlowing.class, Boolean.class, "glowing", "entities");
46+
}
47+
48+
@SuppressWarnings("null")
49+
@Override
50+
public Boolean convert(final Entity e) {
51+
return e.isGlowing();
52+
}
53+
54+
@Override
55+
protected String getPropertyName() {
56+
return "glowing";
57+
}
58+
59+
@Override
60+
public Class<Boolean> getReturnType() {
61+
return Boolean.class;
62+
}
63+
64+
@Override
65+
@Nullable
66+
public Class<?>[] acceptChange(final ChangeMode mode) {
67+
if (mode == ChangeMode.SET || mode == ChangeMode.RESET)
68+
return new Class[] {Boolean.class};
69+
return null;
70+
}
71+
72+
@Override
73+
public void change(final Event e, final @Nullable Object[] delta, final ChangeMode mode) throws UnsupportedOperationException {
74+
for (final Entity entity : getExpr().getArray(e))
75+
entity.setGlowing(delta == null ? false : (Boolean) delta[0]);
76+
}
77+
}

0 commit comments

Comments
 (0)