コード例 #1
0
  public static void onRitualBroken(
      IMasterRitualStone ritualStone, String ritualID, RitualBreakMethod method) {
    String ownerName = ritualStone.getOwner();
    RitualStopEvent event = new RitualStopEvent(ritualStone, ownerName, ritualID, method);
    MinecraftForge.EVENT_BUS.post(event);

    if (ritualMap.containsKey(ritualID)) {
      Rituals ritual = ritualMap.get(ritualID);
      if (ritual != null && ritual.effect != null) {
        ritual.effect.onRitualBroken(ritualStone, method);
      }
    }
  }
コード例 #2
0
  public static void performEffect(IMasterRitualStone ritualStone, String ritualID) {
    String ownerName = ritualStone.getOwner();

    RitualRunEvent event = new RitualRunEvent(ritualStone, ownerName, ritualID);

    if (MinecraftForge.EVENT_BUS.post(event) || event.getResult() == Event.Result.DENY) {
      return;
    }

    if (ritualMap.containsKey(event.ritualKey)) {
      Rituals ritual = ritualMap.get(event.ritualKey);
      if (ritual != null && ritual.effect != null) {
        ritual.effect.performEffect(ritualStone);
      }
    }
  }