mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-18 09:26:05 +00:00
commit
734286e8d3
|
@ -69,7 +69,7 @@ import org.yaml.snakeyaml.error.YAMLException;
|
|||
|
||||
public class Essentials extends JavaPlugin implements IEssentials
|
||||
{
|
||||
public static final int BUKKIT_VERSION = 2624;
|
||||
public static final int BUKKIT_VERSION = 2646;
|
||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||
private transient ISettings settings;
|
||||
private final transient TNTExplodeListener tntListener = new TNTExplodeListener(this);
|
||||
|
|
|
@ -1168,4 +1168,28 @@ public class OfflinePlayer implements Player
|
|||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCustomName(String string)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCustomName()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCustomNameVisible(boolean bln)
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCustomNameVisible()
|
||||
{
|
||||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -510,6 +510,8 @@ protect:
|
|||
portal-creation: false
|
||||
tnt-explosion: false
|
||||
tnt-playerdamage: false
|
||||
tnt-minecart-explosion: false
|
||||
tnt-minecart-playerdamage: false
|
||||
fireball-explosion: false
|
||||
fireball-fire: false
|
||||
fireball-playerdamage: false
|
||||
|
|
|
@ -103,6 +103,13 @@ public class EssentialsProtectEntityListener implements Listener
|
|||
return;
|
||||
}
|
||||
|
||||
if (eAttack instanceof MinecartTNT && prot.getSettingBool(ProtectConfig.prevent_tntminecart_playerdmg)
|
||||
&& !(target instanceof Player && shouldBeDamaged(user, "tnt-minecart")))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
return;
|
||||
}
|
||||
|
||||
// PVP Settings
|
||||
if (target instanceof Player && eAttack instanceof Player
|
||||
&& prot.getSettingBool(ProtectConfig.disable_pvp)
|
||||
|
@ -185,9 +192,10 @@ public class EssentialsProtectEntityListener implements Listener
|
|||
{
|
||||
return;
|
||||
}
|
||||
Entity entity = event.getEntity();
|
||||
final int maxHeight = ess.getSettings().getProtectCreeperMaxHeight();
|
||||
|
||||
if (event.getEntity() instanceof EnderDragon
|
||||
if (entity instanceof EnderDragon
|
||||
&& prot.getSettingBool(ProtectConfig.prevent_enderdragon_blockdmg))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
|
@ -197,12 +205,12 @@ public class EssentialsProtectEntityListener implements Listener
|
|||
}
|
||||
return;
|
||||
}
|
||||
if (event.getEntity() instanceof Wither
|
||||
if (entity instanceof Wither
|
||||
&& prot.getSettingBool(ProtectConfig.prevent_wither_spawnexplosion))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
else if (event.getEntity() instanceof Creeper
|
||||
else if (entity instanceof Creeper
|
||||
&& (prot.getSettingBool(ProtectConfig.prevent_creeper_explosion)
|
||||
|| prot.getSettingBool(ProtectConfig.prevent_creeper_blockdmg)
|
||||
|| (maxHeight >= 0 && event.getLocation().getBlockY() > maxHeight)))
|
||||
|
@ -211,23 +219,27 @@ public class EssentialsProtectEntityListener implements Listener
|
|||
event.setCancelled(true);
|
||||
event.getLocation().getWorld().createExplosion(event.getLocation(), 0F);
|
||||
}
|
||||
else if (event.getEntity() instanceof TNTPrimed
|
||||
else if (entity instanceof TNTPrimed
|
||||
&& prot.getSettingBool(ProtectConfig.prevent_tnt_explosion))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
|
||||
}
|
||||
else if ((event.getEntity() instanceof Fireball || event.getEntity() instanceof SmallFireball)
|
||||
else if ((entity instanceof Fireball || entity instanceof SmallFireball)
|
||||
&& prot.getSettingBool(ProtectConfig.prevent_fireball_explosion))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
|
||||
}
|
||||
else if ((event.getEntity() instanceof WitherSkull)
|
||||
else if ((entity instanceof WitherSkull)
|
||||
&& prot.getSettingBool(ProtectConfig.prevent_witherskull_explosion))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
|
||||
}
|
||||
else if ((entity instanceof MinecartTNT)
|
||||
&& prot.getSettingBool(ProtectConfig.prevent_tntminecart_explosion))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -304,9 +316,11 @@ public class EssentialsProtectEntityListener implements Listener
|
|||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
|
||||
public void onPaintingBreak(HangingBreakByEntityEvent event)
|
||||
{
|
||||
if (event.getCause() == HangingBreakEvent.RemoveCause.ENTITY
|
||||
&& event.getRemover() instanceof Creeper
|
||||
&& prot.getSettingBool(ProtectConfig.prevent_creeper_explosion))
|
||||
if ((event.getCause() == HangingBreakEvent.RemoveCause.ENTITY)
|
||||
&& ((event.getRemover() instanceof Creeper) && prot.getSettingBool(ProtectConfig.prevent_creeper_explosion)
|
||||
|| (((event.getRemover() instanceof Fireball) || (event.getRemover() instanceof SmallFireball)) && prot.getSettingBool(ProtectConfig.prevent_fireball_explosion))
|
||||
|| ((event.getRemover() instanceof TNTPrimed) && prot.getSettingBool(ProtectConfig.prevent_tnt_explosion))
|
||||
|| ((event.getRemover() instanceof WitherSkull) && prot.getSettingBool(ProtectConfig.prevent_witherskull_explosion))))
|
||||
{
|
||||
event.setCancelled(true);
|
||||
}
|
||||
|
|
|
@ -27,6 +27,8 @@ public enum ProtectConfig
|
|||
prevent_block_on_rail("protect.protect.prevent-block-on-rails", false),
|
||||
prevent_tnt_explosion("protect.prevent.tnt-explosion", false),
|
||||
prevent_tnt_playerdmg("protect.prevent.tnt-playerdamage", false),
|
||||
prevent_tntminecart_explosion("protect.prevent.tnt-minecart-explosion", false),
|
||||
prevent_tntminecart_playerdmg("protect.prevent.tnt-minecart-playerdamage", false),
|
||||
prevent_fireball_explosion("protect.prevent.fireball-explosion", false),
|
||||
prevent_fireball_fire("protect.prevent.fireball-fire", false),
|
||||
prevent_fireball_playerdmg("protect.prevent.fireball-playerdamage", false),
|
||||
|
|
BIN
lib/bukkit.jar
BIN
lib/bukkit.jar
Binary file not shown.
Binary file not shown.
Loading…
Reference in a new issue