Skip to content

Commit

Permalink
BTWaila integration shows fluids now.
Browse files Browse the repository at this point in the history
Added Automatic Miner.
Added External I/O.
Added Reinforced Casings.
Added Reinforced Glass (with connected textures!).
Added Signalum Drills (Basic & Reinforced).
New worldgen for Eternity dim.
First achievements.
Arrows shot from blood moon enraged monsters deal the proper amount of damage now.
Other small fixes.
  • Loading branch information
MartinSVK12 committed Sep 16, 2023
1 parent 80107e4 commit 8f31795
Show file tree
Hide file tree
Showing 125 changed files with 4,792 additions and 614 deletions.
42 changes: 36 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,14 @@ repositories {
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/Turnip-Labs"
patternLayout {
artifact "[organisation]/releases/download/[revision]/[module]-[revision].jar"
m2compatible = true
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/Turnip-Labs"
patternLayout {
Expand All @@ -63,6 +71,14 @@ repositories {
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/MartinSVK12"
patternLayout {
artifact "[organisation]/releases/download/[revision]bta/[module]-[revision].jar"
m2compatible = true
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/ToufouMaster"
patternLayout {
Expand All @@ -71,6 +87,14 @@ repositories {
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/SamuelDeboni"
patternLayout {
artifact "[organisation]/releases/download/[revision]/[module]-[revision].jar"
m2compatible = true
}
metadataSources { artifact() }
}
ivy {
url = "https://github.com/MartinSVK12"
patternLayout {
Expand All @@ -93,23 +117,29 @@ dependencies {
modImplementation "bta-halplibe:halplibe:${project.halplibe_version}"

modImplementation "ModMenu:ModMenu:2.0.0"
modImplementation "fluidapi:fluidapi:1.6.6"
modImplementation "sunsetutils:sunsetutils:1.7.3"
modImplementation "guidebookpp:guidebookpp:1.5.3"
modImplementation "BTWaila:btwaila:pre-r1"
modImplementation "fluidapi:fluidapi:1.6.9"
modImplementation "sunsetutils:sunsetutils:1.8.2"
modImplementation "guidebookpp:guidebookpp:1.5.5"
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"
implementation "org.apache.logging.log4j:log4j-slf4j18-impl:2.16.0"
implementation("org.apache.commons:commons-lang3:3.12.0")

//include(implementation(annotationProcessor("com.github.llamalad7.mixinextras:mixinextras-fabric:0.2.0-beta.9")))

implementation 'com.google.guava:guava:30.0-jre'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.8.9'
implementation("org.apache.commons:commons-lang3:3.12.0")

var log4jVersion = "2.20.0"
implementation("org.apache.logging.log4j:log4j-core:${log4jVersion}")
implementation("org.apache.logging.log4j:log4j-api:${log4jVersion}")
implementation("org.apache.logging.log4j:log4j-1.2-api:${log4jVersion}")
implementation("log4j:apache-log4j-extras:1.2.17")
}

java {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
org.gradle.jvmargs=-Xmx2G

# BTA
bta_version=1.7.7.0_01
bta_version=1.7.7.0_02

# Loader
loader_version=0.14.19-babric.1-bta

# HalpLibe
halplibe_version=2.1.1
halplibe_version=2.2.0

# Mod
mod_version=1.0.0
Expand Down
443 changes: 275 additions & 168 deletions src/main/java/sunsetsatellite/signalindustries/SignalIndustries.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

import org.slf4j.Logger;
import sunsetsatellite.signalindustries.api.impl.btwaila.tooltips.EnergyTooltip;
import sunsetsatellite.signalindustries.api.impl.btwaila.tooltips.FluidTooltip;
import toufoumaster.btwaila.BTWailaCustomTootltipPlugin;

public class BTWailaSIPlugin implements BTWailaCustomTootltipPlugin {
@Override
public void initializePlugin(Logger logger) {
logger.info("Loading tooltips for: BTWailaSIPlugin from signalindustries..");
(new EnergyTooltip()).addTooltip();
(new FluidTooltip()).addTooltip();
}
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
package sunsetsatellite.signalindustries.api.impl.btwaila.tooltips;

import net.minecraft.core.block.Block;
import net.minecraft.core.block.entity.TileEntity;
import sunsetsatellite.fluidapi.FluidAPI;
import net.minecraft.core.lang.I18n;
import net.minecraft.core.util.helper.Side;
import sunsetsatellite.fluidapi.template.tiles.TileEntityFluidItemContainer;
import sunsetsatellite.signalindustries.SignalIndustries;
import sunsetsatellite.signalindustries.inventories.*;
import sunsetsatellite.signalindustries.mixin.accessors.GuiBlockOverlayAccessor;
import sunsetsatellite.signalindustries.mixin.invokers.GuiInvoker;
import sunsetsatellite.signalindustries.util.NumberUtil;
import toufoumaster.btwaila.BTWaila;
import toufoumaster.btwaila.IBTWailaCustomBlockTooltip;
import toufoumaster.btwaila.TooltipGroup;
import toufoumaster.btwaila.TooltipRegistry;
import toufoumaster.btwaila.gui.GuiBlockOverlay;
import toufoumaster.btwaila.util.ColorOptions;
import toufoumaster.btwaila.util.ProgressBarOptions;
import toufoumaster.btwaila.util.TextureOptions;

public class EnergyTooltip implements IBTWailaCustomBlockTooltip {
@Override
Expand All @@ -38,30 +40,48 @@ public void addTooltip() {
@Override
public void drawAdvancedTooltip(TileEntity tileEntity, GuiBlockOverlay guiBlockOverlay) {
TileEntityFluidItemContainer tile = (TileEntityFluidItemContainer) tileEntity;
int energySlotId = 0;
int energySlotId = -1;
for (int i = 0; i < tile.acceptedFluids.size(); i++) {
if(tile.acceptedFluids.get(i).contains(SignalIndustries.energyFlowing)){
energySlotId = i;
break;
}
}
int energy = 0;
int energyMax = tile.fluidCapacity[energySlotId];
if(tile.fluidContents[energySlotId] != null){
energy = tile.fluidContents[energySlotId].amount;
if(energySlotId != -1){
int energy = 0;
int energyMax = tile.fluidCapacity[energySlotId];
if(tile.fluidContents[energySlotId] != null){
energy = tile.fluidContents[energySlotId].amount;
}
TextureOptions fgOptions = new TextureOptions().setBlockId(SignalIndustries.energyFlowing.id).setSide(Side.BOTTOM).setMetadata(0);
TextureOptions bgOptions = new TextureOptions().setBlockId(SignalIndustries.realityFabric.id).setSide(Side.BOTTOM).setMetadata(0);
ProgressBarOptions options = new ProgressBarOptions().setValues(true).setPercentage(true).setBackgroundOptions(bgOptions).setForegroundOptions(fgOptions).setText("SE: ");
guiBlockOverlay.drawProgressBarTextureWithText(energy,energyMax,options,0);
}
int x = ((GuiBlockOverlayAccessor)guiBlockOverlay).getPosX();
int y = ((GuiBlockOverlayAccessor)guiBlockOverlay).getOffY();

double fill = FluidAPI.map(energy, 0, energyMax, 0, 140);

((GuiInvoker)guiBlockOverlay).callDrawGradientRect(x,y+4,x+142,y+20,0xFF000000,0xFF000000);
((GuiInvoker)guiBlockOverlay).callDrawGradientRect(x+2,y+6, x+140,y+18,0xFF404040,0xFF404040);
((GuiInvoker)guiBlockOverlay).callDrawGradientRect(x+2,y+6, (int) (x+fill),y+18,0xFFFF0000,0xFFFF0060);
guiBlockOverlay.addOffY(8);
guiBlockOverlay.drawStringWithShadow(String.format("SE: %s/%s (%.1f%%)", NumberUtil.format(energy),NumberUtil.format(energyMax),(((double)energy/(double)energyMax)*100)),-22,0xFFFFFFFF);
guiBlockOverlay.addOffY(-12);
guiBlockOverlay.drawInventory(tile,120);
if(tile instanceof TileEntityTieredMachine) {
ProgressBarOptions options2 = new ProgressBarOptions().setValues(true).setPercentage(true).setBackgroundOptions(new ColorOptions(0x000000)).setForegroundOptions(new ColorOptions(0x00AA00)).setText("Progress: ");
guiBlockOverlay.drawProgressBarWithText(((TileEntityTieredMachine) tile).progressTicks,((TileEntityTieredMachine) tile).progressMaxTicks,options2,0);
}
for (int i = 0; i < tile.fluidContents.length; i++) {
if (tile.fluidContents[i] != null && tile.fluidContents[i].liquid != null && tile.fluidContents[i].liquid != SignalIndustries.energyFlowing) {
String name = I18n.getInstance().translateNameKey(tile.fluidContents[i].liquid.getLanguageKey(0)).replace("Flowing ","");
TextureOptions bgOptions = new TextureOptions().setBlockId(SignalIndustries.realityFabric.id).setSide(Side.BOTTOM);
TextureOptions fgOptions = new TextureOptions().setBlockId(tile.fluidContents[i].liquid.id).setSide(Side.BOTTOM);
if(tile.fluidContents[i].liquid == Block.fluidWaterFlowing){
fgOptions.setColor(0xA0A0FF);
}
ProgressBarOptions options = new ProgressBarOptions().setValues(true).setPercentage(false).setBackgroundOptions(bgOptions).setForegroundOptions(fgOptions).setText(name+": ");
guiBlockOverlay.drawProgressBarTextureWithText(tile.fluidContents[i].amount,tile.fluidCapacity[i],options,0);
}
}
guiBlockOverlay.drawInventory(tile,0);
/*guiBlockOverlay.addOffY(12);
for (int i = 0; i < tile.fluidContents.length; i++) {
if(tile.fluidContents[i] != null && tile.fluidContents[i].liquid != null && tile.fluidContents[i].liquid != SignalIndustries.energyFlowing ){
String name = I18n.getInstance().translateNameKey(tile.fluidContents[i].liquid.getLanguageKey(0)).replace("Flowing ","");
guiBlockOverlay.drawProgressBarWithText(name+": ",tile.fluidContents[i].amount,tile.fluidCapacity[i],true,false,0);
}
}*/
//guiBlockOverlay.drawStringWithShadow("This is a machine from SignalIndustries!",0,0xFFFF0000);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package sunsetsatellite.signalindustries.api.impl.btwaila.tooltips;

import net.minecraft.client.render.block.color.BlockColorWater;
import net.minecraft.core.block.Block;
import net.minecraft.core.block.entity.TileEntity;
import net.minecraft.core.lang.I18n;
import net.minecraft.core.util.helper.Side;
import sunsetsatellite.fluidapi.template.tiles.TileEntityMassFluidItemContainer;
import sunsetsatellite.fluidapi.template.tiles.TileEntityMultiFluidTank;
import sunsetsatellite.signalindustries.SignalIndustries;
import toufoumaster.btwaila.BTWaila;
import toufoumaster.btwaila.IBTWailaCustomBlockTooltip;
import toufoumaster.btwaila.TooltipGroup;
import toufoumaster.btwaila.TooltipRegistry;
import toufoumaster.btwaila.gui.GuiBlockOverlay;
import toufoumaster.btwaila.util.ProgressBarOptions;
import toufoumaster.btwaila.util.TextureOptions;


//TODO: Move to fluidapi eventually
public class FluidTooltip implements IBTWailaCustomBlockTooltip {

@Override
public void addTooltip() {
BTWaila.LOGGER.info("Adding tooltips for: " + this.getClass().getSimpleName());
TooltipGroup tooltipGroup = new TooltipGroup(SignalIndustries.MOD_ID, TileEntityMassFluidItemContainer.class, this);
tooltipGroup.addTooltip(TileEntityMultiFluidTank.class);
TooltipRegistry.tooltipMap.add(tooltipGroup);
}

@Override
public void drawAdvancedTooltip(TileEntity tileEntity, GuiBlockOverlay guiBlockOverlay) {
TileEntityMassFluidItemContainer tile = (TileEntityMassFluidItemContainer) tileEntity;
for (int i = 0; i < tile.fluidContents.size(); i++) {
if (tile.fluidContents.get(i) != null && tile.fluidContents.get(i).liquid != null && tile.fluidContents.get(i).liquid != SignalIndustries.energyFlowing) {
String name = I18n.getInstance().translateNameKey(tile.fluidContents.get(i).liquid.getLanguageKey(0)).replace("Flowing ","");
TextureOptions bgOptions = new TextureOptions().setBlockId(SignalIndustries.realityFabric.id).setSide(Side.BOTTOM).setMetadata(0);
TextureOptions fgOptions = new TextureOptions().setBlockId(tile.fluidContents.get(i).liquid.id).setSide(Side.BOTTOM).setMetadata(0);
if(tile.fluidContents.get(i).liquid == Block.fluidWaterFlowing){
fgOptions.setColor(new BlockColorWater().getWorldColor(tile.worldObj, tile.xCoord, tile.yCoord, tile.zCoord));
}
ProgressBarOptions options = new ProgressBarOptions().setValues(true).setPercentage(false).setBackgroundOptions(bgOptions).setForegroundOptions(fgOptions).setText(name+": ");
guiBlockOverlay.drawProgressBarTextureWithText(tile.fluidContents.get(i).amount,tile.fluidCapacity,options,0);
}
}
/*TileEntityMassFluidItemContainer tile = (TileEntityMassFluidItemContainer) tileEntity;
guiBlockOverlay.addOffY(12);
for (int i = 0; i < tile.fluidContents.size(); i++) {
String name = I18n.getInstance().translateNameKey(tile.fluidContents.get(i).liquid.getLanguageKey(0));
guiBlockOverlay.drawProgressBarWithText(name+": ",99,tile.fluidCapacity,true,false,0);
}*/
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
import sunsetsatellite.signalindustries.SignalIndustries;

public class SignalIndustriesFluidPlugin implements FluidAPIPlugin {
/*@Override
public void initializePlugin(FluidRegistry registry, Logger logger) {
logger.info("Loading fluids from signalindustries..");
registry.addFluid((BlockFluid) SignalIndustries.energyFlowing,SignalIndustries.signalumCrystal, SignalIndustries.signalumCrystalEmpty);
}*/

@Override
public void initializePlugin(Logger logger) {
Expand All @@ -22,5 +17,9 @@ public void initializePlugin(Logger logger) {
FluidRegistry.addToRegistry("signalumEnergy",entry);
entry = new FluidRegistryEntry(SignalIndustries.MOD_ID,SignalIndustries.signalumSaber,SignalIndustries.signalumSaber, (BlockFluid) SignalIndustries.energyFlowing);
FluidRegistry.addToRegistry("signalumSaber",entry);
entry = new FluidRegistryEntry(SignalIndustries.MOD_ID,SignalIndustries.basicSignalumDrill,SignalIndustries.basicSignalumDrill, (BlockFluid) SignalIndustries.energyFlowing);
FluidRegistry.addToRegistry("basicSignalumDrill",entry);
entry = new FluidRegistryEntry(SignalIndustries.MOD_ID,SignalIndustries.reinforcedSignalumDrill,SignalIndustries.reinforcedSignalumDrill, (BlockFluid) SignalIndustries.energyFlowing);
FluidRegistry.addToRegistry("reinforcedSignalumDrill",entry);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ public class ContainerGuidebookAlloySmelterRecipe extends ContainerGuidebookReci

public ContainerGuidebookAlloySmelterRecipe(ItemStack stack, RecipeFluid recipeFluid) {
machine = stack;
this.addSlot(new SlotGuidebook(0, 9, 10, recipeFluid.itemInputs.get(0), false));
this.addSlot(new SlotGuidebook(0, -19, 10, recipeFluid.itemInputs.get(1), false));
this.addSlot(new SlotGuidebook(0, 9, 10, recipeFluid.itemInputs.get(1), false));
this.addSlot(new SlotGuidebook(0, -19, 10, recipeFluid.itemInputs.get(0), false));
this.addSlot(new SlotGuidebook(1, 69, 19, recipeFluid.itemOutputs.get(0), false));
this.addSlot(new SlotGuidebook(2, 9, 45, new ItemStack(SignalIndustries.energyFlowing,recipeFluid.cost), false));
this.addSlot(new SlotGuidebook(3,36,18,stack,true));
Expand Down
Loading

0 comments on commit 8f31795

Please sign in to comment.