Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.minecraft.src;
- // Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
- // Jad home page: http://www.kpdus.com/jad.html
- // Decompiler options: packimports(3) braces deadcode
- import java.io.FileInputStream;
- import java.io.PrintStream;
- import java.net.URI;
- import java.net.URL;
- import java.security.CodeSource;
- import java.security.ProtectionDomain;
- import java.util.*;
- import org.lwjgl.input.Keyboard;
- import java.lang.reflect.Method;
- import net.minecraft.client.Minecraft;
- public class mod_PortalGun extends BaseMod {
- public static int PortalBlueBottomID = ModLoader.addOverride("/terrain.png", "/portalgun/Block_PortalBlueBottom.png");
- public static int PortalBlueTopID = ModLoader.addOverride("/terrain.png", "/portalgun/Block_PortalBlueTop.png");
- public static int PortalBlueRound = ModLoader.addOverride("/terrain.png", "/portalgun/Block_PortalBlueRound.png");
- public static int PortalOrangeBottomID = ModLoader.addOverride("/terrain.png", "/portalgun/Block_PortalOrangeBottom.png");
- public static int PortalOrangeTopID = ModLoader.addOverride("/terrain.png", "/portalgun/Block_PortalOrangeTop.png");
- public static int PortalOrangeRound = ModLoader.addOverride("/terrain.png", "/portalgun/Block_PortalOrangeRound.png");
- public static int PortalWeightedCube = ModLoader.addOverride("/terrain.png", "/portalgun/Block_PortalWeightedCube.png");
- public static int PortalCompanionCube = ModLoader.addOverride("/terrain.png", "/portalgun/Block_PortalCompanionCube.png");
- public static int PortalRenderNum;
- public static int portalblockID = 104;
- public static int portalcubeID = 105;
- public static final Item PortalGunBlue = (new ItemPortalGunBlue(ModLoader.getUniqueEntityId())).setIconIndex(ModLoader.addOverride("/gui/items.png", "/portalgun/Item_PortalGunBlue.png")).setFull3D().setItemName("PortalGunBlue");
- public static final Item PortalGunOrange = (new ItemPortalGunOrange(ModLoader.getUniqueEntityId())).setIconIndex(ModLoader.addOverride("/gui/items.png", "/portalgun/Item_PortalGunOrange.png")).setFull3D().setItemName("PortalGunOrange");
- public static final Item PortalGunCore = (new ItemPortalGunCore(ModLoader.getUniqueEntityId())).setIconIndex(ModLoader.addOverride("/gui/items.png", "/portalgun/Item_PortalGunCore.png")).setFull3D().setItemName("PortalGunCore");
- public static final Item KneeReplacement = (new ItemArmor(ModLoader.getUniqueEntityId(), -1, ModLoader.AddArmor("kneereplacement"), 3)).setIconIndex(ModLoader.addOverride("/gui/items.png", "/portalgun/Item_AdvancedKneeReplacement.png")).setFull3D().setItemName("KneeReplacement");
- public static final Item PortalHeelSpring = (new ItemPortalHeelSpring(ModLoader.getUniqueEntityId())).setIconIndex(ModLoader.addOverride("/gui/items.png", "/portalgun/Item_PortalHeelSpring.png")).setFull3D().setItemName("HeelSpring");
- public static Block PortalMod;
- public static Block PortalCube;
- //public static int unportalbleID[];
- public mod_PortalGun()
- {
- try {
- java.lang.reflect.Method m = ModLoader.class.getDeclaredMethod("SetInGameHook", BaseMod.class, boolean.class, boolean.class);
- m.invoke(null, this, true, false);
- } catch (Throwable e) {}
- ModLoader.SetInGameHook(this,true,true);
- ModLoader.RegisterBlock(PortalMod);
- ModLoader.RegisterBlock(PortalCube, ItemPortalCube.class);
- ModLoader.AddName(PortalMod, "Portal, DO NOT PLACE");
- ModLoader.AddName(KneeReplacement, "Advanced Knee Replacement");
- ModLoader.AddName(PortalHeelSpring, "Heel Spring");
- ModLoader.AddName(PortalGunBlue, "Portal Gun");
- ModLoader.AddName(PortalGunOrange, "Portal Gun");
- ModLoader.AddName(PortalGunCore, "Mysterious Substance");
- PortalRenderNum = ModLoader.getUniqueBlockModelID(this, true);
- }
- private static void initBlocks()
- {
- PortalMod = (new BlockPortalMod(portalblockID, PortalBlueRound)).setLightValue(0.75F).setHardness(100F).setBlockName("PortalMod");
- PortalCube = new BlockPortalCube();
- }
- private static int portalgunswapKey = Keyboard.KEY_G;
- private static int portalgunrebootKey = Keyboard.KEY_R;
- private static boolean portalgunswapKeyDown = false;
- private static boolean portalgunrebootKeyDown = false;
- public void AddRecipes(CraftingManager craftingmanager)
- {
- craftingmanager.addRecipe(new ItemStack(PortalGunBlue, 1),
- new Object[] { "X##", "DC#", "#X#", Character.valueOf('#'), Item.ingotIron, Character.valueOf('X'), Block.obsidian, Character.valueOf('D'), Item.diamond, Character.valueOf('C'), PortalGunCore});
- craftingmanager.addRecipe(new ItemStack(PortalGunCore, 1),
- new Object[] { "#X", Character.valueOf('#'), new ItemStack(Item.dyePowder, 1, 4), Character.valueOf('X'), Item.redstone});
- craftingmanager.addRecipe(new ItemStack(PortalHeelSpring, 1),
- new Object[] { "#D#", " X ", " X ", Character.valueOf('#'), Item.ingotIron, Character.valueOf('X'), Block.obsidian, Character.valueOf('D'), Item.diamond});
- craftingmanager.addRecipe(new ItemStack(KneeReplacement, 1),
- new Object[] { "##", Character.valueOf('#'), PortalHeelSpring});
- craftingmanager.addRecipe(new ItemStack(PortalHeelSpring, 2),
- new Object[] { "#", Character.valueOf('#'), KneeReplacement});
- craftingmanager.addRecipe(new ItemStack(Block.dirt, 64),
- new Object[] { "#", Character.valueOf('#'), new ItemStack(Block.dirt, 1)});
- craftingmanager.addRecipe(new ItemStack(PortalCube, 1, 0),
- new Object[] { "##", Character.valueOf('#'), new ItemStack(Block.dirt, 1)});
- craftingmanager.addRecipe(new ItemStack(new ItemPortalCube(PortalCube.blockID - 256), 2, 2),
- new Object[] { "#", "#", Character.valueOf('#'), new ItemStack(Block.dirt, 1)});//
- }
- public void AddRenderer(Map map)
- {
- map.put(EntityPortalBallBlue.class, new RenderPortalBallBlue());
- map.put(EntityPortalBallOrange.class, new RenderPortalBallOrange());
- }
- public boolean renderPortal(RenderBlocks renderblocks, IBlockAccess iblockaccess, int i, int j, int k, Block block)
- {
- Tessellator tessellator = Tessellator.instance;
- int l = PortalBlueRound;
- int l1 = PortalBlueBottomID;
- int l2 = PortalBlueTopID;
- int l3 = PortalOrangeRound;
- int l4 = PortalOrangeBottomID;
- int l5 = PortalOrangeTopID;
- float f = block.getBlockBrightness(iblockaccess, i, j, k);
- tessellator.setColorOpaque_F(f, f, f);
- int i1 = (l & 0xf) << 4;
- int j1 = l & 0xf0;
- int i2 = (l1 & 0xf) << 4;
- int j2 = l1 & 0xf0;
- int i3 = (l2 & 0xf) << 4;
- int j3 = l2 & 0xf0;
- int i4 = (l3 & 0xf) << 4;
- int j4 = l3 & 0xf0;
- int i5 = (l4 & 0xf) << 4;
- int j5 = l4 & 0xf0;
- int i6 = (l5 & 0xf) << 4;
- int j6 = l5 & 0xf0;
- double d = (float)i2 / 256F;
- double d1 = ((float)i2 + 15.99F) / 256F;
- double d2 = (float)j2 / 256F;
- double d3 = ((float)j2 + 15.99F) / 256F;
- double d4 = (float)i1 / 256F;
- double d5 = ((float)i1 + 15.99F) / 256F;
- double d6 = (float)j1 / 256F;
- double d7 = ((float)j1 + 15.99F) / 256F;
- double d8 = (float)i3 / 256F;
- double d9 = ((float)i3 + 15.99F) / 256F;
- double d10 = (float)j3 / 256F;
- double d11 = ((float)j3 + 15.99F) / 256F;
- double d12 = (float)i4 / 256F;
- double d13 = ((float)i4 + 15.99F) / 256F;
- double d14 = (float)j4 / 256F;
- double d15 = ((float)j4 + 15.99F) / 256F;
- double d16 = (float)i5 / 256F;
- double d17 = ((float)i5 + 15.99F) / 256F;
- double d18 = (float)j5 / 256F;
- double d19 = ((float)j5 + 15.99F) / 256F;
- double d20 = (float)i6 / 256F;
- double d21 = ((float)i6 + 15.99F) / 256F;
- double d22 = (float)j6 / 256F;
- double d23 = ((float)j6 + 15.99F) / 256F;
- int k1 = iblockaccess.getBlockMetadata(i, j, k);
- float f1 = 0.0F;
- float f2 = 0.025F;
- float f3 = i + 1;
- float f4 = i + 1;
- float f5 = i + 0;
- float f6 = i + 0;
- float f7 = k + 0;
- float f8 = k + 1;
- float f9 = k + 1;
- float f10 = k + 0;
- float f11 = (float)j + f2;
- float f12 = (float)j + f2;
- float f13 = (float)j + f2;
- float f14 = (float)j + f2;
- float f15 = 0.975F;
- float f16 = (float)j + f15;
- float f17 = (float)j + f15;
- float f18 = (float)j + f15;
- float f19 = (float)j + f15;
- if(k1 == 2)
- {
- tessellator.addVertexWithUV(f6, f14, f10, d4, d6);
- tessellator.addVertexWithUV(f5, f13, f9, d4, d7);
- tessellator.addVertexWithUV(f4, f12, f8, d5, d7);
- tessellator.addVertexWithUV(f3, f11, f7, d5, d6);
- }
- else if(k1 == 6)
- {
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 1) + f1, (float)(k + 1) + f1, d, d2);
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 0) - f1, (float)(k + 1) + f1, d, d3);
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 0) - f1, (float)(k + 0) - f1, d1, d3);
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 1) + f1, (float)(k + 0) - f1, d1, d2);
- }
- else if(k1 == 5)
- {
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 0) - f1, (float)(k + 1) + f1, d1, d3);
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 1) + f1, (float)(k + 1) + f1, d1, d2);
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 1) + f1, (float)(k + 0) - f1, d, d2);
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 0) - f1, (float)(k + 0) - f1, d, d3);
- }
- else if(k1 == 4)
- {
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 0) - f1, (float)k + f2, d1, d3);
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 1) + f1, (float)k + f2, d1, d2);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 1) + f1, (float)k + f2, d, d2);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 0) - f1, (float)k + f2, d, d3);
- }
- else if(k1 == 3)
- {
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 1) + f1, (float)(k + 1) - f2, d, d2);
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 0) - f1, (float)(k + 1) - f2, d, d3);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 0) - f1, (float)(k + 1) - f2, d1, d3);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 1) + f1, (float)(k + 1) - f2, d1, d2);
- }
- else if(k1 == 7)
- {
- int k2 = iblockaccess.getBlockMetadata(i, j-1, k);
- if(k2 == 6)
- {
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 1) + f1, (float)(k + 1) + f1, d8, d10);
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 0) - f1, (float)(k + 1) + f1, d8, d11);
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 0) - f1, (float)(k + 0) - f1, d9, d11);
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 1) + f1, (float)(k + 0) - f1, d9, d10);
- }
- else if(k2 == 5)
- {
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 0) - f1, (float)(k + 1) + f1, d9, d11);
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 1) + f1, (float)(k + 1) + f1, d9, d10);
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 1) + f1, (float)(k + 0) - f1, d8, d10);
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 0) - f1, (float)(k + 0) - f1, d8, d11);
- }
- else if(k2 == 4)
- {
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 0) - f1, (float)k + f2, d9, d11);
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 1) + f1, (float)k + f2, d9, d10);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 1) + f1, (float)k + f2, d8, d10);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 0) - f1, (float)k + f2, d8, d11);
- }
- else if(k2 == 3)
- {
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 1) + f1, (float)(k + 1) - f2, d8, d10);
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 0) - f1, (float)(k + 1) - f2, d8, d11);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 0) - f1, (float)(k + 1) - f2, d9, d11);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 1) + f1, (float)(k + 1) - f2, d9, d10);
- }
- }
- else if(k1 == 1)
- {
- tessellator.addVertexWithUV(f3, f16, f7, d5, d6);
- tessellator.addVertexWithUV(f4, f17, f8, d5, d7);
- tessellator.addVertexWithUV(f5, f18, f9, d4, d7);
- tessellator.addVertexWithUV(f6, f19, f10, d4, d6);
- }
- else if(k1 == 11)
- {
- tessellator.addVertexWithUV(f6, f14, f10, d12, d14);
- tessellator.addVertexWithUV(f5, f13, f9, d12, d15);
- tessellator.addVertexWithUV(f4, f12, f8, d13, d15);
- tessellator.addVertexWithUV(f3, f11, f7, d13, d14);
- }
- else if(k1 == 15)
- {
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 1) + f1, (float)(k + 1) + f1, d16, d18);
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 0) - f1, (float)(k + 1) + f1, d16, d19);
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 0) - f1, (float)(k + 0) - f1, d17, d19);
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 1) + f1, (float)(k + 0) - f1, d17, d18);
- }
- else if(k1 == 14)
- {
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 0) - f1, (float)(k + 1) + f1, d17, d19);
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 1) + f1, (float)(k + 1) + f1, d17, d18);
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 1) + f1, (float)(k + 0) - f1, d16, d18);
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 0) - f1, (float)(k + 0) - f1, d16, d19);
- }
- else if(k1 == 13)
- {
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 0) - f1, (float)k + f2, d17, d19);
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 1) + f1, (float)k + f2, d17, d18);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 1) + f1, (float)k + f2, d16, d18);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 0) - f1, (float)k + f2, d16, d19);
- }
- else if(k1 == 12)
- {
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 1) + f1, (float)(k + 1) - f2, d16, d18);
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 0) - f1, (float)(k + 1) - f2, d16, d19);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 0) - f1, (float)(k + 1) - f2, d17, d19);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 1) + f1, (float)(k + 1) - f2, d17, d18);
- }
- else if(k1 == 8)
- {
- int k2 = iblockaccess.getBlockMetadata(i, j-1, k);
- if(k2 == 15)
- {
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 1) + f1, (float)(k + 1) + f1, d20, d22);
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 0) - f1, (float)(k + 1) + f1, d20, d23);
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 0) - f1, (float)(k + 0) - f1, d21, d23);
- tessellator.addVertexWithUV((float)i + f2, (float)(j + 1) + f1, (float)(k + 0) - f1, d21, d22);
- }
- else if(k2 == 14)
- {
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 0) - f1, (float)(k + 1) + f1, d21, d23);
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 1) + f1, (float)(k + 1) + f1, d21, d22);
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 1) + f1, (float)(k + 0) - f1, d20, d22);
- tessellator.addVertexWithUV((float)(i + 1) - f2, (float)(j + 0) - f1, (float)(k + 0) - f1, d20, d23);
- }
- else if(k2 == 13)
- {
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 0) - f1, (float)k + f2, d21, d23);
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 1) + f1, (float)k + f2, d21, d22);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 1) + f1, (float)k + f2, d20, d22);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 0) - f1, (float)k + f2, d20, d23);
- }
- else if(k2 == 12)
- {
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 1) + f1, (float)(k + 1) - f2, d20, d22);
- tessellator.addVertexWithUV((float)(i + 1) + f1, (float)(j + 0) - f1, (float)(k + 1) - f2, d20, d23);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 0) - f1, (float)(k + 1) - f2, d21, d23);
- tessellator.addVertexWithUV((float)(i + 0) - f1, (float)(j + 1) + f1, (float)(k + 1) - f2, d21, d22);
- }
- }
- else if(k1 == 10)
- {
- tessellator.addVertexWithUV(f3, f16, f7, d13, d14);
- tessellator.addVertexWithUV(f4, f17, f8, d13, d15);
- tessellator.addVertexWithUV(f5, f18, f9, d12, d15);
- tessellator.addVertexWithUV(f6, f19, f10, d12, d14);
- }
- return true;
- }
- public boolean RenderWorldBlock(RenderBlocks renderblocks, IBlockAccess iblockaccess, int i, int j, int k, Block block, int l)
- {
- if(l == PortalRenderNum)
- {
- return renderPortal(renderblocks, iblockaccess, i, j, k, block);
- }
- else
- {
- return false;
- }
- }
- public void OnTickInGame(Minecraft minecraft)
- {
- PortalGunTick(minecraft);
- }
- public void PortalGunTick(Minecraft minecraft)
- {
- if(minecraft.currentScreen == null && !Keyboard.isKeyDown(portalgunswapKey) && portalgunswapKeyDown)
- {
- ItemStack itemstack = minecraft.thePlayer.inventory.getCurrentItem();
- if(itemstack != null && itemstack.itemID == PortalGunBlue.shiftedIndex)
- {
- minecraft.thePlayer.inventory.mainInventory[minecraft.thePlayer.inventory.currentItem] = new ItemStack(PortalGunOrange, 1);
- }
- else if(itemstack != null && itemstack.itemID == PortalGunOrange.shiftedIndex)
- {
- minecraft.thePlayer.inventory.mainInventory[minecraft.thePlayer.inventory.currentItem] = new ItemStack(PortalGunBlue, 1);
- }
- }
- portalgunswapKeyDown = Keyboard.isKeyDown(portalgunswapKey);
- if(minecraft.currentScreen == null && !Keyboard.isKeyDown(portalgunrebootKey) && portalgunrebootKeyDown)
- {
- ItemStack itemstack1 = minecraft.thePlayer.inventory.getCurrentItem();
- if(itemstack1 != null)
- {
- if(itemstack1.itemID == PortalGunBlue.shiftedIndex || itemstack1.itemID == PortalGunOrange.shiftedIndex)
- {
- if(minecraft.theWorld.getBlockId(BlockPortalMod.BluePortalCoordX, BlockPortalMod.BluePortalCoordY, BlockPortalMod.BluePortalCoordZ) == portalblockID)
- {
- minecraft.theWorld.setBlockWithNotify(BlockPortalMod.BluePortalCoordX, BlockPortalMod.BluePortalCoordY, BlockPortalMod.BluePortalCoordZ, 0);
- minecraft.theWorld.playSoundEffect((float)BlockPortalMod.BluePortalCoordX + 0.5F, (float)BlockPortalMod.BluePortalCoordY + 0.5F, (float)BlockPortalMod.BluePortalCoordZ + 0.5F, "portalgun.portal_close", 1.0F, 1.0F);
- }
- if(minecraft.theWorld.getBlockId(BlockPortalMod.OrangePortalCoordX, BlockPortalMod.OrangePortalCoordY, BlockPortalMod.OrangePortalCoordZ) == portalblockID)
- {
- minecraft.theWorld.setBlockWithNotify(BlockPortalMod.OrangePortalCoordX, BlockPortalMod.OrangePortalCoordY, BlockPortalMod.OrangePortalCoordZ, 0);
- minecraft.theWorld.playSoundEffect((float)BlockPortalMod.OrangePortalCoordX + 0.5F, (float)BlockPortalMod.OrangePortalCoordY + 0.5F, (float)BlockPortalMod.OrangePortalCoordZ + 0.5F, "portalgun.portal_close", 1.0F, 1.0F);
- }
- minecraft.theWorld.playSoundAtEntity(minecraft.thePlayer, "portalgun.portalgun_powerup", 1.0F, 1.0F);
- }
- }
- }
- portalgunrebootKeyDown = Keyboard.isKeyDown(portalgunrebootKey);
- ItemStack itemstack2 = minecraft.thePlayer.inventory.armorItemInSlot(0);
- if(itemstack2 != null && itemstack2.itemID == KneeReplacement.shiftedIndex)
- {
- minecraft.thePlayer.fallDistance = -1;
- }
- }
- public String Version()
- {
- return "1.3_01v3";
- }
- private static void loadProperties()
- {
- Properties properties = new Properties();
- try
- {
- String s = (mod_PortalGun.class).getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
- s = s.substring(0, s.lastIndexOf('/') + 1);
- s = (new StringBuilder()).append(s).append("mod_PortalGun.properties").toString();
- properties.load(new FileInputStream(s));
- String s1 = properties.getProperty("portalgunswapKey");
- int i = Keyboard.getKeyIndex(s1.trim().toUpperCase());
- if(i == 0)
- {
- System.out.println((new StringBuilder()).append("Error binding portal gun swap key. Bad key name: ").append(s1.trim()).toString());
- } else
- {
- portalgunswapKey = i;
- }
- s1 = properties.getProperty("portalgunrebootKey");
- int j = Keyboard.getKeyIndex(s1.trim().toUpperCase());
- if(j == 0)
- {
- System.out.println((new StringBuilder()).append("Error binding portal gun reboot key. Bad key name: ").append(s1.trim()).toString());
- } else
- {
- portalgunrebootKey = j;
- }
- s1 = properties.getProperty("portalblockID");
- portalblockID = Integer.parseInt(s1.trim());
- s1 = properties.getProperty("portalcubeID");
- portalcubeID = Integer.parseInt(s1.trim());
- /*s1 = properties.getProperty("unportalbleID");
- String[] split = s1.split(", *");
- int[] unportalbleID = new int[split.length];
- for(int i1=0; i1<split.length; i1++)
- {
- unportalbleID[i1]=Integer.parseInt(split[i1]);
- }
- System.out.println(mod_PortalGun.unportalbleID.length);
- System.out.println(mod_PortalGun.unportalbleID[0]);
- System.out.println("unportalbles");
- System.out.println(s1);
- System.out.println("unportalbleID");
- System.out.println(unportalbleID[0]);
- System.out.println(unportalbleID[1]);
- System.out.println(unportalbleID[2]);*/
- }
- catch(Exception exception)
- {
- System.out.println("Error loading properties.");
- exception.printStackTrace();
- }
- }
- static
- {
- loadProperties();
- initBlocks();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment