
Jade_Knightblazer
Members-
Posts
88 -
Joined
-
Last visited
Everything posted by Jade_Knightblazer
-
Dyable Armor using a filter?
Jade_Knightblazer replied to Jade_Knightblazer's topic in Modder Support
Thanks for your help, sadly atm this coding is too high for my lvl of expertise however I am going to read into it -
Looking for a way to create Dyable armor with out the need of have 15+ armor.pngs Normal armored useds this method: string getArmorTextureFile (ItemStack itemstack) { return "/mod/texture/dirt_1.png"; } However is there a way to place a color adjuster to the string ".png"? pseudo code of filter Method: public void applyColorFilter(int decimalColorCode, string armorTextureFile) { decimalColorCode applied to armorTextureFile; } Example: string getArmorTextureFile (ItemStack itemstack) { return applyColorFilter(this.func_82814_b(itemstack), "/mod/texture/dirt_1.png"); } This way the said texture file is loaded with new decimal color adjustments added? If no method is supported yet for forge, I would like to request said method for the future of Dyable Armor
-
I have a functional armor set which the icons change based on dye used. However now I am at the point of have the armor render on the player. How do I import both needed texture files for 1.4.2 new cloth_1_b and cloth_2_b. Here is what I use for normal Armor: public String getArmorTextureFile(ItemStack itemstack) { //Livingmetal if(itemstack.itemID == mod_HarkenScythe.HSHelmetLivingmetal.shiftedIndex || itemstack.itemID == mod_HarkenScythe.HSPlateLivingmetal.shiftedIndex || itemstack.itemID == mod_HarkenScythe.HSBootsLivingmetal.shiftedIndex) { return "/mod_HarkenScythe/HarkenScytheTex/livingmetal_1.png"; } if(itemstack.itemID == mod_HarkenScythe.HSLegsLivingmetal.shiftedIndex) { return "/mod_HarkenScythe/HarkenScytheTex/livingmetal_2.png"; } //Soulweave if(itemstack.itemID == mod_HarkenScythe.HSHelmetSoulweave.shiftedIndex) //|| itemstack.itemID == mod_HarkenScythe.HSPlateLivingmetal.shiftedIndex || itemstack.itemID == mod_HarkenScythe.HSBootsLivingmetal.shiftedIndex) { return "/mod_HarkenScythe/HarkenScytheTex/soulweave_1.png"; } /*if(itemstack.itemID == mod_HarkenScythe.HSLegsLivingmetal.shiftedIndex) { return "/mod_HarkenScythe/HarkenScytheTex/livingmetal_2.png"; }*/ return "/mod_HarkenScythe/HarkenScytheTex/livingmetal_1.png"; this.get }
-
Hi, been wondering if there is a way to link mob spawning with world.getmoonphase() method. Over all I would like to have special mobs spawn during different Moon Phases in the game
-
Problem with Block updateTick and client
Jade_Knightblazer replied to Jade_Knightblazer's topic in Modder Support
I used your par1World.markBlockNeedsUpdate(par2, par3, par4); Ones that I tried using prior were: world.setBlock update ones and world.mark dirty ones. -
Problem with Block updateTick and client
Jade_Knightblazer replied to Jade_Knightblazer's topic in Modder Support
Thank you so much, that method worked like a charm!! Kinda sad tho.... I tired all the other update methods besides that one I guess T_T Works like a charm now -
Having a rough time trying to get the client to sync up with the server, which using the updateTick Method. Here is the code I use: public void updateTick(World par1World, int par2, int par3, int par4, Random par5Random) { int metadata = par1World.getBlockMetadata(par2, par3, par4); boolean powered = par1World.isBlockIndirectlyGettingPowered(par2, par3, par4); if (metadata >= 2 && powered == true) { par1World.setBlockMetadataWithNotify(par2, par3, par4, metadata - 1); metadata = par1World.getBlockMetadata(par2, par3, par4); } } This works wonderful as the block does slowely lower in Meta, however the client never sync up with the server. Meaning... The player has to log off and log back in for the Block to be updated Not sure how to sync client with Servers block @_@
-
[solved] Was the new (int par1, int par2) added to the draw Method. Having an odd issue with my fontRenderers in my drawGuiContainerForegroundLayer not showing up @_@ This is my normal code which worked correctly in 1.3.2 Not sure what could have caused this... Edit: Just tried placing said fontRenders in my drawGuiContainerBackgroudLayer() and they work. Just seems the Foreground is getting covered up? or not functioning correctly. Also tested a direct copy and paste of Minecrafts gui foreground codes, they don't work either under my custom Gui.
-
How to use New PlayerEvent HarvestCheck?
Jade_Knightblazer replied to Jade_Knightblazer's topic in General Discussion
Or, help with making custom Items drop from Minecraft Base Blocks. -
Multiple Channels={" "} in a mod_.Java ?
Jade_Knightblazer replied to Jade_Knightblazer's topic in General Discussion
Nevermind, after a quick shave I thought about it for a bit. I believe I just need to set up a if statement checking the first bit of data I send. Based on the value of this data, it will call required methods. The template I am using from the tut posted here is just too cut and dry to handle multiple packet usage. I see that now Thanks -
Multiple Channels={" "} in a mod_.Java ?
Jade_Knightblazer replied to Jade_Knightblazer's topic in General Discussion
k, maybe to can help explain this to me then. @Override public void onPacketData(NetworkManager manager, Packet250CustomPayload packet, Player playerEntity) { if (packet.channel.equals("HSPacket")) { handleRandom(packet); } else if (packet.channel.equals("HSPacket2")) { System.out.println("Working packet2"); handleRandom2(packet); } } I know "HSPacket2" will not be called due to my mod_.java channels is set to "HSPacket". However I already have 2 boolean and 3 int tied to static variables with the "HSPacket" for the tileentity. If I was to send the same packet for my Server.isDaylight() sync with client, wouldn't that screw up my tileEntity and Time sync each time the packet is sent at the wrong time. Mainly if both events happen at once?, or is the packet processed quickly enough to not worry about that? -
Is there a way to have more then one channel for mod_Custom.Java? So far I used up the first channel with a TileEntity sync, however I need another channel for Server isdaylight(), Client isdaylight() sync.
-
Having problems figuring out how to use this new Event. public static class HarvestCheck extends PlayerEvent { public final Block block; public boolean success; public HarvestCheck(EntityPlayer player, Block block, boolean success) { super(player); this.block = block; this.success = success; } } I would like to make a Minecraft Block. Block.slowSand, when harvested have a chance to drop a custom item. Such as, Gravel and Flint. I have understood other events like Livingdrops, and livinghurt, however they each had .Classes. Seems the new HarvestCheck.class is buried inside the PlayerEvent.class. =/ Anyways, I need help starting up this method. A template would be most welcome.
-
is this the correct way of finding the Entityplayer for the servertickhandler? MinecraftServer mcs = FMLServerHandler.instance().getServer(); if (mcs == null || mcs.getConfigurationManager().playerEntityList.isEmpty()) return; { EntityPlayerMP pMp = (EntityPlayerMP)mcs.getConfigurationManager().playerEntityList.get(0); } I need a way to keep updated with my entityplayer's armor slots. I tried using the clientTickHandler for this, however the server likes to reset any changes. So I either need help with sending armor update packets, or a way to figure out who is the entityplayer serverside. Btw, I am currently using the onUpdate() method inside the Item.class, however that only checks if the item is in the player inventory- Not Armor slots- =/
-
Correct, I had it calling from my Gui button action. I now enabled the metadata change method on a Side.SERVER , which works great... however now my Gui does not update with the new Metadata info. If I leave my Gui metadata change in tack and enable the new Side.SERVER method in my tileEntityCustom.class, it works great for servers.... however if you play single player, then the action is done twice T_T. Gained SMP but lost SP =/ Any suggestions? This is the code I use for my Gui Display text of Total Soul Count. I use a static variable that is on my BlockSoulAltar. Which I force an update when the block is activated.
-
I use this following code to adjust the metadata for surrounding blocks Now this works 100% while playing SP however while playing on servers the following happens. First the BlockSoulCrucible in the area are affected by the method - works correct. On server Log out, all BlockSoulCrucible's reset back their old Metadata- not correct. Wondering why the Metadata is not saving or updating/saving upon logout.
-
How to tell is Armor is currently Equiped by player.
Jade_Knightblazer replied to Jade_Knightblazer's topic in Modder Support
I just hate the server side Ontick methods because of the lack of entityplayer control. With Minecrafts 1.3 release. That certain player method was removed from MinecraftServer.java T_T. I believe sending a packet from the client to the server would fix this aye? Just need to use the CommonPacketHandler I hope. Thanks for the tip tho DarkGuardsman. -
[Solved]Loading Ores/ Materials from other mods.
Jade_Knightblazer replied to Jade_Knightblazer's topic in Modder Support
Figured it out, I just did a back door way . I have a special AddonsConfig.java that holds all my ItemIDs and such... well.... I just placed an Empty Item in there. Then I have my ASAddonHarkenScythe.java, load a simple line: ASAddonConfig.ASAddHSSoul = mod_HarkenScythe.common.mod_HarkenScythe.HSSoul; In its @Init. Since this mod addon has to be installed with the Mod HarkenScythe anyways. That that in my Mod AsgardShield I simply reference the ASAddonConfig.ASAddHSSoul. Now I just have to be sure to catch any null pointers -
[Solved]Loading Ores/ Materials from other mods.
Jade_Knightblazer replied to Jade_Knightblazer's topic in Modder Support
Yes that is what I am looking for However I seem to not be able to use it how I like. I am trying to use this code to make sure a certain Item is in the Players inventory. In this case its an item for my other mod. HSSoul. if (livingmetalAura <= 0 && entityplayer.inventory.hasItem(OreDictionary.getOreID("HSSoul"))) { for (int BD = 0; BD < 1; BD++) { roll = diceRoller.nextInt(100) + 1; } if (roll >= 0) { System.out.println("Ate a Soul"); livingmetalAura = 30; } } However that code does not work =/ I do have my OreDic setup like this on my mod_HarkenScythe. in my @Init OreDictionary.registerOre("HSSoul", new ItemStack(HSSoul)); OreDictionary.registerOre("HSLivingmetalIngot", new ItemStack(HSLivingmetalIngot)); Normally I could use this. mod_HarkenScythe.common.mod_HarkenScythe.HSSoul.shiftedIndex, but that is only if the mods are already together. Which if mod_HarkenScythe is not in my Eclipse Work Project or install with my mod_AsgardShield. The game will crash. (expected) I wish to allow both mods to be stand alone, and have mod_AsgardShield check if the item from the other mod is in the inventory w/o Hard Coding. Maybe I am just linking them wrong or OreDic can only be used in crafting? Not as a way to see if other items are around. -
Looking for a way to use other Ores and materials from outside mods, in custom crafting recipes. Do I have to use a string variable approach? Or do I have to have the other mod in my Eclipse work station? Then just make sure Users have both mods installed else they will crash.
-
How to tell is Armor is currently Equiped by player.
Jade_Knightblazer replied to Jade_Knightblazer's topic in Modder Support
I figured it out while playing with client ticker. I placed this code after my EntityPlayer p. if (p.inventory.armorItemInSlot(3) != null) { ItemStack LivingArmor = p.inventory.armorItemInSlot(3); if ("item.HSLivingmetalHelmet".equals(LivingArmor.getItemName()) && LivingArmor.isItemDamaged()) { mod_HarkenScythe.common.mod_HarkenScythe.livingmetalRepair(LivingArmor, 3); } } if (p.inventory.armorItemInSlot(2) != null) { ItemStack LivingArmor = p.inventory.armorItemInSlot(2); if ("item.HSLivingmetalPlate".equals(LivingArmor.getItemName()) && LivingArmor.isItemDamaged()) { mod_HarkenScythe.common.mod_HarkenScythe.livingmetalRepair(LivingArmor, 2); } } if (p.inventory.armorItemInSlot(1) != null) { ItemStack LivingArmor = p.inventory.armorItemInSlot(1); if ("item.HSLivingmetalLegs".equals(LivingArmor.getItemName()) && LivingArmor.isItemDamaged()) { mod_HarkenScythe.common.mod_HarkenScythe.livingmetalRepair(LivingArmor, 1); } } if (p.inventory.armorItemInSlot(0) != null) { ItemStack LivingArmor = p.inventory.armorItemInSlot(0); if ("item.HSLivingmetalBoots".equals(LivingArmor.getItemName()) && LivingArmor.isItemDamaged()) { mod_HarkenScythe.common.mod_HarkenScythe.livingmetalRepair(LivingArmor, 0); } } Works like a charm. I am not sure if I could use a For loop or not for this case.... If I can someone mind condensing this for me? Finished making it smaller. for (int i1 = 0; i1 < 4; i1++) { if (p.inventory.armorItemInSlot(i1) != null) { ItemStack LivingArmor = p.inventory.armorItemInSlot(i1); if ("item.HSLivingmetalHelmet".equals(LivingArmor.getItemName()) && LivingArmor.isItemDamaged()) { mod_HarkenScythe.common.mod_HarkenScythe.livingmetalRepair(LivingArmor, 3); } if ("item.HSLivingmetalPlate".equals(LivingArmor.getItemName()) && LivingArmor.isItemDamaged()) { mod_HarkenScythe.common.mod_HarkenScythe.livingmetalRepair(LivingArmor, 2); } if ("item.HSLivingmetalLegs".equals(LivingArmor.getItemName()) && LivingArmor.isItemDamaged()) { mod_HarkenScythe.common.mod_HarkenScythe.livingmetalRepair(LivingArmor, 1); } if ("item.HSLivingmetalBoots".equals(LivingArmor.getItemName()) && LivingArmor.isItemDamaged()) { mod_HarkenScythe.common.mod_HarkenScythe.livingmetalRepair(LivingArmor, 0); } } } Only oddity that happens is... Once my armor is fully repaired while its equipped. If I drag lets say my helm or boots off, all the recovered health is lost to all items. =/ Client to Server issue? because the use of Client Ticker...? -
How to tell is Armor is currently Equiped by player.
Jade_Knightblazer replied to Jade_Knightblazer's topic in Modder Support
Thanks , yeah I wish Onupdate() worked while armor was equipped aswell. Maybe the Equipment container has its own name rather then players.inventory?