Skip to content

Commit

Permalink
Merge pull request #179 from SpoilersMC/1.7.10
Browse files Browse the repository at this point in the history
Atomic Disassembler Config
  • Loading branch information
maggi373 authored Aug 18, 2024
2 parents f9d84cd + cd92d50 commit 5a9fa59
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
3 changes: 3 additions & 0 deletions src/main/java/mekanism/api/MekanismConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ public static class mekce {
public static boolean enablePersonalChestPocketAccess;
public static boolean accurateHeavyWaterCapture;
public static int heavyWaterChance;
public static int atomicDisassemblerPoweredDamage;
public static int atomicDisassemblerUnpoweredDamage;
public static int atomicDisassemblerAttackPowerCost;
}


Expand Down
5 changes: 4 additions & 1 deletion src/main/java/mekanism/common/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,10 @@ public void loadConfiguration()
mekce.digitalMinerMaxRadius = Mekanism.configurationce.get("mekce", "DigitalMinerMaxRadius", 32, "Select range from 1 to 64, we do not recommend going over 32", 1, 64).getInt();
mekce.enableSingleUseCardboxes = Mekanism.configurationce.get("mekce", "EnableSingleUseCardboxes", true, "This allows to force single use on cardboxes or not").getBoolean();
mekce.enablePersonalChestPocketAccess = Mekanism.configurationce.get("mekce", "enablePersonalChestPocketAccess", true, "This allows opening Personal Chests from your inventory without having to place them").getBoolean();

mekce.atomicDisassemblerPoweredDamage = Mekanism.configurationce.get("mekce", "atomicDisassemblerPoweredDamage", 20, "Attack Damage of a powered Atomic Disassembler. Default is 20").getInt();
mekce.atomicDisassemblerUnpoweredDamage = Mekanism.configurationce.get("mekce", "atomicDisassemblerUnpoweredDamage", 4, "Attack Damage of an unpowered Atomic Disassembler. Default is 4").getInt();
mekce.atomicDisassemblerAttackPowerCost = Mekanism.configurationce.get("mekce", "atomicDisassemblerAttackPowerCost", 2000, "Energy cost of attacking entities with the Atomic Disassembler. Default is 2000").getInt();

mekce.IC2SinkTier = Mekanism.configurationce.get("mekce", "IC2SinkTier", 4, "Tier level for machines, we recommend setting it to tier 2 for ic2 classic", 1, 4).getInt();
mekce.IC2SourceTier = Mekanism.configurationce.get("mekce", "IC2SourceTier", 4, "Tier level for generators, we recommend setting it to tier 2 for ic2 classic", 1, 4).getInt();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import mekanism.api.Coord4D;
import mekanism.api.EnumColor;
import mekanism.api.MekanismConfig.general;
import mekanism.api.MekanismConfig.mekce;
import mekanism.api.util.ListUtils;
import mekanism.common.util.LangUtils;
import mekanism.common.util.MekanismUtils;
Expand Down Expand Up @@ -59,11 +60,11 @@ public boolean hitEntity(ItemStack itemstack, EntityLivingBase hitEntity, Entity
{
if(getEnergy(itemstack) > 0)
{
hitEntity.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)player), 20);
setEnergy(itemstack, getEnergy(itemstack) - 2000);
hitEntity.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)player), mekce.atomicDisassemblerPoweredDamage);
setEnergy(itemstack, getEnergy(itemstack) - mekce.atomicDisassemblerAttackPowerCost);
}
else {
hitEntity.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)player), 4);
hitEntity.attackEntityFrom(DamageSource.causePlayerDamage((EntityPlayer)player), mekce.atomicDisassemblerUnpoweredDamage);
}

return false;
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/mekanism/common/network/PacketConfigSync.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ public void toBytes(ByteBuf dataStream)
dataStream.writeInt(mekce.digitalMinerMaxRadius);
dataStream.writeBoolean(mekce.enableSingleUseCardboxes);
dataStream.writeBoolean(mekce.enablePersonalChestPocketAccess);
dataStream.writeInt(mekce.atomicDisassemblerPoweredDamage);
dataStream.writeInt(mekce.atomicDisassemblerUnpoweredDamage);
dataStream.writeInt(mekce.atomicDisassemblerAttackPowerCost);

for(MachineType type : MachineType.getValidMachines())
{
Expand Down Expand Up @@ -211,6 +214,9 @@ public void toBytes(ByteBuf dataStream)
dataStream.writeBoolean(recipes.enableFlamethrower);
dataStream.writeBoolean(recipes.enableGaugeDropper);
dataStream.writeBoolean(recipes.enableTierInstaller);
mekce.atomicDisassemblerPoweredDamage = dataStream.readInt();
mekce.atomicDisassemblerUnpoweredDamage = dataStream.readInt();
mekce.atomicDisassemblerAttackPowerCost = dataStream.readInt();

Tier.writeConfig(dataStream);

Expand Down

0 comments on commit 5a9fa59

Please sign in to comment.