本文整理汇总了Java中net.minecraft.init.Bootstrap类的典型用法代码示例。如果您正苦于以下问题:Java Bootstrap类的具体用法?Java Bootstrap怎么用?Java Bootstrap使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Bootstrap类属于net.minecraft.init包,在下文中一共展示了Bootstrap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: displayCrashReport
import net.minecraft.init.Bootstrap; //导入依赖的package包/类
/**
* Wrapper around displayCrashReportInternal
*/
public void displayCrashReport(CrashReport crashReportIn)
{
File file1 = new File(getMinecraft().mcDataDir, "crash-reports");
File file2 = new File(file1, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
Bootstrap.printToSYSOUT(crashReportIn.getCompleteReport());
if (crashReportIn.getFile() != null)
{
Bootstrap.printToSYSOUT("#@[email protected]# Game crashed! Crash report saved to: #@[email protected]# " + crashReportIn.getFile());
System.exit(-1);
}
else if (crashReportIn.saveToFile(file2))
{
Bootstrap.printToSYSOUT("#@[email protected]# Game crashed! Crash report saved to: #@[email protected]# " + file2.getAbsolutePath());
System.exit(-1);
}
else
{
Bootstrap.printToSYSOUT("#@[email protected]# Game crashed! Crash report could not be saved. #@[email protected]#");
System.exit(-2);
}
}
示例2: displayCrashReport
import net.minecraft.init.Bootstrap; //导入依赖的package包/类
/**
* Wrapper around displayCrashReportInternal
*/
public void displayCrashReport(CrashReport crashReportIn) {
File file1 = new File(getMinecraft().mcDataDir, "crash-reports");
File file2 = new File(file1,
"crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
Bootstrap.printToSYSOUT(crashReportIn.getCompleteReport());
if (crashReportIn.getFile() != null) {
Bootstrap.printToSYSOUT("#@[email protected]# Game crashed! Crash report saved to: #@[email protected]# " + crashReportIn.getFile());
System.exit(-1);
} else if (crashReportIn.saveToFile(file2)) {
Bootstrap.printToSYSOUT("#@[email protected]# Game crashed! Crash report saved to: #@[email protected]# " + file2.getAbsolutePath());
System.exit(-1);
} else {
Bootstrap.printToSYSOUT("#@[email protected]# Game crashed! Crash report could not be saved. #@[email protected]#");
System.exit(-2);
}
}
示例3: createGson
import net.minecraft.init.Bootstrap; //导入依赖的package包/类
public static Gson createGson()
{
Bootstrap.register();
if (gson == null)
{
GsonBuilder gsonBuilder = new GsonBuilder();
if (!registered)
{
new VanillaPlugin().registerContent(CustomStuff4.contentRegistry);
registered = true;
}
for (Pair<Type, JsonDeserializer<?>> pair : CustomStuff4.contentRegistry.getDeserializers())
{
gsonBuilder.registerTypeAdapter(pair.getLeft(), pair.getRight());
}
gson = gsonBuilder.create();
}
return gson;
}
示例4: displayCrashReport
import net.minecraft.init.Bootstrap; //导入依赖的package包/类
/**
* Wrapper around displayCrashReportInternal
*/
public void displayCrashReport(CrashReport crashReportIn)
{
File file1 = new File(getMinecraft().mcDataDir, "crash-reports");
File file2 = new File(file1, "crash-" + (new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss")).format(new Date()) + "-client.txt");
Bootstrap.printToSYSOUT(crashReportIn.getCompleteReport());
int retVal;
if (crashReportIn.getFile() != null)
{
Bootstrap.printToSYSOUT("#@[email protected]# Game crashed! Crash report saved to: #@[email protected]# " + crashReportIn.getFile());
retVal = -1;
}
else if (crashReportIn.saveToFile(file2))
{
Bootstrap.printToSYSOUT("#@[email protected]# Game crashed! Crash report saved to: #@[email protected]# " + file2.getAbsolutePath());
retVal = -1;
}
else
{
Bootstrap.printToSYSOUT("#@[email protected]# Game crashed! Crash report could not be saved. #@[email protected]#");
retVal = -2;
}
net.minecraftforge.fml.common.FMLCommonHandler.instance().handleExit(retVal);
}
示例5: Minecraft
import net.minecraft.init.Bootstrap; //导入依赖的package包/类
public Minecraft(Session par1Session, int par2, int par3, boolean par4, boolean par5, File par6File, File par7File, File par8File, Proxy par9Proxy, String par10Str)
{
theMinecraft = this;
this.mcDataDir = par6File;
this.fileAssets = par7File;
this.fileResourcepacks = par8File;
this.launchedVersion = par10Str;
this.mcDefaultResourcePack = new DefaultResourcePack(this.fileAssets);
this.addDefaultResourcePack();
this.proxy = par9Proxy == null ? Proxy.NO_PROXY : par9Proxy;
this.startTimerHackThread();
this.session = par1Session;
logger.info("Setting user: " + par1Session.getUsername());
logger.info("(Session ID is " + par1Session.getSessionID() + ")");
this.isDemo = par5;
this.displayWidth = par2;
this.displayHeight = par3;
this.tempDisplayWidth = par2;
this.tempDisplayHeight = par3;
this.fullscreen = par4;
this.jvm64bit = isJvm64bit();
ImageIO.setUseCache(false);
Bootstrap.func_151354_b();
}
示例6: Minecraft
import net.minecraft.init.Bootstrap; //导入依赖的package包/类
public Minecraft(Session p_i1103_1_, int p_i1103_2_, int p_i1103_3_, boolean p_i1103_4_, boolean p_i1103_5_, File p_i1103_6_, File p_i1103_7_, File p_i1103_8_, Proxy p_i1103_9_, String p_i1103_10_, Multimap p_i1103_11_, String p_i1103_12_)
{
theMinecraft = this;
this.mcDataDir = p_i1103_6_;
this.fileAssets = p_i1103_7_;
this.fileResourcepacks = p_i1103_8_;
this.launchedVersion = p_i1103_10_;
this.field_152356_J = p_i1103_11_;
this.mcDefaultResourcePack = new DefaultResourcePack((new ResourceIndex(p_i1103_7_, p_i1103_12_)).func_152782_a());
this.addDefaultResourcePack();
this.proxy = p_i1103_9_ == null ? Proxy.NO_PROXY : p_i1103_9_;
this.field_152355_az = (new YggdrasilAuthenticationService(p_i1103_9_, UUID.randomUUID().toString())).createMinecraftSessionService();
this.startTimerHackThread();
this.session = p_i1103_1_;
logger.info("Setting user: " + p_i1103_1_.getUsername());
this.isDemo = p_i1103_5_;
this.displayWidth = p_i1103_2_;
this.displayHeight = p_i1103_3_;
this.tempDisplayWidth = p_i1103_2_;
this.tempDisplayHeight = p_i1103_3_;
this.fullscreen = p_i1103_4_;
this.jvm64bit = isJvm64bit();
ImageIO.setUseCache(false);
Bootstrap.func_151354_b();
}
示例7: Minecraft
import net.minecraft.init.Bootstrap; //导入依赖的package包/类
public Minecraft(GameConfiguration gameConfig)
{
theMinecraft = this;
this.mcDataDir = gameConfig.folderInfo.mcDataDir;
this.fileAssets = gameConfig.folderInfo.assetsDir;
this.fileResourcepacks = gameConfig.folderInfo.resourcePacksDir;
this.launchedVersion = gameConfig.gameInfo.version;
this.twitchDetails = gameConfig.userInfo.userProperties;
this.field_181038_N = gameConfig.userInfo.field_181172_c;
this.mcDefaultResourcePack = new DefaultResourcePack((new ResourceIndex(gameConfig.folderInfo.assetsDir, gameConfig.folderInfo.assetIndex)).getResourceMap());
this.proxy = gameConfig.userInfo.proxy == null ? Proxy.NO_PROXY : gameConfig.userInfo.proxy;
this.sessionService = (new YggdrasilAuthenticationService(gameConfig.userInfo.proxy, UUID.randomUUID().toString())).createMinecraftSessionService();
this.session = gameConfig.userInfo.session;
logger.info("Setting user: " + this.session.getUsername());
logger.info("(Session ID is " + this.session.getSessionID() + ")");
this.isDemo = gameConfig.gameInfo.isDemo;
this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1;
this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1;
this.tempDisplayWidth = gameConfig.displayInfo.width;
this.tempDisplayHeight = gameConfig.displayInfo.height;
this.fullscreen = gameConfig.displayInfo.fullscreen;
this.jvm64bit = isJvm64bit();
this.theIntegratedServer = new IntegratedServer(this);
if (gameConfig.serverInfo.serverName != null)
{
this.serverName = gameConfig.serverInfo.serverName;
this.serverPort = gameConfig.serverInfo.serverPort;
}
ImageIO.setUseCache(false);
Bootstrap.register();
}
示例8: Minecraft
import net.minecraft.init.Bootstrap; //导入依赖的package包/类
public Minecraft(GameConfiguration gameConfig) {
theMinecraft = this;
this.mcDataDir = gameConfig.folderInfo.mcDataDir;
this.fileAssets = gameConfig.folderInfo.assetsDir;
this.fileResourcepacks = gameConfig.folderInfo.resourcePacksDir;
this.launchedVersion = gameConfig.gameInfo.version;
this.twitchDetails = gameConfig.userInfo.userProperties;
this.field_181038_N = gameConfig.userInfo.field_181172_c;
this.mcDefaultResourcePack = new DefaultResourcePack(
(new ResourceIndex(gameConfig.folderInfo.assetsDir, gameConfig.folderInfo.assetIndex))
.getResourceMap());
this.proxy = gameConfig.userInfo.proxy == null ? Proxy.NO_PROXY : gameConfig.userInfo.proxy;
this.sessionService = (new YggdrasilAuthenticationService(gameConfig.userInfo.proxy,
UUID.randomUUID().toString())).createMinecraftSessionService();
this.session = gameConfig.userInfo.session;
logger.info("Setting user: " + this.session.getUsername());
logger.info("(Session ID is " + this.session.getSessionID() + ")");
this.isDemo = gameConfig.gameInfo.isDemo;
this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1;
this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1;
this.tempDisplayWidth = gameConfig.displayInfo.width;
this.tempDisplayHeight = gameConfig.displayInfo.height;
this.fullscreen = gameConfig.displayInfo.fullscreen;
this.jvm64bit = isJvm64bit();
this.theIntegratedServer = new IntegratedServer(this);
if (gameConfig.serverInfo.serverName != null) {
this.serverName = gameConfig.serverInfo.serverName;
this.serverPort = gameConfig.serverInfo.serverPort;
}
ImageIO.setUseCache(false);
Bootstrap.register();
}
示例9: Minecraft
import net.minecraft.init.Bootstrap; //导入依赖的package包/类
public Minecraft(GameConfiguration gameConfig)
{
theMinecraft = this;
this.mcDataDir = gameConfig.folderInfo.mcDataDir;
this.fileAssets = gameConfig.folderInfo.assetsDir;
this.fileResourcepacks = gameConfig.folderInfo.resourcePacksDir;
this.launchedVersion = gameConfig.gameInfo.version;
this.versionType = gameConfig.gameInfo.versionType;
this.twitchDetails = gameConfig.userInfo.userProperties;
this.profileProperties = gameConfig.userInfo.profileProperties;
this.mcDefaultResourcePack = new DefaultResourcePack(gameConfig.folderInfo.getAssetsIndex());
this.proxy = gameConfig.userInfo.proxy == null ? Proxy.NO_PROXY : gameConfig.userInfo.proxy;
this.sessionService = (new YggdrasilAuthenticationService(this.proxy, UUID.randomUUID().toString())).createMinecraftSessionService();
this.session = gameConfig.userInfo.session;
LOGGER.info("Setting user: {}", new Object[] {this.session.getUsername()});
LOGGER.debug("(Session ID is {})", new Object[] {this.session.getSessionID()});
this.isDemo = gameConfig.gameInfo.isDemo;
this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1;
this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1;
this.tempDisplayWidth = gameConfig.displayInfo.width;
this.tempDisplayHeight = gameConfig.displayInfo.height;
this.fullscreen = gameConfig.displayInfo.fullscreen;
this.jvm64bit = isJvm64bit();
this.theIntegratedServer = null;
if (gameConfig.serverInfo.serverName != null)
{
this.serverName = gameConfig.serverInfo.serverName;
this.serverPort = gameConfig.serverInfo.serverPort;
}
ImageIO.setUseCache(false);
Bootstrap.register();
this.dataFixer = DataFixesManager.createFixer();
//-ZMod-core----------------------------------------------------------
ZHandle.onMinecraftInit(this);
//--------------------------------------------------------------------
}
示例10: setup
import net.minecraft.init.Bootstrap; //导入依赖的package包/类
@BeforeClass
public static void setup()
{
Bootstrap.register();
BLOCK = new TestBlock();
}
示例11: Minecraft
import net.minecraft.init.Bootstrap; //导入依赖的package包/类
public Minecraft(GameConfiguration gameConfig)
{
theMinecraft = this;
this.mcDataDir = gameConfig.folderInfo.mcDataDir;
this.fileAssets = gameConfig.folderInfo.assetsDir;
this.fileResourcepacks = gameConfig.folderInfo.resourcePacksDir;
this.launchedVersion = gameConfig.gameInfo.version;
this.versionType = gameConfig.gameInfo.versionType;
this.twitchDetails = gameConfig.userInfo.userProperties;
this.profileProperties = gameConfig.userInfo.profileProperties;
this.mcDefaultResourcePack = new DefaultResourcePack(gameConfig.folderInfo.getAssetsIndex());
this.proxy = gameConfig.userInfo.proxy == null ? Proxy.NO_PROXY : gameConfig.userInfo.proxy;
this.sessionService = (new YggdrasilAuthenticationService(this.proxy, UUID.randomUUID().toString())).createMinecraftSessionService();
this.session = gameConfig.userInfo.session;
LOGGER.info("Setting user: {}", new Object[] {this.session.getUsername()});
LOGGER.debug("(Session ID is {})", new Object[] {this.session.getSessionID()});
this.isDemo = gameConfig.gameInfo.isDemo;
this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1;
this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1;
this.tempDisplayWidth = gameConfig.displayInfo.width;
this.tempDisplayHeight = gameConfig.displayInfo.height;
this.fullscreen = gameConfig.displayInfo.fullscreen;
this.jvm64bit = isJvm64bit();
this.theIntegratedServer = null;
if (gameConfig.serverInfo.serverName != null)
{
this.serverName = gameConfig.serverInfo.serverName;
this.serverPort = gameConfig.serverInfo.serverPort;
}
ImageIO.setUseCache(false);
Locale.setDefault(Locale.ROOT);
Bootstrap.register();
this.dataFixer = DataFixesManager.createFixer();
}
示例12: Minecraft
import net.minecraft.init.Bootstrap; //导入依赖的package包/类
public Minecraft(GameConfiguration gameConfig)
{
theMinecraft = this;
this.mcDataDir = gameConfig.folderInfo.mcDataDir;
this.fileAssets = gameConfig.folderInfo.assetsDir;
this.fileResourcepacks = gameConfig.folderInfo.resourcePacksDir;
this.launchedVersion = gameConfig.gameInfo.version;
this.versionType = gameConfig.gameInfo.versionType;
this.twitchDetails = gameConfig.userInfo.userProperties;
this.profileProperties = gameConfig.userInfo.profileProperties;
this.mcDefaultResourcePack = new DefaultResourcePack(gameConfig.folderInfo.getAssetsIndex());
this.proxy = gameConfig.userInfo.proxy == null ? Proxy.NO_PROXY : gameConfig.userInfo.proxy;
this.sessionService = (new YggdrasilAuthenticationService(this.proxy, UUID.randomUUID().toString())).createMinecraftSessionService();
this.session = gameConfig.userInfo.session;
LOGGER.info("Setting user: {}", new Object[] {this.session.getUsername()});
this.isDemo = gameConfig.gameInfo.isDemo;
this.displayWidth = gameConfig.displayInfo.width > 0 ? gameConfig.displayInfo.width : 1;
this.displayHeight = gameConfig.displayInfo.height > 0 ? gameConfig.displayInfo.height : 1;
this.tempDisplayWidth = gameConfig.displayInfo.width;
this.tempDisplayHeight = gameConfig.displayInfo.height;
this.fullscreen = gameConfig.displayInfo.fullscreen;
this.jvm64bit = isJvm64bit();
this.theIntegratedServer = null;
if (gameConfig.serverInfo.serverName != null)
{
this.serverName = gameConfig.serverInfo.serverName;
this.serverPort = gameConfig.serverInfo.serverPort;
}
ImageIO.setUseCache(false);
Bootstrap.register();
this.dataFixer = DataFixesManager.createFixer();
}
示例13: constructServerInstance
import net.minecraft.init.Bootstrap; //导入依赖的package包/类
@Nonnull
private DedicatedServer constructServerInstance(@Nonnull BundleContext ctx) {
logger.info("Initializing Minecraft %s", FaucetVersion.API_VERSION);
Bootstrap.register(); // apparently this is how the registries work ... don't question it
// log some environment information
logger.info("Running on Java v%s supplied by %s", System.getProperty("java.version", "Unknown"),
System.getProperty("java.vendor"));
// TODO: Integrate with plugins here?
YggdrasilAuthenticationService var15 = new YggdrasilAuthenticationService(Proxy.NO_PROXY,
UUID.randomUUID().toString());
MinecraftSessionService var16 = var15.createMinecraftSessionService();
GameProfileRepository var17 = var15.createProfileRepository();
PlayerProfileCache var18 = new PlayerProfileCache(var17, new File(".", "usercache.json"));
DedicatedServer server = new DedicatedServer(new File("."), DataFixesManager.createFixer(),
var15, var16, var17, var18);
// TODO: Re-introduce configuration
if (!GraphicsEnvironment.isHeadless()) {
logger.info("Server GUI has been disabled or is unavailable in this environment");
// TODO: Custom GUI
} else {
logger
.info("Server GUI has been disabled or is not available within the current environment");
}
return server;
}
示例14: setup
import net.minecraft.init.Bootstrap; //导入依赖的package包/类
@BeforeClass
public static void setup()
{
Bootstrap.register();
}
示例15: setUp
import net.minecraft.init.Bootstrap; //导入依赖的package包/类
@BeforeClass
public static void setUp() throws Exception
{
Bootstrap.register();
}