Misc fixes for the mechanical multiblocks

This commit is contained in:
malte0811 2018-06-22 18:51:51 +02:00
parent 40eaa907ef
commit 880d350720
7 changed files with 23 additions and 8 deletions

View File

@ -71,7 +71,7 @@ repositories {
dependencies {
deobfCompile 'net.industrial-craft:industrialcraft-2:2.8.+'
deobfCompile "blusunrize:ImmersiveEngineering:0.12-+:deobf"
deobfCompile "blusunrize:ImmersiveEngineering:0.12-+"
compileOnly "TechReborn:TechReborn-1.12:2.6.+:dev"
compileOnly "RebornCore:RebornCore-1.12:3.2.+:dev"
compileOnly 'com.elytradev:mirage:2.0.1-SNAPSHOT'

View File

@ -248,13 +248,19 @@ public class TileEntityMechMB extends TileEntityIWMultiblock implements ITickabl
double totalAvailable = 0;
double totalRequested = 0;
for (int i = 0; i < available.length; i++) {
if (availableWf[i].equals(waveform)) {
totalAvailable += available[i];
} else {
if (!availableWf[i].equals(waveform)) {
available[i] = 0;
}
totalRequested += requested[i];
}
for (int i = 0; i < available.length; i++) {
if (available[i]>0) {
available[i] = Math.min(available[i], totalRequested-requested[i]);
totalAvailable += available[i];
}
}
if (totalAvailable==0)
return 0;
double[] ins = new double[section[1]-section[0]];
double[] extracted = new double[section[1]-section[0]];
for (int i = section[0]; i < section[1]; i++) {
@ -346,6 +352,9 @@ public class TileEntityMechMB extends TileEntityIWMultiblock implements ITickabl
}
electricalStartEnd = electrical.toArray(new int[electrical.size()][]);
decay = Math.pow(DECAY_BASE, mechanical.length);
if (energyState!=null) {
energyState.invalid = true;
}
energyState = new MechEnergy(weight, speed);
}

View File

@ -20,6 +20,7 @@ import net.minecraft.util.math.MathHelper;
public final class MechEnergy {
private double speed = 0;
public boolean invalid = false;
public final double weight;
public MechEnergy(double weight, double speed) {
@ -97,6 +98,8 @@ public final class MechEnergy {
}
private float getTotalVolume() {
if (invalid)
return 0;
float ret = (float) (weight / 20e3 * Math.tanh(getSpeedForSound()/30));
ret = Math.min(ret, 1.5F);
return ret;

View File

@ -271,7 +271,10 @@ public abstract class MechMBPart {
for (int x = -1; x <= 1; x++) {
for (int y = -1; y <= 1; y++) {
pos.setPos(x, y, -z);
world.setBlockState(pos, getOriginalBlock(pos));
IBlockState state = getOriginalBlock(pos);
if (state.getBlock()!=Blocks.AIR) {
world.setBlockState(pos, state);
}
}
}
}

View File

@ -46,7 +46,7 @@ import static blusunrize.immersiveengineering.common.IEContent.blockMetalDecorat
import static blusunrize.immersiveengineering.common.blocks.metal.BlockTypes_MetalDecoration0.RS_ENGINEERING;
import static malte0811.industrialWires.blocks.converter.MechanicalMBBlockType.SPEEDOMETER;
import static net.minecraft.util.EnumFacing.Axis.X;
import static net.minecraft.util.EnumFacing.AxisDirection.POSITIVE;
import static net.minecraft.util.EnumFacing.AxisDirection.NEGATIVE;
import static net.minecraft.util.math.BlockPos.ORIGIN;
public class MechPartSpeedometer extends MechMBPart implements IRedstoneOutput {
@ -192,7 +192,7 @@ public class MechPartSpeedometer extends MechMBPart implements IRedstoneOutput {
@Override
public int getStrongRSOutput(@Nonnull IBlockState state, @Nonnull EnumFacing side) {
if (side.getAxis() == X) {
if (side.getAxisDirection() == POSITIVE) {
if (side.getAxisDirection() == NEGATIVE) {
return currentOutputLog;
} else {
return currentOutputLin;

View File

@ -150,7 +150,7 @@ ie.manual.entry.industrialwires.mech_mb=Mechanical multiblocks serve two main pu
ie.manual.entry.industrialwires.mech_mb_parts.name=Mechanical Multiblock Parts
ie.manual.entry.industrialwires.mech_mb_parts.subtext=
ie.manual.entry.industrialwires.mech_mb_parts=The shaft is the simplest part imaginable: It does not do anything. This can be useful for seperating electrical sections of the multiblock. It consists of a single heavy engineering block in the middle of the multiblock.<np><&0>The flywheel is another very simple part: Its only job is to add inertia to increase energy storage. Various materials can be used instead of the lead blocks in the above schematic. The table on the next page shows all available materials, their inertia and their maximum speed.<&1><np><&2>Coils produce synchronous AC power from the multiblocks rotation or convert AC power (both synchronous and asynchronous will work) into multiblock rotation. For a four-phase coil replace the light engineering blocks on the level of the shaft with copper coil blocks. The maximum speed is 100 radians/second for a single-phase coil and 500 radians/second for a four-phase coil, the maximum energy transfer is 200 kW (4096 Flux/tick) for single-phase coil and 8 times as much on the four-phase version.<np><&3>Electrodes are the standard way of transferring energy out of or into a mechanical multiblock. The above plan shows the four-phase version, the single phase version if formed from a single generator block in the place of the shaft. Both AC and DC power can be connected to it. The maximum energy transfer rates match those of the corresponding coils, but is split equally between the connections.<np>The speedometer does what one would expect it to do: It measures the speed the multiblock is turning at. It consists of a single redstone engineering block in the place of the shaft. Right-clicking with a Voltmeter will give the exact speed, but its most common use is to automatically limit the speed of a multiblock. One side (the one marked with a line) will output a redstone signal proportional to the speed, the other one (marked "ln") will output a signal proportional to the logarithm of the speed plus one. To change what speed equates to a full strength signal you can (shift-) right-click the speedometer with an engineer's hammer.<br>Both signals have hysteresis to prevent flickering: For the signal to drop from n to n-1 the exact signal strength has to drop below n-0.1. To rise from n to n+1 the exact strength has to be above n+1.1.
ie.manual.entry.industrialwires.mech_mb_parts=The shaft is the simplest part imaginable: It does not do anything. This can be useful for seperating electrical sections of the multiblock. It consists of a single heavy engineering block in the middle of the multiblock.<np><&0>The flywheel is another very simple part: Its only job is to add inertia to increase energy storage. Various materials can be used instead of the lead blocks in the above schematic. The table on the next page shows all available materials, their inertia and their maximum speed.<&1><np><&2>Coils produce synchronous AC power from the multiblocks rotation or convert AC power (both synchronous and asynchronous will work) into multiblock rotation. For a four-phase coil replace the light engineering blocks on the level of the shaft with copper coil blocks. The maximum speed is 100 radians/second for a single-phase coil and 500 radians/second for a four-phase coil, the maximum energy transfer is 200 kW (4096 Flux/tick) for single-phase coil and 8 times as much on the four-phase version.<np><&3>Electrodes are the standard way of transferring energy out of or into a mechanical multiblock. The above plan shows the four-phase version, the single phase version if formed from a single generator block in the place of the shaft. Both AC and DC power can be connected to it. The maximum energy transfer rates match those of the corresponding coils, but is split equally between the connections. The energy connections can be set to input, output and not connected by hitting them with an Engineer's hammer.<np>The speedometer does what one would expect it to do: It measures the speed the multiblock is turning at. It consists of a single redstone engineering block in the place of the shaft. Right-clicking with a Voltmeter will give the exact speed, but its most common use is to automatically limit the speed of a multiblock. One side (the one marked with a line) will output a redstone signal proportional to the speed, the other one (marked "ln") will output a signal proportional to the logarithm of the speed plus one. To change what speed equates to a full strength signal you can (shift-) right-click the speedometer with an engineer's hammer.<br>Both signals have hysteresis to prevent flickering: For the signal to drop from n to n-1 the exact signal strength has to drop below n-0.1. To rise from n to n+1 the exact strength has to be above n+1.1.
ie.manual.entry.industrialwires.mech_mb_parts.commutator=<np><&4>The commutator converts synchronous AC to DC and vice versa. The above plan shows the four-phase version, the single-phase version consists of a single kinetic generator from IC2 in the place of the shaft. It transfers half as much power as the corresponding electrodes can.
ie.manual.entry.industrialwires.intro.name=Introduction

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB