File tree Expand file tree Collapse file tree 1 file changed +10
-13
lines changed
Bukkit/src/main/java/com/plotsquared/bukkit/listener Expand file tree Collapse file tree 1 file changed +10
-13
lines changed Original file line number Diff line number Diff line change @@ -244,24 +244,21 @@ public void onWeavingEffect(EntityChangeBlockEvent event) {
244
244
if (event .getTo () != Material .COBWEB ) {
245
245
return ;
246
246
}
247
- Block block = event .getBlock ();
248
- World world = block .getWorld ();
249
- String worldName = world .getName ();
250
- if (!this .plotAreaManager .hasPlotArea (worldName )) {
251
- return ;
252
- }
253
- Location location = BukkitUtil .adapt (block .getLocation ());
247
+ Location location = BukkitUtil .adapt (event .getBlock ().getLocation ());
254
248
PlotArea area = location .getPlotArea ();
255
249
if (area == null ) {
256
250
return ;
257
251
}
258
- Plot plot = area .getOwnedPlotAbs (location );
259
-
260
- if (plot == null || !plot .getFlag (WeavingDeathPlace .class )) {
261
- event .setCancelled (true );
262
- if (plot != null ) {
263
- plot .debug ("Falling block event was cancelled because weaving-death-place = false" );
252
+ Plot plot = location .getOwnedPlot ();
253
+ if (plot == null ) {
254
+ if (PlotFlagUtil .isAreaRoadFlagsAndFlagEquals (area , WeavingDeathPlace .class , false )) {
255
+ event .setCancelled (true );
264
256
}
257
+ return ;
258
+ }
259
+ if (plot .getFlag (WeavingDeathPlace .class )) {
260
+ plot .debug (event .getTo () + " could not spawn because weaving-death-place = false" );
261
+ event .setCancelled (true );
265
262
}
266
263
}
267
264
You can’t perform that action at this time.
0 commit comments