Skip to content

Commit

Permalink
Updated to 7.1pre2a!
Browse files Browse the repository at this point in the history
Added Reinforced External IO and Position Memory Chip to be used with it.
Added bricks of Tier 0-2 materials.
Added filter (for item conduits).
Added prototype item conduits.
Added recipe reload command.
Added restriction item conduit.
  • Loading branch information
MartinSVK12 committed Mar 25, 2024
1 parent aa6ff4a commit 29189ae
Show file tree
Hide file tree
Showing 79 changed files with 2,693 additions and 227 deletions.
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
org.gradle.jvmargs=-Xmx2G

# BTA
bta_version=7.1-pre1a
bta_version=7.1-pre2a

# Loader
loader_version=0.15.6-babric.4-bta

# Mods
halplibe_version=3.4.13
modmenu_version=2.0.3
halplibe_version=3.4.17
modmenu_version=2.0.4
dragonfly_version=1.4.4-7.1
btwaila_version=1.0.7-7.1
btwaila_version=1.0.9-7.1
terrain_api_version=1.4.2-7.1

# Mod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import net.minecraft.client.render.entity.MobRenderer;
import net.minecraft.client.render.entity.SnowballRenderer;
import net.minecraft.client.render.model.ModelZombie;
import net.minecraft.client.sound.block.BlockSounds;
import net.minecraft.core.block.*;
import net.minecraft.core.block.material.Material;
import net.minecraft.core.block.tag.BlockTags;
Expand All @@ -27,6 +26,7 @@
import net.minecraft.core.item.tool.ItemToolPickaxe;
import net.minecraft.core.player.inventory.Container;
import net.minecraft.core.player.inventory.IInventory;
import net.minecraft.core.sound.BlockSounds;
import net.minecraft.core.world.Dimension;
import net.minecraft.core.world.World;
import net.minecraft.core.world.biome.Biome;
Expand Down Expand Up @@ -54,6 +54,7 @@
import sunsetsatellite.signalindustries.blocks.states.ConduitStateInterpreter;
import sunsetsatellite.signalindustries.blocks.states.EEPROMProgrammerStateInterpreter;
import sunsetsatellite.signalindustries.blocks.states.ItemConduitStateInterpreter;
import sunsetsatellite.signalindustries.commands.RecipeReloadCommand;
import sunsetsatellite.signalindustries.dim.WorldTypeEternity;
import sunsetsatellite.signalindustries.entities.EntityCrystal;
import sunsetsatellite.signalindustries.entities.EntityEnergyOrb;
Expand Down Expand Up @@ -434,6 +435,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 prototypeItemConduit = new BlockBuilder(MOD_ID)
.setTextures("item_conduit_prototype.png")
.setLuminance(0)
.setResistance(1)
.setHardness(1)
.setBlockSound(BlockSounds.GLASS)
.setBlockModel(
new BlockModelDragonFly(
ModelHelper.getOrCreateBlockModel(MOD_ID,"conduit/item/prototype/conduit_all.json"),
ModelHelper.getOrCreateBlockState(MOD_ID,"prototype_item_conduit.json"),
new ItemConduitStateInterpreter(),
true
)
)
.build(new BlockItemConduit("prototype.conduit.item",config.getInt("BlockIDs.prototypeItemConduit"),Tier.PROTOTYPE,Material.glass, PipeType.NORMAL));

public static final Block basicItemConduit = new BlockBuilder(MOD_ID)
.setTextures("item_conduit_basic.png")
.setLuminance(0)
Expand All @@ -448,7 +465,23 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint {
true
)
)
.build(new BlockItemConduit("basic.conduit.item",config.getInt("BlockIDs.basicItemConduit"),Tier.BASIC,Material.glass));
.build(new BlockItemConduit("basic.conduit.item",config.getInt("BlockIDs.basicItemConduit"),Tier.BASIC,Material.glass, PipeType.NORMAL));

