-
Posts
2638 -
Joined
-
Last visited
-
Days Won
4
Everything posted by Ernio
-
1. Cleanup your code (what's with commenting out //@Override anyway?) 2. Link all relevant classes. 3. Restate all your issues. 4. Post errors if present and make sure that ALL code you've linked is being CALLED (make prints). P.S - Following up on threads that have few pages is just as time consuming as confusing.
-
boolean - will ne false. (generic primitive) (I messed up) Boolean - will be null. (object)
-
boolean - will ne false. (generic primitive) (I messed up) Boolean - will be null. (object)
-
Have you checked if your "private Item dropsOnHarvest" is not null? You might be setting it before you have item initilized.
-
Have you checked if your "private Item dropsOnHarvest" is not null? You might be setting it before you have item initilized.
-
Make global PRIVATE Boolean. In your read/write NBTmethods make "this.bool = nbt.getBoolean("B");" and "nbt.setBoolean("B");". Create getter for said boolean such as: private static Random RAND = new Random(); public boolean getBool() { if (this.bool == null) { this.bool = RAND.nextBoolean(); } return this.bool; }
-
Make global PRIVATE Boolean. In your read/write NBTmethods make "this.bool = nbt.getBoolean("B");" and "nbt.setBoolean("B");". Create getter for said boolean such as: private static Random RAND = new Random(); public boolean getBool() { if (this.bool == null) { this.bool = RAND.nextBoolean(); } return this.bool; }
-
Your best shot is to setup 1.8+ workspace, study it and downgrade. It won't be possible to make 100% replication without ASM, but as said - you can open your guis instead of vanilla ones. Aside from that - just UPDATE goddamit... 1.7.10 is ANCIENT (it's been 2 years, jesus), it doesn't even deserve getting new mods, total waste of time.
-
Your best shot is to setup 1.8+ workspace, study it and downgrade. It won't be possible to make 100% replication without ASM, but as said - you can open your guis instead of vanilla ones. Aside from that - just UPDATE goddamit... 1.7.10 is ANCIENT (it's been 2 years, jesus), it doesn't even deserve getting new mods, total waste of time.
-
[1.8.9] Custom Mob Drops Only With Specific Item?
Ernio replied to Monstrous_Apple's topic in Modder Support
It is complete and it is working (for 1.9+). The fact that you don't have clue what you are doing is a different thing - if you can't figure out that event.getEntity() is the same as just event.entity then you simply don't know how Java/programming works and have no idea how to use your IDE. Now before hating: 1. Read this sub-forum description. 2. Try to imagine situation where someone who has no idea how to work with physics goes to laboratory and starts asking questions on how to build an atomic bomb. Then imgaine that labs usually have documentation on everything that happens there. Then imagine that person asking about bomb, while not even LOOKING into those documents and getting crystal clear answers from those scientist in lab - still doesn't understand shit! Why? Because he is not a scientist. That is what is hapening here (hint, you are this guy, forum is lab and google/source is documentation). You can't expect to understand anything without actually learning it. 3. Seriously - go learn Java. --------------------------------------------------------------------------- 2nd post: Add this: if (event.getSource() != null && event.getSource().getEntity() instanceof EntityPlayer) -
[1.8.9] Custom Mob Drops Only With Specific Item?
Ernio replied to Monstrous_Apple's topic in Modder Support
It is complete and it is working (for 1.9+). The fact that you don't have clue what you are doing is a different thing - if you can't figure out that event.getEntity() is the same as just event.entity then you simply don't know how Java/programming works and have no idea how to use your IDE. Now before hating: 1. Read this sub-forum description. 2. Try to imagine situation where someone who has no idea how to work with physics goes to laboratory and starts asking questions on how to build an atomic bomb. Then imgaine that labs usually have documentation on everything that happens there. Then imagine that person asking about bomb, while not even LOOKING into those documents and getting crystal clear answers from those scientist in lab - still doesn't understand shit! Why? Because he is not a scientist. That is what is hapening here (hint, you are this guy, forum is lab and google/source is documentation). You can't expect to understand anything without actually learning it. 3. Seriously - go learn Java. --------------------------------------------------------------------------- 2nd post: Add this: if (event.getSource() != null && event.getSource().getEntity() instanceof EntityPlayer) -
[1.8.9] Custom Mob Drops Only With Specific Item?
Ernio replied to Monstrous_Apple's topic in Modder Support
http://lmgtfy.com/?q=java+tutorials+referencing+field 1st result. -
[1.8.9] Custom Mob Drops Only With Specific Item?
Ernio replied to Monstrous_Apple's topic in Modder Support
http://lmgtfy.com/?q=java+tutorials+referencing+field 1st result. -
[1.8.9] Custom Mob Drops Only With Specific Item?
Ernio replied to Monstrous_Apple's topic in Modder Support
Language warning: I really do hope you catch the reference (hint: joke) You are outdated, getters are 1.9+. -
[1.8.9] Custom Mob Drops Only With Specific Item?
Ernio replied to Monstrous_Apple's topic in Modder Support
Language warning: I really do hope you catch the reference (hint: joke) You are outdated, getters are 1.9+. -
[1.8.9] Custom Mob Drops Only With Specific Item?
Ernio replied to Monstrous_Apple's topic in Modder Support
@SubscribeEvent public void addEntityDrop50(LivingDropsEvent event) { if (event.getEntity() instanceof EntityCow) { if (event.getSource() != null && event.getSource().getEntity() instanceof EntityPlayer) { EntityPlayer player = ((EntityPlayer) event.getSource().getEntity()); if (player != null) { ItemStack holding = player.inventory.getStackInSlot(player.inventory.currentItem); if (holding != null && holding.getItem() instanceof MASoulHarvester) { ItemStack itemstack = new ItemStack(MASouls.CowSoul, 1); event.getDrops().add(new EntityItem(event.getEntity().worldObj, event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, itemstack)); } } } } } Jeeezz... Go back to Java tutorials. (I am serious dude, you won't get far with copy pasting from forums, and "that's how I learn" is no excuse). -
[1.8.9] Custom Mob Drops Only With Specific Item?
Ernio replied to Monstrous_Apple's topic in Modder Support
@SubscribeEvent public void addEntityDrop50(LivingDropsEvent event) { if (event.getEntity() instanceof EntityCow) { if (event.getSource() != null && event.getSource().getEntity() instanceof EntityPlayer) { EntityPlayer player = ((EntityPlayer) event.getSource().getEntity()); if (player != null) { ItemStack holding = player.inventory.getStackInSlot(player.inventory.currentItem); if (holding != null && holding.getItem() instanceof MASoulHarvester) { ItemStack itemstack = new ItemStack(MASouls.CowSoul, 1); event.getDrops().add(new EntityItem(event.getEntity().worldObj, event.getEntity().posX, event.getEntity().posY, event.getEntity().posZ, itemstack)); } } } } } Jeeezz... Go back to Java tutorials. (I am serious dude, you won't get far with copy pasting from forums, and "that's how I learn" is no excuse). -
[1.8.9] Custom Mob Drops Only With Specific Item?
Ernio replied to Monstrous_Apple's topic in Modder Support
Jeuss christ. Learn some Java and how to use your IDE. Should this work for all entities or for players? You can make it work for entities by using EntityLivingBase#handHandler Capability. If you only want players, just cast the damn entity and get player.inventory like you do in harvesting. -
[1.8.9] Custom Mob Drops Only With Specific Item?
Ernio replied to Monstrous_Apple's topic in Modder Support
Jeuss christ. Learn some Java and how to use your IDE. Should this work for all entities or for players? You can make it work for entities by using EntityLivingBase#handHandler Capability. If you only want players, just cast the damn entity and get player.inventory like you do in harvesting. -
[1.8.9] Custom Mob Drops Only With Specific Item?
Ernio replied to Monstrous_Apple's topic in Modder Support
What is the problem? You get entity from source, get that entity's current item and check if it's yours. -
[1.8.9] Custom Mob Drops Only With Specific Item?
Ernio replied to Monstrous_Apple's topic in Modder Support
What is the problem? You get entity from source, get that entity's current item and check if it's yours. -
[1.8.9] Custom Mob Drops Only With Specific Item?
Ernio replied to Monstrous_Apple's topic in Modder Support
DamageSource#getEntity() -
[1.8.9] Custom Mob Drops Only With Specific Item?
Ernio replied to Monstrous_Apple's topic in Modder Support
DamageSource#getEntity() -
1. GUI = Graphical user interface, in this case (MC) it rather means HUD. SO when talking about GUI we are (99% times) talk about what is rendered FLAT on TOP of screen. 2. "google search for the topic of ClientPlayerController but no luck so far" - I told you, name may be different. Regarding what is responsible for controlling players: * PlayerControllerMP (actions) * NetHandlerPlayClient (sending/receiving packets) * MovementInput sub-class (values of client input actions, such as if you are moving forward) * EntityPlayerSP (all packeting, e.g: look at : onUpdateWalkingPlayer()). Some stuff: http://mcforge.readthedocs.org/en/latest/concepts/sides/ And finally - learn to use your IDE. As of 1.9+ MC source is so RIDICULOUSLY beutiful! Just sid and read, look for "move" and "input" keywords, callbacks, hierarchy. Everything is there under very nice names. Aditional note; there is difference between moving player and making a path for him, for sevond one you need to lookup pathfinding algorithms - e.g Zombies. Note that pathes should not be further than 32, or it will start to get heavy on performance (for longer distance you can use multiple checkpoints).
-
1. GUI = Graphical user interface, in this case (MC) it rather means HUD. SO when talking about GUI we are (99% times) talk about what is rendered FLAT on TOP of screen. 2. "google search for the topic of ClientPlayerController but no luck so far" - I told you, name may be different. Regarding what is responsible for controlling players: * PlayerControllerMP (actions) * NetHandlerPlayClient (sending/receiving packets) * MovementInput sub-class (values of client input actions, such as if you are moving forward) * EntityPlayerSP (all packeting, e.g: look at : onUpdateWalkingPlayer()). Some stuff: http://mcforge.readthedocs.org/en/latest/concepts/sides/ And finally - learn to use your IDE. As of 1.9+ MC source is so RIDICULOUSLY beutiful! Just sid and read, look for "move" and "input" keywords, callbacks, hierarchy. Everything is there under very nice names. Aditional note; there is difference between moving player and making a path for him, for sevond one you need to lookup pathfinding algorithms - e.g Zombies. Note that pathes should not be further than 32, or it will start to get heavy on performance (for longer distance you can use multiple checkpoints).