mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-13 17:04:24 +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 <alexbobp@gmail.com>
This commit is contained in:
1 parent
531e33765e
commit
3e2ba6ac16
8 files changed
+66
-18
No files matched your search
@@ -6,12 +6,16 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import tconstruct.util.config.PHConstruct;
|
||||
|
||||
public class FancyEntityItem extends EntityItem {
|
||||
|
||||
public FancyEntityItem(World par1World, double par2, double par4, double par6) {
|
||||
super(par1World, par2, par4, par6);
|
||||
this.isImmuneToFire = true;
|
||||
this.lifespan = 72000;
|
||||
if (PHConstruct.indestructible) {
|
||||
this.isImmuneToFire = true;
|
||||
this.lifespan = 72000;
|
||||
}
|
||||
}
|
||||
|
||||
public FancyEntityItem(World par1World, double par2, double par4, double par6, ItemStack par8ItemStack) {
|
||||
@@ -23,8 +27,10 @@ public class FancyEntityItem extends EntityItem {
|
||||
|
||||
public FancyEntityItem(World par1World) {
|
||||
super(par1World);
|
||||
this.isImmuneToFire = true;
|
||||
this.lifespan = 72000;
|
||||
if (PHConstruct.indestructible) {
|
||||
this.isImmuneToFire = true;
|
||||
this.lifespan = 72000;
|
||||
}
|
||||
}
|
||||
|
||||
public FancyEntityItem(World world, Entity original, ItemStack stack) {
|
||||
@@ -37,6 +43,11 @@ public class FancyEntityItem extends EntityItem {
|
||||
}
|
||||
|
||||
public boolean attackEntityFrom(DamageSource par1DamageSource, float par2) {
|
||||
return par1DamageSource.getDamageType().equals("outOfWorld");
|
||||
if (PHConstruct.indestructible) {
|
||||
if (par1DamageSource.getDamageType().equals("outOfWorld")) return true;
|
||||
return false;
|
||||
} else {
|
||||
return super.attackEntityFrom(par1DamageSource, par2);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user