Move configs to one class

This commit is contained in:
modmuss50 2019-08-12 17:57:00 +01:00
parent 9db1978410
commit 77eee6f5b4
76 changed files with 731 additions and 5583 deletions

View file

@ -48,10 +48,8 @@ import net.minecraft.world.World;
import reborncore.api.ToolManager;
import reborncore.api.power.EnergyBlockEntity;
import reborncore.common.blocks.BlockWrenchEventHandler;
import reborncore.common.registration.RebornRegister;
import reborncore.common.registration.config.ConfigRegistry;
import reborncore.common.util.WrenchUtils;
import techreborn.TechReborn;
import techreborn.config.TechRebornConfig;
import techreborn.init.ModSounds;
import techreborn.init.TRContent;
import techreborn.blockentity.cable.CableBlockEntity;
@ -62,7 +60,6 @@ import javax.annotation.Nullable;
/**
* Created by modmuss50 on 19/05/2017.
*/
@RebornRegister(TechReborn.MOD_ID)
public class BlockCable extends BlockWithEntity {
public static final BooleanProperty EAST = BooleanProperty.of("east");
@ -72,15 +69,6 @@ public class BlockCable extends BlockWithEntity {
public static final BooleanProperty UP = BooleanProperty.of("up");
public static final BooleanProperty DOWN = BooleanProperty.of("down");
@ConfigRegistry(config = "misc", category = "cable", key = "uninsulatedElectrocutionDamage", comment = "When true an uninsulated cable will cause damage to entities")
public static boolean uninsulatedElectrocutionDamage = true;
@ConfigRegistry(config = "misc", category = "cable", key = "uninsulatedElectrocutionSound", comment = "When true an uninsulated cable will create a spark sound when an entity touches it")
public static boolean uninsulatedElectrocutionSound = true;
@ConfigRegistry(config = "misc", category = "cable", key = "uninsulatedElectrocutionParticles", comment = "When true an uninsulated cable will create a spark when an entity touches it")
public static boolean uninsulatedElectrocutionParticles = true;
public final TRContent.Cables type;
public BlockCable(TRContent.Cables type) {
@ -216,17 +204,17 @@ public class BlockCable extends BlockWithEntity {
return;
}
if (uninsulatedElectrocutionDamage) {
if (TechRebornConfig.uninsulatedElectrocutionDamage) {
if (type == TRContent.Cables.HV) {
entityIn.setOnFireFor(1);
}
entityIn.damage(new ElectrialShockSource(), 1F);
}
if (uninsulatedElectrocutionSound) {
if (TechRebornConfig.uninsulatedElectrocutionSound) {
worldIn.playSound(null, entityIn.x, entityIn.y, entityIn.z, ModSounds.CABLE_SHOCK, SoundCategory.BLOCKS,
0.6F, 1F);
}
if (uninsulatedElectrocutionParticles) {
if (TechRebornConfig.uninsulatedElectrocutionParticles) {
worldIn.addParticle(ParticleTypes.CRIT, entityIn.x, entityIn.y, entityIn.z, 0, 0, 0);
}
}

View file

@ -40,6 +40,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.explosion.Explosion;
import reborncore.common.BaseBlock;
import techreborn.config.TechRebornConfig;
import techreborn.entities.EntityNukePrimed;
/**
@ -68,7 +69,7 @@ public class BlockNuke extends BaseBlock {
if (!worldIn.isClient) {
EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F),
(double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), explosionIn.getCausingEntity());
entitynukeprimed.setFuse(worldIn.random.nextInt(EntityNukePrimed.fuseTime / 4) + EntityNukePrimed.fuseTime / 8);
entitynukeprimed.setFuse(worldIn.random.nextInt(TechRebornConfig.nukeFuseTime / 4) + TechRebornConfig.nukeFuseTime / 8);
worldIn.spawnEntity(entitynukeprimed);
}
}