Paste #45167: fake lit funraces

Date: 2017/10/23 20:26:51 UTC-07:00
Type: Denizen Script

View Raw Paste Download This Paste
Copy Link


fakeFurnaceCommand:
  type: command
  name: furnace
  usage: /furnace
  script:
    - define arg1 <c.args.get[1]||null>
    - choose %arg1%:
      - case reload:
        - run lightFurnaces
        - narrate "<green>Reloaded Furnaces"
      - case remove:
        - define loc <player.location.cursor_on>
        - if <yaml[litFurnaces].read[furnaces].contains[%loc%].not> {
          - narrate "<red>There are no furnaces there..."
          - queue clear
          }
        - yaml id:litFurnaces set furnaces:<-:%loc%
        - run saveYAML 'def:litFurnaces|decor/furnaces.yml'
        - run lightFurnaces
        - narrate "<green>Removed Furnace"
      - default:
        - define loc <player.location.cursor_on>
        - if <yaml[litFurnaces].read[furnaces].contains[%loc%]> {
          - narrate "<red>Already a furnace there, do /furnace reload if you cant see it"
          - queue clear
          }
        - if <def[loc].material.name.is[==].to[furnace]> {
          - yaml id:litFurnaces set furnaces:->:%loc%
          - run saveYAML 'def:litFurnaces|decor/furnaces.yml'
          - run lightFurnaces
          - narrate "<green>Made a lit furnace"
          } else {
          - narrate "<red>you can only make furnaces lit, point at a furnace"
          }
FakeFurnaces:
  type: world
  events:
    on server start:
      - run loadYAML 'def:litFurnaces|decor/furnaces.yml'
      - run lightFurnaces
    on system time minutely:
      - run lightFurnaces
    on player clicks furnace:
      - if <yaml[litFurnaces].read[furnaces].contains[<c.location>]> {
        - determine passively CANCELLED
        }
lightFurnaces:
  type: task
  debug: false
  script:
    - foreach <yaml[litFurnaces].read[furnaces]> {
      - run showFakeBurning 'def:%value%'
      }
showFakeBurning:
  type: task
  debug: false
  script:
    - define loc %1%
    - define direction <def[loc].material.data>
    - if <def[loc].chunk.is_loaded> {
      - showfake %loc% m@burning_furnace
      }
    - repeat 11:
      - wait 5s
      - if <def[loc].chunk.is_loaded> {
        - showfake %loc% m@burning_furnace,%direction% players:<def[loc].world.players>
        }