aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/features/impl
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/features/impl')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureInstaCloseChest.java10
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureTooltipPrice.java6
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java9
3 files changed, 14 insertions, 11 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureInstaCloseChest.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureInstaCloseChest.java
index 175da78a..d6a6d7c4 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureInstaCloseChest.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/dungeon/FeatureInstaCloseChest.java
@@ -46,7 +46,7 @@ public class FeatureInstaCloseChest extends SimpleFeature implements GuiOpenList
check = true;
}
- public static int getPrice(ItemStack itemStack) {
+ public static long getPrice(ItemStack itemStack) {
if (itemStack == null) return 0;
NBTTagCompound compound = itemStack.getTagCompound();
if (compound == null)
@@ -61,14 +61,14 @@ public class FeatureInstaCloseChest extends SimpleFeature implements GuiOpenList
public int compare(String o1, String o2) {
String id2 = id + "::" + o1 + "-" + enchants.getInteger(o1);
AhUtils.AuctionData auctionData = AhUtils.auctions.get(id2);
- int price1 = (auctionData == null) ? 0 : auctionData.lowestBin;
+ long price1 = (auctionData == null) ? 0 : auctionData.lowestBin;
String id3 = id + "::" + o2 + "-" + enchants.getInteger(o2);
AhUtils.AuctionData auctionData2 = AhUtils.auctions.get(id3);
- int price2 = (auctionData2 == null) ? 0 : auctionData2.lowestBin;
+ long price2 = (auctionData2 == null) ? 0 : auctionData2.lowestBin;
return (compare2(price1, price2) == 0) ? o1.compareTo(o2) : compare2(price1, price2);
}
- public int compare2(int y, int x) {
+ public int compare2(long y, long x) {
return (x < y) ? -1 : ((x == y) ? 0 : 1);
}
});
@@ -88,7 +88,7 @@ public class FeatureInstaCloseChest extends SimpleFeature implements GuiOpenList
if (auctionData.sellPrice == -1 && auctionData.lowestBin != -1) return auctionData.lowestBin;
else if (auctionData.sellPrice != -1 && auctionData.lowestBin == -1) return auctionData.sellPrice;
else {
- int ahPrice = auctionData.lowestBin;
+ long ahPrice = auctionData.lowestBin;
if (ahPrice > auctionData.sellPrice) return ahPrice;
else return auctionData.sellPrice;
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureTooltipPrice.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureTooltipPrice.java
index eebb934b..91a7bc6d 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureTooltipPrice.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/etc/FeatureTooltipPrice.java
@@ -45,14 +45,14 @@ public class FeatureTooltipPrice extends SimpleFeature implements TooltipListene
public int compare(String o1, String o2) {
String id2 = id + "::" + o1 + "-" + enchants.getInteger(o1);
AhUtils.AuctionData auctionData = AhUtils.auctions.get(id2);
- int price1 = (auctionData == null) ? 0 : auctionData.lowestBin;
+ long price1 = (auctionData == null) ? 0 : auctionData.lowestBin;
String id3 = id + "::" + o2 + "-" + enchants.getInteger(o2);
AhUtils.AuctionData auctionData2 = AhUtils.auctions.get(id3);
- int price2 = (auctionData2 == null) ? 0 : auctionData2.lowestBin;
+ long price2 = (auctionData2 == null) ? 0 : auctionData2.lowestBin;
return (compare2(price1, price2) == 0) ? o1.compareTo(o2) : compare2(price1, price2);
}
- public int compare2(int y, int x) {
+ public int compare2(long y, long x) {
return (x < y) ? -1 : ((x == y) ? 0 : 1);
}
});
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java
index 4629e0c9..5b9bfa98 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/features/impl/secret/FeatureMechanicBrowse.java
@@ -12,6 +12,7 @@ import kr.syeyoung.dungeonsguide.e;
import kr.syeyoung.dungeonsguide.features.GuiFeature;
import kr.syeyoung.dungeonsguide.features.listener.GuiClickListener;
import kr.syeyoung.dungeonsguide.features.listener.GuiPostRenderListener;
+import kr.syeyoung.dungeonsguide.features.listener.GuiPreRenderListener;
import kr.syeyoung.dungeonsguide.features.listener.WorldRenderListener;
import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonAddSet;
import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonParameterEdit;
@@ -36,7 +37,7 @@ import java.util.ArrayList;
import java.util.Map;
import java.util.Set;
-public class FeatureMechanicBrowse extends GuiFeature implements GuiPostRenderListener, GuiClickListener, WorldRenderListener {
+public class FeatureMechanicBrowse extends GuiFeature implements GuiPreRenderListener, GuiClickListener, WorldRenderListener {
public FeatureMechanicBrowse() {
super("Secret","Mechanic(Secret) Browser", "Browse and Pathfind secrets and mechanics in the current room", "secret.mechanicbrowse", false, 100, 300);
@@ -86,7 +87,7 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPostRenderLi
}
@Override
- public void onGuiPostRender(GuiScreenEvent.DrawScreenEvent.Post rendered) {
+ public void onGuiPreRender(GuiScreenEvent.DrawScreenEvent.Pre rendered) {
if (Minecraft.getMinecraft().currentScreen instanceof GuiGuiLocationConfig
|| Minecraft.getMinecraft().currentScreen instanceof GuiConfig
|| Minecraft.getMinecraft().currentScreen instanceof GuiDungeonRoomEdit
@@ -108,7 +109,7 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPostRenderLi
int height = scaledResolution.getScaledHeight();
int mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth;
int mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1;
-
+ GlStateManager.pushMatrix();
GeneralRoomProcessor grp = (GeneralRoomProcessor) dungeonRoom.getRoomProcessor();
@@ -171,6 +172,8 @@ public class FeatureMechanicBrowse extends GuiFeature implements GuiPostRenderLi
}
}
GL11.glDisable(GL11.GL_SCISSOR_TEST);
+
+ GlStateManager.popMatrix();
}
private void clip(ScaledResolution resolution, int x, int y, int width, int height) {