Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Z@Nka

Members
  • Posts

    104
  • Joined

  • Last visited

Converted

  • Gender
    Male
  • Personal Text
    Still learning c:

Z@Nka's Achievements

Creeper Killer

Creeper Killer (4/8)

2

Reputation

  1. 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.
  2. 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.
  3. Ohh, oops. I was a minute late... >.> diesieben07 posted while I was writing.
  4. Try this, Override onItemUse then get the block coordinates, check if it's null and set that block to something else.
  5. 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.
  6. 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) { } }
  7. 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.
  8. Thanks for the fast answer. I'll try it and post the code I get for others.
  9. 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.
  10. I found it but I wasn't sure will that do the job since it didn't have the parameters.
  11. But there is no method called updateTick so it won't get called in the tileentity
  12. I have a tile entity, I also custom render my block. So should I put that code in the tileentity class?
  13. It still doesn't work, it doesn't even do anything.
  14. 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.
×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.