aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/SkyblockStatus.java2
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java10
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/e.java2
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonValueEdit.java110
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditBreakableWall.java2
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditTomb.java2
6 files changed, 78 insertions, 50 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/SkyblockStatus.java b/src/main/java/kr/syeyoung/dungeonsguide/SkyblockStatus.java
index c64ecef6..3b951c89 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/SkyblockStatus.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/SkyblockStatus.java
@@ -90,7 +90,7 @@ public class SkyblockStatus {
foundDungeon = true;
}
if (ScorePlayerTeam.formatPlayerName(scorePlayerTeam, sc.getPlayerName()).startsWith(" §7⏣")) {
- dungeonName = strippedLine;
+ dungeonName = strippedLine.trim();
}
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java
index 62b7a06b..698b78ab 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/MapProcessor.java
@@ -45,7 +45,7 @@ public class MapProcessor {
private void buildMap(final byte[] mapData) {
final Point startroom = MapUtils.findFirstColorWithIn(mapData, (byte) 30, new Rectangle(0,0,128,128));
if (startroom == null){
- e.sendDebugChat(new ChatComponentText("BUGGED MAP"));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cCouldn't retrieve map data, disabling mod for this dungeon run"));
bugged = true;
return;
}
@@ -69,7 +69,7 @@ public class MapProcessor {
}
if (doorDir == null) {
- e.sendDebugChat(new ChatComponentText("BUGGED MAP, no connected door found"));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cCouldn't determine door of the room, disabling mod for this dungeon run"));
bugged = true;
return;
}
@@ -81,7 +81,7 @@ public class MapProcessor {
int gap = MapUtils.getLengthOfColorExtending(mapData, (byte) 0, basePoint, doorDir);
Point pt = MapUtils.findFirstColorWithInNegate(mapData, (byte)0, new Rectangle(basePoint.x, basePoint.y, (int)Math.abs(doorDir.y) * unitRoomDimension.width + 1, (int)Math.abs(doorDir.x) * unitRoomDimension.height + 1));
if (pt == null) {
- e.sendDebugChat(new ChatComponentText("BUGGED MAP, can't find door"));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cCouldn't determine door of the room, disabling mod for this dungeon run"));
bugged = true;
return;
}
@@ -100,13 +100,13 @@ public class MapProcessor {
{
StartDoorFinder doorFinder = DoorFinderRegistry.getDoorFinder(((SkyblockStatus) e.getDungeonsGuide().getSkyblockStatus()).getDungeonName());
if (doorFinder == null) {
- e.sendDebugChat(new ChatComponentText("Couldn't find door finder for :: "+((SkyblockStatus) e.getDungeonsGuide().getSkyblockStatus()).getDungeonName()));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cCouldn't find door processor for "+e.getDungeonsGuide().getSkyblockStatus().getDungeonName()));
bugged = true;
return;
}
BlockPos door = doorFinder.find(context.getWorld());
if (door == null) {
- e.sendDebugChat(new ChatComponentText("Couldn't find door :: "+((SkyblockStatus) e.getDungeonsGuide().getSkyblockStatus()).getDungeonName()));
+ Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("§eDungeons Guide §7:: §cCouldn't determine door of the room, disabling mod for this dungeon run"));
bugged = true;
return;
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/e.java b/src/main/java/kr/syeyoung/dungeonsguide/e.java
index 17d3aa26..201a9b3c 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/e.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/e.java
@@ -25,7 +25,7 @@ public class e implements c {
private static e dungeonsGuide;
- public static final boolean DEBUG = false;
+ public static final boolean DEBUG = true;
@Getter
private b authenticator;
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonValueEdit.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonValueEdit.java
index 30d80f3d..5d26c5cb 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonValueEdit.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/gui/GuiDungeonValueEdit.java
@@ -48,41 +48,43 @@ public class GuiDungeonValueEdit extends GuiScreen {
private Object editingObj;
public GuiDungeonValueEdit(final Object object, final List<MPanel> addons) {
- dungeonRoom = EditingContext.getEditingContext().getRoom();
- this.addons = addons;
- this.editingObj = object;
- mainPanel.setBackgroundColor(new Color(17, 17, 17, 179));
- {
- currentValueEdit = new MPanel(){
- @Override
- public void resize(int parentWidth, int parentHeight) {
- setBounds(new Rectangle(0, 0, parentWidth,parentHeight - 20 - addons.size() * 20));
- }
- };
- mainPanel.add(currentValueEdit);
- }
+ try {
+ dungeonRoom = EditingContext.getEditingContext().getRoom();
+ this.addons = addons;
+ this.editingObj = object;
+ mainPanel.setBackgroundColor(new Color(17, 17, 17, 179));
+ {
+ currentValueEdit = new MPanel() {
+ @Override
+ public void resize(int parentWidth, int parentHeight) {
+ setBounds(new Rectangle(0, 0, parentWidth, parentHeight - 20 - addons.size() * 20));
+ }
+ };
+ mainPanel.add(currentValueEdit);
+ }
for (MPanel addon : addons) {
mainPanel.add(addon);
}
- {
- save = new MButton(){
- @Override
- public void resize(int parentWidth, int parentHeight) {
- setBounds(new Rectangle(0 ,parentHeight - 20, parentWidth, 20));
- }
- };
- save.setText("Go back");
- save.setBackgroundColor(Color.green);
- save.setOnActionPerformed(new Runnable() {
- @Override
- public void run() {
- EditingContext.getEditingContext().goBack();
- }
- });
- mainPanel.add(save);
- }
- updateClassSelection();
+ {
+ save = new MButton() {
+ @Override
+ public void resize(int parentWidth, int parentHeight) {
+ setBounds(new Rectangle(0, parentHeight - 20, parentWidth, 20));
+ }
+ };
+ save.setText("Go back");
+ save.setBackgroundColor(Color.green);
+ save.setOnActionPerformed(new Runnable() {
+ @Override
+ public void run() {
+ EditingContext.getEditingContext().goBack();
+ }
+ });
+ mainPanel.add(save);
+ }
+ updateClassSelection();
+ } catch (Exception e){}
}
public void updateClassSelection() {
@@ -118,34 +120,56 @@ public class GuiDungeonValueEdit extends GuiScreen {
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
- ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
- GL11.glPushMatrix();
- GlStateManager.pushAttrib();
- mainPanel.render0(scaledResolution, new Point(0,0), new Rectangle(0,0,scaledResolution.getScaledWidth(),scaledResolution.getScaledHeight()), mouseX, mouseY, mouseX, mouseY, partialTicks);
- GlStateManager.popAttrib();
- GL11.glPopMatrix();
+ try {
+ ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft());
+ GL11.glPushMatrix();
+ GlStateManager.pushAttrib();
+ mainPanel.render0(scaledResolution, new Point(0, 0), new Rectangle(0, 0, scaledResolution.getScaledWidth(), scaledResolution.getScaledHeight()), mouseX, mouseY, mouseX, mouseY, partialTicks);
+ GlStateManager.popAttrib();
+ GL11.glPopMatrix();
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
}
@Override
public void keyTyped(char typedChar, int keyCode) throws IOException {
- super.keyTyped(typedChar, keyCode);
- mainPanel.keyTyped0(typedChar, keyCode);
+
+ try {
+ super.keyTyped(typedChar, keyCode);
+ mainPanel.keyTyped0(typedChar, keyCode);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
}
@Override
public void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
+ try {
super.mouseClicked(mouseX, mouseY, mouseButton);
mainPanel.mouseClicked0(mouseX, mouseY,mouseX,mouseY, mouseButton);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
}
@Override
public void mouseReleased(int mouseX, int mouseY, int state) {
+ try {
mainPanel.mouseReleased0(mouseX, mouseY,mouseX,mouseY, state);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
}
@Override
public void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick) {
- mainPanel.mouseClickMove0(mouseX,mouseY,mouseX,mouseY,clickedMouseButton,timeSinceLastClick);
+ try {
+ mainPanel.mouseClickMove0(mouseX,mouseY,mouseX,mouseY,clickedMouseButton,timeSinceLastClick);
+
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
}
@Override
@@ -157,7 +181,11 @@ public class GuiDungeonValueEdit extends GuiScreen {
int wheel = Mouse.getDWheel();
if (wheel != 0) {
- mainPanel.mouseScrolled0(i, j,i,j, wheel);
+ try {
+ mainPanel.mouseScrolled0(i, j,i,j, wheel);
+ } catch (Throwable t) {
+ t.printStackTrace();
+ }
}
}
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditBreakableWall.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditBreakableWall.java
index 6774b067..debe2be5 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditBreakableWall.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditBreakableWall.java
@@ -116,7 +116,7 @@ public class ValueEditBreakableWall extends MPanel implements ValueEdit<DungeonS
@Override
public Object cloneObj(Object object) {
try {
- return ((DungeonSecret)object).clone();
+ return ((DungeonBreakableWall)object).clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditTomb.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditTomb.java
index 09992bb3..f5578825 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditTomb.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditTomb.java
@@ -93,7 +93,7 @@ public class ValueEditTomb extends MPanel implements ValueEdit<DungeonSecret> {
@Override
public Object cloneObj(Object object) {
try {
- return ((DungeonSecret)object).clone();
+ return ((DungeonTomb)object).clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}