Jump to content

deadrecon98

Forge Modder
  • Posts

    316
  • Joined

Everything posted by deadrecon98

  1. Hey im happy that your helping this guy and all but do you think that you could help me? Im trying really hard not to start using caps at you but you are being very rude.
  2. Honestly I don't see the point if you can't even edit the integers but if you could then I would say per-world for singleplayer and per-server for multiplayer.
  3. Meh, we're working early. Give it 3-4 weeks and there will be fixes in forge, and plenty of "how to fix this update bug" tutorials. I didn't update to 1.5.2 for a couple of months and minus the texture de-stitching that didn't take me long at all, coz I could just google any issues Anyways. I added that extra bit to the code, still getting the same bug: Code: @Override public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int i, float j, float k, float l) { TileEntity tileEntity = world.getBlockTileEntity(x, y, z); NBTTagCompound nbt = player.getEntityData().getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG); if (player.getHeldItem() != null) { if (player.getHeldItem().getItem() == FlenixCities.debitCard) { player.addChatMessage("Your Balance is: " + nbt.getInteger("Balance")); player.openGui(FlenixCities.instance, 0, world, x, y, z); } } if (player.getHeldItem() != null) { if (player.getHeldItem().getItem() == FlenixCities.note1000) { nbt.setInteger("balance", (nbt.getInteger("Balance") + ItemNote10.moneyValue)); player.addChatMessage(ItemNote10.moneyValue + " Deposited! Your balance is now " + nbt.getInteger("balance")); } } return true; } @deadrecon98 have you got anything working yet? Nope. Still working on it
  4. I looked in the vanilla classes which used to use that bindTexture method, then checked what they had changed to when my methods no longer worked. As for saving issues, I think it might have been a fault on my part... Try changing this: NBTTagCompound nbt = player.getEntityData(); to this: NBTTagCompound nbt = player.getEntityData().getCompoundTag(EntityPlayer.PERSISTED_NBT_TAG); now I can't add to the nbt integer
  5. I'm honestly about to quit updating, they keep breaking everything!!!
  6. ummm dude. i updated to 1.6 and the nbt doesn't save anymore.
  7. It looks like you've got it all right and triggering it isn't much different and to see it just use a string + the int.
  8. lol ty. where do you find this stuff btw? it would help me in the future :3
  9. Use a command? An eventlistener for rightclick with a certain item? I don't know, you could use pretty much any event trigger... For current NBT value, it's just Integer currentBalance = nbt.getInteger("Balance"); Ty, I just updated to 1.6 so I have to wait to be able to run it. the renderEngine.bindTexture is broken.. god dammit mojang
  10. Retry with this. https://dl.dropboxusercontent.com/u/73396944/furnace%20code.zip
  11. Try this! public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4){ par3List.add("Text Here"); }
  12. Lol I mean like nbt.getInteger("MiningXp" + 1); but that method just says that the left-hand side must be a variable and just using the int itself won't work. Any Ideas?
  13. How would you add a number to it?
  14. But with nbt you cant load it from another class file wich is what I need to do.
  15. Well you're kinda missing the entire read/write nbt parts... public static void hashSaving(EntityPlayer player){ NBTTagCompound nbt = player.getEntityData(); nbt.setInteger("MiningXp", MiningXp); nbt.setInteger("MiningLevel", MiningLevel); nbt.setInteger("SmithingXp", SmithingXp); nbt.setInteger("SmithingLevel", SmithingLevel); } public int getMiningXp(EntityPlayer player){ NBTTagCompound nbt = player.getEntityData(); return nbt.getInteger("MiningXp"); } public int getSmithingXp(EntityPlayer player){ NBTTagCompound nbt = player.getEntityData(); return nbt.getInteger("SmithingXp"); } Edit: Tab-space derp .... thats a hashmap dude not an nbt compound
  16. Yes you may see it. If you need anything else just ask, I really want to get this done so that I can start working on the modding API for it package mods.cyphereion.cyphscape.levels; import java.util.HashMap; import java.util.Set; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.world.World; import net.minecraftforge.common.IExtendedEntityProperties; public final class Levels { /** * Creates the hashmap. */ public static HashMap map = new HashMap(); /** * The total Mining Experience. */ public static int MiningXp = 0; /** * The total Mining Level. */ public static int MiningLevel = 0; /** * The total smithing xp. */ public static int SmithingXp = 0; /** * The total smithing Level. */ public static int SmithingLevel = 0; public static void hashSaving(EntityPlayer player, World par2World){ player.getEntityData(); map.put("MiningXp", MiningXp); map.put("MiningLevel", MiningLevel); map.put("SmithingXp", SmithingXp); map.put("SmithingLevel", SmithingLevel); } public void getMiningXp(){ map.get("MiningXp"); } public void getSmithingXp(){ map.get("SmithingXp"); } } Btw im not using nbt im attempting to use a hashmap
  17. Is there anything that I am missing here? public static void hashSaving(EntityPlayer player){ player.getEntityData(); map.put("MiningXp", MiningXp); map.put("MiningLevel", MiningLevel); map.put("SmithingXp", SmithingXp); map.put("SmithingLevel", SmithingLevel); } public void getMiningXp(){ map.get("MiningXp"); } public void getSmithingXp(){ map.get("SmithingXp"); } Note: I can change the integer values but they don't save.
  18. Dude I've tried literally everything that I can think of. Hashmap's, NBT, FileWriter. But none of it seems to work for me. I've just never worked with these elements before and can't find anyone who knows or is willing to help me here. And btw I did read that guys code, actually I stripped it down and tried it then but it was still broken.
  19. HV Solar arrays --> MFSU --> Hv Converter --> Mv Converter -->lv Converter --> BC Energy Congratulations! btw you need the electrical engine mod. Not sure the name of it but its in one of my old modpacks. Ill search for it tomarrow for ya buddeh
  20. Lol bro seems a bit difficult, ive looked into it and you would have to make your own methods for this one. But good luck finding someone.
  21. You can get the world edit mod....... Forge has built-in modloader.
  22. Easy fix use this: Base Class Static: public static EnumArmorMaterial BRONZE = EnumHelper.addArmorMaterial("BRONZE", 8, new int[]{2, 6, 4, 2}, 5); Load: BronzePlateChest = new BronzeArmor(2016, Core.BRONZE, proxy.addArmor("Bronze Platechest"), 1).setUnlocalizedName("CyphScape_BronzeChestPlate"); Armor Class: package mods.cyphereion.cyphscape.core; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraftforge.common.IArmorTextureProvider; public class BronzeArmor extends ItemArmor implements IArmorTextureProvider{ public BronzeArmor(int par1, EnumArmorMaterial par2EnumArmorMaterial, int par3, int par4) { super(par1, par2EnumArmorMaterial, par3, par4); this.setCreativeTab(Core.tabCyphScape); } @Override public String getArmorTextureFile(ItemStack itemstack) { if(itemstack.itemID == Core.BronzeFullHelmet.itemID || itemstack.itemID == Core.BronzePlateChest.itemID || itemstack.itemID == Core.BronzeBoots.itemID){ return "/textures/armor/Bronze_1.png"; } if(itemstack.itemID == Core.BronzePlateLegs.itemID){ return "/textures/armor/Bronze_2.png"; } else return null; } } That is literally it. And btw try to avoid modloader methods, those need modloader mp to work. Forge has built in multiplayer so stick with that. Whoops forgot. Here it is now :3 Client Proxy: public int addArmor(String armor){ return RenderingRegistry.addNewArmourRendererPrefix(armor); } Common Proxy: public static int addArmor(String Armor){ return 0; }
×
×
  • Create New...

Important Information

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