本文整理汇总了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)));
}
}
}
示例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);
}
示例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);
}
示例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();
}
}
示例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>();
}
示例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;
}
示例7: getGraphicsLevel
import net.minecraft.src.ModLoader; //导入依赖的package包/类
@SuppressWarnings("static-access")
@Override
public boolean getGraphicsLevel()
{
// TODO Auto-generated method stub
return ModLoader.getMinecraftInstance().isFancyGraphicsEnabled();
}
示例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");
}
示例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();
}
}
}
示例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);
}
}
示例11: load
import net.minecraft.src.ModLoader; //导入依赖的package包/类
public void load(){
ShoulderSurfing.mc = ModLoader.getMinecraftInstance();
}
示例12: load
import net.minecraft.src.ModLoader; //导入依赖的package包/类
public void load(){
ShoulderLoader.mc = ModLoader.getMinecraftInstance();
}
示例13: printText
import net.minecraft.src.ModLoader; //导入依赖的package包/类
public static void printText(String message)
{
ModLoader.getMinecraftInstance().thePlayer.addChatMessage(message);
}
示例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());
}
示例15: SkinUpdateThread
import net.minecraft.src.ModLoader; //导入依赖的package包/类
public SkinUpdateThread(){
setName("HD Skin Update Thread");
mc = ModLoader.getMinecraftInstance();
this.start();
}