1.8 block and disguise hitbox not loading fix

This commit is contained in:
Tyler Murphy 2022-08-07 16:39:31 -04:00
parent 34ceb9f8b3
commit 0ff07e57e0
3 changed files with 9 additions and 2 deletions

View file

@ -292,7 +292,7 @@ public class Config {
}
bungeeLeave = config.getString("leaveType") == null || config.getString("leaveType").equalsIgnoreCase("proxy");
leaveServer = config.getString("leaveServer");
blockhuntEnabled = config.getBoolean("blockhunt.enabled");
blockhuntEnabled = config.getBoolean("blockhunt.enabled") && Main.getInstance().supports(9);
blockhuntBlocks = new ArrayList<>();
tempInteracts = config.getStringList("blockhunt.blocks");
for(String id : tempInteracts) {

View file

@ -1,5 +1,7 @@
package net.tylermurphy.hideAndSeek.game;
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
import net.tylermurphy.hideAndSeek.game.util.Disguise;
import org.bukkit.Material;
import org.bukkit.entity.Player;
@ -46,6 +48,10 @@ public class Disguiser {
}
public void disguise(Player player, Material material){
if(!blockhuntEnabled){
player.sendMessage(errorPrefix + "Please enable blockhunt in config.yml to enable disguises. Blockhunt does not work on 1.8");
return;
}
if(disguises.containsKey(player)){
disguises.get(player).remove();
}

View file

@ -92,7 +92,6 @@ public class Disguise {
solid = true;
blockLocation = hider.getLocation().getBlock().getLocation();
respawnHitbox();
teleportEntity(hitBox, true);
}
sendBlockUpdate(blockLocation, material);
} else if(solid){
@ -104,6 +103,7 @@ public class Disguise {
sendBlockUpdate(blockLocation, Material.AIR);
}
toggleEntityVisibility(block, !solid);
teleportEntity(hitBox, true);
teleportEntity(block, solid);
}
@ -122,6 +122,7 @@ public class Disguise {
}
private void teleportEntity(Entity entity, boolean center) {
if(entity == null) return;
EntityTeleportPacket packet = new EntityTeleportPacket();
packet.setEntity(entity);
double x,y,z;