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.player.PlotPlayer; 022import com.plotsquared.core.plot.Plot; 023import com.plotsquared.core.plot.Rating; 024import org.checkerframework.checker.nullness.qual.Nullable; 025 026public class PlotRateEvent extends PlotEvent implements CancellablePlotEvent { 027 028 private final PlotPlayer<?> rater; 029 @Nullable 030 private Rating rating; 031 private Result eventResult; 032 033 /** 034 * PlotRateEvent: Called when a player rates a plot 035 * 036 * @param rater The player rating the plot 037 * @param rating The rating being given 038 * @param plot The plot being rated 039 */ 040 public PlotRateEvent(PlotPlayer<?> rater, @Nullable Rating rating, Plot plot) { 041 super(plot); 042 this.rater = rater; 043 this.rating = rating; 044 } 045 046 public PlotPlayer<?> getRater() { 047 return this.rater; 048 } 049 050 public @Nullable Rating getRating() { 051 return this.rating; 052 } 053 054 public void setRating(@Nullable Rating rating) { 055 this.rating = rating; 056 } 057 058 @Override 059 public Result getEventResult() { 060 return eventResult; 061 } 062 063 @Override 064 public void setEventResult(Result e) { 065 this.eventResult = e; 066 } 067 068}