From 1b1ec528261fb63265e3bfb5c3e5bb85b81336b9 Mon Sep 17 00:00:00 2001 From: Tyler Murphy Date: Thu, 9 Feb 2023 20:55:58 -0500 Subject: [PATCH] fix rightclick to find hider, and fix hider potion drink --- .../hideAndSeek/game/util/Disguise.java | 17 +++++++++++++---- .../hideAndSeek/world/WorldLoader.java | 1 - 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/net/tylermurphy/hideAndSeek/game/util/Disguise.java b/src/main/java/net/tylermurphy/hideAndSeek/game/util/Disguise.java index b3460d0..17ad90c 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/game/util/Disguise.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/game/util/Disguise.java @@ -20,7 +20,7 @@ public class Disguise { final Player hider; final Material material; FallingBlock block; - Horse hitBox; + AbstractHorse hitBox; Location blockLocation; boolean solid, solidify, solidifying; static Team hidden; @@ -156,15 +156,24 @@ public class Disguise { private void respawnFallingBlock(){ block = hider.getLocation().getWorld().spawnFallingBlock(hider.getLocation().add(0, 1000, 0), material, (byte)0); - block.setGravity(false); + if (Main.getInstance().supports(10)) { + block.setGravity(false); + } block.setDropItem(false); block.setInvulnerable(true); } private void respawnHitbox(){ - hitBox = (Horse) hider.getLocation().getWorld().spawnEntity(hider.getLocation().add(0, 1000, 0), EntityType.HORSE); + if (Main.getInstance().supports(11)) { + hitBox = (AbstractHorse) hider.getLocation().getWorld().spawnEntity(hider.getLocation().add(0, 1000, 0), EntityType.SKELETON_HORSE); + } else { + hitBox = (AbstractHorse) hider.getLocation().getWorld().spawnEntity(hider.getLocation().add(0, 1000, 0), EntityType.HORSE); + hitBox.setVariant(Horse.Variant.SKELETON_HORSE); + } + if (Main.getInstance().supports(10)) { + hitBox.setGravity(false); + } hitBox.setAI(false); - hitBox.setGravity(false); hitBox.setInvulnerable(true); hitBox.setCanPickupItems(false); hitBox.setCollidable(false); diff --git a/src/main/java/net/tylermurphy/hideAndSeek/world/WorldLoader.java b/src/main/java/net/tylermurphy/hideAndSeek/world/WorldLoader.java index e5913aa..821ef63 100644 --- a/src/main/java/net/tylermurphy/hideAndSeek/world/WorldLoader.java +++ b/src/main/java/net/tylermurphy/hideAndSeek/world/WorldLoader.java @@ -112,7 +112,6 @@ public class WorldLoader { String[] parts = file.split("\\."); if (parts.length > 1) { - Main.getInstance().getLogger().info(file); if ( Integer.parseInt(parts[1]) < minX || Integer.parseInt(parts[1]) > maxX || Integer.parseInt(parts[2]) < minZ || Integer.parseInt(parts[2]) > maxZ ) continue; }