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


Java ModLoader类代码示例

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


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

示例1: onEntityCollidedWithBlock

import net.minecraft.src.ModLoader; //导入依赖的package包/类
@Override
public void onEntityCollidedWithBlock(World par1World, int par2, int par3, int par4, Entity entity)
   {
	if(entity.ridingEntity == null && entity.riddenByEntity == null
			&& entity instanceof EntityPlayerMP)
	{
		EntityPlayerMP player = (EntityPlayerMP) entity;
		ModLoader.getMinecraftServerInstance();
		MinecraftServer server = MinecraftServer.getServer();
		
		if(player.timeUntilPortal > 0)
		{
			player.timeUntilPortal = 10;
		}
		else if(player.dimension != Rasterland.DIMENSIONID)
		{
			player.timeUntilPortal = 10;
			player.mcServer.getConfigurationManager().transferPlayerToDimension(player, Rasterland.DIMENSIONID, new TeleporterVoid(server.worldServerForDimension(Rasterland.DIMENSIONID)));
		}
		else
		{
			player.timeUntilPortal = 10;
			player.mcServer.getConfigurationManager().transferPlayerToDimension(player, 0, new TeleporterVoid(server.worldServerForDimension(0)));
		}
	}
}
 
开发者ID:mrgregfinch,项目名称:powell.cellarium,代码行数:27,代码来源:BlockTeleporter.java

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: getGraphicsLevel

import net.minecraft.src.ModLoader; //导入依赖的package包/类
@SuppressWarnings("static-access")
   @Override
public boolean getGraphicsLevel()
{
	// TODO Auto-generated method stub
	return ModLoader.getMinecraftInstance().isFancyGraphicsEnabled();
}
 
开发者ID:JennyLeeP,项目名称:JLPModJam,代码行数:8,代码来源:ClientProxy.java

示例8: Props

import net.minecraft.src.ModLoader; //导入依赖的package包/类
public void Props()
{
	ScarecrowHelmet = new ArmorScarecrow(ArmorConfig.ScarecrowHelmetID, ScarecrowArmor, ModLoader.addArmor("Scarecrow"), 0).setUnlocalizedName("Scarecrow Helmet");
	ScarecrowChestplate = new ArmorScarecrow(ArmorConfig.ScarecrowChestplateID, ScarecrowArmor, ModLoader.addArmor("Scarecrow"), 1).setUnlocalizedName("Scarecrow Chestplate");
	ScarecrowLeggings = new ArmorScarecrow(ArmorConfig.ScarecrowLeggingsID, ScarecrowArmor, ModLoader.addArmor("Scarecrow"), 2).setUnlocalizedName("Scarecrow Leggings");
	ScarecrowBoots = new ArmorScarecrow(ArmorConfig.ScarecrowBootsID, ScarecrowArmor, ModLoader.addArmor("Scarecrow"), 3).setUnlocalizedName("Scarecrow Boots");
}
 
开发者ID:Dontrell94,项目名称:Costume-s-Mod,代码行数:8,代码来源:ArmorProperties.java

示例9: 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

示例10: 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

示例11: load

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

示例12: load

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

示例13: printText

import net.minecraft.src.ModLoader; //导入依赖的package包/类
public static void printText(String message)
{
	ModLoader.getMinecraftInstance().thePlayer.addChatMessage(message);	
}
 
开发者ID:Wehavecookies56,项目名称:Kingdom-Keys,代码行数:5,代码来源:PrintToPlayer.java

示例14: registerRenderers

import net.minecraft.src.ModLoader; //导入依赖的package包/类
@Override
public void registerRenderers() {
 
    EntityRegistry.registerGlobalEntityID(EntityBlasterBolt.class, "BlasterBolt", ModLoader.getUniqueEntityId());
    RenderingRegistry.registerEntityRenderingHandler(EntityBlasterBolt.class, new RenderBlasterBolt());
}
 
开发者ID:fipsi7,项目名称:Minecraft_on_Fire,代码行数:7,代码来源:ClientProxy.java

示例15: 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


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