mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-22 05:02:39 +00:00
Crossbow Modifier Graphics \o/
This commit is contained in:
1 parent
a7f7258b04
commit
62905da392
33 files changed
+27
-4
No files matched your search
@@ -2,6 +2,9 @@ package tconstruct.modifiers.tools;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import tconstruct.library.tools.ToolCore;
|
||||
@@ -23,6 +26,12 @@ public class ModFlux extends ModBoolean
|
||||
{
|
||||
NBTTagCompound tags = tool.getTagCompound().getCompoundTag("InfiTool");
|
||||
|
||||
// not on ammo weapons, since they don't have durability technically
|
||||
String[] traits = ((ToolCore)tool.getItem()).getTraits();
|
||||
for(String trait : traits)
|
||||
if("ammo".equals(trait))
|
||||
return false;
|
||||
|
||||
ItemStack foundBattery = null;
|
||||
// try to find the battery in the input
|
||||
for (ItemStack stack : input)
|
||||
|
||||
@@ -301,13 +301,15 @@ public class Crossbow extends ProjectileWeapon {
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack stack, int renderPass) {
|
||||
if(!animateLayer(renderPass))
|
||||
if(!animateLayer(renderPass) && renderPass < getPartAmount())
|
||||
return super.getIcon(stack, renderPass);
|
||||
|
||||
if(!stack.hasTagCompound())
|
||||
return super.getIcon(stack, renderPass);
|
||||
|
||||
NBTTagCompound tags = stack.getTagCompound().getCompoundTag("InfiTool");
|
||||
if(tags == null || renderPass > 10)
|
||||
return super.getIcon(stack, renderPass);
|
||||
|
||||
float progress;
|
||||
|
||||
@@ -318,10 +320,20 @@ public class Crossbow extends ProjectileWeapon {
|
||||
else
|
||||
progress = getWindupProgress(stack, getWindupTime(stack) - tags.getInteger("Reloading"));
|
||||
|
||||
// effects aren't animated
|
||||
// todo: make effects animated
|
||||
if(renderPass >= getPartAmount())
|
||||
// are we drawing an effect?
|
||||
if(renderPass >= getPartAmount()) {
|
||||
// is the effect animated?
|
||||
String effect = "Effect" + (1 + renderPass - getPartAmount());
|
||||
if(tags.hasKey(effect)) {
|
||||
int index = tags.getInteger(effect);
|
||||
if(animationEffectIcons.get(index) != null)
|
||||
return getCorrectAnimationIcon(animationEffectIcons, index, progress);
|
||||
else
|
||||
// non-animated
|
||||
return effectIcons.get(index);
|
||||
}
|
||||
return super.getIcon(stack, renderPass);
|
||||
}
|
||||
|
||||
// get the correct icon
|
||||
switch (renderPass)
|
||||
|
||||
Reference in new issue
Block a user