001package net.tnemc.item.component.helper; 002/* 003 * The New Item Library 004 * Copyright (C) 2022 - 2025 Daniel "creatorfromhell" Vidmar 005 * 006 * This program is free software; you can redistribute it and/or 007 * modify it under the terms of the GNU Lesser General Public 008 * License as published by the Free Software Foundation; either 009 * version 3 of the License, or (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 GNU 014 * Lesser General Public License for more details. 015 * 016 * You should have received a copy of the GNU Lesser General Public License 017 * along with this program; if not, write to the Free Software Foundation, 018 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 019 */ 020 021/** 022 * AttributeModifiers 023 * 024 * @author creatorfromhell 025 * @since 0.2.0.0 026 */ 027public class AttributeModifier { 028 029 protected String type; 030 protected EquipSlot slot = EquipSlot.ANY; 031 protected String id; 032 protected double amount = 0.0; 033 protected String operation; 034 035 public AttributeModifier(final String type, final String id, final String operation) { 036 037 this.type = type; 038 this.id = id; 039 this.operation = operation; 040 } 041 042 public String getType() { 043 044 return type; 045 } 046 047 public void setType(final String type) { 048 049 this.type = type; 050 } 051 052 public EquipSlot getSlot() { 053 054 return slot; 055 } 056 057 public void setSlot(final EquipSlot slot) { 058 059 this.slot = slot; 060 } 061 062 public String getId() { 063 064 return id; 065 } 066 067 public void setId(final String id) { 068 069 this.id = id; 070 } 071 072 public double getAmount() { 073 074 return amount; 075 } 076 077 public void setAmount(final double amount) { 078 079 this.amount = amount; 080 } 081 082 public String getOperation() { 083 084 return operation; 085 } 086 087 public void setOperation(final String operation) { 088 089 this.operation = operation; 090 } 091 092 @Override 093 public AttributeModifier clone() throws CloneNotSupportedException { 094 095 final AttributeModifier copy = new AttributeModifier(this.type, this.id, this.operation); 096 copy.setAmount(this.amount); 097 copy.setSlot(this.slot); 098 return copy; 099 } 100}