Skip to content

Commit

Permalink
Continued work on the Signalum Reactor.
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinSVK12 committed Oct 22, 2023
1 parent 56f5490 commit e27760f
Show file tree
Hide file tree
Showing 37 changed files with 651 additions and 123 deletions.
11 changes: 5 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ repositories {
}

dependencies {

minecraft "bta-download-repo:bta:${project.bta_version}"
mappings loom.layered() {}

Expand All @@ -117,14 +118,12 @@ dependencies {
modImplementation "bta-halplibe:halplibe:${project.halplibe_version}"

modImplementation "ModMenu:ModMenu:2.0.0"
modImplementation "fluidapi:fluidapi:1.7.1"
modImplementation "sunsetutils:sunsetutils:1.8.2"
//modImplementation "fluidapi:fluidapi:1.7.1"
implementation project(path: ":fluidapi", configuration: "namedElements")
implementation project(path: ":sunsetutils", configuration: "namedElements")
implementation project(path: ":energyapi", configuration: "namedElements")
modImplementation "guidebookpp:guidebookpp:1.5.6"
modImplementation "BTWaila:btwaila:0.2.2"
modImplementation "energyapi:energyapi:1.1.5"
modImplementation "potato-logistics:PotatoLogistics:0.1.4"

//modImplementation files("C:\\Users\\sunsetsatellite\\Projects\\BTA\\SignalIndustries\\PotatoLogistics-0.1.2.jar")
//modImplementation "retrostorage:retrostorage:1.2.0"

implementation "org.slf4j:slf4j-api:1.8.0-beta4"
Expand Down
8 changes: 7 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,10 @@ pluginManagement {
url = 'https://maven.quiltmc.org/repository/release'
}
}
}
}
include(":sunsetutils")
include(":fluidapi")
include(":energyapi")
project(':sunsetutils').projectDir = new File("C:\\Users\\sunsetsatellite\\Projects\\BTA\\1.7.7.0\\sunsetutils")
project(':fluidapi').projectDir = new File("C:\\Users\\sunsetsatellite\\Projects\\BTA\\1.7.7.0\\fluidapi")
project(':energyapi').projectDir = new File("C:\\Users\\sunsetsatellite\\Projects\\BTA\\1.7.7.0\\energyapi")
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,8 @@
import sunsetsatellite.signalindustries.render.RenderAutoMiner;
import sunsetsatellite.signalindustries.render.RenderFluidInBlock;
import sunsetsatellite.signalindustries.render.RenderFluidInConduit;
import sunsetsatellite.signalindustries.util.AttachmentPoint;
import sunsetsatellite.signalindustries.util.BlockTexture;
import sunsetsatellite.signalindustries.util.Mode;
import sunsetsatellite.signalindustries.util.Tier;
import sunsetsatellite.signalindustries.render.RenderSignalumReactor;
import sunsetsatellite.signalindustries.util.*;
import sunsetsatellite.signalindustries.weather.WeatherBloodMoon;
import sunsetsatellite.signalindustries.weather.WeatherEclipse;
import sunsetsatellite.signalindustries.weather.WeatherSolarApocalypse;
Expand Down Expand Up @@ -245,11 +243,44 @@ public class SignalIndustries implements ModInitializer {
.setTextures("reinforced_energy_connector.png")
.build(new BlockEnergyConnector("reinforced.energyConnector",config.getFromConfig("reinforcedEnergyConnector",availableBlockId++),Tier.REINFORCED,Material.metal));

public static final Block reinforcedFluidInputHatch = new BlockBuilder(MOD_ID)
.setBlockSound(BlockSounds.METAL)
.setHardness(5)
.setResistance(20)
.setLuminance(0)
.setTextures("reinforced_fluid_input_hatch.png")
.build(new BlockFluidInputHatch("reinforced.fluidInputHatch",config.getFromConfig("reinforcedFluidInputHatch",availableBlockId++),Tier.REINFORCED,Material.metal));

public static final Block reinforcedFluidOutputHatch = new BlockBuilder(MOD_ID)
.setBlockSound(BlockSounds.METAL)
.setHardness(5)
.setResistance(20)
.setLuminance(0)
.setTextures("reinforced_fluid_output_hatch.png")
.build(new BlockFluidOutputHatch("reinforced.fluidOutputHatch",config.getFromConfig("reinforcedFluidOutputHatch",availableBlockId++),Tier.REINFORCED,Material.metal));

public static final Block reinforcedItemInputBus = new BlockBuilder(MOD_ID)
.setBlockSound(BlockSounds.METAL)
.setHardness(5)
.setResistance(20)
.setLuminance(0)
.setTextures("reinforced_input_bus.png")
.build(new BlockInputBus("reinforced.itemInputBus",config.getFromConfig("reinforcedItemInputBus",availableBlockId++),Tier.REINFORCED,Material.metal));

public static final Block reinforcedItemOutputBus = new BlockBuilder(MOD_ID)
.setBlockSound(BlockSounds.METAL)
.setHardness(5)
.setResistance(20)
.setLuminance(0)
.setTextures("reinforced_output_bus.png")
.build(new BlockOutputBus("reinforced.itemOutputBus",config.getFromConfig("reinforcedItemOutputBus",availableBlockId++),Tier.REINFORCED,Material.metal));


//this has to be after any other block
public static final int[] energyTex = TextureHelper.registerBlockTexture(MOD_ID,"signalum_energy.png");
public static final int[] energyTex = TextureHelper.registerBlockTexture(MOD_ID,"signalum_energy_transparent.png");
public static final int[] burntSignalumTex = TextureHelper.registerBlockTexture(MOD_ID,"burnt_signalum.png");//registerFluidTexture(MOD_ID,"signalum_energy.png",0,4);
public static final Block energyFlowing = BlockHelper.createBlock(MOD_ID,new BlockFluidFlowing(key("signalumEnergy"),config.getFromConfig("signalumEnergy",availableBlockId++),Material.water),"signalum_energy.png",BlockSounds.DEFAULT,1.0f,1.0f,0).withTexCoords(energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1]).withTags(BlockTags.NOT_IN_CREATIVE_MENU,BlockTags.PLACE_OVERWRITES);
public static final Block energyStill = BlockHelper.createBlock(MOD_ID,new BlockFluidStill(key("signalumEnergy"),config.getFromConfig("signalumEnergy",availableBlockId++),Material.water),"signalum_energy.png",BlockSounds.DEFAULT,1.0f,1.0f,0).withTexCoords(energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1]).withTags(BlockTags.NOT_IN_CREATIVE_MENU,BlockTags.PLACE_OVERWRITES);
public static final Block energyFlowing = BlockHelper.createBlock(MOD_ID,new BlockFluidFlowing(key("signalumEnergy"),config.getFromConfig("signalumEnergy",availableBlockId++),Material.water),"signalum_energy_transparent.png",BlockSounds.DEFAULT,1.0f,1.0f,0).withTexCoords(energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1]).withTags(BlockTags.NOT_IN_CREATIVE_MENU,BlockTags.PLACE_OVERWRITES);
public static final Block energyStill = BlockHelper.createBlock(MOD_ID,new BlockFluidStill(key("signalumEnergy"),config.getFromConfig("signalumEnergy",availableBlockId++),Material.water),"signalum_energy_transparent.png",BlockSounds.DEFAULT,1.0f,1.0f,0).withTexCoords(energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1],energyTex[0],energyTex[1]).withTags(BlockTags.NOT_IN_CREATIVE_MENU,BlockTags.PLACE_OVERWRITES);

