File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed
src/main/java/ch/njol/skript Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change 2
2
<modelVersion >4.0.0</modelVersion >
3
3
<groupId >ch.njol</groupId >
4
4
<artifactId >skript</artifactId >
5
- <version >2.2-dev14b </version >
5
+ <version >2.2-dev14c </version >
6
6
<name >Skript</name >
7
7
<description >A plugin for the Minecraft server API Bukkit that allows to create scripts in natural language.</description >
8
8
<url >http://njol.ch/projects/skript/</url >
Original file line number Diff line number Diff line change 48
48
import com .sk89q .worldedit .BlockVector ;
49
49
import com .sk89q .worldguard .bukkit .WorldGuardPlugin ;
50
50
import com .sk89q .worldguard .domains .DefaultDomain ;
51
+ import com .sk89q .worldguard .protection .ApplicableRegionSet ;
52
+ import com .sk89q .worldguard .protection .managers .RegionManager ;
51
53
import com .sk89q .worldguard .protection .regions .ProtectedRegion ;
52
54
53
55
/**
@@ -240,8 +242,15 @@ public int hashCode() {
240
242
@ SuppressWarnings ("null" )
241
243
@ Override
242
244
public Collection <? extends Region > getRegionsAt_i (final Location l ) {
243
- final Iterator <ProtectedRegion > i = plugin .getRegionManager (l .getWorld ()).getApplicableRegions (l ).iterator ();
244
245
final ArrayList <Region > r = new ArrayList <Region >();
246
+
247
+ RegionManager manager = plugin .getRegionManager (l .getWorld ());
248
+ if (manager == null )
249
+ return r ;
250
+ ApplicableRegionSet applicable = manager .getApplicableRegions (l );
251
+ if (applicable == null )
252
+ return r ;
253
+ final Iterator <ProtectedRegion > i = applicable .iterator ();
245
254
while (i .hasNext ())
246
255
r .add (new WorldGuardRegion (l .getWorld (), i .next ()));
247
256
return r ;
Original file line number Diff line number Diff line change @@ -166,7 +166,6 @@ public boolean validateFunction(final boolean first) {
166
166
return true ;
167
167
}
168
168
169
- @ SuppressWarnings ("null" )
170
169
@ Nullable
171
170
protected T [] execute (final Event e ) {
172
171
if (function == null )
@@ -182,16 +181,21 @@ protected T[] execute(final Event e) {
182
181
for (int i = 0 ; i < params .length ; i ++)
183
182
params [i ] = parameters [i ].getArray (e ); // TODO what if an argument is not available? pass null or abort?
184
183
}
184
+ assert function != null ;
185
185
return function .execute (params );
186
186
}
187
187
188
188
public boolean isSingle () {
189
189
return single ;
190
190
}
191
191
192
- @ SuppressWarnings ("null " )
192
+ @ SuppressWarnings ("unchecked " )
193
193
public Class <? extends T > getReturnType () {
194
- return function .returnType .getC ();
194
+ if (function == null )
195
+ return (Class <? extends T >) Void .class ; // No function = no return
196
+ assert function != null ;
197
+ ClassInfo <? extends T > ret = function .getReturnType ();
198
+ return (Class <? extends T >) (ret == null ? Void .class : ret );
195
199
}
196
200
197
201
public String toString (@ Nullable final Event e , final boolean debug ) {
You can’t perform that action at this time.
0 commit comments