Imporved default ForgeResourcePackage#1
Open
tommy1019 wants to merge 1 commit intojmathison:masterfrom
tommy1019:master
Open
Imporved default ForgeResourcePackage#1tommy1019 wants to merge 1 commit intojmathison:masterfrom tommy1019:master
tommy1019 wants to merge 1 commit intojmathison:masterfrom
tommy1019:master
Conversation
Using this no JSON files are needed for Armor, Food, or Tools.
modified: src/main/java/com/idtech/block/QuickBlock.java
- Fixed: WOOD, STONE, IRON, DIAMOND constants
- Added: If itemDropped is set to null the block drops itself
- Changed: createModelJSON, createBlockStatesJSON, createItemJSON, to
protected so subclasses can override them.
new file: src/main/java/com/idtech/item/QuickArmor.java
Usage, in ItemMod create a new instance of QuickArmor:
public static QuickArmor armor;
In preInit() set it equal to a new QuickArmor:
armor = new QuickArmor(ArmorMaterial.IRON, EntityEquipmentSlot.HEAD,
"itemtexture", "skintexture");
And finally register client side renderers in init():
armor.registerRenderers();
The item texture used is "itemtexture.png" from the item texture folder.
The skin texture used is "skintexture_layer_1.png" and
"skintexture_layer_2.png" from the models/armor folder.
No JSON files needed.
To change the display name use the lang file as shown in gameplan.
new file: src/main/java/com/idtech/item/QuickFood.java
Usage, in ItemMod create a new instance of QuickFood:
public static QuickFood food;
In preInit() set it equal to a new QuickFood:
food = new QuickFood("texturename", foodAmount, saturationAmount, canAlwaysEat, isWolfFood);
And finally register client side renderers in init():
food.registerRenderers();
Optionally you can provide an onEat event in preInit() to be run when
the player eats the food.
food.onEat = new QuickFood.OnEatEvent() {
@OverRide
public void onEat() {
player.addPotionEffect(new PotionEffect(Potion.getPotionFromResourceLocation("speed"), 100, 2));
}
};
No JSON files needed.
new file: src/main/java/com/idtech/item/QuickTool.java
Usage, in ItemMod create a new instance of QuickTool:
public static QuickTool tool;
In preInit() set it equal to a new QuickTool:
tool = new QuickTool("texturename", ToolMaterial.DIAMOND, attackDamage, attackSpeed, ToolType.PICKAXE);
And finally register client side renderers in init():
tool.registerRenderers();
No JSON files needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Using this no JSON files are needed for Armor, Food, or Tools.
modified: src/main/java/com/idtech/block/QuickBlock.java
protected so subclasses can override them.
new file: src/main/java/com/idtech/item/QuickArmor.java
Usage, in ItemMod create a new instance of QuickArmor:
public static QuickArmor armor;
In preInit() set it equal to a new QuickArmor:
armor = new QuickArmor(ArmorMaterial.IRON, EntityEquipmentSlot.HEAD,
"itemtexture", "skintexture");
And finally register client side renderers in init():
armor.registerRenderers();
The item texture used is "itemtexture.png" from the item texture folder.
The skin texture used is "skintexture_layer_1.png" and
"skintexture_layer_2.png" from the models/armor folder.
No JSON files needed.
To change the display name use the lang file as shown in gameplan.
new file: src/main/java/com/idtech/item/QuickFood.java
Usage, in ItemMod create a new instance of QuickFood:
public static QuickFood food;
In preInit() set it equal to a new QuickFood:
food = new QuickFood("texturename", foodAmount, saturationAmount, canAlwaysEat, isWolfFood);
And finally register client side renderers in init():
food.registerRenderers();
Optionally you can provide an onEat event in preInit() to be run when
the player eats the food.
food.onEat = new QuickFood.OnEatEvent() {
@OverRide
public void onEat() {
player.addPotionEffect(new PotionEffect(Potion.getPotionFromResourceLocation("speed"), 100, 2));
}
};
No JSON files needed.
new file: src/main/java/com/idtech/item/QuickTool.java
Usage, in ItemMod create a new instance of QuickTool:
public static QuickTool tool;
In preInit() set it equal to a new QuickTool:
tool = new QuickTool("texturename", ToolMaterial.DIAMOND, attackDamage, attackSpeed, ToolType.PICKAXE);
And finally register client side renderers in init():
tool.registerRenderers();
No JSON files needed.