mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-22 03:43:30 +01:00
added infused tools for now
This commit is contained in:
parent
fae8a72892
commit
be83a96487
25 changed files with 275 additions and 36 deletions
|
@ -63,11 +63,6 @@ public class BlockAncientLeaves extends BlockLeaves implements
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ItemStack, ModelVariant> getModelLocations() {
|
||||
return Collections.singletonMap(new ItemStack(this), new ModelVariant(new ResourceLocation(NaturesAura.MOD_ID, this.getBaseName()), "inventory"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) {
|
||||
return Collections.singletonList(new ItemStack(this, 1, 0));
|
||||
|
|
|
@ -47,11 +47,6 @@ public class BlockAncientLog extends BlockLog implements IModItem, IModelProvide
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ItemStack, ModelVariant> getModelLocations() {
|
||||
return Collections.singletonMap(new ItemStack(this), new ModelVariant(new ResourceLocation(NaturesAura.MOD_ID, this.getBaseName()), "inventory"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return new BlockStateContainer(this, LOG_AXIS);
|
||||
|
|
|
@ -55,11 +55,6 @@ public class BlockAncientSapling extends BlockBush implements IGrowable, IModIte
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ItemStack, ModelVariant> getModelLocations() {
|
||||
return Collections.singletonMap(new ItemStack(this), new ModelVariant(new ResourceLocation(NaturesAura.MOD_ID, this.getBaseName()), "inventory"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return "ancient_sapling";
|
||||
|
|
|
@ -76,11 +76,6 @@ public class BlockContainerImpl extends BlockContainer implements IModItem, IMod
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ItemStack, ModelVariant> getModelLocations() {
|
||||
return Collections.singletonMap(new ItemStack(this), new ModelVariant(new ResourceLocation(NaturesAura.MOD_ID, this.getBaseName()), "inventory"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.MODEL;
|
||||
|
|
|
@ -67,11 +67,6 @@ public class BlockGoldenLeaves extends BlockLeaves implements
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ItemStack, ModelVariant> getModelLocations() {
|
||||
return Collections.singletonMap(new ItemStack(this), new ModelVariant(new ResourceLocation(NaturesAura.MOD_ID, this.getBaseName()), "inventory"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> onSheared(ItemStack item, IBlockAccess world, BlockPos pos, int fortune) {
|
||||
NonNullList<ItemStack> drops = NonNullList.create();
|
||||
|
|
|
@ -51,11 +51,6 @@ public class BlockImpl extends Block implements IModItem, IModelProvider {
|
|||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ItemStack, ModelVariant> getModelLocations() {
|
||||
return Collections.singletonMap(new ItemStack(this), new ModelVariant(new ResourceLocation(NaturesAura.MOD_ID, this.getBaseName()), "inventory"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Block setSoundType(SoundType sound) {
|
||||
return super.setSoundType(sound);
|
||||
|
|
|
@ -47,9 +47,4 @@ public class ItemImpl extends Item implements IModItem, IModelProvider {
|
|||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<ItemStack, ModelVariant> getModelLocations() {
|
||||
return Collections.singletonMap(new ItemStack(this), new ModelVariant(new ResourceLocation(NaturesAura.MOD_ID, this.getBaseName()), "inventory"));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import de.ellpeck.naturesaura.items.tools.*;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public final class ModItems {
|
||||
|
||||
|
@ -8,4 +13,12 @@ public final class ModItems {
|
|||
public static final Item GOLD_FIBER = new ItemGoldFiber();
|
||||
public static final Item GOLD_LEAF = new ItemImpl("gold_leaf");
|
||||
public static final Item INFUSED_IRON = new ItemImpl("infused_iron");
|
||||
|
||||
public static final Item.ToolMaterial TOOL_MATERIAL_INFUSED_IRON =
|
||||
EnumHelper.addToolMaterial(NaturesAura.MOD_ID.toUpperCase(Locale.ROOT) + "_INFUSED_IRON", 3, 300, 6.25F, 2.25F, 16);
|
||||
public static final Item INFUSED_PICKAXE = new ItemPickaxeNA("infused_iron_pickaxe", TOOL_MATERIAL_INFUSED_IRON);
|
||||
public static final Item INFUSED_AXE = new ItemAxeNA("infused_iron_axe", TOOL_MATERIAL_INFUSED_IRON, 8.25F, -3.2F);
|
||||
public static final Item INFUSED_SHOVEL = new ItemShovelNA("infused_iron_shovel", TOOL_MATERIAL_INFUSED_IRON);
|
||||
public static final Item INFUSED_HOE = new ItemHoeNA("infused_iron_hoe", TOOL_MATERIAL_INFUSED_IRON);
|
||||
public static final Item INFUSED_SWORD = new ItemSwordNA("infused_iron_sword", TOOL_MATERIAL_INFUSED_IRON);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package de.ellpeck.naturesaura.items.tools;
|
||||
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.item.ItemAxe;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
public class ItemAxeNA extends ItemAxe implements IModItem, IModelProvider {
|
||||
private final String baseName;
|
||||
|
||||
public ItemAxeNA(String baseName, ToolMaterial material, float damage, float speed) {
|
||||
super(material, damage, speed);
|
||||
this.baseName = baseName;
|
||||
ModRegistry.addItemOrBlock(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldAddCreative() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package de.ellpeck.naturesaura.items.tools;
|
||||
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.item.ItemHoe;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
public class ItemHoeNA extends ItemHoe implements IModItem, IModelProvider {
|
||||
|
||||
private final String baseName;
|
||||
|
||||
public ItemHoeNA(String baseName, ToolMaterial material) {
|
||||
super(material);
|
||||
this.baseName = baseName;
|
||||
ModRegistry.addItemOrBlock(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldAddCreative() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package de.ellpeck.naturesaura.items.tools;
|
||||
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.item.ItemPickaxe;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
public class ItemPickaxeNA extends ItemPickaxe implements IModItem, IModelProvider {
|
||||
private final String baseName;
|
||||
|
||||
public ItemPickaxeNA(String baseName, ToolMaterial material) {
|
||||
super(material);
|
||||
this.baseName = baseName;
|
||||
ModRegistry.addItemOrBlock(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldAddCreative() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
package de.ellpeck.naturesaura.items.tools;
|
||||
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.item.ItemSpade;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
public class ItemShovelNA extends ItemSpade implements IModItem, IModelProvider {
|
||||
private final String baseName;
|
||||
|
||||
public ItemShovelNA(String baseName, ToolMaterial material) {
|
||||
super(material);
|
||||
this.baseName = baseName;
|
||||
ModRegistry.addItemOrBlock(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldAddCreative() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
}
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package de.ellpeck.naturesaura.items.tools;
|
||||
|
||||
import de.ellpeck.naturesaura.reg.IModItem;
|
||||
import de.ellpeck.naturesaura.reg.IModelProvider;
|
||||
import de.ellpeck.naturesaura.reg.ModRegistry;
|
||||
import net.minecraft.item.ItemSword;
|
||||
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
|
||||
public class ItemSwordNA extends ItemSword implements IModItem, IModelProvider {
|
||||
private final String baseName;
|
||||
|
||||
public ItemSwordNA(String baseName, ToolMaterial material) {
|
||||
super(material);
|
||||
this.baseName = baseName;
|
||||
ModRegistry.addItemOrBlock(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getBaseName() {
|
||||
return this.baseName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldAddCreative() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPreInit(FMLPreInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onInit(FMLInitializationEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostInit(FMLPostInitializationEvent event) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,13 +1,21 @@
|
|||
package de.ellpeck.naturesaura.reg;
|
||||
|
||||
import de.ellpeck.naturesaura.NaturesAura;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IModelProvider {
|
||||
|
||||
Map<ItemStack, ModelVariant> getModelLocations();
|
||||
default Map<ItemStack, ModelVariant> getModelLocations() {
|
||||
ItemStack stack = this instanceof Item ? new ItemStack((Item) this) : new ItemStack((Block) this);
|
||||
String name = ((IModItem) this).getBaseName();
|
||||
return Collections.singletonMap(stack, new ModelVariant(new ResourceLocation(NaturesAura.MOD_ID, name), "inventory"));
|
||||
}
|
||||
|
||||
class ModelVariant {
|
||||
|
||||
|
|
|
@ -14,6 +14,11 @@ item.naturesaura.eye.name=Environmental Eye
|
|||
item.naturesaura.gold_fiber.name=Brilliant Fiber
|
||||
item.naturesaura.gold_leaf.name=Gold Leaf
|
||||
item.naturesaura.infused_iron.name=Infused Iron
|
||||
item.naturesaura.infused_iron_pickaxe.name=Botanist's Pickaxe
|
||||
item.naturesaura.infused_iron_axe.name=Botanist's Handaxe
|
||||
item.naturesaura.infused_iron_shovel.name=Botanist's Shovel
|
||||
item.naturesaura.infused_iron_sword.name=Botanist's Blade
|
||||
item.naturesaura.infused_iron_hoe.name=Botanist's Hoe
|
||||
|
||||
container.naturesaura.tree_ritual.name=Tree Infusion
|
||||
container.naturesaura.altar.name=Natural Altar
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/handheld",
|
||||
"textures": {
|
||||
"layer0": "naturesaura:items/infused_iron_axe"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/handheld",
|
||||
"textures": {
|
||||
"layer0": "naturesaura:items/infused_iron_hoe"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/handheld",
|
||||
"textures": {
|
||||
"layer0": "naturesaura:items/infused_iron_pickaxe"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/handheld",
|
||||
"textures": {
|
||||
"layer0": "naturesaura:items/infused_iron_shovel"
|
||||
}
|
||||
}
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/handheld",
|
||||
"textures": {
|
||||
"layer0": "naturesaura:items/infused_iron_sword"
|
||||
}
|
||||
}
|
Binary file not shown.
After Width: | Height: | Size: 505 B |
Binary file not shown.
After Width: | Height: | Size: 534 B |
Binary file not shown.
After Width: | Height: | Size: 534 B |
Binary file not shown.
After Width: | Height: | Size: 485 B |
Binary file not shown.
After Width: | Height: | Size: 596 B |
Loading…
Reference in a new issue