Java Code Examples for net.minecraft.world.chunk.storage.AnvilSaveConverter

The following are top voted examples for showing how to use net.minecraft.world.chunk.storage.AnvilSaveConverter. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: paintedbiomes   File: Configs.java   Source Code and License 6 votes vote down vote up
private static void setWorldDir()
{
    MinecraftServer server = FMLCommonHandler.instance().getMinecraftServerInstance();

    if (server != null)
    {
        File worldDir = new File(((AnvilSaveConverter) server.getActiveAnvilConverter()).savesDirectory, server.getFolderName());
        worldConfigDir = new File(worldDir, Reference.MOD_ID);
        worldConfigFile = new File(worldConfigDir, Reference.MOD_ID + ".cfg");
    }
    else
    {
        worldConfigDir = null;
        worldConfigFile = null;
    }
}
 
Example 2
Project: Cauldron   File: MinecraftServer.java   Source Code and License 6 votes vote down vote up
public MinecraftServer(File p_i45281_1_, Proxy p_i45281_2_)
{
    this.field_152366_X = new PlayerProfileCache(this, field_152367_a);
    mcServer = this;
    this.serverProxy = p_i45281_2_;
    this.anvilFile = p_i45281_1_;
    this.field_147144_o = new NetworkSystem(this);
    this.commandManager = new ServerCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(p_i45281_1_);
    this.field_152364_T = new YggdrasilAuthenticationService(p_i45281_2_, UUID.randomUUID().toString());
    this.field_147143_S = this.field_152364_T.createMinecraftSessionService();
    this.field_152365_W = this.field_152364_T.createProfileRepository();
    this.primaryThread = new Thread(this, "Server thread"); // CraftBukkit
    this.cauldronConfig = new CauldronConfig("cauldron.yml", "cauldron");
    this.tileEntityConfig = new TileEntityConfig("tileentities.yml", "cauldron_te");
}
 
Example 3
Project: RuneCraftery   File: MinecraftServer.java   Source Code and License 6 votes vote down vote up
public MinecraftServer(File par1File)
{
    this.serverProxy = Proxy.NO_PROXY;
    this.field_143008_E = 0;
    this.sentPacketCountArray = new long[100];
    this.sentPacketSizeArray = new long[100];
    this.receivedPacketCountArray = new long[100];
    this.receivedPacketSizeArray = new long[100];
    this.tickTimeArray = new long[100];
    this.texturePack = "";
    mcServer = this;
    this.anvilFile = par1File;
    this.commandManager = new ServerCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(par1File);
    this.registerDispenseBehaviors();
}
 
Example 4
Project: BetterNutritionMod   File: MinecraftServer.java   Source Code and License 6 votes vote down vote up
public MinecraftServer(File par1File)
{
    this.serverProxy = Proxy.NO_PROXY;
    this.field_143008_E = 0;
    this.sentPacketCountArray = new long[100];
    this.sentPacketSizeArray = new long[100];
    this.receivedPacketCountArray = new long[100];
    this.receivedPacketSizeArray = new long[100];
    this.tickTimeArray = new long[100];
    this.texturePack = "";
    mcServer = this;
    this.anvilFile = par1File;
    this.commandManager = new ServerCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(par1File);
    this.registerDispenseBehaviors();
}
 
Example 5
Project: DecompiledMinecraft   File: MinecraftServer.java   Source Code and License 5 votes vote down vote up
public MinecraftServer(File workDir, Proxy proxy, File profileCacheDir)
{
    this.serverProxy = proxy;
    mcServer = this;
    this.anvilFile = workDir;
    this.networkSystem = new NetworkSystem(this);
    this.profileCache = new PlayerProfileCache(this, profileCacheDir);
    this.commandManager = this.createNewCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(workDir);
    this.authService = new YggdrasilAuthenticationService(proxy, UUID.randomUUID().toString());
    this.sessionService = this.authService.createMinecraftSessionService();
    this.profileRepo = this.authService.createProfileRepository();
}
 
Example 6
Project: DecompiledMinecraft   File: MinecraftServer.java   Source Code and License 5 votes vote down vote up
public MinecraftServer(File workDir, Proxy proxy, File profileCacheDir)
{
    this.serverProxy = proxy;
    mcServer = this;
    this.anvilFile = workDir;
    this.networkSystem = new NetworkSystem(this);
    this.profileCache = new PlayerProfileCache(this, profileCacheDir);
    this.commandManager = this.createNewCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(workDir);
    this.authService = new YggdrasilAuthenticationService(proxy, UUID.randomUUID().toString());
    this.sessionService = this.authService.createMinecraftSessionService();
    this.profileRepo = this.authService.createProfileRepository();
}
 
Example 7
Project: BaseClient   File: MinecraftServer.java   Source Code and License 5 votes vote down vote up
public MinecraftServer(File workDir, Proxy proxy, File profileCacheDir)
{
    this.serverProxy = proxy;
    mcServer = this;
    this.anvilFile = workDir;
    this.networkSystem = new NetworkSystem(this);
    this.profileCache = new PlayerProfileCache(this, profileCacheDir);
    this.commandManager = this.createNewCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(workDir);
    this.authService = new YggdrasilAuthenticationService(proxy, UUID.randomUUID().toString());
    this.sessionService = this.authService.createMinecraftSessionService();
    this.profileRepo = this.authService.createProfileRepository();
}
 
Example 8
Project: BaseClient   File: MinecraftServer.java   Source Code and License 5 votes vote down vote up
public MinecraftServer(File workDir, Proxy proxy, File profileCacheDir)
{
    this.serverProxy = proxy;
    mcServer = this;
    this.anvilFile = workDir;
    this.networkSystem = new NetworkSystem(this);
    this.profileCache = new PlayerProfileCache(this, profileCacheDir);
    this.commandManager = this.createNewCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(workDir);
    this.authService = new YggdrasilAuthenticationService(proxy, UUID.randomUUID().toString());
    this.sessionService = this.authService.createMinecraftSessionService();
    this.profileRepo = this.authService.createProfileRepository();
}
 
Example 9
Project: Backmemed   File: MinecraftServer.java   Source Code and License 5 votes vote down vote up
public MinecraftServer(File anvilFileIn, Proxy proxyIn, DataFixer dataFixerIn, YggdrasilAuthenticationService authServiceIn, MinecraftSessionService sessionServiceIn, GameProfileRepository profileRepoIn, PlayerProfileCache profileCacheIn)
{
    this.serverProxy = proxyIn;
    this.authService = authServiceIn;
    this.sessionService = sessionServiceIn;
    this.profileRepo = profileRepoIn;
    this.profileCache = profileCacheIn;
    this.anvilFile = anvilFileIn;
    this.networkSystem = new NetworkSystem(this);
    this.commandManager = this.createNewCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(anvilFileIn, dataFixerIn);
    this.dataFixer = dataFixerIn;
}
 
Example 10
Project: Mods   File: TF2weapons.java   Source Code and License 5 votes vote down vote up
@Mod.EventHandler
public void serverStop(FMLServerStoppingEvent event) {
	//MapList.nameToData.clear();
	//MapList.buildInAttributes.clear();

	File output = new File(((AnvilSaveConverter) server.getActiveAnvilConverter()).savesDirectory, server.getFolderName() + "/teleports.dat");
	NBTTagCompound tagRoot = new NBTTagCompound();
	NBTTagCompound tag = new NBTTagCompound();
	tagRoot.setTag("Teleporters", tag);

	for (Entry<UUID, TeleporterData[]> entry : EntityTeleporter.teleporters.entrySet()) {
		NBTTagCompound exitTag = new NBTTagCompound();
		for (int i = 0; i < EntityTeleporter.TP_PER_PLAYER; i++) {
			TeleporterData blockPos = entry.getValue()[i];
			if (blockPos != null)
				exitTag.setIntArray(Integer.toString(i), new int[] { blockPos.getX(), blockPos.getY(), blockPos.getZ(), blockPos.id, blockPos.dimension});
		}
		tag.setTag(entry.getKey().toString(), exitTag);
	}
	tagRoot.setInteger("TPCount", EntityTeleporter.tpCount);

	try {
		CompressedStreamTools.writeCompressed(tagRoot, new FileOutputStream(output));
	} catch (IOException e) {
		e.printStackTrace();
	}

	EntityTeleporter.teleporters.clear();
	EntityTeleporter.tpCount = 0;
	if(udpServer != null) {
		udpServer.stopServer();
		udpServer = null;
	}
}
 
Example 11
Project: CustomWorldGen   File: MinecraftServer.java   Source Code and License 5 votes vote down vote up
public MinecraftServer(File anvilFileIn, Proxy proxyIn, DataFixer dataFixerIn, YggdrasilAuthenticationService authServiceIn, MinecraftSessionService sessionServiceIn, GameProfileRepository profileRepoIn, PlayerProfileCache profileCacheIn)
{
    this.serverProxy = proxyIn;
    this.authService = authServiceIn;
    this.sessionService = sessionServiceIn;
    this.profileRepo = profileRepoIn;
    this.profileCache = profileCacheIn;
    this.anvilFile = anvilFileIn;
    this.networkSystem = new NetworkSystem(this);
    this.commandManager = this.createNewCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(anvilFileIn, dataFixerIn);
    this.dataFixer = dataFixerIn;
}
 
