mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-29 05:55:48 +01:00
Removed try-catch for latest PluginBase.
This commit is contained in:
parent
f5943d87a1
commit
4e9abcb62d
@ -1,6 +1,5 @@
|
|||||||
package com.mvplugin.core;
|
package com.mvplugin.core;
|
||||||
|
|
||||||
import com.dumptruckman.minecraft.pluginbase.properties.PropertyValueException;
|
|
||||||
import com.mvplugin.core.api.MultiverseWorld;
|
import com.mvplugin.core.api.MultiverseWorld;
|
||||||
import com.mvplugin.core.api.WorldProperties;
|
import com.mvplugin.core.api.WorldProperties;
|
||||||
import com.mvplugin.core.minecraft.Difficulty;
|
import com.mvplugin.core.minecraft.Difficulty;
|
||||||
@ -26,11 +25,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setEnvironment(final WorldEnvironment environment) {
|
public void setEnvironment(final WorldEnvironment environment) {
|
||||||
try {
|
getProperties().set(WorldProperties.ENVIRONMENT, environment);
|
||||||
getProperties().set(WorldProperties.ENVIRONMENT, environment);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -41,12 +36,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
@Override
|
@Override
|
||||||
public boolean setDifficulty(final Difficulty difficulty) {
|
public boolean setDifficulty(final Difficulty difficulty) {
|
||||||
// TODO Validate?
|
// TODO Validate?
|
||||||
try {
|
return getProperties().set(WorldProperties.DIFFICULTY, difficulty);
|
||||||
return getProperties().set(WorldProperties.DIFFICULTY, difficulty);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -56,11 +46,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSeed(long seed) {
|
public void setSeed(long seed) {
|
||||||
try {
|
getProperties().set(WorldProperties.SEED, seed);
|
||||||
getProperties().set(WorldProperties.SEED, seed);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -70,11 +56,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setGenerator(final String generator) {
|
public void setGenerator(final String generator) {
|
||||||
try {
|
getProperties().set(WorldProperties.GENERATOR, generator != null ? generator : "");
|
||||||
getProperties().set(WorldProperties.GENERATOR, generator != null ? generator : "");
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -94,11 +76,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAlias(final String alias) {
|
public void setAlias(final String alias) {
|
||||||
try {
|
getProperties().set(WorldProperties.ALIAS, alias != null ? alias : "");
|
||||||
getProperties().set(WorldProperties.ALIAS, alias != null ? alias : "");
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -110,13 +88,9 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAllowAnimalSpawn(final boolean allowAnimalSpawn) {
|
public void setAllowAnimalSpawn(final boolean allowAnimalSpawn) {
|
||||||
try {
|
getProperties().get(WorldProperties.SPAWNING)
|
||||||
getProperties().get(WorldProperties.SPAWNING)
|
.get(WorldProperties.Spawning.ANIMALS)
|
||||||
.get(WorldProperties.Spawning.ANIMALS)
|
.set(WorldProperties.Spawning.Animals.SPAWN, allowAnimalSpawn);
|
||||||
.set(WorldProperties.Spawning.Animals.SPAWN, allowAnimalSpawn);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -135,13 +109,9 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAllowMonsterSpawn(final boolean allowMonsterSpawn) {
|
public void setAllowMonsterSpawn(final boolean allowMonsterSpawn) {
|
||||||
try {
|
getProperties().get(WorldProperties.SPAWNING)
|
||||||
getProperties().get(WorldProperties.SPAWNING)
|
.get(WorldProperties.Spawning.MONSTERS)
|
||||||
.get(WorldProperties.Spawning.MONSTERS)
|
.set(WorldProperties.Spawning.Monsters.SPAWN, allowMonsterSpawn);
|
||||||
.set(WorldProperties.Spawning.Monsters.SPAWN, allowMonsterSpawn);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -158,11 +128,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPVPMode(final boolean pvpMode) {
|
public void setPVPMode(final boolean pvpMode) {
|
||||||
try {
|
getProperties().set(WorldProperties.PVP, pvpMode);
|
||||||
getProperties().set(WorldProperties.PVP, pvpMode);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -172,11 +138,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHidden(final boolean hidden) {
|
public void setHidden(final boolean hidden) {
|
||||||
try {
|
getProperties().set(WorldProperties.HIDDEN, hidden);
|
||||||
getProperties().set(WorldProperties.HIDDEN, hidden);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -186,11 +148,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPrefixChat(final boolean prefixChat) {
|
public void setPrefixChat(final boolean prefixChat) {
|
||||||
try {
|
getProperties().set(WorldProperties.PREFIX_CHAT, prefixChat);
|
||||||
getProperties().set(WorldProperties.PREFIX_CHAT, prefixChat);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -200,11 +158,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setEnableWeather(final boolean enableWeather) {
|
public void setEnableWeather(final boolean enableWeather) {
|
||||||
try {
|
getProperties().set(WorldProperties.ALLOW_WEATHER, enableWeather);
|
||||||
getProperties().set(WorldProperties.ALLOW_WEATHER, enableWeather);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -214,11 +168,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setKeepSpawnInMemory(final boolean keepSpawnInMemory) {
|
public void setKeepSpawnInMemory(final boolean keepSpawnInMemory) {
|
||||||
try {
|
getProperties().set(WorldProperties.KEEP_SPAWN, keepSpawnInMemory);
|
||||||
getProperties().set(WorldProperties.KEEP_SPAWN, keepSpawnInMemory);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -228,11 +178,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setSpawnLocation(final PlayerPosition spawnLocation) {
|
public void setSpawnLocation(final PlayerPosition spawnLocation) {
|
||||||
try {
|
getProperties().set(WorldProperties.SPAWN_LOCATION, spawnLocation);
|
||||||
getProperties().set(WorldProperties.SPAWN_LOCATION, spawnLocation);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -242,11 +188,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setHunger(final boolean hungerEnabled) {
|
public void setHunger(final boolean hungerEnabled) {
|
||||||
try {
|
getProperties().set(WorldProperties.HUNGER, hungerEnabled);
|
||||||
getProperties().set(WorldProperties.HUNGER, hungerEnabled);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -257,12 +199,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
@Override
|
@Override
|
||||||
public boolean setGameMode(final GameMode gameMode) {
|
public boolean setGameMode(final GameMode gameMode) {
|
||||||
// Todo validate?
|
// Todo validate?
|
||||||
try {
|
return getProperties().set(WorldProperties.GAME_MODE, gameMode);
|
||||||
return getProperties().set(WorldProperties.GAME_MODE, gameMode);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -272,11 +209,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPrice(final double price) {
|
public void setPrice(final double price) {
|
||||||
try {
|
getProperties().get(WorldProperties.ENTRY_FEE).set(WorldProperties.EntryFee.AMOUNT, price);
|
||||||
getProperties().get(WorldProperties.ENTRY_FEE).set(WorldProperties.EntryFee.AMOUNT, price);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -286,11 +219,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setCurrency(final int item) {
|
public void setCurrency(final int item) {
|
||||||
try {
|
getProperties().get(WorldProperties.ENTRY_FEE).set(WorldProperties.EntryFee.CURRENCY, item);
|
||||||
getProperties().get(WorldProperties.ENTRY_FEE).set(WorldProperties.EntryFee.CURRENCY, item);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -301,12 +230,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
@Override
|
@Override
|
||||||
public boolean setRespawnToWorld(final String respawnWorld) {
|
public boolean setRespawnToWorld(final String respawnWorld) {
|
||||||
// TODO validation?
|
// TODO validation?
|
||||||
try {
|
return getProperties().set(WorldProperties.RESPAWN_WORLD, respawnWorld);
|
||||||
return getProperties().set(WorldProperties.RESPAWN_WORLD, respawnWorld);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -317,12 +241,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
@Override
|
@Override
|
||||||
public boolean setScaling(final double scaling) {
|
public boolean setScaling(final double scaling) {
|
||||||
// TODO validation?
|
// TODO validation?
|
||||||
try {
|
return getProperties().set(WorldProperties.SCALE, scaling);
|
||||||
return getProperties().set(WorldProperties.SCALE, scaling);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -332,11 +251,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAutoHeal(final boolean heal) {
|
public void setAutoHeal(final boolean heal) {
|
||||||
try {
|
getProperties().set(WorldProperties.AUTO_HEAL, heal);
|
||||||
getProperties().set(WorldProperties.AUTO_HEAL, heal);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -346,11 +261,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAdjustSpawn(final boolean adjust) {
|
public void setAdjustSpawn(final boolean adjust) {
|
||||||
try {
|
getProperties().set(WorldProperties.ADJUST_SPAWN, adjust);
|
||||||
getProperties().set(WorldProperties.ADJUST_SPAWN, adjust);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -360,11 +271,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAutoLoad(final boolean autoLoad) {
|
public void setAutoLoad(final boolean autoLoad) {
|
||||||
try {
|
getProperties().set(WorldProperties.AUTO_LOAD, autoLoad);
|
||||||
getProperties().set(WorldProperties.AUTO_LOAD, autoLoad);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -374,20 +281,12 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setBedRespawn(final boolean bedRespawn) {
|
public void setBedRespawn(final boolean bedRespawn) {
|
||||||
try {
|
getProperties().set(WorldProperties.BED_RESPAWN, bedRespawn);
|
||||||
getProperties().set(WorldProperties.BED_RESPAWN, bedRespawn);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setPlayerLimit(final int limit) {
|
public void setPlayerLimit(final int limit) {
|
||||||
try {
|
getProperties().set(WorldProperties.PLAYER_LIMIT, limit);
|
||||||
getProperties().set(WorldProperties.PLAYER_LIMIT, limit);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -397,11 +296,7 @@ abstract class AbstractMultiverseWorld implements MultiverseWorld {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void allowPortalMaking(final PortalType type) {
|
public void allowPortalMaking(final PortalType type) {
|
||||||
try {
|
getProperties().set(WorldProperties.PORTAL_FORM, type);
|
||||||
getProperties().set(WorldProperties.PORTAL_FORM, type);
|
|
||||||
} catch (PropertyValueException e) {
|
|
||||||
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user