Improving Array
Dieser Commit ist enthalten in:
Ursprung
9984fc0179
Commit
5eedf7bf50
@ -26,7 +26,6 @@ import de.steamwar.fightsystem.states.FightState;
|
||||
import de.steamwar.fightsystem.states.StateDependent;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.AbstractArrow;
|
||||
@ -52,18 +51,14 @@ public class ArrowStopper implements StateDependent {
|
||||
if(arrows.isEmpty())
|
||||
return;
|
||||
for (Entity entity : arrows) {
|
||||
if(entity.getTicksLived() > Config.ArrowTechhiderCollision){
|
||||
LAST_LOCATION.remove(entity);
|
||||
continue;
|
||||
}
|
||||
if(((AbstractArrow) entity).isInBlock()) {
|
||||
if(entity.getTicksLived() > Config.ArrowTechhiderCollision ||
|
||||
((AbstractArrow) entity).isInBlock()){
|
||||
LAST_LOCATION.remove(entity);
|
||||
continue;
|
||||
}
|
||||
if(!LAST_LOCATION.containsKey(entity))
|
||||
LAST_LOCATION.put(entity, ((Player) ((AbstractArrow) entity).getShooter()).getEyeLocation());
|
||||
Location last = LAST_LOCATION.get(entity);
|
||||
LAST_LOCATION.remove(entity);
|
||||
Location last = LAST_LOCATION.remove(entity);
|
||||
if(checkBlocks(entity.getLocation().getBlock(), last.getBlock()))
|
||||
entity.remove();
|
||||
else
|
||||
@ -78,7 +73,7 @@ public class ArrowStopper implements StateDependent {
|
||||
|
||||
@Override
|
||||
public void enable() {
|
||||
task = Bukkit.getScheduler().runTaskTimerAsynchronously(FightSystem.getPlugin(), this::run, 1, 0);
|
||||
task = Bukkit.getScheduler().runTaskTimerAsynchronously(FightSystem.getPlugin(), this::run, 1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren