Skip to content

Conversation

tommy1019
Copy link

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant