Everything posted by deadrecon98
-
[SOLVED][1.6] Config issue?
Why can't they just keep everything the way it was before? And btw that did fix it! Thanks loads!
-
[SOLVED][1.6] Config issue?
Mmmk Pictures: https://dl.dropboxusercontent.com/u/73396944/2013-07-16_16.03.11.png[/img] https://dl.dropboxusercontent.com/u/73396944/2013-07-16_16.03.37.png[/img] https://dl.dropboxusercontent.com/u/73396944/2013-07-16_16.03.45.png[/img] Src: https://github.com/deadrecon98/CWMCode
-
[SOLVED][1.6] Config issue?
Oh all the symbols? And it still didn't work
-
[SOLVED][1.6] Config issue?
Heres the book. The cloth is the same except for the nbt saving method. package cwm; import java.util.List; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; public class ItemResearchBook extends Item { private int index; public static String Comment = "Used for basic research."; public static boolean isResearchBookResearched; public ItemResearchBook(int par1) { super(par1); this.setMaxStackSize(64); this.setCreativeTab(CWM.tabCWM); } public void onCreated(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer){ NBTTagCompound nbt = Config.getTagCompoundInFile(Config.getWorldConfig(par2World)); nbt.setInteger("MaxMana", 25); nbt.setInteger("CurrentMana", nbt.getInteger("CurrentMana" + 1)); } public void onItemRightClick(EntityPlayer par1EntityPlayer, World par2World){ NBTTagCompound nbt = Config.getTagCompoundInFile(Config.getWorldConfig(par2World)); par1EntityPlayer.addChatMessage("Current Mana: " + nbt.getInteger("CurrentMana")); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister iconRegister) { if(itemID == CWM.ResearchBook.itemID) { this.itemIcon = iconRegister.registerIcon("CWM:ItemResearchBook"); } } public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) { par3List.add("Kutumika kwa ajili ya utafiti wa msingi."); par3List.add("vipengele:"); par3List.add("uchawi x1"); par3List.add("maarifa x2"); par3List.add("ugumu x1"); if(isResearchBookResearched == true){ par3List.clear(); par3List.add("Used for basic research."); par3List.add("Elements:"); par3List.add("Magic x1"); par3List.add("Knowledge x2"); par3List.add("Hardness x1"); } } }
-
[SOLVED][1.6] Config issue?
Ex: I made cloth it's 5 string to craft and it has a unique id and picture. Then I made a book, Same thing but different recipe. Now the book has taken every single property of the cloth except the picture and the description and the cloth no longer works. I'm honestly not sure what the error is here but that's all I know. If needed I can take some screenshots.
-
[SOLVED][1.6] Config issue?
Anyone?
-
[SOLVED][1.6] Config issue?
Im not sure if it's my config or what but my items keep overriding each other. Core class: package cwm; import java.io.File; import javax.swing.text.JTextComponent.KeyBinding; import net.java.games.input.Keyboard; import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import cpw.mods.fml.client.registry.KeyBindingRegistry; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.Init; import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.Mod.PostInit; import cpw.mods.fml.common.Mod.PreInit; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPreInitializationEvent; import cpw.mods.fml.common.network.NetworkMod; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.common.registry.LanguageRegistry; @Mod(modid="CWM",name="Cyph's World Of Magic",version="0.0.1") @NetworkMod(clientSideRequired=true,serverSideRequired=false) public class CWM { @Instance("CyphScape Core") public static CWM instance = new CWM(); public static File configFile; @SidedProxy(clientSide = "cwm.clientSide", serverSide = "cwm.serverSide") public static serverSide proxy; public static CreativeTabs tabCWM = new tabCyphereionsWorldOfMagic(CreativeTabs.getNextID(),"tabCWM"); public static Item Cloth; public static Item ResearchBook; @PreInit() public void PreInitTutorial(FMLPreInitializationEvent e){ Cfg cc = new Cfg(); Cloth = new ItemCloth(cc.itemClothID); ResearchBook = new ItemResearchBook(cc.researchBookID); LanguageRegistry.instance().addStringLocalization("itemGroup.tabCWM","Cyphereion's World of Magic"); Cfg.loadConfig(e); //rubySword = new ItemTutorialSword(cc.toolRubySwordID, rubyMat, 8, "DeverionXRubySword"); //blockRuby = new BlockRuby(cc.blockRubyID); } @Init public void load(FMLInitializationEvent event) { GameRegistry.addShapelessRecipe(new ItemStack(Cloth, 1, 0), Item.silk, Item.silk, Item.silk, Item.silk, Item.silk); GameRegistry.addRecipe(new ItemStack(ResearchBook, 1), "G G"," B ","G G", Character.valueOf('B'), Item.book, Character.valueOf('G'), Item.ingotGold); LanguageRegistry.addName(Cloth, "Cloth"); LanguageRegistry.addName(ResearchBook, "Research Book"); proxy.registerRenderersThings(); } @PostInit public void postInit(){ configFile = proxy.initConfigs(); } } Config: package cwm; import net.minecraft.item.Item; import net.minecraftforge.common.Configuration; import net.minecraftforge.common.Property; import cpw.mods.fml.common.event.FMLPreInitializationEvent; public class Cfg { //Items public static int itemClothID; public static int researchBookID; //General public static void loadConfig(FMLPreInitializationEvent e){ Configuration config = new Configuration(e.getSuggestedConfigurationFile()); config.load(); config.addCustomCategoryComment(config.CATEGORY_GENERAL, "Cheats! (Well, Mostly)"); Property clothItem; Property researchBookItem; clothItem = config.getItem("Cloth", 9000); clothItem.comment = ItemCloth.Comment; itemClothID = clothItem.getInt(); researchBookItem = config.getItem("Research Book", 9001); researchBookItem.comment = ItemResearchBook.Comment; researchBookID = researchBookItem.getInt(); //blockRubyID = config.getBlock("Ruby Block", 300).getInt(); ItemCloth.isClothResearched = config.get(config.CATEGORY_GENERAL, "Is Cloth researched?", false).getBoolean(false); ItemResearchBook.isResearchBookResearched = config.get(config.CATEGORY_GENERAL, "Is Research Book Researched?", false).getBoolean(false); config.save(); } }
-
[SOLVED][1.6] Creative tab not working!
Lol sorry for not getting back sooner. Haven't slept in a few days so I finally got some of that and yes! It does work, thank you.
-
[SOLVED][1.6] Creative tab not working!
Lol that may be the issue. Thank you for your response.
-
[SOLVED][1.6] Creative tab not working!
First the creative tab image won't show(probably because the old code for it broke), second any items I added to the creative tab won't show on any tab. Creative Tab: package mods.cyphereion.cyphscape.core; import mods.cyphereion.cyphscape.API.Core; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.client.resources.ResourceLocation; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.ItemStack; import cpw.mods.fml.relauncher.*; public class tabCyphScape extends CreativeTabs { public ResourceLocation guiLocation = new ResourceLocation("CyphScape:/textures/items/CyphScape_Stats.png"); public tabCyphScape(int position, String tabID) { super(position, tabID); } public String getTranslatedTabLabel() { return "CyphScape"; } } Core File: @SidedProxy(clientSide = "mods.cyphereion.cyphscape.proxys.ClientProxy", serverSide = "mods.cyphereion.cyphscape.proxys.CommonProxy") public static CommonProxy proxy; public static CreativeTabs tabCyphScape = new tabCyphScape(CreativeTabs.getNextID(),"tabCyphScape"); Sample of an item: BronzeShovel = new ItemBronzeShovel(2011, CyphScapeMaterials.Bronze).setUnlocalizedName("CyphScape_BronzeShovel");
-
[Not solved but im done.]How to save integers to a file.
No shit shirlock.
-
[Not solved but im done.]How to save integers to a file.
I am sorry for returning the favour. And of course I know it's not static. playerINSTANCE means something like: EntityPlayer [i]playerInstance[/i] = new EntityPlayer(); Except you can't do that. So maybe try Minecraft.getMinecraft().thePlayer.username Don't post here again. I've already reported you a moderator. I hope this isn't the way you solve every problem you come by. Heaps of people have posted here trying to help you and you have not been able to get code that they have spent time to write for you to work. The code is especially tailor made for your request. I suggest this: http://docs.oracle.com/javase/tutorial/ [EDIT] And yes, I have been rude to you. And I have no excuses for that. But you have been extremely rude to me and others in the first place. So I am willing to accept my actions and be reprimanded for them. Report away. Why are you still trying to help him? I gave up after the first sour comment to be honest. If he hasn't understood it by now, he never will- between you and maxpowa you pretty much wrote the entire code for him. I'm not exactly good at Java and I managed to get it all working and even release the first alpha of my standalone economy mod which uses it. I've got the saving done is all I need is the player name as a string and that's it!
-
[Not solved but im done.]How to save integers to a file.
I am sorry for returning the favour. And of course I know it's not static. playerINSTANCE means something like: EntityPlayer [i]playerInstance[/i] = new EntityPlayer(); Except you can't do that. So maybe try Minecraft.getMinecraft().thePlayer.username Don't post here again. I've already reported you a moderator.
-
[1.6.2]Drawing an icon
if your going to add icons to the game then you are probably going to have to edit base classes. If you need any more help look at the source for ee3. lol? i know how to add icons to the game i just need to know how to draw an icon to a gui with the method that is given in the GuiScreen class. it has to work somehow i just dont know how. ... Do what I just told you. Make a new picture and put the icon there! Otherwise go look at the source for ee3.
-
[Not solved but im done.]How to save integers to a file.
Do you have to be a dick to help or is it just instinct? And for the record it's still broken, the string username isn't a static. You might as well stop, you don't know what your doing.
-
[Not solved but im done.]How to save integers to a file.
playerInstance can not be resolved to a variable.
-
[Not solved but im done.]How to save integers to a file.
That's not what I mean. I wanted to get the player name and use it like this: CyphScape.PLAYERNAME.LevelSave So what you are wanting is the saved game for that player? No I want the player name as a string.
-
[1.6.2]Drawing an icon
if your going to add icons to the game then you are probably going to have to edit base classes. If you need any more help look at the source for ee3.
-
[1.6.2]Drawing an icon
You are way off for gui screens there buddy. Use this: Static: public ResourceLocation guiLocation = new ResourceLocation("PIC LOCATION HERE"); DrawScreen public void drawScreen(int i,int j, float f) { drawDefaultBackground(); /** * Renders Images * */ this.mc.func_110434_K().func_110577_a(this.guiLocation); int posX2 = (this.width - xSizeOfTexture) / 1; int posY2 = (this.height - ySizeOfTexture) / 3; drawTexturedModalRect(posX2 - 100, posY2 - 45, 0, 0, xSizeOfTexture, ySizeOfTexture); Edit: Just take the icon and save it to a 256x256 picture and align to the top right. Then go in here and change the x and y to 16. that should load it. Crap sorry wrong button. I forgot this: public final int xSizeOfTexture = 256; //The x value of the picture public final int ySizeOfTexture = 100; // The y value of the picture. put them above the draw background.
-
[1.6.2]Drawing an icon
You are way off for gui screens there buddy. Use this: Static: public ResourceLocation guiLocation = new ResourceLocation(Core.DirTexPre + Core.DirGui + "CyphScapeLogo" + Core.DirEnd); DrawScreen public void drawScreen(int i,int j, float f) { drawDefaultBackground(); /** * Renders Images * */ this.mc.func_110434_K().func_110577_a(this.guiLocation); int posX2 = (this.width - xSizeOfTexture) / 1; int posY2 = (this.height - ySizeOfTexture) / 3; drawTexturedModalRect(posX2 - 100, posY2 - 45, 0, 0, xSizeOfTexture, ySizeOfTexture);
-
[Not solved but im done.]How to save integers to a file.
That's not what I mean. I wanted to get the player name and use it like this: CyphScape.PLAYERNAME.LevelSave
-
[Not solved but im done.]How to save integers to a file.
Yeah it's only too bad that that's wrong. It will not work for what I am trying to do.
-
[Not solved but im done.]How to save integers to a file.
Got that working. Now how do I get the player name returned as a string? Im trying to use EntityPlayerMp
-
[Not solved but im done.]How to save integers to a file.
It fits perfectly. Now does this save to every player or is there a way to set that up? Also can I get it to save like MiningXp = int? Edit: Wtf is this? SEVERE] Encountered an unexpected exception LoaderException cpw.mods.fml.common.LoaderException: java.lang.NoClassDefFoundError: net/minecraft/client/Minecraft at cpw.mods.fml.common.LoadController.transition(LoadController.java:148) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:698) at cpw.mods.fml.server.FMLServerHandler.finishServerLoading(FMLServerHandler.java:94) at cpw.mods.fml.common.FMLCommonHandler.onServerStarted(FMLCommonHandler.java:355) at net.minecraft.server.dedicated.DedicatedServer.startServer(DedicatedServer.java:141) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:443) at net.minecraft.server.ThreadMinecraftServer.run(ThreadMinecraftServer.java:16) Caused by: java.lang.NoClassDefFoundError: net/minecraft/client/Minecraft at mods.cyphereion.cyphscape.API.config.Config.getConfigFolder(Config.java:21) at mods.cyphereion.cyphscape.proxys.CommonProxy.initConfigs(CommonProxy.java:15) at mods.cyphereion.cyphscape.core.Core.load(Core.java:253) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at cpw.mods.fml.common.FMLModContainer.handleModStateEvent(FMLModContainer.java:540) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.sendEventToModContainer(LoadController.java:193) at cpw.mods.fml.common.LoadController.propogateStateMessage(LoadController.java:173) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.google.common.eventbus.EventHandler.handleEvent(EventHandler.java:74) at com.google.common.eventbus.SynchronizedEventHandler.handleEvent(SynchronizedEventHandler.java:45) at com.google.common.eventbus.EventBus.dispatch(EventBus.java:313) at com.google.common.eventbus.EventBus.dispatchQueuedEvents(EventBus.java:296) at com.google.common.eventbus.EventBus.post(EventBus.java:267) at cpw.mods.fml.common.LoadController.distributeStateMessage(LoadController.java:104) at cpw.mods.fml.common.Loader.initializeMods(Loader.java:697) ... 5 more Caused by: java.lang.ClassNotFoundException: net.minecraft.client.Minecraft at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:179) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 35 more Caused by: java.lang.RuntimeException: Attempted to load class net/minecraft/client/Minecraft for invalid side SERVER at cpw.mods.fml.common.asm.transformers.SideTransformer.transform(SideTransformer.java:51) at net.minecraft.launchwrapper.LaunchClassLoader.runTransformers(LaunchClassLoader.java:267) at net.minecraft.launchwrapper.LaunchClassLoader.findClass(LaunchClassLoader.java:165) ... 37 more [sEVERE] This crash report has been saved to: C:\Users\User\Desktop\Modding\Mcps\Current\forge\mcp\jars\.\crash-reports\crash-2013-07-10_00.34.09-server.txt Common Proxy: package mods.cyphereion.cyphscape.proxys; import java.io.File; import mods.cyphereion.cyphscape.API.config.Config; public class CommonProxy { public int addArmor(String string){ return 0; } public void registerRenderersThings() { } public File initConfigs() { return Config.createAndGetNBTFile(new File(Config.getConfigFolder(), "config.dat")); } } Config: package mods.cyphereion.cyphscape.API.config; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import cpw.mods.fml.relauncher.ReflectionHelper; import net.minecraft.client.Minecraft; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraft.world.chunk.storage.AnvilChunkLoader; import net.minecraft.world.chunk.storage.IChunkLoader; import net.minecraft.world.storage.ISaveHandler; public class Config { public static File getConfigFolder() { return new File(new File(Minecraft.getMinecraft().mcDataDir, "config"), "CyphScape"); } public static File getWorldConfig(World world) { return new File(getWorldDir(world), "CyphScape.LevelSave"); } public static File getWorldDir(World world) { try { ISaveHandler worldsaver = world.getSaveHandler(); IChunkLoader loader = worldsaver.getChunkLoader(world.provider); File file = ReflectionHelper .<File, AnvilChunkLoader> getPrivateValue( AnvilChunkLoader.class, (AnvilChunkLoader) loader, 3); return file.getName().contains("DIM") ? file.getParentFile() : file; } catch (Exception e) { return null; } } public static File createAndGetNBTFile(File f) { try { CompressedStreamTools.readCompressed(new FileInputStream(f)); } catch (Exception e) { NBTTagCompound cmp = new NBTTagCompound(); try { CompressedStreamTools.writeCompressed(cmp, new FileOutputStream(f)); } catch (IOException e1) { e1.printStackTrace(); } } return f; } private static boolean injectNBTToFile(NBTTagCompound cmp, File f) { try { CompressedStreamTools.writeCompressed(cmp, new FileOutputStream(f)); return true; } catch (IOException e) { return false; } } public static boolean saveConfig(NBTTagCompound cmp, File f) { return injectNBTToFile(cmp, f); } public static NBTTagCompound getTagCompoundInFile(File f) { try { NBTTagCompound cmp = CompressedStreamTools .readCompressed(new FileInputStream(f)); return cmp; } catch (IOException e) { NBTTagCompound cmp = new NBTTagCompound(); try { CompressedStreamTools.writeCompressed(cmp, new FileOutputStream(f)); return getTagCompoundInFile(f); } catch (IOException e1) { return null; } } } } I don't see the issue.
-
[Not solved but im done.]How to save integers to a file.
Look dude, I am trying my best here. Could you just help me out a bit here and there? I've tried all of this code but to no advantage. I'm going to re-add the config one(that you had on Git Hub) and try again. But I really am trying my best here so there is absolutely no need to be rude to me. I understand that this isn't java school but where else am I going to learn?
IPS spam blocked by CleanTalk.