Guest User

Untitled

a guest
May 3rd, 2011
430
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package org.jbls.LexManos;
  2.  
  3. import java.lang.reflect.Field;
  4.  
  5. import org.bukkit.plugin.java.*;
  6. import org.bukkit.craftbukkit.*;
  7. import net.minecraft.server.*;
  8.  
  9. public class AutoSaveStopper extends JavaPlugin {
  10.     public AutoSaveStopper() {}
  11.  
  12.     @Override
  13.     public void onEnable() {
  14.         try {
  15.             Field saveInterval = World.class.getDeclaredField("k");
  16.             saveInterval.setAccessible(true);
  17.             for(org.bukkit.World bworld : getServer().getWorlds()){
  18.                 CraftWorld cWorld = (CraftWorld)bworld;
  19.                 World mWorld = cWorld.getHandle();
  20.                 saveInterval.setInt(mWorld, 36000);
  21.                 System.out.println("[Perfornace Tweaks]Set auto save interval to 36000 (30 Mins)");
  22.             }
  23.         } catch (Exception e){
  24.             System.out.println("[Perfornace Tweaks]AutoSaveStopper Failed: " + e.toString());
  25.         }
  26.     }
  27.     @Override
  28.     public void onDisable() {}
  29. }
RAW Paste Data