Apply security card texture, fix crafter textures and add wireless fluid grid, small network / wireless transmitter GUI tweak

This commit is contained in:
raoulvdberge
2016-12-30 08:09:54 +01:00
parent 7248b40921
commit 556f2d8d67
18 changed files with 36 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import javax.annotation.Nullable;
@@ -23,6 +24,8 @@ public class ItemSecurityCard extends ItemBase {
super("security_card");
setMaxStackSize(1);
addPropertyOverride(new ResourceLocation("active"), (stack, world, entity) -> (entity != null && isValid(stack)) ? 1.0f : 0.0f);
}
@Override
@@ -66,6 +69,10 @@ public class ItemSecurityCard extends ItemBase {
stack.getTagCompound().setBoolean(String.format(NBT_PERMISSION, permission.getId()), state);
}
public static boolean isValid(ItemStack stack) {
return stack.hasTagCompound() && stack.getTagCompound().hasKey(NBT_OWNER);
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean advanced) {
super.addInformation(stack, player, tooltip, advanced);