diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs index 3a0745f..af7ce86 100644 --- a/.settings/org.eclipse.jdt.core.prefs +++ b/.settings/org.eclipse.jdt.core.prefs @@ -1,9 +1,9 @@ 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.targetPlatform=17 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -13,4 +13,4 @@ org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.source=17 diff --git a/pom.xml b/pom.xml index 5ff0273..f126b85 100644 --- a/pom.xml +++ b/pom.xml @@ -2,10 +2,10 @@ 4.0.0 giants giants - 22.9.0 + 22.10.0 - 1.8 + 17 17 diff --git a/src/main/java/pl/minecon724/giants/Main.java b/src/main/java/pl/minecon724/giants/Main.java index b53b7bb..447fd68 100644 --- a/src/main/java/pl/minecon724/giants/Main.java +++ b/src/main/java/pl/minecon724/giants/Main.java @@ -7,6 +7,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; + import java.util.Random; import org.bstats.bukkit.Metrics; @@ -14,6 +15,7 @@ import org.bstats.charts.SimplePie; import org.bukkit.Bukkit; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.attribute.Attribute; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -161,6 +163,7 @@ public class Main extends JavaPlugin implements Listener, CommandExecutor { @EventHandler public void entityDamage(EntityDamageByEntityEvent e) { + if (!(e.getDamager() instanceof LivingEntity)) return; LivingEntity entity = (LivingEntity) e.getDamager(); if (entity.hasMetadata("giant")) { entity.setInvulnerable(false); @@ -191,12 +194,12 @@ public class Main extends JavaPlugin implements Listener, CommandExecutor { LivingEntity passenger = (LivingEntity) pos.getWorld().spawnEntity(pos, EntityType.HUSK); new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 1) .apply((LivingEntity) passenger); - passenger.setCustomName("Giant"); + //passenger.setCustomName("Giant"); passenger.setCustomNameVisible(false); passenger.setInvulnerable(true); passenger.setPersistent(true); passenger.setMetadata("giant", new FixedMetadataValue(this, "y")); - passenger.setHealth(Integer.MAX_VALUE); + passenger.setHealth(20); entity.addPassenger(passenger); } for (Entry t : effects.entrySet()) { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index 0678b3d..dd01d59 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -4,13 +4,13 @@ ai: true # 0.5 is half a heart attackDamage: 1.0 -# Spawning chance, from 0 to 1 +# Spawning chance, from 0 to 1. "Spawning" means hijacking zombie spawns (natural or not) chance: 0.02 -# Attack delay in ticks, smaller values will lag the server more +# Attack delay (in ticks) hitDelay: 20 -# 0 - attack only entities touching the giant, if too high the giant will hit through walls +# 0 - attack only entities touching the giant. There's nothing preventing us from hitting through walls. attackReach: 2 # Additional potion effects @@ -29,9 +29,9 @@ effects: [] drops: [] # - "APPLE:1:3:25" -# Head rotations, disabling can slightly improve performance headRotations: true refreshDelay: 20 + # No need to change this expandUp: 0 attack: true \ No newline at end of file