Skip to content

Commit

Permalink
Added the basics of item transportation:
Browse files Browse the repository at this point in the history
- Item Conduits and Inserters

Revamped booster system:
- Added a weaker version of the Dilitium Booster available in the Basic Tier, the Redstone Booster
- Added "yield" property to boosters, higher yield has a chance to multiply the outputs of other machines
  • Loading branch information
MartinSVK12 committed Mar 20, 2024
1 parent 91db77d commit aa6ff4a
Show file tree
Hide file tree
Showing 85 changed files with 1,635 additions and 131 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import sunsetsatellite.signalindustries.blocks.machines.*;
import sunsetsatellite.signalindustries.blocks.states.ConduitStateInterpreter;
import sunsetsatellite.signalindustries.blocks.states.EEPROMProgrammerStateInterpreter;
import sunsetsatellite.signalindustries.blocks.states.ItemConduitStateInterpreter;
import sunsetsatellite.signalindustries.dim.WorldTypeEternity;
import sunsetsatellite.signalindustries.entities.EntityCrystal;
import sunsetsatellite.signalindustries.entities.EntityEnergyOrb;
Expand Down Expand Up @@ -210,6 +211,7 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint {

public static final Tag<Block> ENERGY_CONDUITS_CONNECT = Tag.of("energy_conduits_connect");
public static final Tag<Block> FLUID_CONDUITS_CONNECT = Tag.of("fluid_conduits_connect");
public static final Tag<Block> ITEM_CONDUITS_CONNECT = Tag.of("item_conduits_connect");

public static final Block signalumOre = new BlockBuilder(MOD_ID)
.setTextures("signalum_ore.png")
Expand Down Expand Up @@ -432,6 +434,22 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint {
)
.build(new BlockFluidConduit("reinforced.conduit.fluid",config.getInt("BlockIDs.reinforcedFluidConduit"),Tier.REINFORCED,Material.glass));

public static final Block basicItemConduit = new BlockBuilder(MOD_ID)
.setTextures("item_conduit_basic.png")
.setLuminance(0)
.setResistance(1)
.setHardness(1)
.setBlockSound(BlockSounds.GLASS)
.setBlockModel(
new BlockModelDragonFly(
ModelHelper.getOrCreateBlockModel(MOD_ID,"conduit/item/basic/conduit_all.json"),
ModelHelper.getOrCreateBlockState(MOD_ID,"basic_item_conduit.json"),
new ItemConduitStateInterpreter(),
true
)
)
.build(new BlockItemConduit("basic.conduit.item",config.getInt("BlockIDs.basicItemConduit"),Tier.BASIC,Material.glass));


public static final Block infiniteEnergyCell = new BlockBuilder(MOD_ID)
.setTextures("cell_prototype.png")
Expand Down Expand Up @@ -642,14 +660,33 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint {
.setNorthTexture("dilithium_top_inactive.png")
.build(new BlockDilithiumStabilizer("reinforced.dilithiumStabilizer",config.getInt("BlockIDs.dilithiumStabilizer"), Tier.REINFORCED,Material.metal));

public static final Block redstoneBooster = new BlockBuilder(MOD_ID) //BlockHelper.createBlock(MOD_ID,new BlockDilithiumBooster("reinforced.dilithiumBooster",config.getInt("BlockIDs.dilithiumBooster"), Tier.REINFORCED,Material.metal),"reinforced_blank.png","reinforced_blank.png","dilithium_top_inactive.png","dilithium_booster_side_inactive.png","dilithium_booster_side_inactive.png","dilithium_booster_side_inactive.png",BlockSounds.METAL,5f,20f,1);
.setHardness(1)
.setResistance(3)
.setBlockSound(BlockSounds.METAL)
.setTextures("basic_blank.png")
.setSideTextures("basic_booster_side_inactive.png")
.setNorthTexture("basic_booster_top_inactive.png")
.build(new BlockDilithiumBooster("basic.booster",config.getInt("BlockIDs.redstoneBooster"), Tier.BASIC,Material.metal));

public static final Block dilithiumBooster = new BlockBuilder(MOD_ID) //BlockHelper.createBlock(MOD_ID,new BlockDilithiumBooster("reinforced.dilithiumBooster",config.getInt("BlockIDs.dilithiumBooster"), Tier.REINFORCED,Material.metal),"reinforced_blank.png","reinforced_blank.png","dilithium_top_inactive.png","dilithium_booster_side_inactive.png","dilithium_booster_side_inactive.png","dilithium_booster_side_inactive.png",BlockSounds.METAL,5f,20f,1);
.setHardness(1)
.setResistance(3)
.setBlockSound(BlockSounds.METAL)
.setTextures("reinforced_blank.png")
.setSideTextures("dilithium_booster_side_inactive.png")
.setNorthTexture("dilithium_top_inactive.png")
.build(new BlockDilithiumBooster("reinforced.dilithiumBooster",config.getInt("BlockIDs.dilithiumBooster"), Tier.REINFORCED,Material.metal));
.build(new BlockDilithiumBooster("reinforced.booster",config.getInt("BlockIDs.dilithiumBooster"), Tier.REINFORCED,Material.metal));

//TODO: W.I.P.
/*public static final Block awakenedBooster = new BlockBuilder(MOD_ID) //BlockHelper.createBlock(MOD_ID,new BlockDilithiumBooster("reinforced.dilithiumBooster",config.getInt("BlockIDs.dilithiumBooster"), Tier.REINFORCED,Material.metal),"reinforced_blank.png","reinforced_blank.png","dilithium_top_inactive.png","dilithium_booster_side_inactive.png","dilithium_booster_side_inactive.png","dilithium_booster_side_inactive.png",BlockSounds.METAL,5f,20f,1);
.setHardness(1)
.setResistance(3)
.setBlockSound(BlockSounds.METAL)
.setTextures("awakened_blank.png")
.setSideTextures("awakened_booster_side_inactive.png")
.setNorthTexture("awakened_booster_top_inactive.png")
.build(new BlockDilithiumBooster("awakened.booster",config.getInt("BlockIDs.awakenedBooster"), Tier.AWAKENED,Material.metal));*/

public static final Block prototypePump = new BlockBuilder(MOD_ID)
.setHardness(1)
Expand All @@ -669,15 +706,23 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint {
.setSideTextures("basic_pump_side_empty.png")
.build(new BlockPump("basic.pump",config.getInt("BlockIDs.basicPump"), Tier.BASIC,Material.metal));

/*public static final Block prototypeBlockBreaker = new BlockBuilder(MOD_ID)
public static final Block prototypeInserter = new BlockBuilder(MOD_ID)
.setHardness(1)
.setResistance(3)
.setBlockSound(BlockSounds.STONE)
.setTextures("prototype_blank.png")
.setTopBottomTexture("prototype_block_breaker_side_2.png")
.setSideTextures("prototype_block_breaker_side.png")
.setNorthTexture("prototype_block_breaker.png")
.build(new BlockBreaker("prototype.blockBreaker",config.getInt("BlockIDs.prototypeBlockBreaker"),Tier.PROTOTYPE,Material.stone));*/
.setSouthTexture("inserter_output.png")
.setNorthTexture("inserter_input.png")
.build(new BlockInserter("prototype.inserter",config.getInt("BlockIDs.prototypeInserter"),Tier.PROTOTYPE,Material.stone));

public static final Block basicInserter = new BlockBuilder(MOD_ID)
.setHardness(1)
.setResistance(3)
.setBlockSound(BlockSounds.METAL)
.setTextures("basic_blank.png")
.setSouthTexture("basic_inserter_output.png")
.setNorthTexture("basic_inserter_input.png")
.build(new BlockInserter("basic.inserter",config.getInt("BlockIDs.basicInserter"),Tier.BASIC,Material.metal));

public static final int[][] breakerTex = new int[][]{TextureHelper.getOrCreateBlockTexture(MOD_ID,"prototype_block_breaker.png"),TextureHelper.getOrCreateBlockTexture(MOD_ID,"prototype_block_breaker_active.png"),TextureHelper.getOrCreateBlockTexture(MOD_ID,"prototype_block_breaker_side.png"),TextureHelper.getOrCreateBlockTexture(MOD_ID,"prototype_block_breaker_side_active.png"),TextureHelper.getOrCreateBlockTexture(MOD_ID,"prototype_block_breaker_side_2.png"),TextureHelper.getOrCreateBlockTexture(MOD_ID,"prototype_block_breaker_side_2_active.png"),TextureHelper.getOrCreateBlockTexture(MOD_ID,"inserteroutput.png")};
public static final Block basicAutomaticMiner = new BlockBuilder(MOD_ID)
Expand All @@ -687,6 +732,7 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint {
.setTextures("basic_blank.png")
.setNorthTexture("basic_automatic_miner.png")
.build(new BlockAutoMiner("basic.automaticMiner",config.getInt("BlockIDs.basicAutomaticMiner"),Tier.BASIC,Material.metal));

public static final Block externalIo = new BlockBuilder(MOD_ID)
.setBlockSound(BlockSounds.METAL)
.setHardness(1)
Expand Down Expand Up @@ -1100,11 +1146,18 @@ public void onInitialize() {
textures.put("dilithiumStabilizer.vertical.active",new BlockTexture(MOD_ID).setAll("reinforced_blank.png").setSides("dilithium_stabilizer_side_active.png").setTopTexture("dilithium_top_active.png"));
textures.put("dilithiumStabilizer.vertical.active.overlay",new BlockTexture(MOD_ID).setSides("stabilizer_overlay.png").setTopTexture("dilithium_machine_overlay.png"));

textures.put("dilithiumBooster.active",new BlockTexture(MOD_ID).setAll("reinforced_blank.png").setSides("dilithium_booster_side_active.png").setNorthTexture("dilithium_top_active.png"));
textures.put("dilithiumBooster.active.overlay",new BlockTexture(MOD_ID).setSides("booster_overlay.png").setNorthTexture("dilithium_machine_overlay.png"));
textures.put(Tier.BASIC.name()+"booster.active",new BlockTexture(MOD_ID).setAll("basic_blank.png").setSides("basic_booster_side_active.png").setNorthTexture("basic_booster_top_active.png"));
textures.put(Tier.BASIC.name()+"booster.active.overlay",new BlockTexture(MOD_ID).setSides("basic_booster_overlay.png").setNorthTexture("basic_booster_overlay_top.png"));
textures.put(Tier.REINFORCED.name()+"booster.active",new BlockTexture(MOD_ID).setAll("reinforced_blank.png").setSides("dilithium_booster_side_active.png").setNorthTexture("dilithium_top_active.png"));
textures.put(Tier.REINFORCED.name()+"booster.active.overlay",new BlockTexture(MOD_ID).setSides("booster_overlay.png").setNorthTexture("dilithium_machine_overlay.png"));
textures.put(Tier.AWAKENED.name()+"booster.active",new BlockTexture(MOD_ID).setAll("awakened_blank.png").setSides("awakened_booster_side_active.png").setNorthTexture("awakened_booster_top_active.png"));
textures.put(Tier.AWAKENED.name()+"booster.active.overlay",new BlockTexture(MOD_ID).setSides("awakened_booster_overlay.png").setNorthTexture("dilithium_machine_overlay.png"));

textures.put("uvLamp.active",new BlockTexture(MOD_ID).setAll("uv_lamp.png"));

textures.put(Tier.PROTOTYPE.name()+".inserter.vertical",new BlockTexture(MOD_ID).setAll("prototype_blank.png").setBottomTexture("inserter_output.png").setTopTexture("inserter_input.png"));
textures.put(Tier.BASIC.name()+".inserter.vertical",new BlockTexture(MOD_ID).setAll("basic_blank.png").setBottomTexture("basic_inserter_output.png").setTopTexture("basic_inserter_input.png"));

textures.put(Tier.BASIC.name()+".externalIo",new BlockTexture(MOD_ID).setAll("external_io_blank.png").setTopTexture("external_io_input.png").setBottomTexture("external_io_output.png").setNorthTexture("external_io_both.png"));

textures.put(Tier.REINFORCED.name()+".centrifuge.active",new BlockTexture(MOD_ID).setAll("reinforced_blank.png").setTopTexture("reinforced_centrifuge_closed.png").setNorthTexture("reinforced_centrifuge_front_active.png"));
Expand Down Expand Up @@ -1162,21 +1215,24 @@ public SignalIndustries(){
ItemToolPickaxe.miningLevels.put(reinforcedGlass,3);
ItemToolPickaxe.miningLevels.put(reinforcedCasing,3);



ironPlateHammer.setContainerItem(ironPlateHammer);

CommandHelper.Core.createCommand(new NBTEditCommand());
CommandHelper.Core.createCommand(new StructureCommand("structure","struct"));
EntityHelper.Core.createSpecialTileEntity(TileEntityConduit.class, new RenderFluidInConduit(),"Conduit");
EntityHelper.Core.createSpecialTileEntity(TileEntityFluidConduit.class, new RenderFluidInConduit(),"Fluid Conduit");

EntityHelper.Core.createEntity(EntityCrystal.class,47,"signalumCrystal");
EntityHelper.Client.assignEntityRenderer(EntityCrystal.class,new SnowballRenderer(volatileSignalumCrystal.getIconFromDamage(0)));
EntityHelper.Core.createEntity(EntityEnergyOrb.class,49,"energyOrb");
EntityHelper.Client.assignEntityRenderer(EntityEnergyOrb.class,new SnowballRenderer(Block.texCoordToIndex(energyOrbTex[0],energyOrbTex[1])));
EntityHelper.Core.createEntity(EntitySunbeam.class,49,"sunBeam");
EntityHelper.Client.assignEntityRenderer(EntitySunbeam.class,new SunbeamRenderer());

EntityHelper.Core.createSpecialTileEntity(TileEntityConduit.class, new RenderFluidInConduit(),"Conduit");
EntityHelper.Core.createSpecialTileEntity(TileEntityFluidConduit.class, new RenderFluidInConduit(),"Fluid Conduit");
EntityHelper.Core.createSpecialTileEntity(TileEntityItemConduit.class, new RenderItemsInConduit(),"Item Conduit");

EntityHelper.Core.createTileEntity(TileEntityInserter.class, "Inserter");

EntityHelper.Core.createSpecialTileEntity(TileEntityEnergyCell.class,new RenderFluidInBlock(),"Energy Cell");
addToNameGuiMap("Energy Cell", GuiEnergyCell.class, TileEntityEnergyCell.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@

import org.slf4j.Logger;
import sunsetsatellite.signalindustries.SignalIndustries;
import sunsetsatellite.signalindustries.api.impl.btwaila.tooltip.BoosterTooltip;
import sunsetsatellite.signalindustries.api.impl.btwaila.tooltip.FluidTooltip;
import sunsetsatellite.signalindustries.api.impl.btwaila.tooltip.MachineTooltip;
import sunsetsatellite.signalindustries.api.impl.btwaila.tooltip.StabilizerTooltip;
import sunsetsatellite.signalindustries.api.impl.btwaila.tooltip.*;
import toufoumaster.btwaila.entryplugins.waila.BTWailaCustomTooltipPlugin;
import toufoumaster.btwaila.tooltips.TooltipRegistry;

Expand All @@ -17,5 +14,6 @@ public void initializePlugin(TooltipRegistry tooltipRegistry, Logger logger) {
tooltipRegistry.register(new MachineTooltip());
tooltipRegistry.register(new BoosterTooltip());
tooltipRegistry.register(new StabilizerTooltip());
tooltipRegistry.register(new ItemConduitTooltip());
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package sunsetsatellite.signalindustries.api.impl.btwaila.tooltip;

import net.minecraft.core.block.Block;
import net.minecraft.core.lang.I18n;
import net.minecraft.core.util.helper.Side;
import sunsetsatellite.catalyst.fluids.api.IFluidInventory;
Expand All @@ -8,6 +9,7 @@
import sunsetsatellite.signalindustries.SignalIndustries;
import sunsetsatellite.signalindustries.inventories.machines.TileEntityBooster;
import sunsetsatellite.signalindustries.inventories.machines.TileEntityStabilizer;
import sunsetsatellite.signalindustries.util.Tier;
import toufoumaster.btwaila.gui.components.AdvancedInfoComponent;
import toufoumaster.btwaila.tooltips.TileTooltip;
import toufoumaster.btwaila.tooltips.Tooltip;
Expand All @@ -24,9 +26,13 @@ public void initTooltip() {
@Override
public void drawAdvancedTooltip(TileEntityBooster tile, AdvancedInfoComponent c) {
ProgressBarOptions options = new ProgressBarOptions()
.setForegroundOptions(new TextureOptions(0xFFFFFF,SignalIndustries.dilithiumCrystalBlock.atlasIndices[0]))
.setBackgroundOptions(new TextureOptions(0xFFFFFF,SignalIndustries.realityFabric.atlasIndices[0]))
.setText("Fuel: ");
if(tile.tier == Tier.BASIC){
options.setForegroundOptions(new TextureOptions(0xFFFFFF, Block.blockRedstone.atlasIndices[0]));
} else {
options.setForegroundOptions(new TextureOptions(0xFFFFFF,SignalIndustries.dilithiumCrystalBlock.atlasIndices[0]));
}
c.drawProgressBarTextureWithText(tile.progressTicks,tile.progressMaxTicks,options,0);
drawFluids(tile,c);
c.drawInventory(tile, 0);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package sunsetsatellite.signalindustries.api.impl.btwaila.tooltip;

import net.minecraft.core.block.entity.TileEntity;
import net.minecraft.core.item.ItemStack;
import sunsetsatellite.signalindustries.inventories.TileEntityItemConduit;
import toufoumaster.btwaila.gui.components.AdvancedInfoComponent;
import toufoumaster.btwaila.tooltips.TileTooltip;
import toufoumaster.btwaila.tooltips.Tooltip;

import java.util.List;
import java.util.stream.Collectors;

public class ItemConduitTooltip extends TileTooltip<TileEntityItemConduit> {
@Override
public void initTooltip() {
addClass(TileEntityItemConduit.class);
}

@Override
public void drawAdvancedTooltip(TileEntityItemConduit conduit, AdvancedInfoComponent c) {
ItemStack[] stacks = conduit.getContents().stream().map(TileEntityItemConduit.PipeItem::getStack).toArray(ItemStack[]::new);
c.drawItemList(stacks,0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,4 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
}
return false;
}

@Override
public void setBlockBoundsForItemRender() {
float width = 0.35f;
float halfWidth = (1.0F - width) / 2.0F;
setBlockBounds(halfWidth, halfWidth, halfWidth, halfWidth + width, halfWidth + width, halfWidth + width);
}

@Override
public String getDescription(ItemStack stack) {
return super.getDescription(stack);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,4 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
}
return false;
}

@Override
public void setBlockBoundsForItemRender() {
float width = 0.35f;
float halfWidth = (1.0F - width) / 2.0F;
setBlockBounds(halfWidth, halfWidth, halfWidth, halfWidth + width, halfWidth + width, halfWidth + width);
}

@Override
public String getDescription(ItemStack stack) {
return super.getDescription(stack);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package sunsetsatellite.signalindustries.blocks;

import net.minecraft.core.block.BlockTileEntityRotatable;
import net.minecraft.core.block.entity.TileEntity;
import net.minecraft.core.block.material.Material;
import net.minecraft.core.entity.EntityLiving;
import net.minecraft.core.util.helper.Side;
import net.minecraft.core.util.helper.Sides;
import net.minecraft.core.world.World;
import sunsetsatellite.catalyst.core.util.Direction;
import sunsetsatellite.signalindustries.SignalIndustries;
import sunsetsatellite.signalindustries.blocks.base.BlockContainerTiered;
import sunsetsatellite.signalindustries.inventories.TileEntityInserter;
import sunsetsatellite.signalindustries.util.Tier;

public class BlockInserter extends BlockContainerTiered {

public BlockInserter(String key, int i, Tier tier, Material material) {
super(key, i, tier, material);
withTags(SignalIndustries.ITEM_CONDUITS_CONNECT);
}

@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(tier.name()+".inserter.vertical").getTexture(Side.getSideById(index));
} else {
index = Sides.orientationLookUpHorizontal[6 * meta + side.getId()];
}
return this.atlasIndices[index];
}

@Override
public void onBlockPlaced(World world, int x, int y, int z, Side side, EntityLiving entity, double sideHeight) {
world.setBlockMetadataWithNotify(x, y, z, entity.getPlacementDirection(side).getOpposite().getId());
}

@Override
protected TileEntity getNewBlockEntity() {
return new TileEntityInserter();
}
}
Loading

0 comments on commit aa6ff4a

Please sign in to comment.