Forge Lite API An api to even further simplify forge's methods to creating minecraft mods aimed at new incoming modders who would like to create something with minimal knowledge or lazy coders that just want some convenient methods
ForgeLite.addSmelting(Item a, int amount, Item b/Block {
//Smelt item / block b to get amount of item a
}
ForgeLite.addChestLoot(ChestType type, Item item, int amount, ChestLootRarity/int rarity) {
Add amount of item to type of chest with the rarity of ChestLootRarity enum or the rarity int (1-100 %)
}
ForgeLite.addItem/addBlock(Item/block a, String name) {
registers item/block a and adds name to it
sets a's unlocalized name to camelcase ver of name IE "Test Block" becomes testBlock for the unlocalized name
}
Planning to add more methods for simplicity sake of creating guis and containers also planning on adding an easier method of creating dimensions
Forge Lite API An api to even further simplify forge's methods to creating minecraft mods aimed at new incoming modders who would like to create something with minimal knowledge or lazy coders that just want some convenient methods
ForgeLite.addSmelting(Item a, int amount, Item b/Block {
//Smelt item / block b to get amount of item a
}
ForgeLite.addChestLoot(ChestType type, Item item, int amount, ChestLootRarity/int rarity) {
Add amount of item to type of chest with the rarity of ChestLootRarity enum or the rarity int (1-100 %)
}
ForgeLite.addItem/addBlock(Item/block a, String name) {
registers item/block a and adds name to it
sets a's unlocalized name to camelcase ver of name IE "Test Block" becomes testBlock for the unlocalized name
}
Planning to add more methods for simplicity sake of creating guis and containers also planning on adding an easier method of creating dimensions
I understand what you're trying to do but I have some criticism and suggestions for your project.
I may be confused as to what your code is doing but the methods you're supplying seem to features in forge that are already rather easy to access. For example.
//inputID is the itemid (or blockid) for the thing going in.
//output is a stack that is being produced by the furnace.
//exp is the amount of experience points generated by smelting.
GameRegistry.addSmelting(int inputID, ItemStack output, float exp);
//item is an ItemStack that is being added to the chest
//rarity is the rate of how often it shows up.
//minimum is the min of how many show up in a stack.
//maximum is the maximum that can show up in a stack.
MinecraftForge.addDungeonLoot(new ItemStack(item), rarity,minimum,maximum);
There is also alternatively this hook that will allow you to change chest types.
As for your last method, I really don't feel that it's needed. You could argue that it's nice to have your whole item registered and set up with only one line of code and you're right it is nice but I don't think this in itself justifies a whole new dependency for. Also your method still uses the language registry and when looking at forge it's incredibly outdated due the the fact that forge can load strings from language files stored in the assets using the unlocalized names.
Also looking into your source I saw this method that you didn't mention here.
public static void addGrassSeed(Item item, int amount, int rarity) {
MinecraftForge.addGrassSeed(new ItemStack(item, amount), rarity);
}
I don't think I need to point out how redundant this method is since forge already has it's own version that your code is taking advantage of.
One of the common trends I have seen with your methods is that they all make the creation of an ItemStack more simplified. If that's one of the intentions behind the project you may want to look into making something like this instead.
public static ItemStack constructStack(int itemID, int amount, int meta) {
return new ItemStack(itemID, amount, meta);
}
However I personally feel like that would be a bit redundant as well.
Now for the suggestions
I think it may be best to move the project to a repo provider such as github or bitbucket. Using some form of repo will allow you to host all your code in one online space and will also allow other developers to look at your code, make suggestions and actually help you develop the mod.
Over all I think what your doing is great but you way want to work on adding in some less redundant, possibly more complex things. Such as utilities that will help read/write from nbt. Or possibly something to go along with the resource system.
Yes i'm aware that it is redundant and for good reason as well, some friends of mine wanted me to teach them making mods as easy as I could without real java knowledge (god only knows why) and I felt it was easier if all of our method calling could be local to one place so obviously for purpose of releasing on here I could just remove these methods, but I don't think it is too big a deal. Now as for complexity and more useful pieces of API as far as forge is concerned I am currently working on a quite easy way to make dimensions and add resources to the player such as a mana bar or another resource of that nature. I just wanted to make a quick release on here to judge whether or not the community would like to see something along the lines of a "ForgeLite". Your suggestion about NBT tags is pretty good I will have to look into that for the future thanks for that suggestion.
UPDATE V1.0.1
The ForgeLite.addItem and ForgeLite.addBlock were essentially the same method just different names so i condensed them into a method: ForgeLite.registerObject it takes an object and a string as parameters the string is the in game name and the camel case version of the string is the unlocalized name the object is of the type Item or Block right now. It will set the unlocalized name Give the object a name through LangReg and will register it through GameReg
UPDATE v1.1
-Added new Entity Loot System(LootTable.java)
Example usage:
private LootTable table;
*in construct of EntityZombie*
table = new LootTable();
table.addLoot(LootType.ITEM, Item.bow, 100);
table.addLoot(LootType.ITEM, Item.axeGold, 100);
table.addLoot(LootType.ITEM, Item.axeIron, 50);
*end code in constructor*
*OLD CODE*
protected int getDropItemId()
{
return Item.rottenFlesh.itemID:
}
*end old code*
*NEW CODE*
protected int getDropItemId()
{
table.dropLoot(LootType.ITEM);
return table.getItemDrop().itemID;
}
*end new code*
The method will now loop through your loot table of item or block based on the drop chance provided in the addLoot method of the loot table
An api to even further simplify forge's methods to creating minecraft mods aimed at new incoming modders who would like to create something with minimal knowledge or lazy coders that just want some convenient methods
Download - https://dl.dropboxus...3/forgelite.rar
Methods Added
Planning to add more methods for simplicity sake of creating guis and containers
also planning on adding an easier method of creating dimensions
-
View User Profile
-
View Posts
-
Send Message
Retired StaffI understand what you're trying to do but I have some criticism and suggestions for your project.
I may be confused as to what your code is doing but the methods you're supplying seem to features in forge that are already rather easy to access. For example.
There is also alternatively this hook that will allow you to change chest types.
As for your last method, I really don't feel that it's needed. You could argue that it's nice to have your whole item registered and set up with only one line of code and you're right it is nice but I don't think this in itself justifies a whole new dependency for. Also your method still uses the language registry and when looking at forge it's incredibly outdated due the the fact that forge can load strings from language files stored in the assets using the unlocalized names.
Also looking into your source I saw this method that you didn't mention here.
public static void addGrassSeed(Item item, int amount, int rarity) { MinecraftForge.addGrassSeed(new ItemStack(item, amount), rarity); }I don't think I need to point out how redundant this method is since forge already has it's own version that your code is taking advantage of.
One of the common trends I have seen with your methods is that they all make the creation of an ItemStack more simplified. If that's one of the intentions behind the project you may want to look into making something like this instead.
public static ItemStack constructStack(int itemID, int amount, int meta) { return new ItemStack(itemID, amount, meta); }However I personally feel like that would be a bit redundant as well.
Now for the suggestions
I think it may be best to move the project to a repo provider such as github or bitbucket. Using some form of repo will allow you to host all your code in one online space and will also allow other developers to look at your code, make suggestions and actually help you develop the mod.
Over all I think what your doing is great but you way want to work on adding in some less redundant, possibly more complex things. Such as utilities that will help read/write from nbt. Or possibly something to go along with the resource system.
The ForgeLite.addItem and ForgeLite.addBlock were essentially the same method just different names so i condensed them into a method: ForgeLite.registerObject it takes an object and a string as parameters the string is the in game name and the camel case version of the string is the unlocalized name the object is of the type Item or Block right now. It will set the unlocalized name Give the object a name through LangReg and will register it through GameReg
UPDATE v1.1
-Added new Entity Loot System(LootTable.java)
Example usage:
private LootTable table; *in construct of EntityZombie* table = new LootTable(); table.addLoot(LootType.ITEM, Item.bow, 100); table.addLoot(LootType.ITEM, Item.axeGold, 100); table.addLoot(LootType.ITEM, Item.axeIron, 50); *end code in constructor* *OLD CODE* protected int getDropItemId() { return Item.rottenFlesh.itemID: } *end old code* *NEW CODE* protected int getDropItemId() { table.dropLoot(LootType.ITEM); return table.getItemDrop().itemID; } *end new code*The method will now loop through your loot table of item or block based on the drop chance provided in the addLoot method of the loot table