Added property to prevent world damage by flamethrowers & lasers

This commit is contained in:
aidancbrady 2015-05-10 19:33:28 -04:00
parent 909e80ff77
commit 6a25667b20
5 changed files with 13 additions and 4 deletions

View file

@ -50,6 +50,7 @@ public class MekanismConfig
public static boolean prefilledPortableTanks; public static boolean prefilledPortableTanks;
public static double armoredJetpackDamageRatio; public static double armoredJetpackDamageRatio;
public static int armoredJetpackDamageMax; public static int armoredJetpackDamageMax;
public static boolean aestheticWorldDamage;
} }
public static class client public static class client

View file

@ -253,6 +253,7 @@ public class CommonProxy
general.prefilledPortableTanks = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "PrefilledPortableTanks", true).getBoolean(); general.prefilledPortableTanks = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "PrefilledPortableTanks", true).getBoolean();
general.armoredJetpackDamageRatio = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ArmoredJetpackDamageRatio", 0.8).getDouble(); general.armoredJetpackDamageRatio = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ArmoredJetpackDamageRatio", 0.8).getDouble();
general.armoredJetpackDamageMax = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "ArmoredJepackDamageMax", 115).getInt(); 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.blacklistIC2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistIC2Power", false).getBoolean();
general.blacklistRF = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistRFPower", false).getBoolean(); general.blacklistRF = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "BlacklistRFPower", false).getBoolean();

View file

@ -71,6 +71,11 @@ public class LaserManager
public static List<ItemStack> breakBlock(Coord4D blockCoord, boolean dropAtBlock, World world) public static List<ItemStack> breakBlock(Coord4D blockCoord, boolean dropAtBlock, World world)
{ {
if(!general.aestheticWorldDamage)
{
return null;
}
List<ItemStack> ret = null; List<ItemStack> ret = null;
Block blockHit = blockCoord.getBlock(world); Block blockHit = blockCoord.getBlock(world);

View file

@ -1,12 +1,14 @@
package mekanism.common.entity; package mekanism.common.entity;
import io.netty.buffer.ByteBuf;
import java.util.List; import java.util.List;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
import mekanism.api.MekanismConfig.general;
import mekanism.api.Pos3D; import mekanism.api.Pos3D;
import mekanism.api.util.StackUtils; import mekanism.api.util.StackUtils;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
@ -24,8 +26,6 @@ import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
import io.netty.buffer.ByteBuf;
public class EntityFlame extends Entity implements IEntityAdditionalSpawnData public class EntityFlame extends Entity implements IEntityAdditionalSpawnData
{ {
public static final int LIFESPAN = 80; 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)); 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))) if(!smeltBlock(new Coord4D(mop.blockX, mop.blockY, mop.blockZ)))
{ {

View file

@ -56,6 +56,7 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
dataStream.writeBoolean(general.blacklistRF); dataStream.writeBoolean(general.blacklistRF);
dataStream.writeDouble(general.armoredJetpackDamageRatio); dataStream.writeDouble(general.armoredJetpackDamageRatio);
dataStream.writeInt(general.armoredJetpackDamageMax); dataStream.writeInt(general.armoredJetpackDamageMax);
dataStream.writeBoolean(general.aestheticWorldDamage);
for(MachineType type : MachineType.getValidMachines()) for(MachineType type : MachineType.getValidMachines())
{ {
@ -127,6 +128,7 @@ public class PacketConfigSync implements IMessageHandler<ConfigSyncMessage, IMes
general.blacklistRF = dataStream.readBoolean(); general.blacklistRF = dataStream.readBoolean();
general.armoredJetpackDamageRatio = dataStream.readDouble(); general.armoredJetpackDamageRatio = dataStream.readDouble();
general.armoredJetpackDamageMax = dataStream.readInt(); general.armoredJetpackDamageMax = dataStream.readInt();
general.aestheticWorldDamage = dataStream.readBoolean();
for(MachineType type : MachineType.getValidMachines()) for(MachineType type : MachineType.getValidMachines())
{ {