Skip to content
Permalink
Browse files

Actually added missing size + weight to sticks and bump version

  • Loading branch information
alcatrazEscapee committed Sep 15, 2019
1 parent d1e70c6 commit a6a94e11b723836be4de422a1918201f59a2f926
Showing with 13 additions and 1 deletion.
  1. +1 −1 build.gradle
  2. +12 −0 src/main/java/net/dries007/tfc/api/capability/ItemStickCapability.java
@@ -50,7 +50,7 @@ file "build.properties" withReader {
* The version number is a sacred tool that a computer must understand and be able to compare to see what's what.
* `-SNAPSHOT` or `.rc0v14s4dffds2` communicates nothing useful.
*/
version = "0.23.7" // To be clear, you can edit this if you are submitting a patch PR, or if you are merging a feature into master.
version = "0.23.8" // To be clear, you can edit this if you are submitting a patch PR, or if you are merging a feature into master.
if (System.getenv().BUILD_NUMBER != null) version += "." + System.getenv().BUILD_NUMBER

group = "net.dries007.tfc" // According to java standards, as I have control over this domain. If you fork this and release your own version, change this.
@@ -12,17 +12,23 @@
import net.minecraft.client.resources.I18n;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;

import net.dries007.tfc.api.capability.heat.ItemHeatHandler;
import net.dries007.tfc.api.capability.size.CapabilityItemSize;
import net.dries007.tfc.api.capability.size.IItemSize;
import net.dries007.tfc.api.capability.size.Size;
import net.dries007.tfc.api.capability.size.Weight;

import static net.dries007.tfc.api.util.TFCConstants.MOD_ID;

/**
* Custom heat + size capability for stick items.
*/
public class ItemStickCapability extends ItemHeatHandler implements IItemSize
{
public static final ResourceLocation KEY = new ResourceLocation(MOD_ID, "stick");
@@ -62,4 +68,10 @@ public Weight getWeight(@Nonnull ItemStack stack)
{
return Weight.LIGHT;
}

@Override
public boolean hasCapability(@Nonnull Capability<?> capability, @Nullable EnumFacing facing)
{
return capability == CapabilityItemSize.ITEM_SIZE_CAPABILITY || super.hasCapability(capability, facing);
}
}

0 comments on commit a6a94e1

Please sign in to comment.
You can’t perform that action at this time.