Skip to content

Commit

Permalink
Merge pull request #36 from DrParadox7/1.7.10-CommunityEdition
Browse files Browse the repository at this point in the history
A cleaner merge of my changes
  • Loading branch information
maggi373 authored Sep 13, 2022
2 parents 9d84815 + a8944e0 commit 6160b5b
Show file tree
Hide file tree
Showing 15 changed files with 51 additions and 20 deletions.
5 changes: 5 additions & 0 deletions src/main/java/mekanism/api/MekanismConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public static class general
public static int userWorldGenVersion = 0;
public static double ENERGY_PER_REDSTONE = 10000;
public static int ETHENE_BURN_TIME = 40;
public static int METHANE_BURN_TIME = 10;
public static double DISASSEMBLER_USAGE = 10;
public static EnergyType energyUnit = EnergyType.J;
public static TempType tempUnit = TempType.K;
Expand Down Expand Up @@ -87,6 +88,8 @@ public static class client
public static boolean enableAmbientLighting;
public static int ambientLightingLevel;
public static boolean opaqueTransmitters = false;
public static boolean doMultiblockSparkle = true;
public static int multiblockSparkleIntensity = 6;
}

public static class machines
Expand Down Expand Up @@ -140,6 +143,8 @@ public static class generators
public static double heatGeneration;
public static double heatGenerationLava;
public static double heatGenerationNether;
public static int heatGenerationFluidRate;
public static boolean heatGenEnable;
public static double solarGeneration;

public static double windGenerationMin;
Expand Down
16 changes: 10 additions & 6 deletions src/main/java/mekanism/client/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ public void loadConfiguration()
client.enableAmbientLighting = Mekanism.configuration.get("client", "EnableAmbientLighting", true).getBoolean();
client.ambientLightingLevel = Mekanism.configuration.get("client", "AmbientLightingLevel", 15).getInt();
client.opaqueTransmitters = Mekanism.configuration.get("client", "OpaqueTransmitterRender", false).getBoolean();
client.doMultiblockSparkle = Mekanism.configuration.get("client", "DoMultiblockSparkle", true).getBoolean();
client.multiblockSparkleIntensity = Mekanism.configuration.get("client", "MultiblockSparkleIntesity", 6).getInt();

if(Mekanism.configuration.hasChanged())
{
Expand Down Expand Up @@ -567,13 +569,15 @@ public void doGenericSparkle(TileEntity tileEntity, INodeChecker checker)
@Override
public void doMultiblockSparkle(final TileEntityMultiblock<?> tileEntity)
{
new SparkleAnimation(tileEntity, new INodeChecker() {
@Override
public boolean isNode(TileEntity tile)
{
if(client.doMultiblockSparkle == true){
new SparkleAnimation(tileEntity, new INodeChecker() {
@Override
public boolean isNode(TileEntity tile)
{
return MultiblockManager.areEqual(tile, tileEntity);
}
}).run();
}
}).run();
}
}

@Override
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/mekanism/client/SparkleAnimation.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import mekanism.api.Coord4D;
import mekanism.api.MekanismConfig.general;
import mekanism.api.MekanismConfig.client;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
Expand Down Expand Up @@ -46,10 +47,11 @@ public void run()
public void run()
{
World world = pointer.getWorldObj();
int count = client.multiblockSparkleIntensity;

for(Coord4D coord : iteratedNodes)
{
for(int i = 0; i < 6; i++)
for(int i = 0; i < count; i++)
{
world.spawnParticle("reddust", coord.xCoord + random.nextDouble(), coord.yCoord + -.01, coord.zCoord + random.nextDouble(), 0, 0, 0);
world.spawnParticle("reddust", coord.xCoord + random.nextDouble(), coord.yCoord + 1.01, coord.zCoord + random.nextDouble(), 0, 0, 0);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/mekanism/client/render/MekanismRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ public void onStitch(TextureStitchEvent.Pre event)
GasRegistry.getGas("tritium").setIcon(event.map.registerIcon("mekanism:liquid/LiquidTritium"));
GasRegistry.getGas("fusionFuelDT").setIcon(event.map.registerIcon("mekanism:liquid/LiquidDT"));
GasRegistry.getGas("lithium").setIcon(event.map.registerIcon("mekanism:liquid/LiquidLithium"));
GasRegistry.getGas("methane").setIcon(event.map.registerIcon("mekanism:liquid/LiquidMethane"));

for(Gas gas : GasRegistry.getRegisteredGasses())
{
Expand Down
1 change: 1 addition & 0 deletions src/main/java/mekanism/common/CommonProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ public void loadConfiguration()
general.TO_TE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "RFToJoules", 0.4D).getDouble();
general.FROM_H2 = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "HydrogenEnergyDensity", 200D, "Determines Electrolytic Separator usage").getDouble();
general.ETHENE_BURN_TIME = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EthyleneBurnTime", 40).getInt();
general.METHANE_BURN_TIME = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "MethaneBurnTime", 10).getInt();
general.ENERGY_PER_REDSTONE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "EnergyPerRedstone", 10000D).getDouble();
general.DISASSEMBLER_USAGE = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "DisassemblerEnergyUsage", 10).getInt();
general.VOICE_PORT = Mekanism.configuration.get(Configuration.CATEGORY_GENERAL, "VoicePort", 36123, null, 1, 65535).getInt();
Expand Down
1 change: 1 addition & 0 deletions src/main/java/mekanism/common/Mekanism.java
Original file line number Diff line number Diff line change
Expand Up @@ -1168,6 +1168,7 @@ else if(config.getAbsolutePath().contains("tekkit"))
GasRegistry.register(new Gas("tritium")).registerFluid();
GasRegistry.register(new Gas("fusionFuelDT")).registerFluid();
GasRegistry.register(new Gas("lithium")).registerFluid();
GasRegistry.register(new Gas("methane")).registerFluid();

FluidRegistry.registerFluid(new Fluid("heavyWater"));
FluidRegistry.registerFluid(new Fluid("steam").setGaseous(true));
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/mekanism/common/block/BlockCardboardBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,15 @@ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer e
data.block.onBlockPlacedBy(world, x, y, z, entityplayer, new ItemStack(data.block, 1, data.meta));
data.block.onPostBlockPlaced(world, x, y, z, data.meta);
}

// float motion = 0.7F;
// double motionX = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
// double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
// double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;

float motion = 0.7F;
double motionX = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
double motionY = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;
double motionZ = (world.rand.nextFloat() * motion) + (1.0F - motion) * 0.5D;

EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, itemStack);
// EntityItem entityItem = new EntityItem(world, x + motionX, y + motionY, z + motionZ, itemStack);

world.spawnEntityInWorld(entityItem);
// world.spawnEntityInWorld(entityItem);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ public static void init() {

if (OreDictionary.getOres("itemRubber").size() > 0) {
for (ItemStack ore : OreDictionary.getOres("woodRubber")) {
RecipeHandler.addPrecisionSawmillRecipe(StackUtils.size(ore, 1), new ItemStack(Blocks.planks, 4), StackUtils.size(OreDictionary.getOres("itemRubber").get(0), 1), 1F);
}
RecipeHandler.addPrecisionSawmillRecipe(StackUtils.size(ore, 1), new ItemStack(Blocks.planks, 4), StackUtils.size(OreDictionary.getOres("itemRawRubber").get(0), 2), 1F); }
}

