mirror of
https://github.com/GTNewHorizons/StorageDrawers.git
synced 2026-11-17 19:15:11 +00:00
Convert lock upgrade to reusable drawer key.
This commit is contained in:
1 parent
6208dc758d
commit
731f8699f2
5 files changed
+24
-22
No files matched your search
@@ -11,8 +11,8 @@ item.upgradeStatus.level1.name=Status Upgrade (I)
|
||||
item.upgradeStatus.level1.description=Shows full storage
|
||||
item.upgradeStatus.level2.name=Status Upgrade (II)
|
||||
item.upgradeStatus.level2.description=Shows fill level
|
||||
item.upgradeLock.name=Lock Upgrade
|
||||
item.upgradeLock.description=Keep associated items when empty
|
||||
item.upgradeLock.name=Drawer Key
|
||||
item.upgradeLock.description=Locks and unlocks drawers
|
||||
|
||||
# Blocks
|
||||
tile.fullDrawers1.oak.name=Oak Drawer
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 368 B |
@@ -222,25 +222,10 @@ public class BlockDrawers extends BlockContainer implements IExtendedBlockClickH
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (item.getItem() == ModItems.upgradeLock && !tileDrawers.isLocked()) {
|
||||
tileDrawers.setIsLocked(true);
|
||||
else if (item.getItem() == ModItems.upgradeLock) {
|
||||
tileDrawers.setIsLocked(!tileDrawers.isLocked());
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
|
||||
if (player != null && !player.capabilities.isCreativeMode) {
|
||||
if (--item.stackSize <= 0)
|
||||
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (item == null && player.isSneaking()) {
|
||||
if (tileDrawers.isLocked()) {
|
||||
tileDrawers.setIsLocked(false);
|
||||
if (player != null && !player.capabilities.isCreativeMode)
|
||||
dropBlockAsItem(world, x, y, z, new ItemStack(ModItems.upgradeLock));
|
||||
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,8 +78,8 @@ public class ModRecipes
|
||||
}
|
||||
|
||||
if (config.cache.enableLockUpgrades) {
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.upgradeLock), " y ", "xzx", "yxy",
|
||||
'x', Items.stick, 'y', Items.gold_nugget, 'z', ModItems.upgradeTemplate);
|
||||
GameRegistry.addRecipe(new ItemStack(ModItems.upgradeLock), "xy ", " y ", " z ",
|
||||
'x', Items.gold_nugget, 'y', Items.gold_ingot, 'z', ModItems.upgradeTemplate);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +1,13 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.item;
|
||||
|
||||
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;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
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;
|
||||
@@ -16,7 +20,7 @@ public class ItemUpgradeLock extends Item
|
||||
public ItemUpgradeLock (String name) {
|
||||
setUnlocalizedName(name);
|
||||
setCreativeTab(ModCreativeTabs.tabStorageDrawers);
|
||||
setTextureName(StorageDrawers.MOD_ID + ":upgrade_lock");
|
||||
setTextureName(StorageDrawers.MOD_ID + ":drawer_key");
|
||||
setMaxDamage(0);
|
||||
}
|
||||
|
||||
@@ -26,4 +30,17 @@ public class ItemUpgradeLock extends Item
|
||||
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)1, 0));
|
||||
return multimap;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user