Fix Herobrine not allow attack&Use new bukkit api
This commit is contained in:
parent
66ffdd62a4
commit
cc3ab5d48b
@ -1,7 +1,11 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<classpath>
|
<classpath>
|
||||||
<classpathentry kind="src" path="src"/>
|
<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/Factions.jar"/>
|
||||||
<classpathentry kind="lib" path="libs/GriefPrevention.jar"/>
|
<classpathentry kind="lib" path="libs/GriefPrevention.jar"/>
|
||||||
<classpathentry kind="lib" path="libs/MassiveCore.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/worldguard-6.1.jar"/>
|
||||||
<classpathentry kind="lib" path="libs/CustomItems-1.0.0.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/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="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"/>
|
<classpathentry kind="output" path="bin"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
2
.settings/org.eclipse.core.resources.prefs
Normal file
2
.settings/org.eclipse.core.resources.prefs
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding/<project>=UTF-8
|
@ -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
|
|
1
herobrine-for-bukkit-or-spigot-edition
Submodule
1
herobrine-for-bukkit-or-spigot-edition
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 66ffdd62a410a7edcf82c559a9a6fa7b013304c8
|
@ -182,11 +182,13 @@ public class EntityListener implements Listener {
|
|||||||
Herobrine.herobrineNPC.moveTo(newloc);
|
Herobrine.herobrineNPC.moveTo(newloc);
|
||||||
Herobrine.getPluginCore().getAICore().cancelTarget(Core.CoreType.ANY, true);
|
Herobrine.getPluginCore().getAICore().cancelTarget(Core.CoreType.ANY, true);
|
||||||
}
|
}
|
||||||
|
}else {
|
||||||
|
event.setCancelled(true);
|
||||||
|
event.setDamage(0);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
event.setCancelled(true);
|
|
||||||
event.setDamage(0);
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
if ((event instanceof EntityDamageByEntityEvent))
|
if ((event instanceof EntityDamageByEntityEvent))
|
||||||
{
|
{
|
||||||
@ -194,9 +196,9 @@ public class EntityListener implements Listener {
|
|||||||
if ((dEvent.getDamager() instanceof Player))
|
if ((dEvent.getDamager() instanceof Player))
|
||||||
{
|
{
|
||||||
Player player = (Player)dEvent.getDamager();
|
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);
|
this.getLore = ItemName.getLore(this.itemInHand);
|
||||||
if ((this.equalsLoreS != null) && (this.getLore.containsAll(this.equalsLoreS)) && (Herobrine.getPluginCore().getConfigDB().UseArtifactSword) && (new Random().nextBoolean())) {
|
if ((this.equalsLoreS != null) && (this.getLore.containsAll(this.equalsLoreS)) && (Herobrine.getPluginCore().getConfigDB().UseArtifactSword) && (new Random().nextBoolean())) {
|
||||||
player.getLocation().getWorld().strikeLightning(event.getEntity().getLocation());
|
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))
|
if ((event.getCause() != null) && (event.getCause() == EntityDamageEvent.DamageCause.LIGHTNING) && ((event.getEntity() instanceof Player)) && (event.getEntity().getEntityId() != Herobrine.herobrineEntityID))
|
||||||
{
|
{
|
||||||
Player player = (Player)event.getEntity();
|
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);
|
this.getLore = ItemName.getLore(this.itemInHand);
|
||||||
if ((this.getLore.containsAll(this.equalsLoreS)) && (Herobrine.getPluginCore().getConfigDB().UseArtifactSword))
|
if ((this.getLore.containsAll(this.equalsLoreS)) && (Herobrine.getPluginCore().getConfigDB().UseArtifactSword))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user