Merge pull request #1070 from BallOfEnergy1/master

Minor addition in pollution code. (clamping values)
This commit is contained in:
HbmMods 2023-06-13 09:54:39 +02:00 committed by GitHub
commit dd8005f60f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 28 additions and 12 deletions

View File

@ -176,9 +176,9 @@ public class PollutionHandler {
} else {
data.pollution[S] *= 0.99F;
}
data.pollution[H] *= 0.999F;
/* SPREADING */
//apply new data to self
PollutionData newData = newPollution.get(chunk.getKey());

View File

@ -4,9 +4,15 @@ import java.util.ArrayList;
import java.util.List;
import com.hbm.handler.radiation.ChunkRadiationManager;
import cpw.mods.fml.common.Optional;
import li.cil.oc.api.machine.Arguments;
import li.cil.oc.api.machine.Callback;
import li.cil.oc.api.machine.Context;
import li.cil.oc.api.network.SimpleComponent;
import net.minecraft.tileentity.TileEntity;
public class TileEntityGeiger extends TileEntity {
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
public class TileEntityGeiger extends TileEntity implements SimpleComponent {
int timer = 0;
int ticker = 0;
@ -57,5 +63,15 @@ public class TileEntityGeiger extends TileEntity {
int rads = (int)Math.ceil(ChunkRadiationManager.proxy.getRadiation(worldObj, xCoord, yCoord, zCoord));
return rads;
}
@Override
public String getComponentName() {
return "ntm_geiger";
}
@Callback
@Optional.Method(modid = "OpenComputers")
public Object[] getRads(Context context, Arguments args) {
return new Object[] {check()};
}
}

View File

@ -400,7 +400,7 @@ public class TileEntityReactorResearch extends TileEntityMachineBase implements
@Callback
@Optional.Method(modid = "OpenComputers")
public Object[] getLevel(Context context, Arguments args) {
return new Object[] {level};
return new Object[] {level * 100};
}
@Callback

View File

@ -383,10 +383,10 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
@Optional.Method(modid = "OpenComputers")
public Object[] getSteamType(Context context, Arguments args) {
FluidType type = steam.getTankType();
if(type == Fluids.STEAM) {return new Object[] {"0"};}
else if(type == Fluids.HOTSTEAM) {return new Object[] {"1"};}
else if(type == Fluids.SUPERHOTSTEAM) {return new Object[] {"2"};}
else if(type == Fluids.ULTRAHOTSTEAM) {return new Object[] {"3"};}
if(type == Fluids.STEAM) {return new Object[] {0};}
else if(type == Fluids.HOTSTEAM) {return new Object[] {1};}
else if(type == Fluids.SUPERHOTSTEAM) {return new Object[] {2};}
else if(type == Fluids.ULTRAHOTSTEAM) {return new Object[] {3};}
else {return new Object[] {"Unknown Error"};}
}
@ -401,16 +401,16 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
}
if(type == 0) {
steam.setTankType(Fluids.STEAM);
return new Object[] {"true"};
return new Object[] {true};
} else if(type == 1) {
steam.setTankType(Fluids.HOTSTEAM);
return new Object[] {"true"};
return new Object[] {true};
} else if(type == 2) {
steam.setTankType(Fluids.SUPERHOTSTEAM);
return new Object[] {"true"};
return new Object[] {true};
} else {
steam.setTankType(Fluids.ULTRAHOTSTEAM);
return new Object[] {"true"};
return new Object[] {true};
}
}