Uninsulated cable Sound/Particle/Damage configs

This commit is contained in:
TheDoctorSoda 2016-03-07 21:46:29 -08:00
parent 29c43ddd99
commit 60ae28ad49
2 changed files with 31 additions and 4 deletions

View file

@ -77,9 +77,13 @@ public class ConfigTechReborn {
public static boolean TinIngotsLoot;
public static boolean CopperIngotsLoot;
public static boolean SteelIngotsLoot;
public static boolean UninsulatedElectocutionSound;
public static boolean UninsulatedElectocutionParticle;
public static boolean UninsulatedElectocutionDamage;
// Power
public static int ThermalGenertaorOutput;
public static int CentrifugeInputTick;
@ -677,6 +681,22 @@ public class ConfigTechReborn {
oreUnifer = config.get(CATEGORY_INTEGRATION, "OreUnifer", false, "change all ores int TechReborn Ores")
.getBoolean(false);
UninsulatedElectocutionDamage = config
.get(CATEGORY_WORLD, "Uninsulated Electocution Damage", true, "Damage entities on contact with uninsulated cables")
.getBoolean(true);
UninsulatedElectocutionSound = config
.get(CATEGORY_WORLD, "Uninsulated Electocution Sound", true, "Play sound on contact with uninsulated cables")
.getBoolean(true);
UninsulatedElectocutionParticle = config
.get(CATEGORY_WORLD, "Uninsulated Electocution Particle", true, "Spawn particles on contact with uninsulated cables")
.getBoolean(true);
ExpensiveWatermill = config
.get(CATEGORY_CRAFTING, "Expensive Watermill", true, "Allow TechReborn to change the Watermill recipe")
.getBoolean(true);
// Integration
AllowBOPRecipes = config.get(CATEGORY_INTEGRATION, "Allow Bop Recipes", true, "Add BOP suport")
.getBoolean(true);

View file

@ -25,6 +25,7 @@ import net.minecraftforge.common.property.Properties;
import reborncore.api.power.IEnergyInterfaceTile;
import reborncore.common.misc.Functions;
import reborncore.common.misc.vecmath.Vecs3dCube;
import techreborn.config.ConfigTechReborn;
import techreborn.parts.walia.IPartWaliaProvider;
import techreborn.power.TRPowerNet;
import techreborn.utils.damageSources.ElectrialShockSource;
@ -307,9 +308,15 @@ public abstract class CableMultipart extends Multipart implements IOccludingPart
@Override
public void onEntityCollided(Entity entity) {
if (getCableType().canKill && entity instanceof EntityLivingBase) {
entity.attackEntityFrom(new ElectrialShockSource(), 1F);
getWorld().playSoundAtEntity(entity, "techreborn:cable_shock", 0.6F, 1F);
getWorld().spawnParticle(EnumParticleTypes.CRIT, entity.posX, entity.posY, entity.posZ, 0, 0, 0);
if(ConfigTechReborn.UninsulatedElectocutionDamage){
entity.attackEntityFrom(new ElectrialShockSource(), 1F);
}
if(ConfigTechReborn.UninsulatedElectocutionSound){
getWorld().playSoundAtEntity(entity, "techreborn:cable_shock", 0.6F, 1F);
}
if(ConfigTechReborn.UninsulatedElectocutionParticle){
getWorld().spawnParticle(EnumParticleTypes.CRIT, entity.posX, entity.posY, entity.posZ, 0, 0, 0);
}
}
}