Cutting tool
This commit is contained in:
@@ -46,6 +46,7 @@ public final class RS {
|
||||
|
||||
e.getRegistry().register(new ItemSecurityCard());
|
||||
e.getRegistry().register(new ItemNetworkCard());
|
||||
e.getRegistry().register(new ItemCuttingTool());
|
||||
}
|
||||
|
||||
/* TODO
|
||||
|
@@ -39,7 +39,8 @@ public final class RSItems {
|
||||
public static final ItemFluidStoragePart FLUID_STORAGE_PART = new ItemFluidStoragePart();
|
||||
@ObjectHolder(RS.ID + ":security_card")
|
||||
public static final ItemSecurityCard SECURITY_CARD = null;
|
||||
public static final ItemCuttingTool CUTTING_TOOL = new ItemCuttingTool();
|
||||
@ObjectHolder(RS.ID + ":cutting_tool")
|
||||
public static final ItemCuttingTool CUTTING_TOOL = null;
|
||||
public static final ItemCover COVER = new ItemCover();
|
||||
public static final ItemHollowCover HOLLOW_COVER = new ItemHollowCover();
|
||||
public static final ItemWrench WRENCH = new ItemWrench();
|
||||
|
@@ -1,24 +1,18 @@
|
||||
package com.raoulvdberge.refinedstorage.item;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.item.info.ItemInfo;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemCuttingTool extends ItemBase {
|
||||
public class ItemCuttingTool extends Item {
|
||||
public ItemCuttingTool() {
|
||||
super(new ItemInfo(RS.ID, "cutting_tool"));
|
||||
super(new Item.Properties().group(RS.MAIN_GROUP).maxDamage(50 - 1));
|
||||
|
||||
//setMaxDamage(50 - 1);
|
||||
//setMaxStackSize(1);
|
||||
}
|
||||
/* TODO
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModels(IModelRegistration modelRegistration) {
|
||||
modelRegistration.setModel(this, 0, new ModelResourceLocation(info.getId(), "inventory"));
|
||||
this.setRegistryName(RS.ID, "cutting_tool");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isRepairable() {
|
||||
public boolean getIsRepairable(ItemStack a, ItemStack b) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -26,7 +20,7 @@ public class ItemCuttingTool extends ItemBase {
|
||||
public ItemStack getContainerItem(ItemStack stack) {
|
||||
ItemStack copy = stack.copy();
|
||||
|
||||
copy.setItemDamage(stack.getItemDamage() + 1);
|
||||
copy.setDamage(stack.getDamage() + 1);
|
||||
|
||||
return copy;
|
||||
}
|
||||
@@ -35,9 +29,4 @@ public class ItemCuttingTool extends ItemBase {
|
||||
public boolean hasContainerItem(ItemStack stack) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTranslationKey(ItemStack stack) {
|
||||
return getTranslationKey(); // Ignore damage
|
||||
}*/
|
||||
}
|
||||
|
@@ -16,6 +16,7 @@ import net.minecraft.util.text.Style;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.dimension.DimensionType;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
@@ -42,7 +43,7 @@ public class ItemNetworkCard extends Item {
|
||||
tag.putInt(NBT_RECEIVER_X, ctx.getPos().getX());
|
||||
tag.putInt(NBT_RECEIVER_Y, ctx.getPos().getY());
|
||||
tag.putInt(NBT_RECEIVER_Z, ctx.getPos().getZ());
|
||||
tag.putString(NBT_DIMENSION, ctx.getWorld().getDimension().getType().getRegistryName().toString());
|
||||
tag.putString(NBT_DIMENSION, DimensionType.getKey(ctx.getWorld().getDimension().getType()).toString());
|
||||
|
||||
ctx.getPlayer().getHeldItem(ctx.getHand()).setTag(tag);
|
||||
|
||||
@@ -72,7 +73,16 @@ public class ItemNetworkCard extends Item {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static ResourceLocation getDimension(ItemStack stack) {
|
||||
return (stack.hasTag() && stack.getTag().contains(NBT_DIMENSION)) ? ResourceLocation.tryCreate(stack.getTag().getString(NBT_DIMENSION)) : null;
|
||||
public static DimensionType getDimension(ItemStack stack) {
|
||||
if (stack.hasTag() && stack.getTag().contains(NBT_DIMENSION)) {
|
||||
ResourceLocation name = ResourceLocation.tryCreate(stack.getTag().getString(NBT_DIMENSION));
|
||||
if (name == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return DimensionType.byName(name);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@@ -273,7 +273,7 @@
|
||||
"item.refinedstorage:wrench": "Wrench",
|
||||
"item.refinedstorage.security_card": "Security Card",
|
||||
"item.refinedstorage.security_card.owner": "Bound to: %s",
|
||||
"item.refinedstorage:cutting_tool": "Cutting Tool",
|
||||
"item.refinedstorage.cutting_tool": "Cutting Tool",
|
||||
"item.refinedstorage:cover": "Cover",
|
||||
"item.refinedstorage:hollow_cover": "Hollow Cover",
|
||||
"item.refinedstorage.processor_binding": "Processor Binding",
|
||||
|
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"type": "forge:ore_shaped",
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"pattern": [
|
||||
" E",
|
||||
" S ",
|
||||
@@ -7,8 +7,7 @@
|
||||
],
|
||||
"key": {
|
||||
"S": {
|
||||
"type": "forge:ore_dict",
|
||||
"ore": "stickWood"
|
||||
"tag": "forge:rods/wooden"
|
||||
},
|
||||
"E": {
|
||||
"item": "refinedstorage:quartz_enriched_iron"
|
Reference in New Issue
Block a user