Skip to content

Commit

Permalink
1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Moulberry committed Oct 31, 2020
1 parent 431d4a5 commit 36af336
Show file tree
Hide file tree
Showing 18 changed files with 508 additions and 322 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ apply plugin: 'com.github.johnrengelman.shadow'
sourceCompatibility = 1.8
targetCompatibility = 1.8

version = "1.4-REL"
version = "1.5-REL"
group= "io.github.moulberry"
archivesBaseName = "NotEnoughUpdates"
String modid = "notenoughupdates"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,17 @@ public class AccessoryBagOverlay {
private static int currentTab = TAB_BASIC;

public static boolean mouseClick() {
if(Minecraft.getMinecraft().currentScreen instanceof GuiChest) {
GuiChest eventGui = (GuiChest) Minecraft.getMinecraft().currentScreen;
ContainerChest cc = (ContainerChest) eventGui.inventorySlots;
String containerName = cc.getLowerChestInventory().getDisplayName().getUnformattedText();
if(!containerName.trim().startsWith("Accessory Bag")) {
return false;
}
} else {
return false;
}

if(!Mouse.getEventButtonState()) return false;
try {
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
Expand Down
53 changes: 0 additions & 53 deletions src/main/java/io/github/moulberry/notenoughupdates/DumymMod.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static void bindTextureIfExists() {
}

public static boolean isInDungeons() {
return false && !NotEnoughUpdates.INSTANCE.manager.config.disableDungeonBlocks.value &&
return !NotEnoughUpdates.INSTANCE.manager.config.disableDungeonBlocks.value &&
(NotEnoughUpdates.INSTANCE.manager.config.dungeonBlocksEverywhere.value ||
(SBInfo.getInstance().getLocation() != null && SBInfo.getInstance().getLocation().equals("dungeon")));
}
Expand Down
42 changes: 33 additions & 9 deletions src/main/java/io/github/moulberry/notenoughupdates/DungeonMap.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class DungeonMap {
private static final ResourceLocation GREEN_CHECK = new ResourceLocation("notenoughupdates:dungeon_map/green_check.png");
private static final ResourceLocation WHITE_CHECK = new ResourceLocation("notenoughupdates:dungeon_map/white_check.png");
private static final ResourceLocation QUESTION = new ResourceLocation("notenoughupdates:dungeon_map/question.png");
private static final ResourceLocation CROSS = new ResourceLocation("notenoughupdates:dungeon_map/cross.png");

private static final ResourceLocation ROOM_RED = new ResourceLocation("notenoughupdates:dungeon_map/rooms_default/red_room.png");
private static final ResourceLocation ROOM_BROWN = new ResourceLocation("notenoughupdates:dungeon_map/rooms_default/brown_room.png");
Expand Down Expand Up @@ -187,6 +188,8 @@ public void renderNoRotate(int roomSize, int connectorSize, int rotation) {
indicatorTex = GREEN_CHECK;
} else if(tick.getRed() == 13 && tick.getGreen() == 13 && tick.getBlue() == 13) {
indicatorTex = QUESTION;
} else if(tick.getRed() == 255 && tick.getGreen() == 0 && tick.getBlue() == 0) {
indicatorTex = CROSS;
}
if(indicatorTex != null) {
Minecraft.getMinecraft().getTextureManager().bindTexture(indicatorTex);
Expand Down Expand Up @@ -353,12 +356,14 @@ private static void upload(Shader shader, int width, int height, int scale, floa

public int getRenderRoomSize() {
int roomSizeOption = NotEnoughUpdates.INSTANCE.manager.config.dmRoomSize.value.intValue();
return roomSizeOption == 0 ? 12 : roomSizeOption == 2 ? 20 : 16;
if(roomSizeOption <= 0) return 12;
return 12 + roomSizeOption*4;
}

public int getRenderConnSize() {
int roomSizeOption = NotEnoughUpdates.INSTANCE.manager.config.dmRoomSize.value.intValue();
return roomSizeOption == 0 ? 3 : roomSizeOption == 2 ? 5 : 4;
if(roomSizeOption <= 0) return 3;
return 3 + roomSizeOption;
}

private HashMap<Integer, Float> borderRadiusCache = new HashMap<>();
Expand Down Expand Up @@ -429,8 +434,8 @@ public void render(int centerX, int centerY) {
rotation = (int)playerPos.rotation;
}

int mapSizeX = borderSizeOption == 0 ? 90 : borderSizeOption == 2 ? 160 : 120;
int mapSizeY = borderSizeOption == 0 ? 90 : borderSizeOption == 2 ? 160 : 120;
int mapSizeX = borderSizeOption == 0 ? 90 : borderSizeOption == 2 ? 160 : borderSizeOption == 3 ? 240 : 120;
int mapSizeY = borderSizeOption == 0 ? 90 : borderSizeOption == 2 ? 160 : borderSizeOption == 3 ? 240 : 120;
int roomsSizeX = (maxRoomX-minRoomX)*(renderRoomSize+renderConnSize)+renderRoomSize;
int roomsSizeY = (maxRoomY-minRoomY)*(renderRoomSize+renderConnSize)+renderRoomSize;
int mapCenterX = mapSizeX/2;
Expand Down Expand Up @@ -588,7 +593,7 @@ public void render(int centerX, int centerY) {
float deltaX = entityPos.getRenderX() - pos.getRenderX();
float deltaY = entityPos.getRenderY() - pos.getRenderY();

/*if(deltaX > (renderRoomSize + renderConnSize)/2) {
if(deltaX > (renderRoomSize + renderConnSize)/2) {
deltaX -= (renderRoomSize + renderConnSize);
} else if(deltaX < -(renderRoomSize + renderConnSize)/2) {
deltaX += (renderRoomSize + renderConnSize);
Expand All @@ -597,7 +602,7 @@ public void render(int centerX, int centerY) {
deltaY -= (renderRoomSize + renderConnSize);
} else if(deltaY < -(renderRoomSize + renderConnSize)/2) {
deltaY += (renderRoomSize + renderConnSize);
}*/
}

x += deltaX;
y += deltaY;
Expand Down Expand Up @@ -636,13 +641,18 @@ public void render(int centerX, int centerY) {
}
}

boolean headLayer = false;
int pixelWidth = 8;
int pixelHeight = 8;
if(renderRoomSize >= 24) {
pixelWidth = pixelHeight = 12;
}
GlStateManager.color(1, 1, 1, 1);
if(NotEnoughUpdates.INSTANCE.manager.config.dmPlayerHeads.value >= 1 &&
playerSkinMap.containsKey(entry.getKey())) {
Minecraft.getMinecraft().getTextureManager().bindTexture(playerSkinMap.get(entry.getKey()));

headLayer = true;
if(NotEnoughUpdates.INSTANCE.manager.config.dmPlayerHeads.value >= 3) {
minU = 9/64f;
minV = 9/64f;
Expand All @@ -656,8 +666,8 @@ public void render(int centerX, int centerY) {
}

if(NotEnoughUpdates.INSTANCE.manager.config.dmPlayerHeads.value >= 2) {
pixelWidth = 6;
pixelHeight = 6;
pixelWidth = pixelWidth*6/8;
pixelHeight = pixelHeight*6/8;
}
} else {
Minecraft.getMinecraft().getTextureManager().bindTexture(mapIcons);
Expand All @@ -682,6 +692,14 @@ public void render(int centerX, int centerY) {
worldrenderer.pos(-pixelWidth/2f, -pixelHeight/2f, 30+((float)k * -0.005F)).tex(minU, maxV).endVertex();
tessellator.draw();

if(headLayer) {
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(-pixelWidth/2f, pixelHeight/2f, 30+((float)k * -0.005F)+0.001f).tex(minU+0.5f, minV).endVertex();
worldrenderer.pos(pixelWidth/2f, pixelHeight/2f, 30+((float)k * -0.005F)+0.001f).tex(maxU+0.5f, minV).endVertex();
worldrenderer.pos(pixelWidth/2f, -pixelHeight/2f, 30+((float)k * -0.005F)+0.001f).tex(maxU+0.5f, maxV).endVertex();
worldrenderer.pos(-pixelWidth/2f, -pixelHeight/2f, 30+((float)k * -0.005F)+0.001f).tex(minU+0.5f, maxV).endVertex();
tessellator.draw();
}
GlStateManager.popMatrix();
k--;
}
Expand Down Expand Up @@ -775,7 +793,7 @@ public void render(int centerX, int centerY) {
Minecraft.getMinecraft().getTextureManager().bindTexture(rl);
GlStateManager.color(1, 1, 1, 1);

int size = borderSizeOption == 0 ? 165 : borderSizeOption == 2 ? 300 : 220;
int size = borderSizeOption == 0 ? 165 : borderSizeOption == 2 ? 300 : borderSizeOption == 3 ? 440 : 220;
Utils.drawTexturedRect(-size/2, -size/2, size, size, GL11.GL_NEAREST);
}

Expand Down Expand Up @@ -1308,6 +1326,12 @@ public void onRenderOverlay(RenderGameOverlayEvent event) {
if(SBInfo.getInstance().getLocation() == null || !SBInfo.getInstance().getLocation().equals("dungeon")) {
return;
}
if(Minecraft.getMinecraft().gameSettings.showDebugInfo ||
(Minecraft.getMinecraft().gameSettings.keyBindPlayerList.isKeyDown() &&
(!Minecraft.getMinecraft().isIntegratedServerRunning() ||
Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap().size() > 1))) {
return;
}

ItemStack stack = Minecraft.getMinecraft().thePlayer.inventory.mainInventory[8];
boolean holdingBow = stack != null && stack.getItem() == Items.arrow;
Expand Down

This file was deleted.

Loading

0 comments on commit 36af336

Please sign in to comment.