
Z@Nka
Members-
Posts
104 -
Joined
-
Last visited
Everything posted by Z@Nka
-
I'm pretty suree it's this: protected void dropBlockAsItem(World p_149642_1_, int p_149642_2_, int p_149642_3_, int p_149642_4_, ItemStack p_149642_5_) { It has a World, x, y, z, Itemstack. For help about that look at the Block class. EDIT: I'm sure that if you Override getItemDropped(int, Random, int) it will work but I'm not sure what are the parameters there.
-
I fixed my problem so I could get back into modding, I register it in EventHandler like this: package bulkyzanka.electro.mod.handler; import bulkyzanka.electro.mod.research.PlayerResearch; import net.minecraft.entity.player.EntityPlayer; import net.minecraftforge.event.entity.EntityEvent.EntityConstructing; import cpw.mods.fml.common.eventhandler.SubscribeEvent; public class ElectroEventHandler { @SubscribeEvent public void onEntityConstructing(EntityConstructing event) { if(event.entity instanceof EntityPlayer && PlayerResearch.get((EntityPlayer) event.entity) == null) { PlayerResearch.register((EntityPlayer) event.entity); } if (event.entity instanceof EntityPlayer && event.entity.getExtendedProperties(PlayerResearch.EXT_PROP_NAME) == null) { event.entity.registerExtendedProperties(PlayerResearch.EXT_PROP_NAME, new PlayerResearch((EntityPlayer) event.entity)); } } } But for the player.registerExtendedEntityProperties(EXT_PROP_NAME,this); Where do I register that? I'm guessing it's in that class because of the "this". Should I put it in init? ABout the other little mistakes, I fixed them.
-
[1.7.2] Item that changes Block on right Click
Z@Nka replied to SantacreeperLP's topic in Modder Support
Ohh, oops. I was a minute late... >.> diesieben07 posted while I was writing. -
[1.7.2] Item that changes Block on right Click
Z@Nka replied to SantacreeperLP's topic in Modder Support
Try this, Override onItemUse then get the block coordinates, check if it's null and set that block to something else. -
I'm not sure if this is the right place to post this, sorry if it's not. It's just that it has something to do with this post. I was going to fix all that now but my Eclipse sort of messed up. Last time I saved my work and just closed it, this morning when I tired to run Eclipse, It was constantly giving a me an error. Something to do with the workspace not loading and my code didn't appear. I reinstalled Eclipse, the code was all there but I got a different error: eclipse.buildId=4.3.2.M20140221-1700 java.version=1.8.0 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pl_PL Framework arguments: -product org.eclipse.epp.package.standard.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.standard.product Error Sun May 25 12:10:22 BST 2014 Unable to find Action Set: org.eclipse.rse.core.search.searchActionSet eclipse.buildId=4.3.2.M20140221-1700 java.version=1.8.0 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pl_PL Framework arguments: -product org.eclipse.epp.package.standard.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.standard.product Error Sun May 25 12:10:22 BST 2014 Unable to find Action Set: org.eclipse.mylyn.tasks.ui.navigation eclipse.buildId=4.3.2.M20140221-1700 java.version=1.8.0 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pl_PL Framework arguments: -product org.eclipse.epp.package.standard.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.standard.product Error Sun May 25 12:10:22 BST 2014 Unable to find Action Set: org.eclipse.mylyn.doc.actionSet eclipse.buildId=4.3.2.M20140221-1700 java.version=1.8.0 java.vendor=Oracle Corporation BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=pl_PL Framework arguments: -product org.eclipse.epp.package.standard.product Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.standard.product Error Sun May 25 12:10:22 BST 2014 Unable to find Action Set: org.eclipse.mylyn.context.ui.actionSet When I try to do something like research and I try to put a dot there, nothing is appearing.
-
I read a little about it and I think I got it... Didn't test it yet because I don't have anything triggering it. Here is my code. I f I did anything wrong feel free to point it out. public class PlayerResearch implements IExtendedEntityProperties { public final static String EXT_PROP_NAME = "PlayerResearch"; private final EntityPlayer player; public int[] CurrentResearch = { 0, 0, 0, 0, 0}; public PlayerResearch(EntityPlayer player) { this.player = player; } public static final void register(EntityPlayer player) { player.registerExtendedProperties(PlayerResearch.EXT_PROP_NAME, new PlayerResearch(player)); } public static final PlayerResearch get(EntityPlayer player) { return (PlayerResearch)player.getExtendedProperties(EXT_PROP_NAME); } public void saveNBTData(NBTTagCompound nbt) { NBTTagCompound research = new NBTTagCompound(); research.setInteger("Research1", CurrentResearch[0]); research.setInteger("Research2", CurrentResearch[1]); research.setInteger("Research3", CurrentResearch[2]); research.setInteger("Research4", CurrentResearch[3]); research.setInteger("Research5", CurrentResearch[4]); System.out.print("Key Presses"); nbt.setTag(EXT_PROP_NAME, research); } public void loadNBTData(NBTTagCompound nbt) { NBTTagCompound research = (NBTTagCompound) nbt.getTag(EXT_PROP_NAME); CurrentResearch[0] = research.getInteger("Research1"); CurrentResearch[1] = research.getInteger("Research2"); CurrentResearch[2] = research.getInteger("Research3"); CurrentResearch[3] = research.getInteger("Research4"); CurrentResearch[4] = research.getInteger("Research5"); System.out.println(research.getInteger("Research1")); } public void init(Entity entity, World world) { } }
-
I wasn't how to do it so the player data is different for all the players, I don't want them to share the research.
-
Thanks for the fast answer. I'll try it and post the code I get for others.
-
I was wonder how to store some data about players. Stuff like research. I thought about NBT but it what I did didn't work so I scraped it. I also tried something involving IExtendedEntityProperties. I read about the fact you can use it with an entity but it totally failed. Then I did player.getEntityData() but same thing happened. I think the way to do it would be the NBT but I'm not sure how to store the completed research in every player individually. Thanks for any help.
-
I found it but I wasn't sure will that do the job since it didn't have the parameters.
-
But there is no method called updateTick so it won't get called in the tileentity
-
I have a tile entity, I also custom render my block. So should I put that code in the tileentity class?
-
It still doesn't work, it doesn't even do anything.
-
Ok, so this is the code I used, and it didn't work. Nothing happend. public void updateTick(World world, int x, int y, int z, Random random) { EntityPlayer player = world.getClosestVulnerablePlayer(5, x, y, z); if(player != null) { System.out.println("gf"); } } Ohh yeah, sorry for posting this here but, when I log out and back in, my block isn't there.
-
Thanks!
-
In: world.getClosestVulnerablePlayer(1, x, y, z) What does the 1 stand for? Is it the gamemode? If so, when I have it at 1, does that mean that players with gamemode 1 will be counted or anything that isn't 1?
-
I tough about that yesturday but I forgot to try it. Thanks for the fast help!
-
The method is public void updateTick(World world, int x, int y, int z, Random random) The parameter I need is EntityPlayer. I need my block to scan for players in a radius of a few blocks.
-
I have a quick question, if I have a method in the block class doesn't have a parameter I need, how can I add a parameter to it with it still getting called?
-
Soz I ment tile-entites.
-
Don't you register entities in the proxy as well?
-
Post both of them...
-
[1.7.2] Custom pickaxe isn't returning stone when mined [SOLVED]
Z@Nka replied to Budboy33's topic in Modder Support
I hope I helped! -
[1.7.2] Custom pickaxe isn't returning stone when mined [SOLVED]
Z@Nka replied to Budboy33's topic in Modder Support
Should look like this: public Itemname(ToolMaterial material) { super(material); } Then you can add this: setCreativeTab(CreativeTab.magicTab); setUnlocalizedName("empoweredPickaxe"); setTextureName("am:empoweredPickaxe"); You won't need to set the stack size since its a pickaxe, they never stack.. -
[1.7.2] Custom pickaxe isn't returning stone when mined [SOLVED]
Z@Nka replied to Budboy33's topic in Modder Support
Try to extend it with ItemPickaxe