mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-21 12:42:57 +00:00
adding the config options from the tinkered constructor fork (#73)
* config option for invulnerability of dropped tools and base EntityItem despawn time * config option to drop life canisters on death * Added config option for dagger damage multiplier when thrown, default = 3x * emulate vanilla behavior by default --------- Co-authored-by: Alex Ponebshek <[email protected]>
This commit is contained in:
1 parent
531e33765e
commit
3e2ba6ac16
8 files changed
+66
-18
No files matched your search
@@ -58,11 +58,11 @@ public class AbilityHelper {
|
||||
}
|
||||
|
||||
public static boolean onLeftClickEntity(ItemStack stack, EntityLivingBase player, Entity entity, ToolCore tool) {
|
||||
return onLeftClickEntity(stack, player, entity, tool, 0);
|
||||
return onLeftClickEntity(stack, player, entity, tool, 1);
|
||||
}
|
||||
|
||||
public static boolean onLeftClickEntity(ItemStack stack, EntityLivingBase player, Entity entity, ToolCore tool,
|
||||
int baseDamage) {
|
||||
double damageFactor) {
|
||||
if (entity != null && player != null && entity.canAttackWithItem() && stack.hasTagCompound()) {
|
||||
if (!entity.hitByEntity(player)) // can't attack this entity
|
||||
{
|
||||
@@ -75,8 +75,8 @@ public class AbilityHelper {
|
||||
|
||||
float stoneboundDamage = (float) Math.log(durability / 72f + 1) * -2 * stonebound;
|
||||
|
||||
int damage = calcDamage(player, entity, stack, tool, toolTags, baseDamage);
|
||||
float knockback = calcKnockback(player, entity, stack, tool, toolTags, baseDamage);
|
||||
int damage = calcDamage(player, entity, stack, tool, toolTags, damageFactor);
|
||||
float knockback = calcKnockback(player, entity, stack, tool, toolTags);
|
||||
|
||||
float enchantDamage = 0;
|
||||
|
||||
@@ -108,8 +108,7 @@ public class AbilityHelper {
|
||||
}
|
||||
|
||||
if (broken) {
|
||||
if (baseDamage > 0) damage = baseDamage;
|
||||
else damage = 1;
|
||||
damage = 1;
|
||||
}
|
||||
boolean causedDamage;
|
||||
boolean isAlive = entity.isEntityAlive();
|
||||
@@ -197,10 +196,10 @@ public class AbilityHelper {
|
||||
}
|
||||
|
||||
public static int calcDamage(Entity user, Entity entity, ItemStack stack, ToolCore tool, NBTTagCompound toolTags,
|
||||
int baseDamage) {
|
||||
double damageFactor) {
|
||||
EntityLivingBase living = user instanceof EntityLivingBase ? (EntityLivingBase) user : null;
|
||||
|
||||
int damage = toolTags.getInteger("Attack") + baseDamage;
|
||||
int damage = toolTags.getInteger("Attack");
|
||||
int earlyModDamage = 0;
|
||||
for (ActiveToolMod mod : TConstructRegistry.activeModifiers) {
|
||||
earlyModDamage = mod.baseAttackDamage(
|
||||
@@ -242,11 +241,13 @@ public class AbilityHelper {
|
||||
}
|
||||
damage += modDamage;
|
||||
|
||||
damage *= damageFactor;
|
||||
|
||||
return damage;
|
||||
}
|
||||
|
||||
public static float calcKnockback(Entity user, Entity entity, ItemStack stack, ToolCore tool,
|
||||
NBTTagCompound toolTags, int baseDamage) {
|
||||
NBTTagCompound toolTags) {
|
||||
if (user == null) return 0;
|
||||
float knockback = 0;
|
||||
|
||||
|
||||
Reference in new issue
Block a user