mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 11:59:26 +00:00
Staff Charging Fix
This commit is contained in:
1 parent
fed82bc932
commit
38df157c40
2 files changed
+22
No files matched your search
@@ -91,6 +91,19 @@ public class ItemStaff extends ItemNpcInterface implements IProjectileCallback {
|
||||
|
||||
int chargeTime = 20 + material.getHarvestLevel() * 8;
|
||||
|
||||
// Keep a fully-charged orb alive while the player is still holding
|
||||
if (tick > chargeTime && stack.stackTagCompound != null) {
|
||||
Entity existing = ((WorldServer) player.worldObj)
|
||||
.getEntityByID(stack.stackTagCompound.getInteger("MagicProjectile"));
|
||||
if (existing instanceof EntityAbilityOrb) {
|
||||
EntityAbilityOrb orb = (EntityAbilityOrb) existing;
|
||||
if (orb.isCharging()) {
|
||||
orb.resetChargeTick();
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (tick == chargeTime) {
|
||||
|
||||
if (!player.capabilities.isCreativeMode && !hasInfinite(stack)) {
|
||||
|
||||
Reference in new issue
Block a user