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