Skip to content

Commit

Permalink
Blocks cannot solidify on incomplete blocks.
Browse files Browse the repository at this point in the history
  • Loading branch information
iceBear67 committed Oct 22, 2024
1 parent c987c2f commit 3059c70
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/main/java/dev/tylerm/khs/game/util/Disguise.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public void update() {
}

private void onSolidifyChanged(boolean solid) {
if(solid){
if (solid) {
var tp = new EntityTeleportPacket();
tp.setEntity(getPlayer());
// seekers may see a "phantom" when hiders come back to their block.
Expand All @@ -129,7 +129,7 @@ private void onSolidifyChanged(boolean solid) {
for (Player seeker : Main.getInstance().getBoard().getSeekers()) {
tp.send(seeker);
}
}else{
} else {
var tp = new EntityTeleportPacket();
tp.setEntity(getPlayer());
var loc = getPlayer().getLocation();
Expand Down Expand Up @@ -184,8 +184,7 @@ private void toggleEntityVisibility(Entity entity, boolean show) {
if (entity instanceof Player p) {
receiver.showPlayer(Main.getInstance(), p);
} else receiver.showEntity(Main.getInstance(), entity);
} else
if (entity instanceof Player p) {
} else if (entity instanceof Player p) {
receiver.hidePlayer(Main.getInstance(), p);
} else receiver.hideEntity(Main.getInstance(), entity);
//Main.getInstance().getEntityHider().hideEntity(receiver, entity);
Expand Down Expand Up @@ -228,6 +227,13 @@ private void solidifyUpdate(Location lastLocation, int time) {
solidifying = false;
return;
}
var pos = currentLocation.getBlock();
if (!pos.getType().isAir()
&& pos.getType() != Material.WATER
&& (currentLocation.getY() - pos.getY() > 0)) {
solidifying = false;
return;
}
if (time == 0) {
ActionBar.clearActionBar(hider);
setSolidify(true);
Expand Down

0 comments on commit 3059c70

Please sign in to comment.