blob: ef3b5d698af3848b335470e9ba0f1c34b3275d5b [file] [log] [blame] [raw]
/* Copyright 2015-2020 Rivoreo
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
package rivoreo.minecraft.worldmgr;
import org.bukkit.World;
public class BukkitWorldMaxHeightProperty implements BukkitWorldProperty {
public String get(World world) throws Exception {
return String.valueOf(world.getMaxHeight());
}
public void set(World world, String value) throws Exception {
if(!BukkitPlugin.is_minecraftforge_available()) {
throw new UnsupportedOperationException("This operation requires Minecraft Forge");
}
Object provider = BukkitPlugin.get_world_provider(world);
BukkitPlugin.set_custom_world_provider_max_height(provider, Integer.decode(value));
}
}