Search in sources :

Example 6 with MinecraftException

use of net.minecraft.world.MinecraftException in project MineFactoryReloaded by powercrystals.

the class WorldServerProxy method saveLevel.

@Override
protected /**
 * Saves the chunks to disk.
 */
void saveLevel() throws MinecraftException {
    ArrayList<String> q = new ArrayList<String>();
    q.add("saveLevel");
    q.addAll(Arrays.asList(ObfuscationReflectionHelper.remapFieldNames("net.minecraft.world.WorldServer", new String[] { "func_73042_a" })));
    Method callable = ReflectionHelper.findMethod(World.class, this.proxiedWorld, q.toArray(new String[q.size()]));
    try {
        callable.invoke(this.proxiedWorld);
    } catch (Throwable e) {
        if (e instanceof MinecraftException)
            throw (MinecraftException) e;
    }
}
Also used : MinecraftException(net.minecraft.world.MinecraftException) ArrayList(java.util.ArrayList) Method(java.lang.reflect.Method)

Aggregations

MinecraftException (net.minecraft.world.MinecraftException)6 WorldServer (net.minecraft.world.WorldServer)4 IMixinWorldServer (org.spongepowered.common.interfaces.world.IMixinWorldServer)3 MinecraftServer (net.minecraft.server.MinecraftServer)2 WorldEvent (net.minecraftforge.event.world.WorldEvent)2 WorldProperties (org.spongepowered.api.world.storage.WorldProperties)2 IMixinMinecraftServer (org.spongepowered.common.interfaces.IMixinMinecraftServer)2 RegenerationGuiMessage (cavern.network.client.RegenerationGuiMessage)1 File (java.io.File)1 IOException (java.io.IOException)1 Method (java.lang.reflect.Method)1 ArrayList (java.util.ArrayList)1 Calendar (java.util.Calendar)1 Optional (java.util.Optional)1 EntityPlayer (net.minecraft.entity.player.EntityPlayer)1 EntityPlayerMP (net.minecraft.entity.player.EntityPlayerMP)1 ITextComponent (net.minecraft.util.text.ITextComponent)1 TextComponentString (net.minecraft.util.text.TextComponentString)1 TextComponentTranslation (net.minecraft.util.text.TextComponentTranslation)1 DimensionType (net.minecraft.world.DimensionType)1