public static final Block burntSignalumFlowing = new BlockBuilder(MOD_ID)
.setTextures("burnt_signalum.png")
Expand Down Expand Up @@ -380,6 +411,8 @@ public class SignalIndustries implements ModInitializer {
public static final Dimension dimEternity = new Dimension(key("eternity"),Dimension.overworld,1,portalEternity.id).setDefaultWorldType(eternityWorld);

public static final Multiblock dimAnchorMultiblock = new Multiblock(MOD_ID,new Class[]{SignalIndustries.class},"dimensionalAnchor","dimensionalAnchor",false);
public static final Multiblock testMultiblock = new Multiblock(MOD_ID,new Class[]{SignalIndustries.class},"test","test",false);
public static final Multiblock signalumReactor = new Multiblock(MOD_ID,new Class[]{SignalIndustries.class},"signalumReactor","signalumReactor",false);

public static Map<String, BlockTexture> textures = new HashMap<>();

Expand Down Expand Up @@ -532,12 +565,18 @@ public SignalIndustries(){
EntityHelper.createTileEntity(TileEntityCentrifuge.class,"Separation Centrifuge");
addToNameGuiMap("Separation Centrifuge", GuiCentrifuge.class, TileEntityCentrifuge.class);

EntityHelper.createTileEntity(TileEntitySignalumReactor.class,"Signalum Reactor");
EntityHelper.createSpecialTileEntity(TileEntitySignalumReactor.class,new RenderSignalumReactor(),"Signalum Reactor");
addToNameGuiMap("Signalum Reactor", GuiSignalumReactor.class, TileEntitySignalumReactor.class);

EntityHelper.createTileEntity(TileEntityEnergyConnector.class,"Energy Connector");
addToNameGuiMap("Energy Connector", GuiEnergyConnector.class, TileEntityEnergyConnector.class);

EntityHelper.createTileEntity(TileEntityItemBus.class,"Item Bus");
addToNameGuiMap("Item Bus", GuiItemBus.class, TileEntityItemBus.class);

EntityHelper.createTileEntity(TileEntityFluidHatch.class,"Fluid Hatch");
addToNameGuiMap("Fluid Hatch", GuiItemBus.class, TileEntityFluidHatch.class);

EntityHelper.createTileEntity(TileEntityIgnitor.class,"Signalum Ignitor");

addToNameGuiMap("The Pulsar", GuiPulsar.class, InventoryPulsar.class);
Expand All @@ -548,12 +587,15 @@ public SignalIndustries(){
EntityHelper.createTileEntity(TileEntityBlockBreaker.class,"Block Breaker");

Multiblock.multiblocks.put("dimensionalAnchor",dimAnchorMultiblock);
Multiblock.multiblocks.put("test",testMultiblock);
Multiblock.multiblocks.put("signalumReactor",signalumReactor);
SignalIndustries.LOGGER.info(String.format("Loaded %d multiblocks..",Multiblock.multiblocks.size()));
SignalIndustries.LOGGER.info(String.format("Loaded %d internal structures.", Structure.internalStructures.size()));

EntityHelper.createEntity(EntityInfernal.class,new MobRenderer<EntityInfernal>(new ModelZombie(), 0.5F),config.getFromConfig("infernalId",50),"Infernal");
//crafting recipes in RecipeHandlerCraftingSI

BlockDataExporter.export();
}

public static <K,V> Map<K,V> mapOf(K[] keys, V[] values){
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,21 @@ public void onBlockPlaced(World world, int x, int y, int z, Side side, EntityLiv
world.setBlockMetadataWithNotify(x, y, z, entity.getPlacementDirection(side).getOpposite().getId());
}

@Override
public int getBlockTextureFromSideAndMetadata(Side side, int meta) {

if(SignalIndustries.textures == null) return this.atlasIndices[side.getId()];
int index;
int[] orientationLookUpVertical = new int[]{1, 0, 2, 3, 4, 5, /**/ 0, 1, 2, 3, 4, 5};
if(meta == 0 || meta == 1){
index = orientationLookUpVertical[6 * meta + side.getId()];
return SignalIndustries.textures.get("dilithiumStabilizer.vertical").getTexture(Side.getSideById(index));
} else {
index = Sides.orientationLookUpHorizontal[6 * meta + side.getId()];
}
return this.atlasIndices[index];
}

@Override
public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side side) {
TileEntityStabilizer tile = (TileEntityStabilizer) blockAccess.getBlockTileEntity(x,y,z);
Expand All @@ -102,7 +117,7 @@ public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side si
if(meta == 0 || meta == 1){
index = orientationLookUpVertical[6 * meta + side.getId()];
if(tile.isBurning()){
return SignalIndustries.textures.get("dilithiumStabilizer.verticaL.active").getTexture(Side.getSideById(index));
return SignalIndustries.textures.get("dilithiumStabilizer.vertical.active").getTexture(Side.getSideById(index));
} else {
return SignalIndustries.textures.get("dilithiumStabilizer.vertical").getTexture(Side.getSideById(index));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ public void onBlockRemoval(World world, int i, int j, int k) {
@Override
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
world.setBlockMetadata(i,j,k,3);
if(world.isClientSide)
{
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import net.minecraft.core.world.World;
import sunsetsatellite.fluidapi.template.tiles.TileEntityFluidPipe;
import sunsetsatellite.signalindustries.SignalIndustries;
import sunsetsatellite.signalindustries.containers.ContainerBus;
import sunsetsatellite.signalindustries.gui.GuiBus;
import sunsetsatellite.signalindustries.inventories.TileEntityBus;
import sunsetsatellite.signalindustries.containers.ContainerItemBus;
import sunsetsatellite.signalindustries.gui.GuiItemBus;
import sunsetsatellite.signalindustries.inventories.TileEntityItemBus;
import sunsetsatellite.signalindustries.util.Tier;
import sunsetsatellite.sunsetutils.util.Direction;

Expand All @@ -24,12 +24,12 @@ public BlockInputBus(String key, int i, Tier tier, Material material) {

@Override
protected TileEntity getNewBlockEntity() {
return new TileEntityBus();
return new TileEntityItemBus();
}

@Override
public void onBlockRemoval(World world, int i, int j, int k) {
TileEntityBus tile = (TileEntityBus) world.getBlockTileEntity(i, j, k);
TileEntityItemBus tile = (TileEntityItemBus) world.getBlockTileEntity(i, j, k);
if (tile != null) {
for (Direction dir : Direction.values()) {
TileEntity tile2 = dir.getTileEntity(world, tile);
Expand Down Expand Up @@ -74,9 +74,9 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
return true;
} else
{
TileEntityBus tile = (TileEntityBus) world.getBlockTileEntity(i, j, k);
TileEntityItemBus tile = (TileEntityItemBus) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiBus(entityplayer.inventory, tile),new ContainerBus(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,new GuiItemBus(entityplayer.inventory, tile),new ContainerItemBus(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import net.minecraft.core.world.World;
import sunsetsatellite.fluidapi.template.tiles.TileEntityFluidPipe;
import sunsetsatellite.signalindustries.SignalIndustries;
import sunsetsatellite.signalindustries.containers.ContainerBus;
import sunsetsatellite.signalindustries.gui.GuiBus;
import sunsetsatellite.signalindustries.inventories.TileEntityBus;
import sunsetsatellite.signalindustries.containers.ContainerItemBus;
import sunsetsatellite.signalindustries.gui.GuiItemBus;
import sunsetsatellite.signalindustries.inventories.TileEntityItemBus;
import sunsetsatellite.signalindustries.util.Tier;
import sunsetsatellite.sunsetutils.util.Direction;

Expand All @@ -24,12 +24,12 @@ public BlockOutputBus(String key, int i, Tier tier, Material material) {

@Override
protected TileEntity getNewBlockEntity() {
return new TileEntityBus();
return new TileEntityItemBus();
}

@Override
public void onBlockRemoval(World world, int i, int j, int k) {
TileEntityBus tile = (TileEntityBus) world.getBlockTileEntity(i, j, k);
TileEntityItemBus tile = (TileEntityItemBus) world.getBlockTileEntity(i, j, k);
if (tile != null) {
for (Direction dir : Direction.values()) {
TileEntity tile2 = dir.getTileEntity(world, tile);
Expand Down Expand Up @@ -74,9 +74,9 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
return true;
} else
{
TileEntityBus tile = (TileEntityBus) world.getBlockTileEntity(i, j, k);
TileEntityItemBus tile = (TileEntityItemBus) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiBus(entityplayer.inventory, tile),new ContainerBus(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,new GuiItemBus(entityplayer.inventory, tile),new ContainerItemBus(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
import sunsetsatellite.signalindustries.gui.GuiSignalumReactor;
import sunsetsatellite.signalindustries.inventories.TileEntitySignalumReactor;
import sunsetsatellite.signalindustries.util.Tier;
import sunsetsatellite.sunsetutils.util.BlockInstance;
import sunsetsatellite.sunsetutils.util.Direction;
import sunsetsatellite.sunsetutils.util.Vec3i;

public class BlockSignalumReactorCore extends BlockContainerTiered{
public BlockSignalumReactorCore(String key, int i, Tier tier, Material material) {
Expand All @@ -32,8 +35,10 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
} else
{
TileEntitySignalumReactor tile = (TileEntitySignalumReactor) world.getBlockTileEntity(i, j, k);
if(tile != null) {
if(tile.multiblock != null && tile.multiblock.isValidAt(world,new BlockInstance(this,new Vec3i(i,j,k),tile), Direction.Z_POS/*Direction.getDirectionFromSide(world.getBlockMetadata(i,j,k)))*/)){
SignalIndustries.displayGui(entityplayer, new GuiSignalumReactor(entityplayer.inventory, tile), tile, i, j, k);
} else {
entityplayer.addChatMessage("event.signalindustries.invalidMultiblock");
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
import net.minecraft.core.player.inventory.IInventory;
import net.minecraft.core.player.inventory.slot.Slot;
import sunsetsatellite.fluidapi.api.ContainerFluid;
import sunsetsatellite.fluidapi.api.SlotFluid;
import sunsetsatellite.signalindustries.inventories.TileEntityTieredContainer;

public class ContainerBus extends ContainerFluid {
public class ContainerItemBus extends ContainerFluid {

public ContainerBus(IInventory iInventory, TileEntityTieredContainer tile) {
public ContainerItemBus(IInventory iInventory, TileEntityTieredContainer tile) {
super(iInventory, tile);
this.tile = tile;
this.addFluidSlot(new SlotFluid(tile, 0, 80, 35));
this.addSlot(new Slot(tile, 0, 80, 60));

for (int i = 0; i < 3; ++i) {
for (int l = 0; l < 3; ++l) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,20 @@
import sunsetsatellite.signalindustries.SignalIndustries;
import sunsetsatellite.signalindustries.blocks.BlockContainerTiered;
import sunsetsatellite.signalindustries.containers.ContainerFluidHatch;
import sunsetsatellite.signalindustries.inventories.TileEntityEnergyConnector;
import sunsetsatellite.signalindustries.inventories.TileEntityFluidHatch;
import sunsetsatellite.signalindustries.inventories.TileEntityTieredContainer;

public class GuiFluidHatch extends GuiFluid {

public String name = "Fluid I/O Hatch";
public String name = "Fluid Hatch";
public EntityPlayer entityplayer;
public TileEntityEnergyConnector tile;
public TileEntityFluidHatch tile;


public GuiFluidHatch(InventoryPlayer inventoryPlayer, TileEntity tile) {
super(new ContainerFluidHatch(inventoryPlayer, (TileEntityTieredContainer) tile),inventoryPlayer);
this.ySize = 192;
this.tile = (TileEntityEnergyConnector) tile;
this.tile = (TileEntityFluidHatch) tile;
this.entityplayer = inventoryPlayer.player;
}

Expand Down
Loading

0 comments on commit e27760f

Please sign in to comment.