diff options
author | syeyoung <cyong06@naver.com> | 2021-02-12 00:03:42 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-12 00:03:42 +0900 |
commit | 89c82ad1fea9fd0a8e32a5e818c6c01856cdd660 (patch) | |
tree | eb989b2e58b2b18480d41a262b9cabf1a0ba387d /src/main/java/kr/syeyoung/dungeonsguide/dungeon | |
parent | 505cb6fc92e7d2c7412b43f459796791ca36e5a3 (diff) | |
download | Skyblock-Dungeons-Guide-89c82ad1fea9fd0a8e32a5e818c6c01856cdd660.tar.gz Skyblock-Dungeons-Guide-89c82ad1fea9fd0a8e32a5e818c6c01856cdd660.tar.bz2 Skyblock-Dungeons-Guide-89c82ad1fea9fd0a8e32a5e818c6c01856cdd660.zip |
YES
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon')
4 files changed, 94 insertions, 4 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionBreakWithSuperBoom.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionBreakWithSuperBoom.java index 04b839e6..3dcae148 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionBreakWithSuperBoom.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionBreakWithSuperBoom.java @@ -59,6 +59,8 @@ public class ActionBreakWithSuperBoom extends AbstractAction { GlStateManager.translate(-x_fix, -y_fix, -z_fix); GlStateManager.disableLighting(); GlStateManager.enableAlpha(); + GlStateManager.disableDepth(); + GlStateManager.depthMask(false); GlStateManager.enableBlend(); Tessellator tessellator = Tessellator.getInstance(); @@ -74,7 +76,7 @@ public class ActionBreakWithSuperBoom extends AbstractAction { GlStateManager.enableLighting(); GlStateManager.popMatrix(); - RenderUtils.highlightBlock(blockpos, new Color(0, 255,255,50), partialTicks, false); + RenderUtils.highlightBlock(blockpos, new Color(0, 255,255,50), partialTicks, true); RenderUtils.drawTextAtWorld("Superboom", blockpos.getX() + 0.5f, blockpos.getY() + 0.5f, blockpos.getZ() + 0.5f, 0xFFFFFF00, 0.03f, false, false, partialTicks); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/OffsetPoint.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/OffsetPoint.java index 2fdfec96..78ae7ab9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/OffsetPoint.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/data/OffsetPoint.java @@ -6,6 +6,7 @@ import lombok.AllArgsConstructor; import lombok.Data; import net.minecraft.block.Block; import net.minecraft.util.BlockPos; +import net.minecraft.util.Vec3; import javax.vecmath.Vector2d; import java.io.Serializable; @@ -13,6 +14,8 @@ import java.io.Serializable; @Data @AllArgsConstructor public class OffsetPoint implements Cloneable, Serializable { + private static final long serialVersionUID = 3102336358774967540L; + private int x; private int y; private int z; @@ -20,6 +23,10 @@ public class OffsetPoint implements Cloneable, Serializable { public OffsetPoint(DungeonRoom dungeonRoom, BlockPos pos) { setPosInWorld(dungeonRoom, pos); } + public OffsetPoint(DungeonRoom dungeonRoom, Vec3 pos) { + setPosInWorld(dungeonRoom, new BlockPos((int)pos.xCoord, (int)pos.yCoord, (int)pos.zCoord)); + } + public void setPosInWorld(DungeonRoom dungeonRoom, BlockPos pos) { Vector2d vector2d = new Vector2d(pos.getX() - dungeonRoom.getMin().getX(), pos.getZ() - dungeonRoom.getMin().getZ()); diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java index 9b32802f..5ba3f21c 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java @@ -46,11 +46,11 @@ public class DungeonBreakableWall implements DungeonMechanic, RouteBlocker { Set<Action> preRequisites = base = new HashSet<Action>(); { ActionBreakWithSuperBoom actionClick; - preRequisites.add(actionClick = new ActionBreakWithSuperBoom(secretPoint.getOffsetPointList().get(0))); + preRequisites.add(actionClick = new ActionBreakWithSuperBoom(getRepresentingPoint())); preRequisites = actionClick.getPreRequisite(); } { - ActionMoveNearestAir actionMove = new ActionMoveNearestAir(secretPoint.getOffsetPointList().get(0)); + ActionMoveNearestAir actionMove = new ActionMoveNearestAir(getRepresentingPoint()); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); } @@ -113,6 +113,6 @@ public class DungeonBreakableWall implements DungeonMechanic, RouteBlocker { @Override public OffsetPoint getRepresentingPoint() { - return secretPoint.getOffsetPointList().size() == 0 ? null : secretPoint.getOffsetPointList().get(0); + return secretPoint.getOffsetPointList().size() == 0 ? null : secretPoint.getOffsetPointList().get(secretPoint.getOffsetPointList().size() / 2); } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java new file mode 100755 index 00000000..6cd7238a --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java @@ -0,0 +1,81 @@ +package kr.syeyoung.dungeonsguide.dungeon.mechanics; + +import com.google.common.collect.Sets; +import kr.syeyoung.dungeonsguide.dungeon.actions.Action; +import kr.syeyoung.dungeonsguide.dungeon.actions.ActionChangeState; +import kr.syeyoung.dungeonsguide.dungeon.actions.ActionInteract; +import kr.syeyoung.dungeonsguide.dungeon.actions.ActionMove; +import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; +import kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates.PredicateArmorStand; +import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; +import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import lombok.Data; +import net.minecraft.util.BlockPos; + +import java.awt.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@Data +public class DungeonDummy implements DungeonMechanic { + private OffsetPoint secretPoint = new OffsetPoint(0,0,0); + private List<String> preRequisite = new ArrayList<String>(); + + + @Override + public Set<Action> getAction(String state, DungeonRoom dungeonRoom) { + if (!"navigate".equalsIgnoreCase(state)) throw new IllegalArgumentException(state+" is not valid state for secret"); + Set<Action> base; + Set<Action> preRequisites = base = new HashSet<Action>(); + { + ActionMove actionMove = new ActionMove(secretPoint); + preRequisites.add(actionMove); + preRequisites = actionMove.getPreRequisite(); + } + { + for (String str : preRequisite) { + if (str.isEmpty()) continue; + ActionChangeState actionChangeState = new ActionChangeState(str.split(":")[0], str.split(":")[1]); + preRequisites.add(actionChangeState); + } + } + return base; + } + + @Override + public void highlight(Color color, String name, DungeonRoom dungeonRoom, float partialTicks) { + BlockPos pos = getSecretPoint().getBlockPos(dungeonRoom); + RenderUtils.highlightBlock(pos, color,partialTicks); + RenderUtils.drawTextAtWorld("D-"+name, pos.getX() +0.5f, pos.getY()+0.375f, pos.getZ()+0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); + RenderUtils.drawTextAtWorld(getCurrentState(dungeonRoom), pos.getX() +0.5f, pos.getY()+0f, pos.getZ()+0.5f, 0xFFFFFFFF, 0.03f, false, true, partialTicks); + } + + + public DungeonDummy clone() throws CloneNotSupportedException { + DungeonDummy dungeonSecret = new DungeonDummy(); + dungeonSecret.secretPoint = (OffsetPoint) secretPoint.clone(); + dungeonSecret.preRequisite = new ArrayList<String>(preRequisite); + return dungeonSecret; + } + + + @Override + public String getCurrentState(DungeonRoom dungeonRoom) { + return "no-state"; + } + + @Override + public Set<String> getPossibleStates(DungeonRoom dungeonRoom) { + return Sets.newHashSet("navigate"); + } + @Override + public Set<String> getTotalPossibleStates(DungeonRoom dungeonRoom) { + return Sets.newHashSet("no-state","navigate"); + } + @Override + public OffsetPoint getRepresentingPoint() { + return secretPoint; + } +} |