RANKSHANK
Members-
Posts
305 -
Joined
-
Last visited
Everything posted by RANKSHANK
-
[SOLVED]Armor, Dye, and Tools Crafting Recipes?
RANKSHANK replied to FloatingGrapefruit's topic in Modder Support
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 -
[Fixed] Unregistering of RenderGameOverlayEvent does not work
RANKSHANK replied to Chimaine's topic in Modder Support
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- -
[Fixed] Unregistering of RenderGameOverlayEvent does not work
RANKSHANK replied to Chimaine's topic in Modder Support
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- -
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
-
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
-
Register New Block Texture Without Registering A New Block
RANKSHANK replied to LRFLEW's topic in Modder Support
check the debug texture that's outputted in the /jars directory to see if it's there, some code will need to be shown -
Register New Block Texture Without Registering A New Block
RANKSHANK replied to LRFLEW's topic in Modder Support
check the debug texture that's outputted in the /jars directory to see if it's there, some code will need to be shown -
Any way to store unique data per block placement?
RANKSHANK replied to Lycanus Darkbinder's topic in Modder Support
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. -
Any way to store unique data per block placement?
RANKSHANK replied to Lycanus Darkbinder's topic in Modder Support
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. -
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);
-
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);
-
Register New Block Texture Without Registering A New Block
RANKSHANK replied to LRFLEW's topic in Modder Support
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 -
Register New Block Texture Without Registering A New Block
RANKSHANK replied to LRFLEW's topic in Modder Support
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 -
Icon registry happens in the ItemSpear.class so it goes there
-
Icon registry happens in the ItemSpear.class so it goes there
-
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 } }
-
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 } }
-
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, ;
-
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, ;
-
Lex explained quite a bit. you just failed to comprehend it-
-
Lex explained quite a bit. you just failed to comprehend it-
-
How would I get a world based on dimension Id
RANKSHANK replied to thebest108's topic in Modder Support
like this? DimensionManager.getWorld(id) or are you looking for something else? -
How would I get a world based on dimension Id
RANKSHANK replied to thebest108's topic in Modder Support
like this? DimensionManager.getWorld(id) or are you looking for something else? -
Nested class with Networkmod dosen't switch as member ?
RANKSHANK replied to 0xC6607Eo1's topic in Modder Support
switch the modifier from static to public static -
Nested class with Networkmod dosen't switch as member ?
RANKSHANK replied to 0xC6607Eo1's topic in Modder Support
switch the modifier from static to public static