Skip to content

Commit

Permalink
1.18.2-0.2.6a
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuxelus committed Aug 10, 2022
1 parent f75803d commit a28e575
Show file tree
Hide file tree
Showing 31 changed files with 1,110 additions and 52 deletions.
35 changes: 22 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ plugins {
}
apply plugin: 'net.minecraftforge.gradle'

version = '1.18.2-0.2.6'
version = '1.18.2-0.2.6a'
group = 'com.zuxelus.energycontrol'
archivesBaseName = 'EnergyControl-forge'

Expand All @@ -27,10 +27,10 @@ minecraft {
workingDirectory project.file('run')
//property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
property 'forge.enabledGameTestNamespaces', 'examplemod'
property 'mixin.env.disableRefMap', 'true'

mods {
examplemod {
EnergyControl {
source sourceSets.main
}
}
Expand All @@ -42,7 +42,7 @@ minecraft {
property 'forge.logging.console.level', 'debug'

mods {
examplemod {
EnergyControl {
source sourceSets.main
}
}
Expand All @@ -55,7 +55,7 @@ minecraft {
property 'forge.enabledGameTestNamespaces', 'examplemod'

mods {
examplemod {
EnergyControl {
source sourceSets.main
}
}
Expand All @@ -68,7 +68,7 @@ minecraft {
args '--mod', 'examplemod', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')

mods {
examplemod {
EnergyControl {
source sourceSets.main
}
}
Expand All @@ -87,13 +87,22 @@ repositories {
}

dependencies {
minecraft 'net.minecraftforge:forge:1.18.2-40.0.18'
compileOnly fg.deobf ("curse.maven:ae2-223794:3646192")
compileOnly fg.deobf ("curse.maven:cctweaked-282001:3670782")
compileOnly fg.deobf ("curse.maven:WTHIT-455982:3680651") //
compileOnly fg.deobf ("curse.maven:jei-238222:3695636")
compileOnly fg.deobf ("curse.maven:extremereactors-250277:3681561")
compileOnly fg.deobf ("curse.maven:zerocore-247921:3681549")
minecraft 'net.minecraftforge:forge:1.18.2-40.1.73'
compileOnly fg.deobf ("curse.maven:ae2-223794:3911833")
compileOnly fg.deobf ("curse.maven:cctweaked-282001:3904453")
compileOnly fg.deobf ("curse.maven:WTHIT-455982:3834228") //
compileOnly fg.deobf ("curse.maven:jei-238222:3904349")
compileOnly fg.deobf ("curse.maven:extremereactors-250277:3855572")
compileOnly fg.deobf ("curse.maven:zerocore-247921:3872364")
compileOnly fg.deobf ("curse.maven:biggerreactors-407780:3884291")
compileOnly fg.deobf ("curse.maven:quartz-552262:3809944")
compileOnly fg.deobf ("curse.maven:phosphophyllite-412551:3888252")
compileOnly fg.deobf ("curse.maven:badpackets-615134:3773642")
compileOnly fg.deobf ("curse.maven:advancedgenerators-223622:3873885")
compileOnly fg.deobf ("curse.maven:bdlib-70496:3734491")
compileOnly fg.deobf ("curse.maven:catsforce-320926:3759354")
compileOnly fg.deobf ("curse.maven:mekanism-268560:3875976")
compileOnly fg.deobf ("curse.maven:mekanismgenerators-268566:3875978")
}

jar {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public InteractionResult use(BlockState state, Level world, BlockPos pos, Player
if (!(te instanceof TileEntityHoloPanel))
return InteractionResult.PASS;
if (!world.isClientSide)
NetworkHooks.openGui((ServerPlayer) player, (TileEntityHoloPanel) te, pos);
NetworkHooks.openGui((ServerPlayer) player, (TileEntityHoloPanel) te, pos);
return InteractionResult.SUCCESS;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public InteractionResult use(BlockState state, Level world, BlockPos pos, Player
if (((TileEntityInfoPanel) te).runTouchAction(player.getItemInHand(hand), pos, hit.getLocation()))
return InteractionResult.SUCCESS;
if (!world.isClientSide)
NetworkHooks.openGui((ServerPlayer) player, (TileEntityInfoPanel) te, pos);
NetworkHooks.openGui((ServerPlayer) player, (TileEntityInfoPanel) te, pos);
return InteractionResult.SUCCESS;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResult;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.RenderShape;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.material.Material;
Expand All @@ -25,7 +25,7 @@
public class InfoPanelExtender extends FacingBlockActive {

public InfoPanelExtender() {
super(Block.Properties.of(Material.METAL).strength(1.0F, 3.0F).lightLevel(state -> state.getValue(ACTIVE) ? 10 : 0));
super(Block.Properties.of(Material.METAL).strength(1.0F, 3.0F).sound(SoundType.METAL).lightLevel(state -> state.getValue(ACTIVE) ? 10 : 0));
}

@Override
Expand All @@ -50,11 +50,6 @@ public InteractionResult use(BlockState state, Level world, BlockPos pos, Player
return InteractionResult.SUCCESS;
}

@Override
public BlockState getStateForPlacement(BlockPlaceContext context) {
return super.getStateForPlacement(context).setValue(ACTIVE, false);
}

@Override
public RenderShape getRenderShape(BlockState state) {
return RenderShape.ENTITYBLOCK_ANIMATED;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package com.zuxelus.energycontrol.crossmod;

import java.util.List;

import com.zuxelus.energycontrol.utils.FluidInfo;

import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.block.entity.BlockEntity;

public class CrossAdvGenerators extends CrossModBase {

@Override
public CompoundTag getEnergyData(BlockEntity te) {
return null;
}

@Override
public List<FluidInfo> getAllTanks(BlockEntity te) {
return null;
}

@Override
public CompoundTag getCardData(BlockEntity te) {
return null;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
package com.zuxelus.energycontrol.crossmod;

import java.util.ArrayList;
import java.util.List;

import com.zuxelus.energycontrol.api.PanelString;
import com.zuxelus.energycontrol.utils.FluidInfo;

import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.roguelogix.biggerreactors.multiblocks.reactor.ReactorMultiblockController;
import net.roguelogix.biggerreactors.multiblocks.reactor.simulation.IReactorSimulation;
import net.roguelogix.biggerreactors.multiblocks.reactor.simulation.IReactorSimulation.ICoolantTank;
import net.roguelogix.biggerreactors.multiblocks.reactor.simulation.IReactorSimulation.IFuelTank;
import net.roguelogix.biggerreactors.multiblocks.reactor.tiles.ReactorBaseTile;
import net.roguelogix.biggerreactors.multiblocks.reactor.util.ReactorTransitionTank;
import net.roguelogix.biggerreactors.multiblocks.turbine.TurbineMultiblockController;
import net.roguelogix.biggerreactors.multiblocks.turbine.simulation.ITurbineFluidTank;
import net.roguelogix.biggerreactors.multiblocks.turbine.simulation.ITurbineSimulation;
import net.roguelogix.biggerreactors.multiblocks.turbine.tiles.TurbineBaseTile;
import net.roguelogix.phosphophyllite.repack.org.joml.Vector3ic;

public class CrossBiggerReactors extends CrossModBase {

@Override
public CompoundTag getEnergyData(BlockEntity te) {
if (te instanceof ReactorBaseTile) {
try {
ReactorMultiblockController controller = ((ReactorBaseTile) te).controller();
IReactorSimulation reactor = controller.simulation();

CompoundTag tag = new CompoundTag();
tag.putString("euType", "FE");
tag.putDouble("storage", reactor.battery().stored());
tag.putDouble("maxStorage", reactor.battery().capacity());
return tag;
} catch (Throwable t) { }
}
if (te instanceof TurbineBaseTile) {
try {
TurbineMultiblockController controller = ((TurbineBaseTile) te).controller();
ITurbineSimulation turbine = controller.simulation();

CompoundTag tag = new CompoundTag();
tag.putString("euType", "FE");
tag.putDouble("storage", turbine.battery().stored());
tag.putDouble("maxStorage", turbine.battery().capacity());
return tag;
} catch (Throwable t) { }
}
return null;
}

@Override
public int getReactorHeat(Level world, BlockPos pos) {
BlockEntity te;
for (Direction dir : Direction.values()) {
te = world.getBlockEntity(pos.relative(dir));
if (te instanceof ReactorBaseTile) {
try {
ReactorMultiblockController controller = ((ReactorBaseTile) te).controller();
IReactorSimulation reactor = controller.simulation();
return (int) reactor.stackHeat();
} catch (Throwable t) { }
}
}
return -1;
}

@Override
public List<FluidInfo> getAllTanks(BlockEntity te) {
List<FluidInfo> result = new ArrayList<>();
if (te instanceof ReactorBaseTile) {
try {
ReactorMultiblockController controller = ((ReactorBaseTile) te).controller();
IReactorSimulation reactor = controller.simulation();
if (reactor.battery() != null)
return null;

ReactorTransitionTank tank = controller.coolantTank();
ICoolantTank tank2 = reactor.coolantTank();
if (tank != null && tank2 != null) {
result.add(new FluidInfo(tank.fluidTypeInTank(0), tank2.liquidAmount(), tank2.perSideCapacity()));
result.add(new FluidInfo(tank.fluidTypeInTank(1), tank2.vaporAmount(), tank2.perSideCapacity()));
}
return result;
} catch (Throwable t) { }
}
if (te instanceof TurbineBaseTile) {
try {
TurbineMultiblockController controller = ((TurbineBaseTile) te).controller();
ITurbineSimulation turbine = controller.simulation();

ITurbineFluidTank tank = turbine.fluidTank();
result.add(new FluidInfo(tank.getFluidInTank(0), tank.tankCapacity(0)));
result.add(new FluidInfo(tank.getFluidInTank(1), tank.tankCapacity(1)));
return result;
} catch (Throwable t) { }
}
return null;
}

@Override
public CompoundTag getCardData(BlockEntity te) {
if (te instanceof ReactorBaseTile) {
try {
ReactorMultiblockController controller = ((ReactorBaseTile) te).controller();
IReactorSimulation reactor = controller.simulation();

CompoundTag tag = new CompoundTag();
tag.putInt("type", 1);
tag.putBoolean("reactorPoweredB", controller.isActive());
tag.putBoolean("cooling", reactor.battery() != null);
tag.putDouble("heat", reactor.fuelHeat());
tag.putDouble("coreHeat", reactor.stackHeat());
if (reactor.battery() != null)
tag.putString("storage", String.format("%s / %s", PanelString.getFormatter().format(reactor.battery().stored()), PanelString.getFormatter().format(reactor.battery().capacity())));
tag.putDouble("output", (reactor.battery() != null) ? reactor.battery().generatedLastTick() : reactor.coolantTank().transitionedLastTick());
Vector3ic min = controller.minCoord();
Vector3ic max = controller.maxCoord();
tag.putInt("rods", controller.controlRodCount() * (max.y() - min.y() - 1));
IFuelTank tank = reactor.fuelTank();
tag.putString("fuel", String.format("%s / %s", tank.fuel(), tank.capacity()));
tag.putDouble("waste", tank.waste());
tag.putDouble("consumption", reactor.fuelTank().burnedLastTick());
tag.putString("size", String.format("%sx%sx%s", max.x() - min.x() + 1, max.y() - min.y() + 1, max.z() - min.z() + 1));
return tag;
} catch (Throwable t) { }
}
if (te instanceof TurbineBaseTile) {
try {
TurbineMultiblockController controller = ((TurbineBaseTile) te).controller();
ITurbineSimulation turbine = controller.simulation();

CompoundTag tag = new CompoundTag();
tag.putInt("type", 2);
tag.putBoolean("reactorPoweredB", turbine.active());
tag.putString("storage", String.format("%s / %s", PanelString.getFormatter().format(turbine.battery().stored()), PanelString.getFormatter().format(turbine.battery().capacity())));
tag.putDouble("output", turbine.FEGeneratedLastTick());
tag.putDouble("speed", turbine.RPM());
tag.putDouble("efficiency", turbine.bladeEfficiencyLastTick() * 100);
tag.putDouble("consumption", turbine.nominalFlowRate());
tag.putInt("blades", 0); // TODO
tag.putInt("mass", (int) turbine.rotorMass());
Vector3ic min = controller.minCoord();
Vector3ic max = controller.maxCoord();
tag.putString("size", String.format("%sx%sx%s", max.x() - min.x() + 1, max.y() - min.y() + 1, max.z() - min.z() + 1));
return tag;
} catch (Throwable t) { }
}
return null;
}
}
Loading

0 comments on commit a28e575

Please sign in to comment.