aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree
diff options
context:
space:
mode:
authorsyeyoung <cyoung06@naver.com>2021-10-02 15:30:51 +0900
committersyeyoung <cyoung06@naver.com>2021-10-02 15:33:33 +0900
commitf818e42c6c21ed6b2d7993dca87e6cd52f3d5251 (patch)
tree250f7979a82e146b61bcbcc2f4d9fd6b57bee911 /src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree
parent07f74480447495e6cd42237e4740fb082cb4b821 (diff)
downloadSkyblock-Dungeons-Guide-f818e42c6c21ed6b2d7993dca87e6cd52f3d5251.tar.gz
Skyblock-Dungeons-Guide-f818e42c6c21ed6b2d7993dca87e6cd52f3d5251.tar.bz2
Skyblock-Dungeons-Guide-f818e42c6c21ed6b2d7993dca87e6cd52f3d5251.zip
Line Properties for each pathfind context
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionRoute.java41
1 files changed, 31 insertions, 10 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionRoute.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionRoute.java
index 76fe5c85..3580dd03 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionRoute.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionRoute.java
@@ -18,10 +18,13 @@
package kr.syeyoung.dungeonsguide.dungeon.actions.tree;
+import kr.syeyoung.dungeonsguide.config.types.AColor;
import kr.syeyoung.dungeonsguide.dungeon.actions.*;
import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom;
import kr.syeyoung.dungeonsguide.events.PlayerInteractEntityEvent;
+import lombok.Data;
import lombok.Getter;
+import net.minecraft.client.Minecraft;
import net.minecraftforge.event.entity.living.LivingDeathEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
@@ -40,9 +43,13 @@ public class ActionRoute {
private final DungeonRoom dungeonRoom;
- public ActionRoute(DungeonRoom dungeonRoom, String mechanic, String state) {
+ @Getter
+ private final ActionRouteProperties actionRouteProperties;
+
+ public ActionRoute(DungeonRoom dungeonRoom, String mechanic, String state, ActionRouteProperties actionRouteProperties) {
this.mechanic = mechanic;
this.state = state;
+ this.actionRouteProperties = actionRouteProperties;
ActionChangeState actionChangeState = new ActionChangeState(mechanic, state);
ActionTree tree= ActionTree.buildActionTree(actionChangeState, dungeonRoom);
@@ -71,25 +78,27 @@ public class ActionRoute {
public void onPlayerInteract(PlayerInteractEvent event) {
- getCurrentAction().onPlayerInteract(dungeonRoom, event);
+ getCurrentAction().onPlayerInteract(dungeonRoom, event, actionRouteProperties );
}
public void onLivingDeath(LivingDeathEvent event) {
- getCurrentAction().onLivingDeath(dungeonRoom, event);
+ getCurrentAction().onLivingDeath(dungeonRoom, event, actionRouteProperties );
}
- public void onRenderWorld(float partialTicks) {
- if (current -1 >= 0 && (actions.get(current-1) instanceof ActionMove || actions.get(current-1) instanceof ActionMoveNearestAir)) actions.get(current-1).onRenderWorld(dungeonRoom, partialTicks);
- getCurrentAction().onRenderWorld(dungeonRoom, partialTicks);
+ public void onRenderWorld(float partialTicks, boolean flag) {
+ if (current -1 >= 0 && (
+ (actions.get(current-1) instanceof ActionMove && ((ActionMove) actions.get(current-1)).getTarget().getBlockPos(dungeonRoom).distanceSq(Minecraft.getMinecraft().thePlayer.getPosition()) >= 25)
+ || (actions.get(current-1) instanceof ActionMoveNearestAir && ((ActionMoveNearestAir) actions.get(current-1)).getTarget().getBlockPos(dungeonRoom).distanceSq(Minecraft.getMinecraft().thePlayer.getPosition()) >= 25))) actions.get(current-1).onRenderWorld(dungeonRoom, partialTicks, actionRouteProperties, flag );
+ getCurrentAction().onRenderWorld(dungeonRoom, partialTicks, actionRouteProperties, flag);
}
public void onRenderScreen(float partialTicks) {
- getCurrentAction().onRenderScreen(dungeonRoom, partialTicks);
+ getCurrentAction().onRenderScreen(dungeonRoom, partialTicks, actionRouteProperties);
}
public void onTick() {
Action current = getCurrentAction();
- current.onTick(dungeonRoom);
- if (this.current -1 >= 0 && (actions.get(this.current-1) instanceof ActionMove || actions.get(this.current-1) instanceof ActionMoveNearestAir)) actions.get(this.current-1).onTick(dungeonRoom);
+ current.onTick(dungeonRoom, actionRouteProperties);
+ if (this.current -1 >= 0 && (actions.get(this.current-1) instanceof ActionMove || actions.get(this.current-1) instanceof ActionMoveNearestAir)) actions.get(this.current-1).onTick(dungeonRoom, actionRouteProperties );
if (dungeonRoom.getMechanics().get(mechanic).getCurrentState(dungeonRoom).equals(state)) {
this.current = actions.size() - 1;
@@ -99,5 +108,17 @@ public class ActionRoute {
next();
}
- public void onLivingInteract(PlayerInteractEntityEvent event) { getCurrentAction().onLivingInteract(dungeonRoom, event); }
+ public void onLivingInteract(PlayerInteractEntityEvent event) { getCurrentAction().onLivingInteract(dungeonRoom, event, actionRouteProperties ); }
+
+ @Data
+ public static class ActionRouteProperties {
+ private boolean pathfind;
+ private int lineRefreshRate;
+ private AColor lineColor;
+ private float lineWidth;
+
+ private boolean beacon;
+ private AColor beaconColor;
+ private AColor beaconBeamColor;
+ }
}