Example 12
Project: justenoughdimensions   File: JustEnoughDimensions.java   Source Code and License 5 votes vote down vote up
@Mod.EventHandler
public void onServerAboutToStart(FMLServerAboutToStartEvent event)
{
    File worldDir = new File(((AnvilSaveConverter) event.getServer().getActiveAnvilConverter()).savesDirectory, event.getServer().getFolderName());
    DimensionConfig.instance().readDimensionConfig(worldDir);

    // This needs to be here so that we are able to override existing dimensions before
    // they get loaded during server start.
    // But on the other hand we don't want to register the rest of the dimensions yet,
    // otherwise they would be considered 'static dimensions' and get loaded on server start.
    DimensionConfig.instance().registerOverriddenDimensions();
}
 
Example 13
Project: morecommands   File: CommandWorld.java   Source Code and License 5 votes vote down vote up
private void loadWorld(DedicatedServer server, AnvilSaveConverter saveLoader, String world, long seed, WorldType type, String genSettings) {
	if (this.loadWorlds != null) {
		try {
			server.getPlayerList().saveAllPlayerData();
			this.loadWorlds.invoke(server, world, world, seed, type == null ? WorldType.DEFAULT : type, genSettings);
			server.setFolderName(world);
			
			for (EntityPlayerMP player : server.getPlayerList().getPlayers()) {
				transferPlayer(server, player);
			}
		}
		catch (Exception ex) {ex.printStackTrace(); return;}
	}
}
 
Example 14
Project: Resilience-Client-Source   File: MinecraftServer.java   Source Code and License 5 votes vote down vote up
public MinecraftServer(File p_i45281_1_, Proxy p_i45281_2_)
{
    mcServer = this;
    this.serverProxy = p_i45281_2_;
    this.anvilFile = p_i45281_1_;
    this.field_147144_o = new NetworkSystem(this);
    this.commandManager = new ServerCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(p_i45281_1_);
    this.field_147143_S = (new YggdrasilAuthenticationService(p_i45281_2_, UUID.randomUUID().toString())).createMinecraftSessionService();
}
 
Example 15
Project: Cauldron   File: MinecraftServer.java   Source Code and License 5 votes vote down vote up
public MinecraftServer(File p_i45281_1_, Proxy p_i45281_2_)
{
    this.field_152366_X = new PlayerProfileCache(this, field_152367_a);
    mcServer = this;
    this.serverProxy = p_i45281_2_;
    this.anvilFile = p_i45281_1_;
    this.field_147144_o = new NetworkSystem(this);
    this.commandManager = new ServerCommandManager();
    this.anvilConverterForAnvilFile = new AnvilSaveConverter(p_i45281_1_);
    this.field_152364_T = new YggdrasilAuthenticationService(p_i45281_2_, UUID.randomUUID().toString());
    this.field_147143_S = this.field_152364_T.createMinecraftSessionService();
    this.field_152365_W = this.field_152364_T.createProfileRepository();
}
 
Example 16
Project: RuneCraftery   File: MinecraftServer.java   Source Code and License 5 votes vote down vote up
public MinecraftServer(File p_i1498_1_) {
   this.field_110456_c = Proxy.NO_PROXY;
   this.field_143008_E = 0;
   this.field_71300_f = new long[100];
   this.field_71301_g = new long[100];
   this.field_71313_h = new long[100];
   this.field_71314_i = new long[100];
   this.field_71311_j = new long[100];
   this.field_71297_P = "";
   field_71309_l = this;
   this.field_71308_o = p_i1498_1_;
   this.field_71321_q = new ServerCommandManager();
   this.field_71310_m = new AnvilSaveConverter(p_i1498_1_);
   this.func_82355_al();
}
 
Example 17
Project: NeptuneMod   File: MixinMinecraftServer.java   Source Code and License 4 votes vote down vote up
@Redirect(method = "<init>", at = @At(value = "NEW", args = "class=net/minecraft/world/chunk/storage/AnvilSaveConverter"))
public AnvilSaveConverter createSaveConverter(File dir) {
    return new AnvilSaveConverter(NeptuneWorldManager.WORLDS_DIR);
}
 
Example 18
Project: RuneCraftery   File: AnvilSaveConverterFileFilter.java   Source Code and License 4 votes vote down vote up
AnvilSaveConverterFileFilter(AnvilSaveConverter p_i2143_1_) {
   this.field_76172_a = p_i2143_1_;
}