1.8 block and disguise hitbox not loading fix
This commit is contained in:
parent
34ceb9f8b3
commit
0ff07e57e0
3 changed files with 9 additions and 2 deletions
|
@ -292,7 +292,7 @@ public class Config {
|
||||||
}
|
}
|
||||||
bungeeLeave = config.getString("leaveType") == null || config.getString("leaveType").equalsIgnoreCase("proxy");
|
bungeeLeave = config.getString("leaveType") == null || config.getString("leaveType").equalsIgnoreCase("proxy");
|
||||||
leaveServer = config.getString("leaveServer");
|
leaveServer = config.getString("leaveServer");
|
||||||
blockhuntEnabled = config.getBoolean("blockhunt.enabled");
|
blockhuntEnabled = config.getBoolean("blockhunt.enabled") && Main.getInstance().supports(9);
|
||||||
blockhuntBlocks = new ArrayList<>();
|
blockhuntBlocks = new ArrayList<>();
|
||||||
tempInteracts = config.getStringList("blockhunt.blocks");
|
tempInteracts = config.getStringList("blockhunt.blocks");
|
||||||
for(String id : tempInteracts) {
|
for(String id : tempInteracts) {
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package net.tylermurphy.hideAndSeek.game;
|
package net.tylermurphy.hideAndSeek.game;
|
||||||
|
|
||||||
|
import static net.tylermurphy.hideAndSeek.configuration.Config.*;
|
||||||
|
|
||||||
import net.tylermurphy.hideAndSeek.game.util.Disguise;
|
import net.tylermurphy.hideAndSeek.game.util.Disguise;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
@ -46,6 +48,10 @@ public class Disguiser {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void disguise(Player player, Material material){
|
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)){
|
if(disguises.containsKey(player)){
|
||||||
disguises.get(player).remove();
|
disguises.get(player).remove();
|
||||||
}
|
}
|
||||||
|
|
|
@ -92,7 +92,6 @@ public class Disguise {
|
||||||
solid = true;
|
solid = true;
|
||||||
blockLocation = hider.getLocation().getBlock().getLocation();
|
blockLocation = hider.getLocation().getBlock().getLocation();
|
||||||
respawnHitbox();
|
respawnHitbox();
|
||||||
teleportEntity(hitBox, true);
|
|
||||||
}
|
}
|
||||||
sendBlockUpdate(blockLocation, material);
|
sendBlockUpdate(blockLocation, material);
|
||||||
} else if(solid){
|
} else if(solid){
|
||||||
|
@ -104,6 +103,7 @@ public class Disguise {
|
||||||
sendBlockUpdate(blockLocation, Material.AIR);
|
sendBlockUpdate(blockLocation, Material.AIR);
|
||||||
}
|
}
|
||||||
toggleEntityVisibility(block, !solid);
|
toggleEntityVisibility(block, !solid);
|
||||||
|
teleportEntity(hitBox, true);
|
||||||
teleportEntity(block, solid);
|
teleportEntity(block, solid);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,6 +122,7 @@ public class Disguise {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void teleportEntity(Entity entity, boolean center) {
|
private void teleportEntity(Entity entity, boolean center) {
|
||||||
|
if(entity == null) return;
|
||||||
EntityTeleportPacket packet = new EntityTeleportPacket();
|
EntityTeleportPacket packet = new EntityTeleportPacket();
|
||||||
packet.setEntity(entity);
|
packet.setEntity(entity);
|
||||||
double x,y,z;
|
double x,y,z;
|
||||||
|
|
Loading…
Reference in a new issue