|
| 1 | +/* |
| 2 | + * GNU General Public License v3 |
| 3 | + * |
| 4 | + * PaperTweaks, a performant replacement for the VanillaTweaks datapacks. |
| 5 | + * |
| 6 | + * Copyright (C) 2021-2025 Machine_Maker |
| 7 | + * |
| 8 | + * This program is free software: you can redistribute it and/or modify |
| 9 | + * it under the terms of the GNU General Public License as published by |
| 10 | + * the Free Software Foundation, version 3. |
| 11 | + * |
| 12 | + * This program is distributed in the hope that it will be useful, |
| 13 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | + * GNU General Public License for more details. |
| 16 | + * |
| 17 | + * You should have received a copy of the GNU General Public License |
| 18 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 19 | + */ |
| 20 | +package me.machinemaker.papertweaks.modules.survival.cauldronmud; |
| 21 | + |
| 22 | +import java.util.Collection; |
| 23 | +import java.util.Set; |
| 24 | +import me.machinemaker.papertweaks.annotations.ModuleInfo; |
| 25 | +import me.machinemaker.papertweaks.modules.ModuleBase; |
| 26 | +import me.machinemaker.papertweaks.modules.ModuleLifecycle; |
| 27 | +import me.machinemaker.papertweaks.modules.ModuleListener; |
| 28 | +import org.bukkit.Material; |
| 29 | + |
| 30 | +@ModuleInfo(name = "CauldronMud", configPath = "survival.cauldron-mud", description = "Make mud using cauldrons") |
| 31 | +public class CauldronMud extends ModuleBase { |
| 32 | + |
| 33 | + static Material toMudFromDirt(final Material dirt) { |
| 34 | + if (!(dirt.equals(Material.DIRT) || dirt.equals(Material.COARSE_DIRT) || dirt.equals(Material.ROOTED_DIRT))) { |
| 35 | + throw new IllegalArgumentException(dirt + " is not a valid dirt type!"); |
| 36 | + } |
| 37 | + |
| 38 | + return Material.MUD; |
| 39 | + } |
| 40 | + |
| 41 | + @Override |
| 42 | + protected Collection<Class<? extends ModuleListener>> listeners() { |
| 43 | + return Set.of(CauldronListener.class); |
| 44 | + } |
| 45 | + |
| 46 | + @Override |
| 47 | + protected Class<? extends ModuleLifecycle> lifecycle() { |
| 48 | + return ModuleLifecycle.Empty.class; |
| 49 | + } |
| 50 | +} |
0 commit comments