|
42 | 42 | import org.bukkit.scheduler.BukkitScheduler;
|
43 | 43 |
|
44 | 44 | import java.util.HashMap;
|
| 45 | +import java.util.Locale; |
45 | 46 | import java.util.UUID;
|
46 | 47 |
|
47 | 48 | /**
|
@@ -161,32 +162,11 @@ public void run() {
|
161 | 162 | bd.setTardisID(id);
|
162 | 163 | bd.setThrottle(spaceTimeThrottle);
|
163 | 164 | bd.setParticles(throticle.getParticles());
|
| 165 | + // get sound effects |
| 166 | + String landSFX = (spaceTimeThrottle != SpaceTimeThrottle.NORMAL) ? "tardis_land_" + spaceTimeThrottle.toString().toLowerCase(Locale.ROOT) : "tardis_land"; |
164 | 167 | // determine delay values
|
165 |
| - long flight_mode_delay; |
166 |
| - long travel_time; |
167 |
| - String landSFX; |
168 |
| - switch (spaceTimeThrottle) { |
169 |
| - case WARP -> { |
170 |
| - flight_mode_delay = ((plugin.getTrackerKeeper().getDestinationVortex().containsKey(id)) ? 0L : 130L); |
171 |
| - travel_time = (malfunction) ? 400L : 94L; |
172 |
| - landSFX = "tardis_land_warp"; |
173 |
| - } |
174 |
| - case RAPID -> { |
175 |
| - flight_mode_delay = ((plugin.getTrackerKeeper().getDestinationVortex().containsKey(id)) ? 0L : 259L); |
176 |
| - travel_time = (malfunction) ? 400L : 188L; |
177 |
| - landSFX = "tardis_land_rapid"; |
178 |
| - } |
179 |
| - case FASTER -> { |
180 |
| - flight_mode_delay = ((plugin.getTrackerKeeper().getDestinationVortex().containsKey(id)) ? 0L : 388L); |
181 |
| - travel_time = (malfunction) ? 400L : 282L; |
182 |
| - landSFX = "tardis_land_faster"; |
183 |
| - } |
184 |
| - default -> { // NORMAL |
185 |
| - flight_mode_delay = ((plugin.getTrackerKeeper().getDestinationVortex().containsKey(id)) ? 0L : 518L); |
186 |
| - travel_time = (malfunction) ? 400L : 375L; |
187 |
| - landSFX = "tardis_land"; |
188 |
| - } |
189 |
| - } |
| 168 | + long travel_time = (malfunction) ? 400L : (long) (spaceTimeThrottle.getFlightTime() * 0.75d) + 4L; |
| 169 | + long flight_mode_delay = ((plugin.getTrackerKeeper().getDestinationVortex().containsKey(id)) ? 0L : spaceTimeThrottle.getFlightTime()); |
190 | 170 | // remember flight data
|
191 | 171 | plugin.getTrackerKeeper().getFlightData().put(uuid, bd);
|
192 | 172 | long materialisation_delay = flight_mode_delay;
|
|
0 commit comments