本文整理汇总了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);
}
示例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);
}
示例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();
}
}
示例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>();
}
示例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;
}
示例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();
}
}
}
示例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);
}
}
示例8: load
import net.minecraft.src.ModLoader; //导入方法依赖的package包/类
public void load(){
ShoulderSurfing.mc = ModLoader.getMinecraftInstance();
}
示例9: load
import net.minecraft.src.ModLoader; //导入方法依赖的package包/类
public void load(){
ShoulderLoader.mc = ModLoader.getMinecraftInstance();
}
示例10: SkinUpdateThread
import net.minecraft.src.ModLoader; //导入方法依赖的package包/类
public SkinUpdateThread(){
setName("HD Skin Update Thread");
mc = ModLoader.getMinecraftInstance();
this.start();
}
示例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());
}
}
}
示例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);
}
}
}