diff options
6 files changed, 89 insertions, 61 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java b/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java index 95b9ebba..ff49bdb8 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuide.java @@ -25,7 +25,7 @@ public class DungeonsGuide implements DungeonsGuideInterface { private static DungeonsGuide dungeonsGuide; - public static boolean DEBUG = true; + public static boolean DEBUG = false; @Getter private Authenticator authenticator; diff --git a/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuideMain.java b/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuideMain.java index 00d49a96..029fac8a 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuideMain.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/DungeonsGuideMain.java @@ -27,7 +27,7 @@ import java.security.NoSuchAlgorithmException; public class DungeonsGuideMain { public static final String MODID = "skyblock_dungeons_guide"; - public static final String VERSION = "0.1"; + public static final String VERSION = "1.0"; private static DungeonsGuideMain dungeonsGuideMain; @@ -41,71 +41,71 @@ public class DungeonsGuideMain dungeonsGuideInterface.init(event); } -// @EventHandler -// public void pre(FMLPreInitializationEvent event) { -// Authenticator authenticator = new Authenticator(); -// String token = null; -// try { -// token = authenticator.authenticate(); -// if (token != null) { -// dungeonsGuideMain = this; -// URL.setURLStreamHandlerFactory(new DGURLStreamHandlerFactory(authenticator)); -// LaunchClassLoader launchClassLoader = (LaunchClassLoader) DungeonsGuideMain.class.getClassLoader(); -// launchClassLoader.addURL(new URL("dungeonsguide:///")); -// -// try { -// dungeonsGuideInterface = new DungeonsGuide(authenticator); -// dungeonsGuideInterface.pre(event); -// } catch (Exception e) { -// e.printStackTrace(); -// -// error(new String[]{ -// "Couldn't load Dungeons Guide", -// "Please contact developer if this problem persists after restart" -// }); -// } -// return; -// } -// } catch (IOException e) { -// e.printStackTrace(); -// } catch (AuthenticationException e) { -// e.printStackTrace(); -// } catch (NoSuchAlgorithmException e) { -// e.printStackTrace(); -// } catch (NoSuchPaddingException e) { -// e.printStackTrace(); -// } catch (InvalidKeyException e) { -// e.printStackTrace(); -// } catch (InvalidAlgorithmParameterException e) { -// e.printStackTrace(); -// } catch (IllegalBlockSizeException e) { -// e.printStackTrace(); -// } catch (BadPaddingException e) { -// e.printStackTrace(); -// } -// -// error(new String[]{ -// "Can't validate current installation of Dungeons Guide", -// "Steps to fix", -// "1. check if other people can't join minecraft servers. If they can't it's impossible to validate", -// "2. restart minecraft launcher", -// "3. make sure you're on the right account", -// "4. restart your computer", -// "If the problem persists after following these steps, please contact developer", -// "If you haven't purchased the mod, please consider doing so" -// }); -// } @EventHandler public void pre(FMLPreInitializationEvent event) { + Authenticator authenticator = new Authenticator(); + String token = null; + try { + token = authenticator.authenticate(); + if (token != null) { dungeonsGuideMain = this; - URL.setURLStreamHandlerFactory(new DGURLStreamHandlerFactory(null)); + URL.setURLStreamHandlerFactory(new DGURLStreamHandlerFactory(authenticator)); + LaunchClassLoader launchClassLoader = (LaunchClassLoader) DungeonsGuideMain.class.getClassLoader(); + launchClassLoader.addURL(new URL("dungeonsguide:///")); + try { - dungeonsGuideInterface = new DungeonsGuide(null); + dungeonsGuideInterface = new DungeonsGuide(authenticator); dungeonsGuideInterface.pre(event); } catch (Exception e) { e.printStackTrace(); + + error(new String[]{ + "Couldn't load Dungeons Guide", + "Please contact developer if this problem persists after restart" + }); } + return; + } + } catch (IOException e) { + e.printStackTrace(); + } catch (AuthenticationException e) { + e.printStackTrace(); + } catch (NoSuchAlgorithmException e) { + e.printStackTrace(); + } catch (NoSuchPaddingException e) { + e.printStackTrace(); + } catch (InvalidKeyException e) { + e.printStackTrace(); + } catch (InvalidAlgorithmParameterException e) { + e.printStackTrace(); + } catch (IllegalBlockSizeException e) { + e.printStackTrace(); + } catch (BadPaddingException e) { + e.printStackTrace(); + } + + error(new String[]{ + "Can't validate current installation of Dungeons Guide", + "Steps to fix", + "1. check if other people can't join minecraft servers. If they can't it's impossible to validate", + "2. restart minecraft launcher", + "3. make sure you're on the right account", + "4. restart your computer", + "If the problem persists after following these steps, please contact developer", + "If you haven't purchased the mod, please consider doing so" + }); } +// @EventHandler +// public void pre(FMLPreInitializationEvent event) { +// dungeonsGuideMain = this; +// URL.setURLStreamHandlerFactory(new DGURLStreamHandlerFactory(null)); +// try { +// dungeonsGuideInterface = new DungeonsGuide(null); +// dungeonsGuideInterface.pre(event); +// } catch (Exception e) { +// e.printStackTrace(); +// } +// } public void error(final String[] s_msg) { final GuiScreen errorGui = new GuiErrorScreen(null, null) { 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 fd7438af..6774b067 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditBreakableWall.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditBreakableWall.java @@ -110,7 +110,7 @@ public class ValueEditBreakableWall extends MPanel implements ValueEdit<DungeonS @Override public Object createDefaultValue(Parameter parameter) { - return new DungeonSecret(); + return new DungeonBreakableWall(); } @Override 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 04150b19..09992bb3 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditTomb.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/mechanicedit/ValueEditTomb.java @@ -87,7 +87,7 @@ public class ValueEditTomb extends MPanel implements ValueEdit<DungeonSecret> { @Override public Object createDefaultValue(Parameter parameter) { - return new DungeonSecret(); + return new DungeonTomb(); } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditOffsetPoint.java b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditOffsetPoint.java index 7e603dc5..25f69ab4 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditOffsetPoint.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomedit/valueedit/ValueEditOffsetPoint.java @@ -8,6 +8,8 @@ import kr.syeyoung.dungeonsguide.roomedit.elements.*; import kr.syeyoung.dungeonsguide.utils.RenderUtils; import net.minecraft.block.Block; import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.BlockPos; import scala.actors.threadpool.Arrays; import java.awt.*; @@ -84,6 +86,22 @@ public class ValueEditOffsetPoint extends MPanel implements ValueEdit<String> { mLabelAndElement.setBounds(new Rectangle(0,80,bounds.width,20)); add(mLabelAndElement); } + { + final MButton setToHEre2 = new MButton(); + setToHEre2.setText("Set to here"); + setToHEre2.setBackgroundColor(Color.green); + setToHEre2.setOnActionPerformed(new Runnable() { + @Override + public void run() { + EntityPlayer player = Minecraft.getMinecraft().thePlayer; + BlockPos pos = new BlockPos(player.posX, player.posY, player.posZ); + ((OffsetPoint)parameter2.getNewData()).setPosInWorld(EditingContext.getEditingContext().getRoom(),pos ); + } + }); + MLabelAndElement mLabelAndElement = new MLabelAndElement("set",setToHEre2); + mLabelAndElement.setBounds(new Rectangle(0,100,bounds.width,20)); + add(mLabelAndElement); + } } @Override diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java index 3d326349..b3c933d9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java @@ -1,11 +1,16 @@ package kr.syeyoung.dungeonsguide.roomprocessor; +import kr.syeyoung.dungeonsguide.DungeonsGuide; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.DungeonMechanic; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.RoomProcessorWaterPuzzle; import lombok.Getter; import lombok.Setter; import net.minecraft.util.IChatComponent; +import java.awt.*; +import java.util.Map; + public class GeneralRoomProcessor implements RoomProcessor { @Getter @@ -27,7 +32,12 @@ public class GeneralRoomProcessor implements RoomProcessor { @Override public void drawWorld(float partialTicks) { - + if (DungeonsGuide.DEBUG) { + for (Map.Entry<String, DungeonMechanic> value : dungeonRoom.getDungeonRoomInfo().getMechanics().entrySet()) { + if (value.getValue() == null) continue;; + value.getValue().highlight(new Color(0,255,255,50), value.getKey(), dungeonRoom, partialTicks); + } + } } @Override |