mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-14 01:04:16 +00:00
Black Hole Talisman QoL improvements.
This commit is contained in:
1 parent
48cd21a8d4
commit
db3b64db63
2 files changed
+18
-4
No files matched your search
@@ -21,6 +21,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -45,7 +46,8 @@ public final class ItemsRemainingRenderHandler {
|
||||
float alpha = ticks + partTicks > start ? 1F : (ticks + partTicks) / start;
|
||||
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
GL11.glColor4f(1F, 1F, 1F, alpha);
|
||||
|
||||
@@ -25,12 +25,14 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
import vazkii.botania.client.core.handler.ItemsRemainingRenderHandler;
|
||||
import vazkii.botania.client.core.helper.IconHelper;
|
||||
import vazkii.botania.common.core.helper.InventoryHelper;
|
||||
import vazkii.botania.common.core.helper.ItemNBTHelper;
|
||||
@@ -110,9 +112,12 @@ public class ItemBlackHoleTalisman extends ItemMod {
|
||||
int entities = par3World.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(par4 + dir.offsetX, par5 + dir.offsetY, par6 + dir.offsetZ, par4 + dir.offsetX + 1, par5 + dir.offsetY + 1, par6 + dir.offsetZ + 1)).size();
|
||||
|
||||
if(entities == 0) {
|
||||
int remove = remove(par1ItemStack, 1);
|
||||
int remove = par2EntityPlayer.capabilities.isCreativeMode ? 1 : remove(par1ItemStack, 1);
|
||||
if(remove > 0) {
|
||||
Item.getItemFromBlock(bBlock).onItemUse(new ItemStack(bBlock, 1, bmeta), par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
ItemStack stack = new ItemStack(bBlock, 1, bmeta);
|
||||
ItemsRemainingRenderHandler.set(stack, getBlockCount(par1ItemStack));
|
||||
|
||||
Item.getItemFromBlock(bBlock).onItemUse(stack, par2EntityPlayer, par3World, par4, par5, par6, par7, par8, par9, par10);
|
||||
set = true;
|
||||
}
|
||||
}
|
||||
@@ -180,6 +185,13 @@ public class ItemBlackHoleTalisman extends ItemMod {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack par1ItemStack) {
|
||||
Block block = getBlock(par1ItemStack);
|
||||
int meta = getBlockMeta(par1ItemStack);
|
||||
return super.getItemStackDisplayName(par1ItemStack) + (block == null ? "" : " (" + EnumChatFormatting.GREEN + new ItemStack(block, meta).getDisplayName() + EnumChatFormatting.RESET + ")");
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getContainerItem(ItemStack itemStack) {
|
||||
int count = getBlockCount(itemStack);
|
||||
@@ -240,7 +252,7 @@ public class ItemBlackHoleTalisman extends ItemMod {
|
||||
Block block = getBlock(par1ItemStack);
|
||||
if(block != null && block != Blocks.air) {
|
||||
int count = getBlockCount(par1ItemStack);
|
||||
par3List.add(StatCollector.translateToLocal(new ItemStack(block, 1, getBlockMeta(par1ItemStack)).getUnlocalizedName() + ".name") + " (x" + count + ")");
|
||||
par3List.add(count + " " + StatCollector.translateToLocal(new ItemStack(block, 1, getBlockMeta(par1ItemStack)).getUnlocalizedName() + ".name"));
|
||||
}
|
||||
|
||||
if(par1ItemStack.getItemDamage() == 1)
|
||||
|
||||
Reference in new issue
Block a user