for (ItemStack ore : OreDictionary.getOres("dustSulfur")) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/mekanism/common/network/PacketConfigSync.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public void toBytes(ByteBuf dataStream)
dataStream.writeDouble(general.TO_TE);
dataStream.writeDouble(general.FROM_H2);
dataStream.writeInt(general.ETHENE_BURN_TIME);
dataStream.writeInt(general.METHANE_BURN_TIME);
dataStream.writeDouble(general.ENERGY_PER_REDSTONE);
dataStream.writeDouble(general.DISASSEMBLER_USAGE);
dataStream.writeInt(general.VOICE_PORT);
Expand Down Expand Up @@ -138,6 +139,7 @@ public void fromBytes(ByteBuf dataStream)
general.TO_TE = dataStream.readDouble();
general.FROM_H2 = dataStream.readDouble();
general.ETHENE_BURN_TIME = dataStream.readInt();
general.METHANE_BURN_TIME = dataStream.readInt();
general.ENERGY_PER_REDSTONE = dataStream.readDouble();
general.DISASSEMBLER_USAGE = dataStream.readDouble();
general.VOICE_PORT = dataStream.readInt();
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mekanism/generators/common/FusionReactor.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ public class FusionReactor implements IFusionReactor
public static double plasmaHeatCapacity = 100;
public static double caseHeatCapacity = 1;
public static double enthalpyOfVaporization = 10;
public static double thermocoupleEfficiency = 0.05;
public static double steamTransferEfficiency = 0.1;
public static double thermocoupleEfficiency = 0.00125;
public static double steamTransferEfficiency = 0.0025;

//Heat transfer metrics
public static double plasmaCaseConductivity = 0.2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ public void addRecipes()
}));

FuelHandler.addGas(GasRegistry.getGas("ethene"), general.ETHENE_BURN_TIME, general.FROM_H2 + generators.bioGeneration * 2 * general.ETHENE_BURN_TIME); //1mB hydrogen + 2*bioFuel/tick*200ticks/100mB * 20x efficiency bonus
FuelHandler.addGas(GasRegistry.getGas("methane"), general.METHANE_BURN_TIME, general.FROM_H2 + generators.bioGeneration * general.METHANE_BURN_TIME);
}

@Override
Expand All @@ -203,6 +204,8 @@ public void writeConfig(ByteBuf dataStream) throws IOException
dataStream.writeDouble(generators.heatGeneration);
dataStream.writeDouble(generators.heatGenerationLava);
dataStream.writeDouble(generators.heatGenerationNether);
dataStream.writeInt(generators.heatGenerationFluidRate);
dataStream.writeBoolean(generators.heatGenEnable);
dataStream.writeDouble(generators.solarGeneration);

dataStream.writeDouble(generators.windGenerationMin);
Expand All @@ -224,7 +227,9 @@ public void readConfig(ByteBuf dataStream) throws IOException
generators.bioGeneration = dataStream.readDouble();
generators.heatGeneration = dataStream.readDouble();
generators.heatGenerationLava = dataStream.readDouble();
generators.heatGenerationNether = dataStream.readDouble();
generators.heatGenerationNether = dataStream.readDouble();;
generators.heatGenerationFluidRate = dataStream.readInt();
generators.heatGenEnable = dataStream.readBoolean();
generators.solarGeneration = dataStream.readDouble();

generators.windGenerationMin = dataStream.readDouble();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ else if(fluid != null)
{
setActive(true);

lavaTank.drain(10, true);
lavaTank.drain(generators.heatGenerationFluidRate, true);
transferHeatTo(generators.heatGeneration);
}
else {
Expand Down Expand Up @@ -445,7 +445,11 @@ public double applyTemperatureChange()
@Override
public boolean canConnectHeat(ForgeDirection side)
{
if(generators.heatGenEnable == true){
return side == ForgeDirection.DOWN;
}else {
return side == ForgeDirection.UNKNOWN;
}
}

@Override
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/mekanism/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ gas.deuterium=Deuterium
gas.tritium=Tritium
gas.lithium=Lithium
gas.fusionFuelDT=D-T Fuel
gas.methane=Methane

gas.iron=Iron Slurry
gas.gold=Gold Slurry
Expand Down Expand Up @@ -486,6 +487,7 @@ gui.undefined=Undefined
gui.owner=Owner
gui.public=Public
gui.private=Private
gui.trusted=Trusted
gui.add=Add
gui.set=Set
gui.freq=Freq
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"animation": {
"frametime": 2
}
}

0 comments on commit 6160b5b

Please sign in to comment.