A few tweaks and fixes for flamecatcher
This commit is contained in:
@@ -21,6 +21,7 @@ import net.minecraft.client.renderer.GlStateManager;
|
|||||||
import net.minecraft.client.renderer.Tessellator;
|
import net.minecraft.client.renderer.Tessellator;
|
||||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||||
import net.minecraft.entity.EntityLiving;
|
import net.minecraft.entity.EntityLiving;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.tileentity.TileEntityDispenser;
|
import net.minecraft.tileentity.TileEntityDispenser;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
@@ -165,21 +166,24 @@ public final class WizardryClientEventHandler {
|
|||||||
public static void onFOVUpdateEvent(FOVUpdateEvent event){
|
public static void onFOVUpdateEvent(FOVUpdateEvent event){
|
||||||
|
|
||||||
// Bow zoom. Taken directly from AbstractClientPlayer so it works exactly like vanilla.
|
// Bow zoom. Taken directly from AbstractClientPlayer so it works exactly like vanilla.
|
||||||
if(event.getEntity().isHandActive() &&
|
if(event.getEntity().isHandActive()){
|
||||||
(event.getEntity().getActiveItemStack().getItem() instanceof ItemSpectralBow
|
|
||||||
|| event.getEntity().getActiveItemStack().getItem() instanceof ItemFlamecatcher)){
|
|
||||||
|
|
||||||
int maxUseTicks = event.getEntity().getItemInUseMaxCount();
|
Item item = event.getEntity().getActiveItemStack().getItem();
|
||||||
|
|
||||||
float maxUseSeconds = (float)maxUseTicks / 20.0F;
|
if(item instanceof ItemSpectralBow || item instanceof ItemFlamecatcher){
|
||||||
|
|
||||||
if(maxUseSeconds > 1.0F){
|
int maxUseTicks = event.getEntity().getItemInUseMaxCount();
|
||||||
maxUseSeconds = 1.0F;
|
|
||||||
}else{
|
float maxUseSeconds = (float)maxUseTicks / (item instanceof ItemFlamecatcher ? ItemFlamecatcher.DRAW_TIME : 20);
|
||||||
maxUseSeconds = maxUseSeconds * maxUseSeconds;
|
|
||||||
|
if(maxUseSeconds > 1.0F){
|
||||||
|
maxUseSeconds = 1.0F;
|
||||||
|
}else{
|
||||||
|
maxUseSeconds = maxUseSeconds * maxUseSeconds;
|
||||||
|
}
|
||||||
|
|
||||||
|
event.setNewfov(event.getFov() * 1.0F - maxUseSeconds * 0.15F);
|
||||||
}
|
}
|
||||||
|
|
||||||
event.setNewfov(event.getFov() * 1.0F - maxUseSeconds * 0.15F);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import javax.annotation.Nullable;
|
|||||||
|
|
||||||
public class ItemFlamecatcher extends ItemBow implements IConjuredItem {
|
public class ItemFlamecatcher extends ItemBow implements IConjuredItem {
|
||||||
|
|
||||||
private static final float DRAW_TIME = 10;
|
public static final float DRAW_TIME = 10;
|
||||||
|
|
||||||
public ItemFlamecatcher(){
|
public ItemFlamecatcher(){
|
||||||
super();
|
super();
|
||||||
@@ -188,8 +188,8 @@ public class ItemFlamecatcher extends ItemBow implements IConjuredItem {
|
|||||||
if(charge < 0) return;
|
if(charge < 0) return;
|
||||||
|
|
||||||
if(stack.getTagCompound() != null){
|
if(stack.getTagCompound() != null){
|
||||||
int shotsLeft = stack.getTagCompound().getInteger(Flamecatcher.SHOTS_REMAINING_NBT_KEY);
|
int shotsLeft = stack.getTagCompound().getInteger(Flamecatcher.SHOTS_REMAINING_NBT_KEY) - 1;
|
||||||
stack.getTagCompound().setInteger(Flamecatcher.SHOTS_REMAINING_NBT_KEY, shotsLeft - 1);
|
stack.getTagCompound().setInteger(Flamecatcher.SHOTS_REMAINING_NBT_KEY, shotsLeft);
|
||||||
if(shotsLeft == 0 && !world.isRemote){
|
if(shotsLeft == 0 && !world.isRemote){
|
||||||
stack.setItemDamage(getMaxDamage(stack) - getAnimationFrames());
|
stack.setItemDamage(getMaxDamage(stack) - getAnimationFrames());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
"chargeup": 20,
|
"chargeup": 20,
|
||||||
"cooldown": 150,
|
"cooldown": 150,
|
||||||
"base_properties": {
|
"base_properties": {
|
||||||
"item_lifetime": 600,
|
"item_lifetime": 900,
|
||||||
"range": 40,
|
"range": 40,
|
||||||
"shot_count": 5,
|
"shot_count": 5,
|
||||||
"damage": 16,
|
"damage": 16,
|
||||||
|
|||||||
Reference in New Issue
Block a user