001/* 002 * PlotSquared, a land and world management plugin for Minecraft. 003 * Copyright (C) IntellectualSites <https://intellectualsites.com> 004 * Copyright (C) IntellectualSites team and contributors 005 * 006 * This program is free software: you can redistribute it and/or modify 007 * it under the terms of the GNU General Public License as published by 008 * the Free Software Foundation, either version 3 of the License, or 009 * (at your option) any later version. 010 * 011 * This program is distributed in the hope that it will be useful, 012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 014 * GNU General Public License for more details. 015 * 016 * You should have received a copy of the GNU General Public License 017 * along with this program. If not, see <https://www.gnu.org/licenses/>. 018 */ 019package com.plotsquared.core.events; 020 021import com.plotsquared.core.location.Direction; 022import com.plotsquared.core.player.PlotPlayer; 023import com.plotsquared.core.plot.Plot; 024import org.checkerframework.checker.nullness.qual.NonNull; 025 026/** 027 * Event called when several plots are merged 028 * {@inheritDoc} 029 */ 030public final class PlotMergeEvent extends PlotPlayerEvent implements CancellablePlotEvent { 031 032 private final String world; 033 private final PlotPlayer<?> player; 034 private Direction dir; 035 private int max; 036 private Result eventResult; 037 038 /** 039 * PlotMergeEvent: Called when plots are merged 040 * 041 * @param world World in which the event occurred 042 * @param plot Plot that was merged 043 * @param dir The direction of the merge 044 * @param max Max merge size 045 * @param player The player attempting the merge 046 */ 047 public PlotMergeEvent( 048 final @NonNull String world, final @NonNull Plot plot, 049 final @NonNull Direction dir, final int max, final PlotPlayer<?> player 050 ) { 051 super(player, plot); 052 this.world = world; 053 this.dir = dir; 054 this.max = max; 055 this.player = player; 056 } 057 058 059 @Override 060 public Result getEventResult() { 061 return eventResult; 062 } 063 064 @Override 065 public void setEventResult(Result e) { 066 this.eventResult = e; 067 } 068 069 public String getWorld() { 070 return this.world; 071 } 072 073 public Direction getDir() { 074 return this.dir; 075 } 076 077 public void setDir(Direction dir) { 078 this.dir = dir; 079 } 080 081 public int getMax() { 082 return this.max; 083 } 084 085 public void setMax(int max) { 086 this.max = max; 087 } 088 089 public PlotPlayer<?> getPlayer() { 090 return this.player; 091 } 092 093}