From 6a25667b2098a6d275727aef0212462b712694a5 Mon Sep 17 00:00:00 2001 From: aidancbrady Date: Sun, 10 May 2015 19:33:28 -0400 Subject: [PATCH] Added property to prevent world damage by flamethrowers & lasers --- src/main/java/mekanism/api/MekanismConfig.java | 1 + src/main/java/mekanism/common/CommonProxy.java | 1 + src/main/java/mekanism/common/LaserManager.java | 5 +++++ src/main/java/mekanism/common/entity/EntityFlame.java | 8 ++++---- .../java/mekanism/common/network/PacketConfigSync.java | 2 ++ 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/main/java/mekanism/api/MekanismConfig.java b/src/main/java/mekanism/api/MekanismConfig.java index a155231be..6bcae0ebb 100644 --- a/src/main/java/mekanism/api/MekanismConfig.java +++ b/src/main/java/mekanism/api/MekanismConfig.java @@ -50,6 +50,7 @@ public class MekanismConfig public static boolean prefilledPortableTanks; public static double armoredJetpackDamageRatio; public static int armoredJetpackDamageMax; + public static boolean aestheticWorldDamage; } public static class client diff --git a/src/main/java/mekanism/common/CommonProxy.java b/src/main/java/mekanism/common/CommonProxy.java index aa45ae0c9..6d34ec33a 100644 --- a/src/main/java/mekanism/common/CommonProxy.java +++ b/src/main/java/mekanism/common/CommonProxy.java @@ -253,6 +253,7 @@ public class CommonProxy general.prefilledPortableTanks = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "PrefilledPortableTanks", true).getBoolean(); general.armoredJetpackDamageRatio = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ArmoredJetpackDamageRatio", 0.8).getDouble(); general.armoredJetpackDamageMax = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ArmoredJepackDamageMax", 115).getInt(); + general.aestheticWorldDamage = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "AestheticWorldDamage", true).getBoolean(); general.blacklistIC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistIC2Power", false).getBoolean(); general.blacklistRF = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistRFPower", false).getBoolean(); diff --git a/src/main/java/mekanism/common/LaserManager.java b/src/main/java/mekanism/common/LaserManager.java index c2c5144c7..2822e45bb 100644 --- a/src/main/java/mekanism/common/LaserManager.java +++ b/src/main/java/mekanism/common/LaserManager.java @@ -71,6 +71,11 @@ public class LaserManager public static List breakBlock(Coord4D blockCoord, boolean dropAtBlock, World world) { + if(!general.aestheticWorldDamage) + { + return null; + } + List ret = null; Block blockHit = blockCoord.getBlock(world); diff --git a/src/main/java/mekanism/common/entity/EntityFlame.java b/src/main/java/mekanism/common/entity/EntityFlame.java index 8e122c138..4cd7d6c4a 100644 --- a/src/main/java/mekanism/common/entity/EntityFlame.java +++ b/src/main/java/mekanism/common/entity/EntityFlame.java @@ -1,12 +1,14 @@ package mekanism.common.entity; +import io.netty.buffer.ByteBuf; + import java.util.List; import mekanism.api.Coord4D; +import mekanism.api.MekanismConfig.general; import mekanism.api.Pos3D; import mekanism.api.util.StackUtils; import mekanism.common.util.MekanismUtils; - import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; @@ -24,8 +26,6 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; -import io.netty.buffer.ByteBuf; - public class EntityFlame extends Entity implements IEntityAdditionalSpawnData { public static final int LIFESPAN = 80; @@ -184,7 +184,7 @@ public class EntityFlame extends Entity implements IEntityAdditionalSpawnData Coord4D sideCoord = new Coord4D(mop.blockX, mop.blockY, mop.blockZ, worldObj.provider.dimensionId).getFromSide(ForgeDirection.getOrientation(mop.sideHit)); - if(!fluid && (sideCoord.isAirBlock(worldObj) || sideCoord.isReplaceable(worldObj))) + if(general.aestheticWorldDamage && !fluid && (sideCoord.isAirBlock(worldObj) || sideCoord.isReplaceable(worldObj))) { if(!smeltBlock(new Coord4D(mop.blockX, mop.blockY, mop.blockZ))) { diff --git a/src/main/java/mekanism/common/network/PacketConfigSync.java b/src/main/java/mekanism/common/network/PacketConfigSync.java index e704a4249..723ab1e71 100644 --- a/src/main/java/mekanism/common/network/PacketConfigSync.java +++ b/src/main/java/mekanism/common/network/PacketConfigSync.java @@ -56,6 +56,7 @@ public class PacketConfigSync implements IMessageHandler