fix rightclick to find hider, and fix hider potion drink

This commit is contained in:
Tyler Murphy 2023-02-09 20:55:58 -05:00
parent b87174e770
commit 1b1ec52826
2 changed files with 13 additions and 5 deletions

View file

@ -20,7 +20,7 @@ public class Disguise {
final Player hider; final Player hider;
final Material material; final Material material;
FallingBlock block; FallingBlock block;
Horse hitBox; AbstractHorse hitBox;
Location blockLocation; Location blockLocation;
boolean solid, solidify, solidifying; boolean solid, solidify, solidifying;
static Team hidden; static Team hidden;
@ -156,15 +156,24 @@ public class Disguise {
private void respawnFallingBlock(){ private void respawnFallingBlock(){
block = hider.getLocation().getWorld().spawnFallingBlock(hider.getLocation().add(0, 1000, 0), material, (byte)0); block = hider.getLocation().getWorld().spawnFallingBlock(hider.getLocation().add(0, 1000, 0), material, (byte)0);
if (Main.getInstance().supports(10)) {
block.setGravity(false); block.setGravity(false);
}
block.setDropItem(false); block.setDropItem(false);
block.setInvulnerable(true); block.setInvulnerable(true);
} }
private void respawnHitbox(){ private void respawnHitbox(){
hitBox = (Horse) hider.getLocation().getWorld().spawnEntity(hider.getLocation().add(0, 1000, 0), EntityType.HORSE); if (Main.getInstance().supports(11)) {
hitBox.setAI(false); 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.setGravity(false);
}
hitBox.setAI(false);
hitBox.setInvulnerable(true); hitBox.setInvulnerable(true);
hitBox.setCanPickupItems(false); hitBox.setCanPickupItems(false);
hitBox.setCollidable(false); hitBox.setCollidable(false);

View file

@ -112,7 +112,6 @@ public class WorldLoader {
String[] parts = file.split("\\."); String[] parts = file.split("\\.");
if (parts.length > 1) { 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 ) if ( Integer.parseInt(parts[1]) < minX || Integer.parseInt(parts[1]) > maxX || Integer.parseInt(parts[2]) < minZ || Integer.parseInt(parts[2]) > maxZ )
continue; continue;
} }