当前位置: 首页>>代码示例>>Java>>正文


Java ModLoader.getMinecraftInstance方法代码示例

本文整理汇总了Java中net.minecraft.src.ModLoader.getMinecraftInstance方法的典型用法代码示例。如果您正苦于以下问题:Java ModLoader.getMinecraftInstance方法的具体用法?Java ModLoader.getMinecraftInstance怎么用?Java ModLoader.getMinecraftInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.src.ModLoader的用法示例。


在下文中一共展示了ModLoader.getMinecraftInstance方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import net.minecraft.src.ModLoader; //导入方法依赖的package包/类
@Subscribe
public void init(FMLInitializationEvent event){		
	//load the keyboard bindings
	kbh = ShoulderKeybindings.registerKeybindings();
	
	//create mc pointer
	mc = ModLoader.getMinecraftInstance();
	
	//create tick handler
	st = new ShoulderTickHandler();
	TickRegistry.registerTickHandler(st, Side.CLIENT);
}
 
开发者ID:sabarjp,项目名称:ShoulderSurfing,代码行数:13,代码来源:ShoulderSurfing.java

示例2: load

import net.minecraft.src.ModLoader; //导入方法依赖的package包/类
@Init
public void load(FMLInitializationEvent event) {
	//load the keyboard bindings
	kbh = ShoulderKeybindings.registerKeybindings();
	
	//create mc pointer
	mc = ModLoader.getMinecraftInstance();
	
	//create tick handler
	st = new ShoulderTickHandler();
	TickRegistry.registerTickHandler(st, Side.CLIENT);
}
 
开发者ID:sabarjp,项目名称:ShoulderSurfing,代码行数:13,代码来源:ShoulderSurfing.java

示例3: storeNBTIntegers

import net.minecraft.src.ModLoader; //导入方法依赖的package包/类
public void storeNBTIntegers(int x, int y, int z, String key, int i, String k2, int j, String k3, int[] potions)
{
	try
	{
		File file = new File(ModLoader.getMinecraftInstance().mcDataDir + "/saves/brewingdata/", "cauldron." + x + "." + y + "." + z + ".data.dat");
		
		if (!file.exists())
		{
			file.getParentFile().mkdirs();
			file.createNewFile();
		}
		
		FileOutputStream fileoutputstream = new FileOutputStream(file.getCanonicalFile());
		NBTTagCompound nbt = new NBTTagCompound();
		
		nbt.setInteger(key, i); 
		nbt.setInteger(k2, j);
		nbt.setIntArray(k3, potions);
		
		CompressedStreamTools.writeCompressed(nbt, fileoutputstream);
		fileoutputstream.close();
	}
	catch (Exception exception)
	{
		exception.printStackTrace();
	}
}
 
开发者ID:ajwgeek,项目名称:Modjam-2,代码行数:28,代码来源:TileEntityCauldron.java

示例4: readNBTDataArray

import net.minecraft.src.ModLoader; //导入方法依赖的package包/类
public List<Integer> readNBTDataArray(int x, int y, int z, String key)
{
	try
	{
		ModLoader.getMinecraftInstance().theWorld.checkSessionLock();
	}
	catch (MinecraftException e)
	{
		e.printStackTrace();
	}
	try
	{
		File file = new File(ModLoader.getMinecraftInstance().mcDataDir + "/saves/brewingdata/", "cauldron." + x + "." + y + "." + z + ".data.dat");

		if (!file.exists())
		{
			return new ArrayList<Integer>();
		}
		
		FileInputStream fileinputstream = new FileInputStream(file.getCanonicalFile());
		NBTTagCompound nbt = CompressedStreamTools.readCompressed(fileinputstream);
		
		if (nbt.hasKey(key))
		{
			List<Integer> l = new ArrayList<Integer>();
			for (int i : nbt.getIntArray(key))
			{
				l.add(i);
			}
			return l;
		}
		
		fileinputstream.close();
	}
	catch (Exception exception)
	{
		exception.printStackTrace();
	}
	return new ArrayList<Integer>();
}
 
开发者ID:ajwgeek,项目名称:Modjam-2,代码行数:41,代码来源:TileEntityCauldron.java

示例5: readNBTData

import net.minecraft.src.ModLoader; //导入方法依赖的package包/类
public int readNBTData(int x, int y, int z, String key)
{
	try
	{
		ModLoader.getMinecraftInstance().theWorld.checkSessionLock();
	}
	catch (MinecraftException e)
	{
		e.printStackTrace();
	}
	try
	{
		File file = new File(ModLoader.getMinecraftInstance().mcDataDir + "/saves/brewingdata/", "cauldron." + x + "." + y + "." + z + ".data.dat");

		if (!file.exists())
		{
			return 0;
		}
		
		FileInputStream fileinputstream = new FileInputStream(file.getCanonicalFile());
		NBTTagCompound nbt = CompressedStreamTools.readCompressed(fileinputstream);
		
		if (nbt.hasKey(key))
		{
			return nbt.getInteger(key);
		}
		
		fileinputstream.close();
	}
	catch (Exception exception)
	{
		exception.printStackTrace();
	}
	return 0;
}
 
开发者ID:ajwgeek,项目名称:Modjam-2,代码行数:36,代码来源:TileEntityCauldron.java

示例6: run

import net.minecraft.src.ModLoader; //导入方法依赖的package包/类
public void run(){
	while(mc.running){
		mc = ModLoader.getMinecraftInstance();
		if(mc.theWorld != null)
			HDSkinHandler.updateSkins(mc.theWorld);
		try {
			sleep(5000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
	}
}
 
开发者ID:uzzaco2002,项目名称:secri,代码行数:13,代码来源:SkinUpdateThread.java

示例7: keyDown

import net.minecraft.src.ModLoader; //导入方法依赖的package包/类
@Override
     public void keyDown(EnumSet<TickType> types, KeyBinding kb,
                     boolean tickEnd, boolean isRepeat) {
         Minecraft mc = ModLoader.getMinecraftInstance();
if(mc.theWorld!=null && mc.currentScreen instanceof GuiIngameMenu){
	HDSkinHandler.forceUpdateSkins(mc.theWorld);
}
             
     }
 
开发者ID:uzzaco2002,项目名称:secri,代码行数:10,代码来源:HDKeyHandler.java

示例8: load

import net.minecraft.src.ModLoader; //导入方法依赖的package包/类
public void load(){
	ShoulderSurfing.mc = ModLoader.getMinecraftInstance();
}
 
开发者ID:sabarjp,项目名称:ShoulderSurfing,代码行数:4,代码来源:ShoulderLoader.java

示例9: load

import net.minecraft.src.ModLoader; //导入方法依赖的package包/类
public void load(){
	ShoulderLoader.mc = ModLoader.getMinecraftInstance();
}
 
开发者ID:sabarjp,项目名称:ShoulderSurfing,代码行数:4,代码来源:ShoulderLoader.java

示例10: SkinUpdateThread

import net.minecraft.src.ModLoader; //导入方法依赖的package包/类
public SkinUpdateThread(){
	setName("HD Skin Update Thread");
	mc = ModLoader.getMinecraftInstance();
	this.start();

}
 
开发者ID:uzzaco2002,项目名称:secri,代码行数:7,代码来源:SkinUpdateThread.java

示例11: updateSkins

import net.minecraft.src.ModLoader; //导入方法依赖的package包/类
public static void updateSkins(World world){
	List<EntityPlayer> players = world.playerEntities;
	for(EntityPlayer p : players){

		
	if(p.skinUrl!="http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png"){
			
		try{	
			
			
		SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";
	
		URL url = new URL(SkinURL);
	
		HttpURLConnection con = ((HttpURLConnection) url.openConnection());
		con.setConnectTimeout(1000);
		con.setRequestMethod("HEAD");
		try{
		int responseCode = con.getResponseCode();
			if  (responseCode ==200){

					p.skinUrl = SkinURL;

					
					p.worldObj.obtainEntitySkin(p);
					
				
				
			
			

			}else{
				SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";

					p.skinUrl = SkinURL;

					p.worldObj.obtainEntitySkin(p);
					
				
			}
		}catch (SocketTimeoutException ste){
			SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";

					p.skinUrl = SkinURL;

					p.worldObj.obtainEntitySkin(p);
					
			
		}
		}catch (IOException e){
			SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";

					p.skinUrl = SkinURL;

					p.worldObj.obtainEntitySkin(p);
					
			
		}
		
		
		
		p.cloakUrl = "http://home.maemesoft.wo.tc:25564/MinecraftCloaks/" + p.username + ".png";
		p.cloakUrl = p.cloakUrl;
		
		mc1 = ModLoader.getMinecraftInstance();;
		
		mc1.renderEngine.obtainImageData(p.cloakUrl, new ImageBufferDownload());
		
		
		}
	}
}
 
开发者ID:uzzaco2002,项目名称:secri,代码行数:73,代码来源:HDSkinHandler.java

示例12: forceUpdateSkins

import net.minecraft.src.ModLoader; //导入方法依赖的package包/类
public static void forceUpdateSkins(World world){
	List<EntityPlayer> players = world.playerEntities;
	for(EntityPlayer p : players){
		
	
		
	if(p.skinUrl!="http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png"){
			
		try{	
			
			
		SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";
	
		URL url = new URL(SkinURL);
	
		HttpURLConnection con = ((HttpURLConnection) url.openConnection());
		con.setConnectTimeout(1000);
		con.setRequestMethod("HEAD");
		try{
		int responseCode = con.getResponseCode();
			if  (responseCode ==200){
	

					p.skinUrl = SkinURL;

					p.worldObj.releaseEntitySkin(p);
					p.worldObj.obtainEntitySkin(p);
					
				
				
			
			

			}else{
				SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";

					p.skinUrl = SkinURL;
					
					p.worldObj.releaseEntitySkin(p);
					p.worldObj.obtainEntitySkin(p);
					
				
				
			}
		}catch (SocketTimeoutException ste){
			SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";

					p.skinUrl = SkinURL;

					p.worldObj.releaseEntitySkin(p);
					p.worldObj.obtainEntitySkin(p);
					
			
		}
		}catch (IOException e){
			SkinURL = "http://home.maemesoft.wo.tc:25564/MinecraftSkins/" + p.username + ".png";

					p.skinUrl = SkinURL;

					p.worldObj.releaseEntitySkin(p);
					p.worldObj.obtainEntitySkin(p);
					
			
		}
		
		
		
		p.cloakUrl = "http://home.maemesoft.wo.tc:25564/MinecraftCloaks/" + p.username + ".png";
		p.cloakUrl = p.cloakUrl;
		
		mc1 = ModLoader.getMinecraftInstance();;
		
		mc1.renderEngine.obtainImageData(p.cloakUrl, new ImageBufferDownload());
		
		
		}else{
			p.worldObj.releaseEntitySkin(p);
			p.worldObj.obtainEntitySkin(p);
		}
	}
}
 
开发者ID:uzzaco2002,项目名称:secri,代码行数:82,代码来源:HDSkinHandler.java


注:本文中的net.minecraft.src.ModLoader.getMinecraftInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。