diff options
Diffstat (limited to 'src/main/java/kr/syeyoung')
7 files changed, 172 insertions, 4 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java index 8bd43fc9..07c5353a 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/GeneralRoomProcessor.java @@ -12,6 +12,9 @@ import kr.syeyoung.dungeonsguide.roomedit.gui.GuiDungeonRoomEdit; import lombok.Getter; import lombok.Setter; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.entity.Entity; +import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; @@ -37,7 +40,12 @@ public class GeneralRoomProcessor implements RoomProcessor { @Override public void drawScreen(float partialTicks) { - +// FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; +// Entity e = Minecraft.getMinecraft().objectMouseOver.entityHit; +// if (e != null) { +// fr.drawString(e.getInventory()[4].serializeNBT() +"", 0, 0, 0xFFFFFFFF); +// System.out.println(e.getInventory()[4].serializeNBT()); +// } } @Override @@ -114,7 +122,12 @@ public class GeneralRoomProcessor implements RoomProcessor { @Override public void onEntitySpawn(LivingEvent.LivingUpdateEvent updateEvent) { - +// if (updateEvent.entityLiving instanceof EntityArmorStand) { +// updateEvent.entityLiving.setInvisible(false); +// byte b0 = updateEvent.entityLiving.getDataWatcher().getWatchableObjectByte(10); +// b0 = (byte)(b0 & -17); +// updateEvent.entityLiving.getDataWatcher().updateObject(10, Byte.valueOf(b0)); +// } } public static class Generator implements RoomProcessorGenerator<GeneralRoomProcessor> { diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/ProcessorFactory.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/ProcessorFactory.java index 118d92b7..6574c170 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/ProcessorFactory.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/ProcessorFactory.java @@ -1,5 +1,6 @@ package kr.syeyoung.dungeonsguide.roomprocessor; +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.RoomProcessorBombDefuseSolver; import kr.syeyoung.dungeonsguide.roomprocessor.boxpuzzle.RoomProcessorBoxSolver; import kr.syeyoung.dungeonsguide.roomprocessor.icefill.RoomProcessorIcePath2; import kr.syeyoung.dungeonsguide.roomprocessor.waterpuzzle.RoomProcessorWaterPuzzle; @@ -37,6 +38,7 @@ public class ProcessorFactory { registerRoomProcessor("puzzle_silverfish", new RoomProcessorIcePath.Generator()); // done registerRoomProcessor("puzzle_icefill", new RoomProcessorIcePath2.Generator()); registerRoomProcessor("puzzle_box", new RoomProcessorBoxSolver.Generator()); - registerRoomProcessor("puzzle_trivia", new RoomProcessorTrivia.Generator()); + registerRoomProcessor("puzzle_trivia", new RoomProcessorTrivia.Generator());; + registerRoomProcessor("puzzle_bombdefuse", new RoomProcessorBombDefuseSolver.Generator()); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java index 1cc9a744..db47c0a9 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/RoomProcessorBombDefuseSolver.java @@ -7,9 +7,15 @@ import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import kr.syeyoung.dungeonsguide.e; import kr.syeyoung.dungeonsguide.roomprocessor.GeneralRoomProcessor; +import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessorBlazeSolver; +import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessorGenerator; import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.DummyDefuseChamberProcessor; +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.arrow.ArrowProcessorMatcher; +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.color.ColorProcessorMatcher; +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.creeper.CreeperProcessorMatcher; +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.number.NumberProcessorMatcher; import kr.syeyoung.dungeonsguide.utils.TextUtils; import lombok.AllArgsConstructor; import lombok.Data; @@ -37,7 +43,10 @@ public class RoomProcessorBombDefuseSolver extends GeneralRoomProcessor { private static final List<BombDefuseChamberGenerator> chamberGenerators = new ArrayList<BombDefuseChamberGenerator>(); { - + chamberGenerators.add(new ArrowProcessorMatcher()); + chamberGenerators.add(new ColorProcessorMatcher()); + chamberGenerators.add(new CreeperProcessorMatcher()); + chamberGenerators.add(new NumberProcessorMatcher()); } private boolean bugged = false; @@ -230,4 +239,13 @@ public class RoomProcessorBombDefuseSolver extends GeneralRoomProcessor { private BDChamber right; private BombDefuseChamberGenerator chamberGen; } + + + public static class Generator implements RoomProcessorGenerator<RoomProcessorBombDefuseSolver> { + @Override + public RoomProcessorBombDefuseSolver createNew(DungeonRoom dungeonRoom) { + RoomProcessorBombDefuseSolver defaultRoomProcessor = new RoomProcessorBombDefuseSolver(dungeonRoom); + return defaultRoomProcessor; + } + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowProcessorMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowProcessorMatcher.java new file mode 100644 index 00000000..29c4d9e9 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/arrow/ArrowProcessorMatcher.java @@ -0,0 +1,33 @@ +package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.arrow; + +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.ChamberProcessor; +import net.minecraft.init.Blocks; + +public class ArrowProcessorMatcher implements BombDefuseChamberGenerator { + @Override + public boolean match(BDChamber left, BDChamber right) { + return left.getBlock(8,1,1).getBlock() == Blocks.planks && + left.getBlock(8,1,2).getBlock() == Blocks.planks && + left.getBlock(8,1,3).getBlock() == Blocks.planks && + right.getBlock(0,1,1).getBlock() == Blocks.planks && + right.getBlock(0,1,2).getBlock() == Blocks.planks && + right.getBlock(0,1,3).getBlock() == Blocks.planks; + } + + @Override + public String getName() { + return "arrowMatch"; + } + + @Override + public ChamberProcessor createLeft(BDChamber left) { + return null; + } + + @Override + public ChamberProcessor createRight(BDChamber right) { + return null; + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorProcessorMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorProcessorMatcher.java new file mode 100644 index 00000000..3d526eee --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/color/ColorProcessorMatcher.java @@ -0,0 +1,33 @@ +package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.color; + +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.ChamberProcessor; +import net.minecraft.init.Blocks; + +public class ColorProcessorMatcher implements BombDefuseChamberGenerator { + @Override + public boolean match(BDChamber left, BDChamber right) { + return left.getBlock(8,1,1).getBlock() == Blocks.stonebrick && + left.getBlock(8,1,2).getBlock() == Blocks.stonebrick && + left.getBlock(8,1,3).getBlock() == Blocks.stonebrick && + right.getBlock(0,1,1).getBlock() == Blocks.stonebrick && + right.getBlock(0,1,2).getBlock() == Blocks.stonebrick && + right.getBlock(0,1,3).getBlock() == Blocks.stonebrick; + } + + @Override + public String getName() { + return "colorMatch"; + } + + @Override + public ChamberProcessor createLeft(BDChamber left) { + return null; + } + + @Override + public ChamberProcessor createRight(BDChamber right) { + return null; + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperProcessorMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperProcessorMatcher.java new file mode 100644 index 00000000..c15f7e41 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/creeper/CreeperProcessorMatcher.java @@ -0,0 +1,34 @@ +package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.creeper; + +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.ChamberProcessor; +import net.minecraft.init.Blocks; + +public class CreeperProcessorMatcher implements BombDefuseChamberGenerator { + @Override + public boolean match(BDChamber left, BDChamber right) { + int airs = 0; + for (int x = 0; x < 3; x ++) { + for (int y = 0; y < 3; y++) { + if (right.getBlock(3 + x, 1, y + 1).getBlock() != Blocks.stone) return false; + } + } + return true; + } + + @Override + public String getName() { + return "creeperMatch"; + } + + @Override + public ChamberProcessor createLeft(BDChamber left) { + return null; + } + + @Override + public ChamberProcessor createRight(BDChamber right) { + return null; + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberProcessorMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberProcessorMatcher.java new file mode 100644 index 00000000..7faa29fb --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bombdefuse/chambers/number/NumberProcessorMatcher.java @@ -0,0 +1,35 @@ +package kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.number; + +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BDChamber; +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.BombDefuseChamberGenerator; +import kr.syeyoung.dungeonsguide.roomprocessor.bombdefuse.chambers.ChamberProcessor; +import net.minecraft.init.Blocks; + +public class NumberProcessorMatcher implements BombDefuseChamberGenerator { + @Override + public boolean match(BDChamber left, BDChamber right) { + return left.getBlock(1,1,4).getBlock() == Blocks.stone && + left.getBlock(2,1,4).getBlock() == Blocks.stone && + left.getBlock(6,1,4).getBlock() == Blocks.stone && + left.getBlock(7,1,4).getBlock() == Blocks.stone && + right.getBlock(1,1,4).getBlock() == Blocks.stone && + right.getBlock(2,1,4).getBlock() == Blocks.stone && + right.getBlock(6,1,4).getBlock() == Blocks.stone && + right.getBlock(7,1,4).getBlock() == Blocks.stone; + } + + @Override + public String getName() { + return "numberMatch"; + } + + @Override + public ChamberProcessor createLeft(BDChamber left) { + return null; + } + + @Override + public ChamberProcessor createRight(BDChamber right) { + return null; + } +} |