Fix Herobrine not allow attack&Use new bukkit api

This commit is contained in:
Ghost_chu 2018-03-10 22:11:43 +08:00
parent 66ffdd62a4
commit cc3ab5d48b
76 changed files with 13890 additions and 13893 deletions

View File

@ -1,7 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="lib" path="libs/Factions.jar"/>
<classpathentry kind="lib" path="libs/GriefPrevention.jar"/>
<classpathentry kind="lib" path="libs/MassiveCore.jar"/>
@ -11,7 +15,7 @@
<classpathentry kind="lib" path="libs/worldguard-6.1.jar"/>
<classpathentry kind="lib" path="libs/CustomItems-1.0.0.jar"/>
<classpathentry kind="lib" path="libs/Residence4.6.1.4.jar"/>
<classpathentry kind="lib" path="libs/craftbukkit-1.12.jar"/>
<classpathentry kind="lib" path="libs/RedProtect.jar"/>
<classpathentry kind="lib" path="C:/Users/MACHENIKE/OneDrive/eclipse-workspace/RedstoneTracker/lib/spigot-1.12.2.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8

View File

@ -1,12 +0,0 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.8

@ -0,0 +1 @@
Subproject commit 66ffdd62a410a7edcf82c559a9a6fa7b013304c8

View File

@ -182,21 +182,23 @@ public class EntityListener implements Listener {
Herobrine.herobrineNPC.moveTo(newloc);
Herobrine.getPluginCore().getAICore().cancelTarget(Core.CoreType.ANY, true);
}
}
}
}else {
event.setCancelled(true);
event.setDamage(0);
return;
}
}
}
if ((event instanceof EntityDamageByEntityEvent))
{
EntityDamageByEntityEvent dEvent = (EntityDamageByEntityEvent)event;
if ((dEvent.getDamager() instanceof Player))
{
Player player = (Player)dEvent.getDamager();
if ((player.getItemInHand() != null) && (player.getItemInHand().getType() == Material.DIAMOND_SWORD) && (ItemName.getLore(player.getItemInHand()) != null))
if ((player.getInventory().getItemInMainHand()!= null) && (player.getInventory().getItemInMainHand().getType() == Material.DIAMOND_SWORD) && (ItemName.getLore(player.getItemInHand()) != null))
{
this.itemInHand = player.getItemInHand();
this.itemInHand = player.getInventory().getItemInMainHand();
this.getLore = ItemName.getLore(this.itemInHand);
if ((this.equalsLoreS != null) && (this.getLore.containsAll(this.equalsLoreS)) && (Herobrine.getPluginCore().getConfigDB().UseArtifactSword) && (new Random().nextBoolean())) {
player.getLocation().getWorld().strikeLightning(event.getEntity().getLocation());
@ -221,9 +223,9 @@ public class EntityListener implements Listener {
if ((event.getCause() != null) && (event.getCause() == EntityDamageEvent.DamageCause.LIGHTNING) && ((event.getEntity() instanceof Player)) && (event.getEntity().getEntityId() != Herobrine.herobrineEntityID))
{
Player player = (Player)event.getEntity();
if ((player.getItemInHand() != null) && (player.getItemInHand().getType() == Material.DIAMOND_SWORD) && (ItemName.getLore(player.getItemInHand()) != null))
if ((player.getInventory().getItemInMainHand() != null) && (player.getInventory().getItemInMainHand().getType() == Material.DIAMOND_SWORD) && (ItemName.getLore(player.getItemInHand()) != null))
{
this.itemInHand = player.getItemInHand();
this.itemInHand =player.getInventory().getItemInMainHand();;
this.getLore = ItemName.getLore(this.itemInHand);
if ((this.getLore.containsAll(this.equalsLoreS)) && (Herobrine.getPluginCore().getConfigDB().UseArtifactSword))
{