public static final Block basicRestrictItemConduit = 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/restrict/conduit_all.json"),
ModelHelper.getOrCreateBlockState(MOD_ID,"basic_item_conduit_restrict.json"),
new ItemConduitStateInterpreter(),
true
)
)
.build(new BlockItemConduit("basic.conduit.item.restrict",config.getInt("BlockIDs.basicRestrictItemConduit"),Tier.BASIC,Material.glass, PipeType.RESTRICT));


public static final Block infiniteEnergyCell = new BlockBuilder(MOD_ID)
Expand Down Expand Up @@ -724,6 +757,18 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint {
.setNorthTexture("basic_inserter_input.png")
.build(new BlockInserter("basic.inserter",config.getInt("BlockIDs.basicInserter"),Tier.BASIC,Material.metal));

public static final Block prototypeFilter = new BlockBuilder(MOD_ID)
.setHardness(1)
.setResistance(3)
.setBlockSound(BlockSounds.STONE)
.setTopTexture("filter_red.png")
.setNorthTexture("filter_green.png")
.setEastTexture("filter_blue.png")
.setWestTexture("filter_yellow.png")
.setSouthTexture("filter_magenta.png")
.setBottomTexture("filter_cyan.png")
.build(new BlockFilter("prototype.filter",config.getInt("BlockIDs.prototypeFilter"),Tier.PROTOTYPE,Material.stone));

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)
.setBlockSound(BlockSounds.METAL)
Expand All @@ -740,6 +785,13 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint {
.setTextures("external_io_blank.png")
.build(new BlockExternalIO("basic.externalIO",config.getInt("BlockIDs.externalIo"),Tier.BASIC,Material.metal));

public static final Block reinforcedExternalIo = new BlockBuilder(MOD_ID)
.setBlockSound(BlockSounds.METAL)
.setHardness(1)
.setResistance(3)
.setTextures("reinforced_external_io_blank.png")
.build(new BlockExternalIO("reinforced.externalIO",config.getInt("BlockIDs.reinforcedExternalIo"),Tier.REINFORCED,Material.metal));

public static final Block reinforcedCentrifuge = new BlockBuilder(MOD_ID)
.setBlockSound(BlockSounds.METAL)
.setHardness(1)
Expand Down Expand Up @@ -844,6 +896,30 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint {
.setTextures(1,0)
.build(new BlockProgrammer("basic.programmer",config.getInt("BlockIDs.basicProgrammer"),Tier.BASIC,Material.metal));

public static final Block cobblestoneBricks = new BlockBuilder(MOD_ID)
.setBlockSound(BlockSounds.STONE)
.setHardness(1)
.setResistance(3)
.setLuminance(0)
.setTextures("cobblestone_bricks.png")
.build(new Block("prototype.bricks",config.getInt("BlockIDs.cobblestoneBricks"),Material.stone));

public static final Block crystalAlloyBricks = new BlockBuilder(MOD_ID)
.setBlockSound(BlockSounds.METAL)
.setHardness(1)
.setResistance(3)
.setLuminance(0)
.setTextures("crystal_alloy_bricks.png")
.build(new Block("basic.bricks",config.getInt("BlockIDs.crystalAlloyBricks"),Material.metal));

public static final Block reinforcedCrystalAlloyBricks = new BlockBuilder(MOD_ID)
.setBlockSound(BlockSounds.METAL)
.setHardness(1)
.setResistance(3)
.setLuminance(0)
.setTextures("reinforced_alloy_bricks.png")
.build(new Block("reinforced.bricks",config.getInt("BlockIDs.reinforcedCrystalAlloyBricks"),Material.metal));

//this has to be after any other block
public static final int[] energyTex = TextureHelper.getOrCreateBlockTexture(MOD_ID,"signalum_energy_transparent.png");
public static final int[] burntSignalumTex = TextureHelper.getOrCreateBlockTexture(MOD_ID,"burnt_signalum.png");//registerFluidTexture(MOD_ID,"signalum_energy.png",0,4);
Expand Down Expand Up @@ -1061,6 +1137,7 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint {
public static final Item blankAbilityModule = simpleItem("blankAbilityModule","blank_module.png");
public static final Item abilityContainerCasing = simpleItem("abilityContainerCasing","abilitycontainercasing.png");
public static final Item blankChip = simpleItem("blankChip","romChip.blank","blank_chip.png");
public static final Item positionMemoryChip = ItemHelper.createItem(MOD_ID,new ItemPositionChip("romChip.position",config.getInt("ItemIDs.positionMemoryChip")),"position_chip.png");


public static final int[] energyOrbTex = TextureHelper.getOrCreateItemTexture(MOD_ID,"energyorb.png");
Expand All @@ -1071,7 +1148,7 @@ public class SignalIndustries implements ModInitializer, GameStartEntrypoint {

public static final AchievementPage ACHIEVEMENTS = new SignalIndustriesAchievementPage();

public static final Biome biomeEternity = Biomes.register("signalindustries:eternity",new Biome().setFillerBlock(realityFabric.id).setTopBlock(realityFabric.id).setColor(0x808080));
public static final Biome biomeEternity = Biomes.register("signalindustries:eternity",new Biome("signalindustries:eternity").setFillerBlock(realityFabric.id).setTopBlock(realityFabric.id).setColor(0x808080));
public static final WorldType eternityWorld = WorldTypes.register("signalindustries:eternity",new WorldTypeEternity(key("eternity")));
public static final Dimension dimEternity = new Dimension(key("eternity"),Dimension.overworld,1,portalEternity.id).setDefaultWorldType(eternityWorld);

Expand Down Expand Up @@ -1159,6 +1236,8 @@ public void onInitialize() {
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()+".externalIo",new BlockTexture(MOD_ID).setAll("reinforced_external_io_blank.png").setTopTexture("reinforced_external_io_input.png").setBottomTexture("reinforced_external_io_output.png").setNorthTexture("reinforced_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"));
textures.put(Tier.REINFORCED.name()+".centrifuge.active.overlay",new BlockTexture(MOD_ID).setNorthTexture("centrifuge_overlay.png"));
Expand Down Expand Up @@ -1218,6 +1297,7 @@ public SignalIndustries(){
ironPlateHammer.setContainerItem(ironPlateHammer);

CommandHelper.Core.createCommand(new NBTEditCommand());
CommandHelper.Core.createCommand(new RecipeReloadCommand("recipes"));
CommandHelper.Core.createCommand(new StructureCommand("structure","struct"));

EntityHelper.Core.createEntity(EntityCrystal.class,47,"signalumCrystal");
Expand Down Expand Up @@ -1307,6 +1387,9 @@ public SignalIndustries(){
EntityHelper.Core.createTileEntity(TileEntityProgrammer.class,"EEPROM Programmer");
addToNameGuiMap("EEPROM Programmer", GuiProgrammer.class,TileEntityProgrammer.class);

EntityHelper.Core.createTileEntity(TileEntityFilter.class,"Filter");
addToNameGuiMap("Filter", GuiFilter.class, TileEntityFilter.class);

EntityHelper.Core.createTileEntity(TileEntityUVLamp.class,"Ultraviolet Lamp");

addToNameGuiMap("The Pulsar", GuiPulsar.class, InventoryPulsar.class);
Expand Down Expand Up @@ -1355,7 +1438,6 @@ public static Item simpleItem(String name, String lang, String texture){
return ItemHelper.createItem(MOD_ID,new Item(lang,config.getInt("ItemIDs."+name)),texture);
}


public static void displayGui(EntityPlayer entityplayer, GuiScreen guiScreen, Container container, IInventory tile, int x, int y, int z) {
if(entityplayer instanceof EntityPlayerMP) {
((IEntityPlayerMP)entityplayer).displayGuiScreen_si(guiScreen,container,tile,x,y,z);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,34 @@ public int getBlockTexture(WorldSource blockAccess, int x, int y, int z, Side si
int meta = blockAccess.getBlockMetadata(x,y,z);
int index = Sides.orientationLookUpHorizontal[6 * meta + side.getId()];
Connection connection = tile.itemConnections.get(Direction.getDirectionFromSide(side.getId()));
if(connection == Connection.INPUT){
int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_input.png");
return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]);
} else if(connection == Connection.OUTPUT){
int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_output.png");
return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]);
} else if(connection == Connection.BOTH){
int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_both.png");
return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]);
if(tier == Tier.REINFORCED){
if(connection == Connection.INPUT){
int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"reinforced_external_io_input.png");
return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]);
} else if(connection == Connection.OUTPUT){
int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"reinforced_external_io_output.png");
return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]);
} else if(connection == Connection.BOTH){
int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"reinforced_external_io_both.png");
return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]);
} else {
int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"reinforced_external_io_blank.png");
return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]);
}
} else {
int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_blank.png");
return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]);
if(connection == Connection.INPUT){
int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_input.png");
return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]);
} else if(connection == Connection.OUTPUT){
int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_output.png");
return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]);
} else if(connection == Connection.BOTH){
int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_both.png");
return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]);
} else {
int[] t = TextureHelper.getOrCreateBlockTexture(SignalIndustries.MOD_ID,"external_io_blank.png");
return this.atlasIndices[index] = Block.texCoordToIndex(t[0],t[1]);
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
package sunsetsatellite.signalindustries.blocks;

import net.minecraft.core.block.entity.TileEntity;
import net.minecraft.core.block.entity.TileEntityChest;
import net.minecraft.core.block.material.Material;
import net.minecraft.core.entity.EntityItem;
import net.minecraft.core.entity.player.EntityPlayer;
import net.minecraft.core.item.ItemStack;
import net.minecraft.core.world.World;
import sunsetsatellite.catalyst.core.util.Direction;
import sunsetsatellite.catalyst.fluids.impl.tiles.TileEntityFluidPipe;
import sunsetsatellite.signalindustries.SignalIndustries;
import sunsetsatellite.signalindustries.blocks.base.BlockContainerTiered;
import sunsetsatellite.signalindustries.containers.ContainerCrusher;
import sunsetsatellite.signalindustries.containers.ContainerFilter;
import sunsetsatellite.signalindustries.gui.GuiCrusher;
import sunsetsatellite.signalindustries.gui.GuiFilter;
import sunsetsatellite.signalindustries.inventories.TileEntityFilter;
import sunsetsatellite.signalindustries.inventories.machines.TileEntityCrusher;
import sunsetsatellite.signalindustries.util.Tier;

import java.util.ArrayList;
import java.util.Random;

public class BlockFilter extends BlockContainerTiered {
public BlockFilter(String key, int i, Tier tier, Material material) {
super(key, i, tier, material);
}

@Override
public void onBlockRemoved(World world, int i, int j, int k, int data) {
TileEntityFilter tile = (TileEntityFilter) world.getBlockTileEntity(i, j, k);
if (tile != null) {
Random random = new Random();
for (int l = 0; l < tile.getSizeInventory(); ++l) {
ItemStack itemstack = tile.getStackInSlot(l);
if (itemstack != null) {
float f = random.nextFloat() * 0.8F + 0.1F;
float f1 = random.nextFloat() * 0.8F + 0.1F;
float f2 = random.nextFloat() * 0.8F + 0.1F;

while (itemstack.stackSize > 0) {
int i1 = random.nextInt(21) + 10;
if (i1 > itemstack.stackSize) {
i1 = itemstack.stackSize;
}

itemstack.stackSize -= i1;
EntityItem entityitem = new EntityItem(world, (float) i + f, (float) j + f1, (float) k + f2, new ItemStack(itemstack.itemID, i1, itemstack.getMetadata()));
float f3 = 0.05F;
entityitem.xd = (float) random.nextGaussian() * f3;
entityitem.yd = (float) random.nextGaussian() * f3 + 0.2F;
entityitem.zd = (float) random.nextGaussian() * f3;
world.entityJoinedWorld(entityitem);
}
}
}
}

super.onBlockRemoved(world, i, j, k, data);
}

@Override
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
{
if(world.isClientSide)
{
return true;
} else
{
TileEntityFilter tile = (TileEntityFilter) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiFilter(entityplayer.inventory, tile),new ContainerFilter(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
}

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

0 comments on commit 29189ae

Please sign in to comment.