Skip to content

Commit 36af336

Browse files
author
Moulberry
committed
1.5
1 parent 431d4a5 commit 36af336

18 files changed

Lines changed: 508 additions & 322 deletions

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ apply plugin: 'com.github.johnrengelman.shadow'
1919
sourceCompatibility = 1.8
2020
targetCompatibility = 1.8
2121

22-
version = "1.4-REL"
22+
version = "1.5-REL"
2323
group= "io.github.moulberry"
2424
archivesBaseName = "NotEnoughUpdates"
2525
String modid = "notenoughupdates"

src/main/java/io/github/moulberry/notenoughupdates/AccessoryBagOverlay.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ public class AccessoryBagOverlay {
6464
private static int currentTab = TAB_BASIC;
6565

6666
public static boolean mouseClick() {
67+
if(Minecraft.getMinecraft().currentScreen instanceof GuiChest) {
68+
GuiChest eventGui = (GuiChest) Minecraft.getMinecraft().currentScreen;
69+
ContainerChest cc = (ContainerChest) eventGui.inventorySlots;
70+
String containerName = cc.getLowerChestInventory().getDisplayName().getUnformattedText();
71+
if(!containerName.trim().startsWith("Accessory Bag")) {
72+
return false;
73+
}
74+
} else {
75+
return false;
76+
}
77+
6778
if(!Mouse.getEventButtonState()) return false;
6879
try {
6980
ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());

src/main/java/io/github/moulberry/notenoughupdates/DumymMod.java

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/main/java/io/github/moulberry/notenoughupdates/DungeonBlocks.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static void bindTextureIfExists() {
3939
}
4040

4141
public static boolean isInDungeons() {
42-
return false && !NotEnoughUpdates.INSTANCE.manager.config.disableDungeonBlocks.value &&
42+
return !NotEnoughUpdates.INSTANCE.manager.config.disableDungeonBlocks.value &&
4343
(NotEnoughUpdates.INSTANCE.manager.config.dungeonBlocksEverywhere.value ||
4444
(SBInfo.getInstance().getLocation() != null && SBInfo.getInstance().getLocation().equals("dungeon")));
4545
}

src/main/java/io/github/moulberry/notenoughupdates/DungeonMap.java

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public class DungeonMap {
5353
private static final ResourceLocation GREEN_CHECK = new ResourceLocation("notenoughupdates:dungeon_map/green_check.png");
5454
private static final ResourceLocation WHITE_CHECK = new ResourceLocation("notenoughupdates:dungeon_map/white_check.png");
5555
private static final ResourceLocation QUESTION = new ResourceLocation("notenoughupdates:dungeon_map/question.png");
56+
private static final ResourceLocation CROSS = new ResourceLocation("notenoughupdates:dungeon_map/cross.png");
5657

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

354357
public int getRenderRoomSize() {
355358
int roomSizeOption = NotEnoughUpdates.INSTANCE.manager.config.dmRoomSize.value.intValue();
356-
return roomSizeOption == 0 ? 12 : roomSizeOption == 2 ? 20 : 16;
359+
if(roomSizeOption <= 0) return 12;
360+
return 12 + roomSizeOption*4;
357361
}
358362

359363
public int getRenderConnSize() {
360364
int roomSizeOption = NotEnoughUpdates.INSTANCE.manager.config.dmRoomSize.value.intValue();
361-
return roomSizeOption == 0 ? 3 : roomSizeOption == 2 ? 5 : 4;
365+
if(roomSizeOption <= 0) return 3;
366+
return 3 + roomSizeOption;
362367
}
363368

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

432-
int mapSizeX = borderSizeOption == 0 ? 90 : borderSizeOption == 2 ? 160 : 120;
433-
int mapSizeY = borderSizeOption == 0 ? 90 : borderSizeOption == 2 ? 160 : 120;
437+
int mapSizeX = borderSizeOption == 0 ? 90 : borderSizeOption == 2 ? 160 : borderSizeOption == 3 ? 240 : 120;
438+
int mapSizeY = borderSizeOption == 0 ? 90 : borderSizeOption == 2 ? 160 : borderSizeOption == 3 ? 240 : 120;
434439
int roomsSizeX = (maxRoomX-minRoomX)*(renderRoomSize+renderConnSize)+renderRoomSize;
435440
int roomsSizeY = (maxRoomY-minRoomY)*(renderRoomSize+renderConnSize)+renderRoomSize;
436441
int mapCenterX = mapSizeX/2;
@@ -588,7 +593,7 @@ public void render(int centerX, int centerY) {
588593
float deltaX = entityPos.getRenderX() - pos.getRenderX();
589594
float deltaY = entityPos.getRenderY() - pos.getRenderY();
590595

591-
/*if(deltaX > (renderRoomSize + renderConnSize)/2) {
596+
if(deltaX > (renderRoomSize + renderConnSize)/2) {
592597
deltaX -= (renderRoomSize + renderConnSize);
593598
} else if(deltaX < -(renderRoomSize + renderConnSize)/2) {
594599
deltaX += (renderRoomSize + renderConnSize);
@@ -597,7 +602,7 @@ public void render(int centerX, int centerY) {
597602
deltaY -= (renderRoomSize + renderConnSize);
598603
} else if(deltaY < -(renderRoomSize + renderConnSize)/2) {
599604
deltaY += (renderRoomSize + renderConnSize);
600-
}*/
605+
}
601606

602607
x += deltaX;
603608
y += deltaY;
@@ -636,13 +641,18 @@ public void render(int centerX, int centerY) {
636641
}
637642
}
638643

644+
boolean headLayer = false;
639645
int pixelWidth = 8;
640646
int pixelHeight = 8;
647+
if(renderRoomSize >= 24) {
648+
pixelWidth = pixelHeight = 12;
649+
}
641650
GlStateManager.color(1, 1, 1, 1);
642651
if(NotEnoughUpdates.INSTANCE.manager.config.dmPlayerHeads.value >= 1 &&
643652
playerSkinMap.containsKey(entry.getKey())) {
644653
Minecraft.getMinecraft().getTextureManager().bindTexture(playerSkinMap.get(entry.getKey()));
645654

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

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

695+
if(headLayer) {
696+
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
697+
worldrenderer.pos(-pixelWidth/2f, pixelHeight/2f, 30+((float)k * -0.005F)+0.001f).tex(minU+0.5f, minV).endVertex();
698+
worldrenderer.pos(pixelWidth/2f, pixelHeight/2f, 30+((float)k * -0.005F)+0.001f).tex(maxU+0.5f, minV).endVertex();
699+
worldrenderer.pos(pixelWidth/2f, -pixelHeight/2f, 30+((float)k * -0.005F)+0.001f).tex(maxU+0.5f, maxV).endVertex();
700+
worldrenderer.pos(-pixelWidth/2f, -pixelHeight/2f, 30+((float)k * -0.005F)+0.001f).tex(minU+0.5f, maxV).endVertex();
701+
tessellator.draw();
702+
}
685703
GlStateManager.popMatrix();
686704
k--;
687705
}
@@ -775,7 +793,7 @@ public void render(int centerX, int centerY) {
775793
Minecraft.getMinecraft().getTextureManager().bindTexture(rl);
776794
GlStateManager.color(1, 1, 1, 1);
777795

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

@@ -1308,6 +1326,12 @@ public void onRenderOverlay(RenderGameOverlayEvent event) {
13081326
if(SBInfo.getInstance().getLocation() == null || !SBInfo.getInstance().getLocation().equals("dungeon")) {
13091327
return;
13101328
}
1329+
if(Minecraft.getMinecraft().gameSettings.showDebugInfo ||
1330+
(Minecraft.getMinecraft().gameSettings.keyBindPlayerList.isKeyDown() &&
1331+
(!Minecraft.getMinecraft().isIntegratedServerRunning() ||
1332+
Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap().size() > 1))) {
1333+
return;
1334+
}
13111335

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

src/main/java/io/github/moulberry/notenoughupdates/GuiButtonItem.java

Lines changed: 0 additions & 93 deletions
This file was deleted.

0 commit comments

Comments
 (0)