|
|
|
@ -28,6 +28,14 @@ val MINERAL_TYPES: ImmutableMap<Material, Material> = ImmutableMap.Builder<Mater |
|
|
|
|
.put(EMERALD_BLOCK, GREEN_STAINED_GLASS) |
|
|
|
|
.put(IRON_BLOCK, GRAY_STAINED_GLASS) |
|
|
|
|
.put(QUARTZ_BLOCK, WHITE_STAINED_GLASS) |
|
|
|
|
.put(TERRACOTTA, ORANGE_STAINED_GLASS) |
|
|
|
|
.put(SMOOTH_RED_SANDSTONE, PINK_STAINED_GLASS) |
|
|
|
|
.put(END_STONE_BRICKS, LIME_STAINED_GLASS) |
|
|
|
|
.put(PRISMARINE, LIGHT_BLUE_STAINED_GLASS) |
|
|
|
|
.put(BRICKS, MAGENTA_STAINED_GLASS) |
|
|
|
|
.put(PURPUR_BLOCK, PURPLE_STAINED_GLASS) |
|
|
|
|
.put(POLISHED_GRANITE, BROWN_STAINED_GLASS) |
|
|
|
|
.put(POLISHED_ANDESITE, LIGHT_GRAY_STAINED_GLASS) |
|
|
|
|
.build() |
|
|
|
|
|
|
|
|
|
val DOOR_TYPES: ImmutableSet<Material> = ImmutableSet.of(ACACIA_DOOR, BIRCH_DOOR, DARK_OAK_DOOR, IRON_DOOR, JUNGLE_DOOR, OAK_DOOR, SPRUCE_DOOR) |
|
|
|
@ -233,9 +241,9 @@ data class PortalFrame(val lowerLeftFrontCorner: Location, val direction: ExitDi |
|
|
|
|
fun activate() { |
|
|
|
|
val mineral = (lowerLeftFrontCorner + direction.mineralOffset).block |
|
|
|
|
for (offset in direction.glassOffsets) { |
|
|
|
|
(lowerLeftFrontCorner + offset).block.type = MINERAL_TYPES.getOrDefault(mineral.type, BROWN_STAINED_GLASS) |
|
|
|
|
(lowerLeftFrontCorner + offset).block.type = MINERAL_TYPES.getOrDefault(mineral.type, GLASS) |
|
|
|
|
} |
|
|
|
|
portalCenter.world?.playSound(midCenter, Sound.ENTITY_EVOKER_CAST_SPELL, 20f, 1f) |
|
|
|
|
portalCenter.world?.playSound(midCenter, Sound.ENTITY_EVOKER_CAST_SPELL, 1f, 1f) |
|
|
|
|
portalCenter.world?.spawnParticle(Particle.SPELL, midCenter, 75) |
|
|
|
|
open() |
|
|
|
|
} |
|
|
|
@ -244,7 +252,7 @@ data class PortalFrame(val lowerLeftFrontCorner: Location, val direction: ExitDi |
|
|
|
|
for (offset in direction.glassOffsets) { |
|
|
|
|
(lowerLeftFrontCorner + offset).block.type = GLASS |
|
|
|
|
} |
|
|
|
|
portalCenter.world?.playSound(midCenter, Sound.ENTITY_ILLUSIONER_CAST_SPELL, 20f, 1f) |
|
|
|
|
portalCenter.world?.playSound(midCenter, Sound.ENTITY_ILLUSIONER_CAST_SPELL, 1f, 1f) |
|
|
|
|
portalCenter.world?.spawnParticle(Particle.SMOKE_NORMAL, midCenter, 75) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -253,21 +261,21 @@ data class PortalFrame(val lowerLeftFrontCorner: Location, val direction: ExitDi |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun playPortalsLinkedEffect() { |
|
|
|
|
portalCenter.world?.playSound(midCenter, Sound.BLOCK_BEACON_ACTIVATE, 20f, 1f) |
|
|
|
|
portalCenter.world?.playSound(midCenter, Sound.BLOCK_BEACON_ACTIVATE, 1f, 1f) |
|
|
|
|
portalCenter.world?.spawnParticle(Particle.SPELL, midCenter, 30) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun playPortalsUnlinkedEffect() { |
|
|
|
|
portalCenter.world?.playSound(midCenter, Sound.BLOCK_BEACON_DEACTIVATE, 20f, 1f) |
|
|
|
|
portalCenter.world?.playSound(midCenter, Sound.BLOCK_BEACON_DEACTIVATE, 1f, 1f) |
|
|
|
|
portalCenter.world?.spawnParticle(Particle.SMOKE_NORMAL, midCenter, 30) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun playTeleporterActivatedEffect() { |
|
|
|
|
portalCenter.world?.playSound(midCenter, Sound.BLOCK_PORTAL_TRIGGER, 20f, 1f) |
|
|
|
|
portalCenter.world?.playSound(midCenter, Sound.BLOCK_PORTAL_TRIGGER, 1f, 1f) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun playTeleportTravelEffect() { |
|
|
|
|
portalCenter.world?.playSound(midCenter, Sound.BLOCK_PORTAL_TRAVEL, 20f, 1f) |
|
|
|
|
portalCenter.world?.playSound(midCenter, Sound.BLOCK_PORTAL_TRAVEL, 1f, 1f) |
|
|
|
|
portalCenter.world?.spawnParticle(Particle.FIREWORKS_SPARK, midCenter, 75) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -280,13 +288,13 @@ data class PortalFrame(val lowerLeftFrontCorner: Location, val direction: ExitDi |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fun playTeleportCanceledEffect() { |
|
|
|
|
portalCenter.world?.playSound(midCenter, Sound.BLOCK_LAVA_EXTINGUISH, 20f, 1f) |
|
|
|
|
portalCenter.world?.playSound(midCenter, Sound.BLOCK_LAVA_EXTINGUISH, 1f, 1f) |
|
|
|
|
portalCenter.world?.spawnParticle(Particle.SMOKE_NORMAL, midCenter, 30) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
inner class MakePortalSound : BukkitRunnable() { |
|
|
|
|
override fun run() { |
|
|
|
|
portalCenter.world?.playSound(portalCenter + MID_BLOCK, Sound.BLOCK_PORTAL_AMBIENT, 3f, 0f) |
|
|
|
|
portalCenter.world?.playSound(portalCenter + MID_BLOCK, Sound.BLOCK_PORTAL_AMBIENT, 0.1f, 0f) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
inner class MakePortalSparkles : BukkitRunnable() { |
|
|
|
|