mirror of
https://github.com/GTNewHorizons/StorageDrawers.git
synced 2026-11-19 11:59:19 +00:00
Add in quantify key
This commit is contained in:
1 parent
a9cbf8806e
commit
7027303cc8
3 files changed
+60
No files matched your search
+12
@@ -0,0 +1,12 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.api.storage.attribute;
|
||||
|
||||
public interface IQuantifiable {
|
||||
|
||||
/**
|
||||
* Gets whether the drawer has the quantifiable attribute. The quantifiable attribute instructs the drawer to render
|
||||
* the quantity of the item contained in the drawer.
|
||||
*/
|
||||
boolean isQuantified();
|
||||
|
||||
boolean setIsQuantified(boolean state);
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.core.ModCreativeTabs;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemQuantifyKey extends Item {
|
||||
|
||||
public ItemQuantifyKey(String name) {
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(ModCreativeTabs.tabStorageDrawers);
|
||||
setTextureName(StorageDrawers.MOD_ID + ":drawer_key_quantify");
|
||||
setMaxDamage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean par4) {
|
||||
String name = getUnlocalizedName(itemStack);
|
||||
list.add(StatCollector.translateToLocalFormatted(name + ".description"));
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isFull3D() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap getAttributeModifiers(ItemStack item) {
|
||||
Multimap multimap = super.getAttributeModifiers(item);
|
||||
multimap.put(
|
||||
SharedMonsterAttributes.attackDamage.getAttributeUnlocalizedName(),
|
||||
new AttributeModifier(field_111210_e, "Weapon modifier", (double) 2, 0));
|
||||
return multimap;
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 333 B |
Reference in new issue
Block a user