Skip to content

Commit

Permalink
3.3.1 - Compatibility with M7 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Quantizr committed Mar 2, 2022
1 parent 25e067a commit f4bf1b4
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ buildscript {
}
apply plugin: 'net.minecraftforge.gradle.forge'

version = "3.3.0"
version = "3.3.1"
group= "io.github.quantizr.DungeonRooms" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "Dungeon_Rooms"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ public void onServerConnect(FMLNetworkEvent.ClientConnectedToServerEvent event)
}

logger.info("DungeonRooms: Getting MOTD...");
url = new URL("https://gist.githubusercontent.com/Quantizr/50ed64a7a0f3b28dc742d5268d7a3217/raw/");
url = new URL("https://gist.githubusercontent.com/Quantizr/01aca53e61cef5dfd08989fec600b204/raw/");
BufferedReader in = new BufferedReader(new InputStreamReader(url.openStream(), StandardCharsets.UTF_8));
String line;
motd = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public void onTick(TickEvent.ClientTickEvent event) {
if (!player.getPositionVector().equals(new Vec3(0.0D,0.0D,0.0D))) {
//this point is calculated using math, not scanning, which may cause issues when reconnecting to a run
entrancePhysicalNWCorner = MapUtils.getClosestNWPhysicalCorner(player.getPositionVector());
DungeonRooms.logger.info("DungeonRooms: entrancePhysicalNWCorner has been set");
DungeonRooms.logger.info("DungeonRooms: entrancePhysicalNWCorner has been set to " + entrancePhysicalNWCorner);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public void onTick(TickEvent.ClientTickEvent event) {
if (MapUtils.getMapColor(playerMarkerPos, map).equals("green") && MapUtils.getMapColor(closestNWMapCorner, map).equals("green")) {
if (!player.getPositionVector().equals(new Vec3(0.0D, 0.0D, 0.0D))) {
entrancePhysicalNWCorner = MapUtils.getClosestNWPhysicalCorner(player.getPositionVector());
DungeonRooms.logger.info("DungeonRooms: entrancePhysicalNWCorner has been set");
DungeonRooms.logger.info("DungeonRooms: entrancePhysicalNWCorner has been set to " + entrancePhysicalNWCorner);
}
} else {
DungeonRooms.textToDisplay = new ArrayList<>(Arrays.asList(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,11 @@ public static Point getClosestNWMapCorner(Point mapPos, Point leftCorner, Point
*/
public static Point getClosestNWPhysicalCorner (Vec3 vectorPos) {
Vec3 shiftedPos = vectorPos.addVector(0.5, 0, 0.5); //shift by 0.5 so room borders are evenly split
int x = (int) (shiftedPos.xCoord - (shiftedPos.xCoord % 32)); //room length 31, +1 to account for gap between rooms
int z = (int) (shiftedPos.zCoord - (shiftedPos.zCoord % 32));
return new Point(x, z);
shiftedPos = shiftedPos.addVector(8, 0, 8); //because Hypixel randomly shifted rooms in Skyblock 0.12.3
int x = (int) (shiftedPos.xCoord - Math.floorMod((int) shiftedPos.xCoord, 32)); //room length 31, +1 to account for gap between rooms
int z = (int) (shiftedPos.zCoord - Math.floorMod((int) shiftedPos.zCoord, 32));

return new Point(x - 8 , z - 8); //-8 for same reason as above
}

public static Point getClosestNWPhysicalCorner (BlockPos blockPos) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ public static boolean blockPartOfDoorway(BlockPos blockToCheck) {
//will also return true for blocks in the middle of rooms where there would be a doorway if it were a 1x1
if (blockToCheck.getY() < 66 || blockToCheck.getY() > 73) return false;

int relX = blockToCheck.getX() % 32;
int relZ = blockToCheck.getZ() % 32;
int relX = Math.floorMod((blockToCheck.getX() - 8), 32);
int relZ = Math.floorMod((blockToCheck.getZ() - 8), 32);

if (relX >= 13 && relX <= 17) {
if (relZ <= 2) return true;
Expand Down

0 comments on commit f4bf1b4

Please sign in to comment.