introduced efficiency
This commit is contained in:
parent
b3427dec54
commit
8897724301
|
@ -46,7 +46,9 @@ public class SPConfig {
|
|||
public final ForgeConfigSpec.IntValue bronzeBurnerHU;
|
||||
public final ForgeConfigSpec.IntValue castIronBurnerHU;
|
||||
public final ForgeConfigSpec.IntValue steelBurnerHU;
|
||||
|
||||
public final ForgeConfigSpec.DoubleValue bronzeBurnerEfficiency;
|
||||
public final ForgeConfigSpec.DoubleValue castIronBurnerEfficiency;
|
||||
public final ForgeConfigSpec.DoubleValue steelBurnerEfficiency;
|
||||
|
||||
public final ForgeConfigSpec.IntValue dynamoFeMaxOut;
|
||||
public final ForgeConfigSpec.IntValue dynamoFeCapacity;
|
||||
|
@ -81,6 +83,13 @@ public class SPConfig {
|
|||
steelBurnerHU=builder.defineInRange("steelBurnerHu",480,0,1000000);;
|
||||
}
|
||||
builder.pop();
|
||||
builder.push("burnerEfficiency").comment("Fuel Tick to HU Convertion Percentage. 10HU=1mb of steam. ");
|
||||
{
|
||||
bronzeBurnerEfficiency=builder.defineInRange("bronzeBurnerEfficiency",0.8,0,1.0);
|
||||
castIronBurnerEfficiency=builder.defineInRange("castIronBurnerEfficiency",0.9,0,1.0);
|
||||
steelBurnerEfficiency=builder.defineInRange("steelBurnerEfficiency",1,0,1.0);
|
||||
}
|
||||
builder.pop();
|
||||
builder.push("flywheel");
|
||||
{
|
||||
builder.push("bronze_flywheel");
|
||||
|
|
|
@ -39,4 +39,9 @@ public class BronzeBurnerBlock extends BurnerBlock {
|
|||
public int getHuProduce() {
|
||||
return SPConfig.COMMON.bronzeBurnerHU.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getEfficiency() {
|
||||
return SPConfig.COMMON.bronzeBurnerEfficiency.get();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,4 +32,9 @@ public class BronzeBurnerTileEntity extends BurnerTileEntity {
|
|||
protected int getHuPerTick() {
|
||||
return SPConfig.COMMON.bronzeBurnerHU.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected double getEfficiency() {
|
||||
return SPConfig.COMMON.bronzeBurnerEfficiency.get();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -110,6 +110,10 @@ public abstract class BurnerBlock extends Block {
|
|||
e.hurt(DamageSource.HOT_FLOOR, 2);
|
||||
}
|
||||
public abstract int getHuProduce() ;
|
||||
public abstract double getEfficiency();
|
||||
public String getEfficiencyString() {
|
||||
return ((int)(this.getEfficiency()*1000))/1000+"%";
|
||||
}
|
||||
protected void createBlockStateDefinition(StateContainer.Builder<Block, BlockState> builder) {
|
||||
super.createBlockStateDefinition(builder.add(LIT).add(FACING).add(REDSTONE_LOCKED));
|
||||
}
|
||||
|
@ -121,8 +125,9 @@ public abstract class BurnerBlock extends Block {
|
|||
if(Screen.hasShiftDown()) {
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.burner.brief").withStyle(TextFormatting.GOLD));
|
||||
if(ClientUtils.hasGoggles()) {
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.burner.danger").withStyle(TextFormatting.RED));
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.burner.huproduce",this.getHuProduce()).withStyle(TextFormatting.GOLD));
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.burner.efficiency",getEfficiencyString()).withStyle(TextFormatting.RED));
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.burner.huproduce",this.getHuProduce()).withStyle(TextFormatting.GOLD));
|
||||
t.add(new TranslationTextComponent("tooltip.steampowered.burner.danger").withStyle(TextFormatting.RED));
|
||||
}
|
||||
}else {
|
||||
t.add(TooltipHelper.holdShift(Palette.Gray,false));
|
||||
|
|
|
@ -147,7 +147,7 @@ public abstract class BurnerTileEntity extends TileEntity implements ITickableTi
|
|||
int time = ForgeHooks.getBurnTime(inv.getStackInSlot(0), IRecipeType.SMELTING);
|
||||
if (time <= 0) return false;
|
||||
inv.getStackInSlot(0).shrink(1);
|
||||
HURemain += time * SPConfig.COMMON.HUPerFuelTick.get();//2.4HU/t
|
||||
HURemain += time * SPConfig.COMMON.HUPerFuelTick.get()*getEfficiency();//2.4HU/t
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -171,4 +171,5 @@ public abstract class BurnerTileEntity extends TileEntity implements ITickableTi
|
|||
* HU per tick max, 10HU=1 steam
|
||||
* */
|
||||
protected abstract int getHuPerTick();
|
||||
protected abstract double getEfficiency();
|
||||
}
|
||||
|
|
|
@ -39,4 +39,9 @@ public class CastIronBurnerBlock extends BurnerBlock {
|
|||
public int getHuProduce() {
|
||||
return SPConfig.COMMON.castIronBurnerHU.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getEfficiency() {
|
||||
return SPConfig.COMMON.castIronBurnerEfficiency.get();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,4 +32,8 @@ public class CastIronBurnerTileEntity extends BurnerTileEntity {
|
|||
protected int getHuPerTick() {
|
||||
return SPConfig.COMMON.castIronBurnerHU.get();
|
||||
}
|
||||
@Override
|
||||
public double getEfficiency() {
|
||||
return SPConfig.COMMON.castIronBurnerEfficiency.get();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -39,4 +39,9 @@ public class SteelBurnerBlock extends BurnerBlock {
|
|||
public int getHuProduce() {
|
||||
return SPConfig.COMMON.steelBurnerHU.get();
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getEfficiency() {
|
||||
return SPConfig.COMMON.steelBurnerEfficiency.get();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,4 +32,8 @@ public class SteelBurnerTileEntity extends BurnerTileEntity {
|
|||
protected int getHuPerTick() {
|
||||
return SPConfig.COMMON.steelBurnerHU.get();
|
||||
}
|
||||
@Override
|
||||
public double getEfficiency() {
|
||||
return SPConfig.COMMON.steelBurnerEfficiency.get();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ public abstract class SteamEngineTileEntity extends EngineTileEntity implements
|
|||
BlockState state = this.level.getBlockState(this.worldPosition);
|
||||
if (!tank.isEmpty()&&tank.drain(this.getSteamConsumptionPerTick(), IFluidHandler.FluidAction.EXECUTE).getAmount() >= this.getSteamConsumptionPerTick()) {
|
||||
this.level.setBlockAndUpdate(this.worldPosition, state.setValue(SteamEngineBlock.LIT, true));
|
||||
if(heatup>=20) {
|
||||
if(heatup>=60) {
|
||||
this.appliedCapacity = this.getGeneratingCapacity();
|
||||
this.appliedSpeed = this.getGeneratingSpeed();
|
||||
this.refreshWheelSpeed();
|
||||
|
|
|
@ -6,6 +6,7 @@ import org.spongepowered.asm.mixin.injection.At;
|
|||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import com.simibubi.create.content.contraptions.KineticNetwork;
|
||||
import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity;
|
||||
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelBlock;
|
||||
import com.simibubi.create.content.contraptions.components.flywheel.FlywheelTileEntity;
|
||||
|
@ -24,6 +25,10 @@ public abstract class MixinFlywheel extends GeneratingKineticTileEntity{
|
|||
@Inject(at=@At("HEAD"),method="tick")
|
||||
public void sp$tick(CallbackInfo cbi) {
|
||||
Direction at=FlywheelBlock.getConnection(getBlockState());
|
||||
KineticNetwork nw=this.getOrCreateNetwork();
|
||||
if(nw!=null) {
|
||||
nw.updateCapacityFor(this,this.capacity);
|
||||
}
|
||||
if(at!=null) {
|
||||
if(!(this.getWorld().getBlockState(this.getBlockPos().relative(at,2)).getBlock() instanceof EngineBlock)) {
|
||||
FlywheelBlock.setConnection(getWorld(),getBlockPos(),getBlockState(),null);
|
||||
|
|
Loading…
Reference in a new issue