mirror of
https://github.com/MassiveCraft/Factions.git
synced 2024-11-19 16:55:21 +01:00
removed TNT exploit handling code, since they did finally fix the bug in the CraftBukkit 1.1-RC1 release
This commit is contained in:
parent
84b6278529
commit
84e137049e
@ -348,7 +348,7 @@ public class Faction extends Entity implements EconomyParticipator
|
||||
public Set<FPlayer> getFPlayers()
|
||||
{
|
||||
// return a shallow copy of the FPlayer list, to prevent tampering and concurrency issues
|
||||
Set<FPlayer> ret = new HashSet(fplayers);
|
||||
Set<FPlayer> ret = new HashSet<FPlayer>(fplayers);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,6 @@ public class P extends MPlugin
|
||||
this.registerEvent(Event.Type.ENTITY_TARGET, this.entityListener, Event.Priority.Normal);
|
||||
this.registerEvent(Event.Type.PAINTING_BREAK, this.entityListener, Event.Priority.Normal);
|
||||
this.registerEvent(Event.Type.PAINTING_PLACE, this.entityListener, Event.Priority.Normal);
|
||||
this.registerEvent(Event.Type.EXPLOSION_PRIME, this.entityListener, Event.Priority.Normal);
|
||||
|
||||
// Block Events
|
||||
this.registerEvent(Event.Type.BLOCK_BREAK, this.blockListener, Event.Priority.Normal);
|
||||
|
@ -117,47 +117,6 @@ public class FactionsEntityListener extends EntityListener
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onExplosionPrime(ExplosionPrimeEvent event)
|
||||
{
|
||||
if (event.isCancelled()) return;
|
||||
if (! (event.getEntity() instanceof TNTPrimed)) return;
|
||||
if (exploitExplosions.isEmpty()) return;
|
||||
|
||||
// make sure this isn't a TNT explosion exploit attempt
|
||||
|
||||
int locX = event.getEntity().getLocation().getBlockX();
|
||||
int locZ = event.getEntity().getLocation().getBlockZ();
|
||||
|
||||
for (int i = exploitExplosions.size() - 1; i >= 0; i--)
|
||||
{
|
||||
PotentialExplosionExploit ex = exploitExplosions.get(i);
|
||||
|
||||
// remove anything from the list older than 10 seconds (TNT takes 4 seconds to trigger; provide some leeway)
|
||||
if (ex.timeMillis + 10000 < System.currentTimeMillis())
|
||||
{
|
||||
exploitExplosions.remove(i);
|
||||
continue;
|
||||
}
|
||||
|
||||
int absX = Math.abs(ex.X - locX);
|
||||
int absZ = Math.abs(ex.Z - locZ);
|
||||
if (absX < 5 && absZ < 5)
|
||||
{ // it sure looks like an exploit attempt
|
||||
// let's tattle on him to everyone
|
||||
String msg = "NOTICE: Player \""+ex.playerName+"\" attempted to exploit a TNT bug in the territory of \""+ex.faction.getTag()+"\" at "+ex.X+","+ex.Z+" (X,Z) using "+ex.item.name();
|
||||
P.p.log(Level.WARNING, msg);
|
||||
for (FPlayer fplayer : FPlayers.i.getOnline())
|
||||
{
|
||||
fplayer.sendMessage(msg);
|
||||
}
|
||||
event.setCancelled(true);
|
||||
exploitExplosions.remove(i);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityExplode(EntityExplodeEvent event)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user