Jump to content

nickfromgreek

Members
  • Posts

    10
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

nickfromgreek's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. i did it but i cant get rid of teh eclipse errors
  2. in which class do i put this in the tick handler or in a new class?
  3. just make a crafting handler: 1st register it: GameRegistry.registerCraftingHandler(new yourcraftinghandlerclassname()); import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import cpw.mods.fml.common.ICraftingHandler; public class DamageCraftingHandler implements ICraftingHandler{ @Override public void onCrafting(EntityPlayer player, ItemStack item, IInventory inv) { for(int i=0; i < inv.getSizeInventory(); i++) { if(inv.getStackInSlot(i) != null) { ItemStack j = inv.getStackInSlot(i); if(j.getItem() != null && j.getItem() == Yourclass.youritem) { ItemStack k = new ItemStack(Yourclass.youritem, 2, (j.getItemDamage() + 1)); // the damage your item will get if(k.getItemDamage() >= k.getMaxDamage()) k = null; inv.setInventorySlotContents(i, k); } } } } @Override public void onSmelting(EntityPlayer player, ItemStack item) { // TODO Auto-generated method stub } }
  4. i am trying to make afree flight jetpack but on landong i get fall damage why? package enderCraft; import java.util.EnumSet; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import org.lwjgl.input.Keyboard; import cpw.mods.fml.common.ITickHandler; import cpw.mods.fml.common.TickType; public class Tickjetpack implements ITickHandler{ public int tickpnumber = 0; public int isjactive = 0; public int isfull = 0; @Override public void tickStart(EnumSet<TickType> type, Object... tickData) { } @Override public void tickEnd(EnumSet<TickType> type, Object... tickData) { if(type.equals(EnumSet.of(TickType.RENDER))) { onRenderTick(); } else if(type.equals(EnumSet.of(TickType.CLIENT))) { Minecraft mc = Minecraft.getMinecraft(); GuiScreen gui = mc.currentScreen; if(gui != null) { onTickInGui(mc, gui); } else { onTickInGame(mc); } } } private void onTickInGame(Minecraft minecraft) { tickpnumber++; if (minecraft.thePlayer.inventory.armorItemInSlot(2) != null) { System.out.println("Armor ON"); System.out.println(tickpnumber); minecraft.thePlayer.fallDistance = 0.0F; ItemStack itemstack = minecraft.thePlayer.inventory.armorItemInSlot(2); if (itemstack.itemID == Main.enderjetpack.shiftedIndex) { isjactive = tickpnumber; if(minecraft.thePlayer.inventory.hasItem(Item.coal.shiftedIndex)){ if(minecraft.theWorld.isRemote){ if(isjactive == 200 && isfull == 0){ minecraft.thePlayer.addChatMessage("Jetpack at full power"); isfull++; } } if(isjactive == 200 && minecraft.thePlayer.capabilities.allowFlying == false){ minecraft.thePlayer.capabilities.allowFlying = true; minecraft.thePlayer.capabilities.isFlying = true; tickpnumber = 0; } }else{ if(tickpnumber == 200){ if(minecraft.theWorld.isRemote){ minecraft.thePlayer.addChatMessage("Unexpected error!!Do you have fuel?"); } } minecraft.thePlayer.capabilities.allowFlying = false; minecraft.thePlayer.capabilities.isFlying = false; if(isjactive == 400){ isjactive = 0; tickpnumber = 0; } } }else{ if(minecraft.theWorld.isRemote && tickpnumber == 160){ minecraft.thePlayer.addChatMessage("You took off your jetpack"); } minecraft.thePlayer.capabilities.allowFlying = false; minecraft.thePlayer.capabilities.isFlying = false; tickpnumber = 0; } } } private void onTickInGui(Minecraft minecraft, GuiScreen gui) { } private void onRenderTick() { } @Override public EnumSet<TickType> ticks() { return EnumSet.of(TickType.CLIENT, TickType.RENDER); } @Override public String getLabel() { return "TickHandler.CLIENT"; } }
  5. I want to store a booolean variable(well 2) and i want to triger it on Item rick click: i want ot store these 2: par3EntityPlayer.capabilities.isFlying = false; par3EntityPlayer.capabilities.allowFlying = true; code: package toolsPlus; import cpw.mods.fml.common.Side; import cpw.mods.fml.common.asm.SideOnly; import net.minecraft.src.CreativeTabs; import net.minecraft.src.EntityPlayer; import net.minecraft.src.Item; import net.minecraft.src.ItemStack; import net.minecraft.src.TileEntity; import net.minecraft.src.TileEntityBeacon; import net.minecraft.src.World; public class Itemenderfcoremk2 extends Item { protected Itemenderfcoremk2(int par1) { super(par1); this.setCreativeTab(CreativeTabs.tabMisc); } public TileEntity createNewTileEntity(World par1World) { return new TileEntityBeacon(); } @Override public String getTextureFile() { return "/Sheet.png"; } @SideOnly(Side.CLIENT) public boolean hasEffect(ItemStack stack) { return true; } @Override public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { if(par3EntityPlayer.experienceLevel < 40 || par3EntityPlayer.experienceLevel <= 0){ par3EntityPlayer.capabilities.allowFlying = false; par3EntityPlayer.capabilities.isFlying = false; } else if(!par3EntityPlayer.capabilities.isFlying || !par3EntityPlayer.capabilities.allowFlying){ par3EntityPlayer.capabilities.isFlying = false; par3EntityPlayer.capabilities.allowFlying = true; par3EntityPlayer.experienceLevel = par3EntityPlayer.experienceLevel - 40; } else if(par3EntityPlayer.capabilities.isFlying || par3EntityPlayer.capabilities.allowFlying){ par3EntityPlayer.capabilities.allowFlying = false; par3EntityPlayer.capabilities.isFlying = false; par3EntityPlayer.experienceLevel = par3EntityPlayer.experienceLevel + 40; } return par1ItemStack; } }
  6. I created a mod i always testing it throught eclipse 5 mins ago it crashed with this error: the crash only hapens when i create a new world 2012-11-13 18:27:27 [iNFO] [ForgeModLoader] Forge Mod Loader version 4.2.6.422 for Minecraft 1.4.2 loading 2012-11-13 18:27:36 [iNFO] [sTDOUT] 27 achievements 2012-11-13 18:27:36 [iNFO] [sTDOUT] 208 recipes 2012-11-13 18:27:37 [iNFO] [sTDOUT] Setting user: Player843, - 2012-11-13 18:27:37 [iNFO] [sTDERR] Client asked for parameter: server 2012-11-13 18:27:37 [iNFO] [sTDOUT] LWJGL Version: 2.4.2 2012-11-13 18:27:38 [iNFO] [ForgeModLoader] Attempting early MinecraftForge initialization 2012-11-13 18:27:38 [iNFO] [sTDOUT] MinecraftForge v6.0.1.341 Initialized 2012-11-13 18:27:38 [iNFO] [ForgeModLoader] MinecraftForge v6.0.1.341 Initialized 2012-11-13 18:27:38 [iNFO] [ForgeModLoader] Completed early MinecraftForge initialization 2012-11-13 18:27:38 [iNFO] [ForgeModLoader] Searching C:\Users\Nick\Desktop\Modding(forge)\toolsPlus\jars\mods for mods 2012-11-13 18:27:42 [iNFO] [ForgeModLoader] Forge Mod Loader has identified 4 mods to load 2012-11-13 18:27:43 [iNFO] [ForgeModLoader] Configured a dormant chunk cache size of 0 2012-11-13 18:27:43 [iNFO] [sTDOUT] Starting up SoundSystem... 2012-11-13 18:27:43 [iNFO] [sTDOUT] Initializing LWJGL OpenAL 2012-11-13 18:27:43 [iNFO] [sTDOUT] (The LWJGL binding of OpenAL. For more information, see http://www.lwjgl.org) 2012-11-13 18:27:43 [iNFO] [sTDOUT] OpenAL initialized. 2012-11-13 18:27:44 [iNFO] [ForgeModLoader] Forge Mod Loader has successfully loaded 4 mods 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting level New World 2012-11-13 18:28:32 [iNFO] [sTDOUT] Attempt 1... 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\data 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\data\villages.dat 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\DIM-1 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\DIM-1\data 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\DIM-1\forcedchunks.dat 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\DIM1 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\DIM1\data 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\DIM1\forcedchunks.dat 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\forcedchunks.dat 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\level.dat 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\level.dat_mcr 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\level.dat_old 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\players 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\players\Player747.dat 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\region 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\region\r.0.0.mca 2012-11-13 18:28:32 [iNFO] [sTDOUT] Deleting .\saves\New World\session.lock 2012-11-13 18:28:34 [iNFO] [sTDOUT] Scanning folders... 2012-11-13 18:28:34 [iNFO] [sTDOUT] Total conversion count is 0 2012-11-13 18:28:35 [iNFO] [sTDOUT] .\saves\New World\data\idcounts.dat 2012-11-13 18:28:35 [iNFO] [sTDOUT] .\saves\New World\data\villages.dat 2012-11-13 18:28:35 [iNFO] [ForgeModLoader] Loading dimension 0 (New World) (net.minecraft.src.IntegratedServer@db03ddc) 2012-11-13 18:28:35 [iNFO] [sTDOUT] .\saves\New World\DIM1\data\idcounts.dat 2012-11-13 18:28:35 [iNFO] [sTDOUT] .\saves\New World\DIM1\data\villages.dat 2012-11-13 18:28:35 [iNFO] [ForgeModLoader] Loading dimension 1 (New World) (net.minecraft.src.IntegratedServer@db03ddc) 2012-11-13 18:28:35 [iNFO] [sTDOUT] .\saves\New World\DIM-1\data\idcounts.dat 2012-11-13 18:28:35 [iNFO] [sTDOUT] .\saves\New World\DIM-1\data\villages.dat 2012-11-13 18:28:35 [iNFO] [ForgeModLoader] Loading dimension -1 (New World) (net.minecraft.src.IntegratedServer@db03ddc) 2012-11-13 18:29:25 [iNFO] [sTDERR] java.lang.OutOfMemoryError: Java heap space 2012-11-13 18:29:25 [iNFO] [sTDERR] at net.minecraft.src.AABBPool.addOrModifyAABBInPool(AABBPool.java:50) 2012-11-13 18:29:25 [iNFO] [sTDERR] at net.minecraft.src.Block.getCollisionBoundingBoxFromPool(Block.java:557) 2012-11-13 18:29:25 [iNFO] [sTDERR] at net.minecraft.src.Block.addCollidingBlockToList(Block.java:533) 2012-11-13 18:29:25 [iNFO] [sTDERR] at net.minecraft.src.World.getCollidingBoundingBoxes(World.java:1543) 2012-11-13 18:29:25 [iNFO] [sTDERR] at net.minecraft.src.ServerConfigurationManager.playerLoggedIn(ServerConfigurationManager.java:176) 2012-11-13 18:29:25 [iNFO] [sTDERR] at net.minecraft.src.ServerConfigurationManager.initializeConnectionToPlayer(ServerConfigurationManager.java:94) 2012-11-13 18:29:25 [iNFO] [sTDERR] at net.minecraft.src.IntegratedServerListenThread.networkTick(IntegratedServerListenThread.java:99) 2012-11-13 18:29:25 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.updateTimeLightAndEntities(MinecraftServer.java:664) 2012-11-13 18:29:25 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.tick(MinecraftServer.java:585) 2012-11-13 18:29:25 [iNFO] [sTDERR] at net.minecraft.src.IntegratedServer.tick(IntegratedServer.java:110) 2012-11-13 18:29:25 [iNFO] [sTDERR] at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:492) 2012-11-13 18:29:25 [iNFO] [sTDERR] at net.minecraft.src.ThreadMinecraftServer.run(ThreadMinecraftServer.java:17) 2012-11-13 18:29:28 [iNFO] [sTDOUT] .\saves\New World\data\villages.dat 2012-11-13 18:29:42 [iNFO] [ForgeModLoader] Unloading dimension 0 2012-11-13 18:29:42 [iNFO] [ForgeModLoader] Unloading dimension -1 2012-11-13 18:29:42 [iNFO] [ForgeModLoader] Unloading dimension 1 2012-11-13 18:29:54 [iNFO] [sTDOUT] Stopping! 2012-11-13 18:29:54 [iNFO] [sTDOUT] SoundSystem shutting down... 2012-11-13 18:29:54 [iNFO] [sTDOUT] Author: Paul Lamb, www.paulscode.com whats causing this if you need to see any of my classes say to post em
  7. It works but when the damage reaches 0 it doesnt disapear
  8. I want an item to take damage everytime its getting used for crafting i have tried this: http://www.minecraftforge.net/forum/index.php/topic,2137.0.html topic but it doesnt seem to work eclipse gives an error if someone can explain it please
  9. i am trying to install forge on MCP i have no mods in the jar and i get this error (posted all installation messages)
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.