Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
Changed into a Map and no more "]" on the directions
  • Loading branch information
OnlyBMan committed May 30, 2020
1 parent 8d5777c commit a9bdde4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public class GeyserSession implements CommandSender {
private InventoryCache inventoryCache;
private ScoreboardCache scoreboardCache;
private WindowCache windowCache;
private Map<Position, Long> skullCache = new HashMap<>();
private Object2LongMap<Position> skullCache = new Object2LongOpenHashMap<Position>() {};
@Setter
private TeleportCache teleportCache;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,8 @@ public class BlockTranslator {
}

if (entry.getKey().contains("wall_skull") || entry.getKey().contains("wall_head")) {
BlockStateValues.getWallSkullDirection().put(javaBlockState, entry.getKey().substring(entry.getKey().lastIndexOf("facing=") + 7));
String direction = entry.getKey().substring(entry.getKey().lastIndexOf("facing=") + 7);
BlockStateValues.getWallSkullDirection().put(javaBlockState, direction.substring(0, direction.length() - 1));
}

if ("minecraft:water[level=0]".equals(javaId)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,19 +125,19 @@ public static void spawnPlayer(GeyserSession session, com.github.steveice10.open
if (BlockStateValues.getSkullRotation(blockState) == -1) {
y += 0.25f;
switch (BlockStateValues.getWallSkullDirection().get(blockState)) {
case "north]":
case "north":
rotation = 180f;
z += 0.24;
break;
case "south]":
case "south":
rotation = 0;
z -= 0.24f;
break;
case "west]":
case "west":
rotation = 90;
x += 0.24f;
break;
case "east]":
case "east":
rotation = 270;
x -= 0.24f;
break;
Expand Down

0 comments on commit a9bdde4

Please sign in to comment.