Everything posted by deadrecon98
-
[Not solved but im done.]How to save integers to a file.
That source code is a bust, its very hard to understand someone elses coding when it gets to that level. I need someone to explain this to me so that Im learning. Not being a scriptkitty, im trying to get out of that.
-
[Not solved but im done.]How to save integers to a file.
Heres the code im trying to set up to save and get. package mods.cyphereion.cyphscape.levels; import java.io.FileWriter; import java.io.Writer; import org.lwjgl.input.Keyboard; import cpw.mods.fml.common.registry.GameRegistry; import mods.cyphereion.cyphscape.blocks.BlockCopper; import mods.cyphereion.cyphscape.core.Core; import mods.cyphereion.cyphscape.core.CyphScapeMaterials; import net.minecraft.block.Block; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.src.ModLoader; import net.minecraft.world.World; public class Levels { public static int MiningLevel; public static int MiningXp; public void levelCap(EntityPlayer par1EntityPlayer){ if(MiningLevel > 100){ MiningLevel = 100; } } public void onUpdate(EntityPlayer par1EntityPlayer) { for (int i = 0; i < 61; i++) { if (MiningXp / 50 == i) { MiningLevel = i; } } } public int getMiningLevel() { for (int i = 0; i < 61; i++) { if (MiningXp / 50 == i) { return MiningLevel = i; } } return 0; } } That's going to cause problems if you try to use it on a server. You don't want to save that in a Configuration; you want to use EntityPlayer.registerExtendedProperties(). If a config won't work then a hashmap maybe?
-
[Not solved but im done.]How to save integers to a file.
I know that but is all I need it to do is save and load from a file. The rest I can do myself.
-
[Not solved but im done.]How to save integers to a file.
Heres the code im trying to set up to save and get. package mods.cyphereion.cyphscape.levels; import java.io.FileWriter; import java.io.Writer; import org.lwjgl.input.Keyboard; import cpw.mods.fml.common.registry.GameRegistry; import mods.cyphereion.cyphscape.blocks.BlockCopper; import mods.cyphereion.cyphscape.core.Core; import mods.cyphereion.cyphscape.core.CyphScapeMaterials; import net.minecraft.block.Block; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.src.ModLoader; import net.minecraft.world.World; public class Levels { public static int MiningLevel; public static int MiningXp; public void levelCap(EntityPlayer par1EntityPlayer){ if(MiningLevel > 100){ MiningLevel = 100; } } public void onUpdate(EntityPlayer par1EntityPlayer) { for (int i = 0; i < 61; i++) { if (MiningXp / 50 == i) { MiningLevel = i; } } } public int getMiningLevel() { for (int i = 0; i < 61; i++) { if (MiningXp / 50 == i) { return MiningLevel = i; } } return 0; } } That's going to cause problems if you try to use it on a server. You don't want to save that in a Configuration; you want to use EntityPlayer.registerExtendedProperties(). Its strictly singleplayer.
-
Custom Furnace functions not working
Bro let me make this easy for you. Start over but use this code. Courtesy of me and f3rullo14. https://dl.dropboxusercontent.com/u/73396944/furnace%20code.zip
-
[Not solved but im done.]How to save integers to a file.
Heres the code im trying to set up to save and get. package mods.cyphereion.cyphscape.levels; import java.io.FileWriter; import java.io.Writer; import org.lwjgl.input.Keyboard; import cpw.mods.fml.common.registry.GameRegistry; import mods.cyphereion.cyphscape.blocks.BlockCopper; import mods.cyphereion.cyphscape.core.Core; import mods.cyphereion.cyphscape.core.CyphScapeMaterials; import net.minecraft.block.Block; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.src.ModLoader; import net.minecraft.world.World; public class Levels { public static int MiningLevel; public static int MiningXp; public void levelCap(EntityPlayer par1EntityPlayer){ if(MiningLevel > 100){ MiningLevel = 100; } } public void onUpdate(EntityPlayer par1EntityPlayer) { for (int i = 0; i < 61; i++) { if (MiningXp / 50 == i) { MiningLevel = i; } } } public int getMiningLevel() { for (int i = 0; i < 61; i++) { if (MiningXp / 50 == i) { return MiningLevel = i; } } return 0; } }
-
[Not solved but im done.]How to save integers to a file.
Im trying my best here dude, no need to be rude. And I have googled that at least 6 different ways and nothing I try works.
-
[Not solved but im done.]How to save integers to a file.
I wanted to know how to save integers to a config file. Not like item id's but just a basic integer. And also how to get the integer from the config file.
-
Item sounds on right click?
The sound name can't be longer than... um, I think it's 32 characters. well when I tried random.test it still wouldnt work. Where do i put the sounds?
-
Crafting without losing the item?
Here ya go. Its items getting damaged while crafting to make them not get damaged (make sure to have max damage set first) on the recipe instead of -1 use -0 and in the handler instead of +1 try +0 http://cyphereionsmoddingtuts.weebly.com/advanced.html
-
Item sounds on right click?
Im not sure if im putting the files in the wrong place or if im using the wrong method. this is the method: par2World.playSoundAtEntity(par3EntityPlayer, "mods.cyphereion.cyphscape.sounds.test", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F)); Please help. (btw the sounds are in mods/cyphereion/cyphscape/sounds/test.ogg)
-
Open gui on irc.
I really cant figure this out for the life of me. This is my item class package mods.cyphereion.MagicSwords; import java.util.List; import net.minecraft.client.gui.GuiMultiplayer; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class RecipeBook extends Item { private ItemStack info; private int index; public RecipeBook(int par1) { super(par1); this.setMaxStackSize(1); this.setCreativeTab(Core.tabMagicSwords); } public boolean hasEffecct(ItemStack par1ItemStack){ return true; } public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { //par3List.add("Use me to see the avaliable recipes. "); par3List.add("Work In Progress."); } public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer, int x, int y, int z){ return null; } And this is my guihandler: package mods.cyphereion.MagicSwords; import net.minecraft.client.gui.Gui; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import cpw.mods.fml.common.network.IGuiHandler; public class RecipeBookGuiHandler implements IGuiHandler{ @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { { if (!world.isRemote) { player.openGui(RecipeBookCore.instance, 0, world, x, y, z); return true; } return true; } } @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { { if (!world.isRemote) { player.openGui(RecipeBookCore.instance, 0, world, x, y, z); return true; } return true; } } }
-
Open gui on irc.
Hello. I cant figure out how to open a custom gui ex: GuiTest.class on item right click. I have tried many steps so please help.
-
1.5.1 Custom Furnace Error
Oh i am getting that error But then again i was just working on the gui
-
1.5.1 Custom Furnace Error
Thank you it seems that the tutorial I followed was wrong.
-
1.5.1 Custom Furnace Error
Thats the same as mine... Wonder whats going on there.
-
1.5.1 Custom Furnace Error
http://gw.minecraftforge.net/Q2js
-
1.5.1 Custom Furnace Error
Hello. I am having trouble on a custom furnace that I made. Here is the error report. http://gw.minecraftforge.net/CVuQ There is also a texture glitch... The main error i see on right click is the one about network mod. Please help soon.
IPS spam blocked by CleanTalk.