Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/28/18 in all areas

  1. 1) Use Java 8, not Java 9. 2) 1.7.10 is no longer supported on this forum. Update.
    1 point
  2. he wants to know to to get in the assets folder, probably
    1 point
  3. Here's an example of what would work and would not work. Assume that the optional mod has an EntityVampire and in your mod if the other mod is loaded you want to spawn vampires, but if the other mod is not loaded then you want to spawn EntityWitch. Proper Encapsulation Example For proper encapsulation, the interface is designed so that the dummy implementation doesn't see any classes it won't have. For example, in your proxy interface you could have a method called spawnEvilEntity() that is prototyped like this: void spawnEvilEntity(World worldIn, BlockPos posIn); Then in your dummy proxy implementation class you implement the method as: public void spawnEvilEntity(World worldIn, BlockPos posIn) { EntityWitch entity = new EntityWitch(worldIn); entity.setLocationAndAngles(posIn); worldIn.spawnEntity(entity); } And in your active mod proxy implementation class you implement the method as: public void spawnEvilEntity(World worldIn, BlockPos posIn) { EntityVampire entity = new EntityVampire(worldIn); entity.setLocationAndAngles(posIn); worldIn.spawnEntity(entity); } Then you could use this in your main mod code whenever you want to spawn one of these you just call: proxy.spawnEvilEntity(theWorld, thePos); Wrong Way If you expose any classes from the optional mod to the interface it will cause trouble. For example, if instead of actually spawning the mob, if you made a method called createVampire() in your proxy interface like: EntityVampire createVampire(World worldIn, BlockPos posIn); And in your dummy proxy you had: public EntityVampire createVampire(World worldIn, BlockPos posIn) { return null; } And in your active mod proxy you had: public EntityVampire createVampire(World worldIn, BlockPos posIn) { EntityVampire entity = new EntityVampire(worldIn); entity.setLocationAndAngles(posIn); return entity; } In which case you might try to use it this way in your main mod: EntityVampire vampire = proxy.createVampire(theWorld, thePos); if (vampire != null) { theWorld.spawn(vampire); } else { EntityWitch witch = new EntityWitch(worldIn); witch.setLocationAndAngles(posIn); theWorld.spawn(witch); } This will fail because you have your main mod trying to access EntityVampire which may not be available. Not sure if my example is clear but the point is that you need to organize your proxy code so that all the code that depends on the classes from the optional mod are ONLY accessed within the active mod proxy implementation. You cannot expose those classes to the dummy proxy or the rest of your mod. If you get more specific on what you're trying to do, we can give more specific examples.
    1 point
  4. Two things: 1) Are you sure that the item stack you're getting is not empty? 2) That's not the only way to make an item slot empty
    0 points
  5. You can also make recipes between mods compatible with craft tweaker. Its a mod that allows you to write scripts and create and delete recipes. Its useful for recipes, and changing item names, but nothing else.
    0 points
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.