
mardiff
Members-
Posts
158 -
Joined
-
Last visited
Everything posted by mardiff
-
Textures and LanguageRegistry in preInit instead of Init
mardiff replied to sorash67's topic in Modder Support
Not sure what you did, but I put the code in, and then the textures in, and everything worked fine. Cool mod btw. Anyways, the only thing I can think of is that you put the textures in the wrong place. To try to make things easier, the destination of invisible.png is at forge/mcp/src/minecraft/assets/traps/textures/blocks/invisible.png. Hope I helped. -
Textures and LanguageRegistry in preInit instead of Init
mardiff replied to sorash67's topic in Modder Support
Mind if I take a look? -
Textures and LanguageRegistry in preInit instead of Init
mardiff replied to sorash67's topic in Modder Support
Alright guys, chill out. What problems do we still have? -
Textures and LanguageRegistry in preInit instead of Init
mardiff replied to sorash67's topic in Modder Support
Nothing, actually. I thought I did change something, but I can't find it after comparing my 1.5.2 code with 758. Also, put everything in preInit, but remember that preInit is no longer called that. Instead, it should be: @EventHandler public void load(FMLPreInitializationEvent event) {} It is still the FMLPreInitializationEvent, but this goes inside @EventHandler. -
Textures and LanguageRegistry in preInit instead of Init
mardiff replied to sorash67's topic in Modder Support
I have my textures working in 758, and I don't have func_111022 in my block declaration. I simply put the textures where lex said to, then changed the declarations to preInitialization, as well as updating the registerIcon functions. -
How would you do this if you only wanted it to spawn particles if the living entity was hit by a certain item?
-
Thank you, it works just the way I wanted it to! Here's the final code or the spawning: public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { Random rand = new Random(); for(int countparticles = 0; countparticles <= 10; ++countparticles) { par2World.spawnParticle("reddust", par3EntityPlayer.posX + (rand.nextDouble() - 0.5D) * (double)par3EntityPlayer.width, par3EntityPlayer.posY + rand.nextDouble() * (double)par3EntityPlayer.height - (double)par3EntityPlayer.yOffset, par3EntityPlayer.posZ + (rand.nextDouble() - 0.5D) * (double)par3EntityPlayer.width, 0.0D, 0.0D, 0.0D); } par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); return par1ItemStack; }
-
I finally got it to work! Here's the code for the whole class, I'm not quite sure how it was different but it works for some reason now: package redstone; import java.util.Random; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraft.world.World; public class RedstoneSword extends ItemSword { public RedstoneSword(int par1, EnumToolMaterial par2EnumToolMaterial) { super(par1, par2EnumToolMaterial); } @Override public void updateIcons(IconRegister par1IconRegister) { this.iconIndex = par1IconRegister.registerIcon("quartzTextures:quartzSword"); } public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { for(int countparticles = 0; countparticles <= 10; ++countparticles) { par2World.spawnParticle("reddust", par3EntityPlayer.posX + 1, par3EntityPlayer.posY, par3EntityPlayer.posZ, 0.0D, 0.0D, 0.0D); } par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); return par1ItemStack; } } But now I have a different problem. The particles only spawn in the same place, which is always 1 block east of the player, no matter where he is looking. I think having the same effect as the potions do would be appropriate. Does anyone know where that is?
-
I don't think that would make much of a difference, considering many of the vanilla particle effects don't integrate velocity whatsoever.
-
I'm almost positive. I tried making the particles spawn at places like 1 block in front of the player, but still nothing.
-
I tried to insert a spawnParticle on an item right click and I'm not quite sure what I'm doing wrong: public ItemStack onItemRightClick(ItemStack par1ItemStack, World par2World, EntityPlayer par3EntityPlayer) { par2World.spawnParticle("reddust", par3EntityPlayer.posX, par3EntityPlayer.posY, par3EntityPlayer.posZ, 0.0D, 0.0D, 0.0D); par3EntityPlayer.setItemInUse(par1ItemStack, this.getMaxItemUseDuration(par1ItemStack)); return par1ItemStack; } The last part with set Item in Use is just so the sword continues to block. It still does nothing, please help.
-
Use a redstone block.
-
I want my sword item to spawn particles when it's right clicked. I'm not really sure how to do it, I was hoping someone could give me a sample. Heres the code I have for my sword: package redstone; import java.util.Random; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumToolMaterial; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraft.world.World; public class RedstoneSword extends ItemSword { public RedstoneSword(int par1, EnumToolMaterial par2EnumToolMaterial) { super(par1, par2EnumToolMaterial); } @Override public void updateIcons(IconRegister par1IconRegister) { this.iconIndex = par1IconRegister.registerIcon("redstoneTextures:redstoneSword"); } }
-
[Solved]Block with different textures on top & bottom
mardiff replied to SeaBass's topic in Modder Support
I'm not sure, but try replacing the @Side.only in the register icon function with an @Override. -
I'm not sure how to do this without editing base files if your item is vanilla, but if the item is an item you made yourself, then just use the vanilla code from the hoe file. Do you have any code so far in your class?
-
Tell me exactly what you are trying to do.
-
Look at the ItemHoe class. It seems like you are trying to do just about the same thing that the hoe does, by checking to see if the block clicked on is dirt, and if it is, it turns it into tilled earth. Just a question, is the item that you are clicking with an item you made or a vanilla item?
-
Hello Everyone, I know that this may be a silly question and the answer is probably blatantly obvious, but I was wondering if there was a function that returns the coordinates of the player. Any help would be appreciated. Thanks, Mardiff
-
As we all know, quartz has been added to the game in the form of nether quartz. Now, diamond is the strongest naturally found material in the world, but as it happens to be, quartz is the 4th hardest. Now, if this is true, why doesn't Minecraft have quartz armor and tools? This is what I'm here to add. This mod adds quartz tools & armor (as you probably guessed from the title), which is better than iron but worse than diamond. I hope you have fun with it! Download: http://www.mediafire.com/?z8gmn25esrwbsbj Also, if you have any reccomendations, the help would be greatly appreciated. Thanks, Mardiff712
-
This is my code that works. Post this as a new class, and only change the achievement, the class names, and the item names. package net.minecraft.mardiff; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import cpw.mods.fml.common.IPickupNotifier; public class MardiffAchievementsPickup implements IPickupNotifier { @Override public void notifyPickup(EntityItem item, EntityPlayer player) { if(item.func_92014_d().itemID == MardiffBase.ruby.itemID) { player.addStat(MardiffBase.MardiffGem, 1); } } }
-
Yes it does. Do you have any more questions?
-
How should I let the player get my mod item?
mardiff replied to temporalus's topic in Modder Support
Heres a quick bit of code that adds it to spawn in dungeon chests around the map: DungeonHooks.addDungeonLoot(new ItemStack(ITEM), PERCENT CHANCE OF SPAWN, MINIMUM, MAXIMUM); The example I have is this: DungeonHooks.addDungeonLoot(new ItemStack(cornKernel), 75, 1, 4); -
Hello Everyone, I'm currently making custom achievements, and one of them is triggered by a crafting recipe, and it is triggered by the recipe, but also by all of the other recipes. Any help would be greatly appreciated. Thanks again, Mardiff package net.minecraft.mardiff; import cpw.mods.fml.common.ICraftingHandler; import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; public class MardiffAchievements implements ICraftingHandler { @Override public void onCrafting(EntityPlayer player, ItemStack item, IInventory craftMatrix) { if(item.itemID == MardiffBase.silverPick.itemID || item.itemID == MardiffBase.bronzePick.itemID || item.itemID == MardiffBase.silverAxe.itemID || item.itemID == MardiffBase.bronzeAxe.itemID || item.itemID == MardiffBase.silverShovel.itemID || item.itemID == MardiffBase.bronzeShovel.itemID || item.itemID == MardiffBase.silverHoe.itemID || item.itemID == MardiffBase.bronzeHoe.itemID); { player.addStat(MardiffBase.IngotTool, 1); } if(item.itemID == MardiffBase.rubyPick.itemID || item.itemID == MardiffBase.sapphirePick.itemID || item.itemID == MardiffBase.rubyAxe.itemID || item.itemID == MardiffBase.sapphireAxe.itemID || item.itemID == MardiffBase.rubyShovel.itemID || item.itemID == MardiffBase.sapphireShovel.itemID || item.itemID == MardiffBase.rubyHoe.itemID || item.itemID == MardiffBase.sapphireHoe.itemID); { player.addStat(MardiffBase.GemTool, 1); } } @Override public void onSmelting(EntityPlayer player, ItemStack item) { if(item.itemID == MardiffBase.silver.itemID || item.itemID == MardiffBase.tin.itemID || item.itemID == MardiffBase.copper.itemID); { player.addStat(MardiffBase.MardiffIngot, 1); } } }
-
Hello Everyone, I have successfully modeled the tutorial from http://www.minecraftforge.net/wiki/Containers_and_GUIs, but instead of making a tiny chest, I wanted to make a working furnace that only requires a redstone signal to run. I can't find any coding that has worked, and I haven't even managed to make a furnace without fuel. My current code can be found at http://pastebin.com/Y3vdBM5T. Any help would be appreciated. Thanks, Gmen712