Jump to content

RANKSHANK

Members
  • Posts

    305
  • Joined

  • Last visited

Everything posted by RANKSHANK

  1. GameRegistry.addRecipe(new ItemStack(baconiteChestplate), new Object[] { "T T", "TTT", "TTT", 'T', Crystalia.baconiteIngot, }); //tools baconiteBow = new BaconiteBow(5010).setUnlocalizedName("Crystalia:baconiteBow"); LanguageRegistry.addName(baconiteBow, "Baconite Bow"); here you are registering recipes before creating the item, which is a no. this registers a null instead of the item, since the item is set to null until you have placed an instance in it
  2. Use an instance, For example I use public final class BuildController{ private BuildController(){instance = this;} private static BuildController instance; public static void bind(){ if(instance == null) MinecraftForge.EVENT_BUS.register(instance = new BuildController()); } public static void unbind(){ if(instance != null){ MinecraftForge.EVENT_BUS.unregister(instance); instance = null; } } } and it cleanly registered and unregistered the listeners in the class-
  3. Use an instance, For example I use public final class BuildController{ private BuildController(){instance = this;} private static BuildController instance; public static void bind(){ if(instance == null) MinecraftForge.EVENT_BUS.register(instance = new BuildController()); } public static void unbind(){ if(instance != null){ MinecraftForge.EVENT_BUS.unregister(instance); instance = null; } } } and it cleanly registered and unregistered the listeners in the class-
  4. I have a feeling that it's not being done locally, you'll need to send a packet to notify the client of the changes too
  5. I have a feeling that it's not being done locally, you'll need to send a packet to notify the client of the changes too
  6. check the debug texture that's outputted in the /jars directory to see if it's there, some code will need to be shown
  7. check the debug texture that's outputted in the /jars directory to see if it's there, some code will need to be shown
  8. Your supposed 'saving of resources' is flawed. if someone where to build a massive fence based structure and then those chunks where unloaded, rinse lather repeat, you would leave the print of all of those blocks in the system(the more you put, the slower saving and loading gets...), unless you used system resources to load and offload the values as needed, basically you either suffer one way or another... so tile entity is your best bet.
  9. Your supposed 'saving of resources' is flawed. if someone where to build a massive fence based structure and then those chunks where unloaded, rinse lather repeat, you would leave the print of all of those blocks in the system(the more you put, the slower saving and loading gets...), unless you used system resources to load and offload the values as needed, basically you either suffer one way or another... so tile entity is your best bet.
  10. getEntityData() doesn't guarantee that you'll get the data you want. In fact forge code: public NBTTagCompound getEntityData() { if (customEntityData == null) { customEntityData = new NBTTagCompound(); } return customEntityData; } this means you don't get any data aside from a new tag compound. the easiest way to work around this though is to pseudo load the entity ie EnitytMineCart e = yadda yadda initialization stuff; NBTTagCompound data = new NBTTagCompound(); e.writeToNBT(data); data.setString("EntityId", "SnowMan"); e.readFromNBT(data); w.spawnEntityInWorld(e);
  11. getEntityData() doesn't guarantee that you'll get the data you want. In fact forge code: public NBTTagCompound getEntityData() { if (customEntityData == null) { customEntityData = new NBTTagCompound(); } return customEntityData; } this means you don't get any data aside from a new tag compound. the easiest way to work around this though is to pseudo load the entity ie EnitytMineCart e = yadda yadda initialization stuff; NBTTagCompound data = new NBTTagCompound(); e.writeToNBT(data); data.setString("EntityId", "SnowMan"); e.readFromNBT(data); w.spawnEntityInWorld(e);
  12. sounds like you may need to either reflect to get access to the block's icon and replace it with your own, or reflect to replace the block instance with one of your own which will bind your custom texture
  13. sounds like you may need to either reflect to get access to the block's icon and replace it with your own, or reflect to replace the block instance with one of your own which will bind your custom texture
  14. Icon registry happens in the ItemSpear.class so it goes there
  15. Icon registry happens in the ItemSpear.class so it goes there
  16. well you will need to set the unlocalized name per item, and you can use that to access the file, if the file is directly related to the unlocalized name, otherwise you could create an if statement or add it to your constructor(not recommended due to side differences) so something like //pseudo code public void registerIcon(IconRegister i){ //if using unlocalized i.registerIcon("yourmod:" + getUnlocalizedName()); //item id switch switch(itemID){ case(woodSpearID): i.registerIcon("yourmod:wooden spear"; break; case(diamondSpearID): i.registerIcon("yourmod:diamond spear"; break; default: break } }
  17. well you will need to set the unlocalized name per item, and you can use that to access the file, if the file is directly related to the unlocalized name, otherwise you could create an if statement or add it to your constructor(not recommended due to side differences) so something like //pseudo code public void registerIcon(IconRegister i){ //if using unlocalized i.registerIcon("yourmod:" + getUnlocalizedName()); //item id switch switch(itemID){ case(woodSpearID): i.registerIcon("yourmod:wooden spear"; break; case(diamondSpearID): i.registerIcon("yourmod:diamond spear"; break; default: break } }
  18. Each item type can get it's own instance you could do something like public class Spear extends Item{ public final int damage; public Spear(int id, int dmg){ damage = dmg } } and then set the values on init Item spearWood = new ItemSpear(woodSpearID, 2); Item spearDiamond = new ItemSpear(diamSpearID, ;
  19. Each item type can get it's own instance you could do something like public class Spear extends Item{ public final int damage; public Spear(int id, int dmg){ damage = dmg } } and then set the values on init Item spearWood = new ItemSpear(woodSpearID, 2); Item spearDiamond = new ItemSpear(diamSpearID, ;
  20. Lex explained quite a bit. you just failed to comprehend it-
  21. Lex explained quite a bit. you just failed to comprehend it-
  22. like this? DimensionManager.getWorld(id) or are you looking for something else?
  23. like this? DimensionManager.getWorld(id) or are you looking for something else?
  24. switch the modifier from static to public static
  25. switch the modifier from static to public static
×
×
  • Create New...

Important Information

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