Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic if moderately broken mp support #11

Merged
merged 5 commits into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 75 additions & 34 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 @@ -88,7 +88,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityEnergyCell tile = (TileEntityEnergyCell) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiEnergyCell(entityplayer.inventory, tile),new ContainerFluidTank(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiEnergyCell(entityplayer.inventory, tile),new ContainerFluidTank(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityEnergyConnector tile = (TileEntityEnergyConnector) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiEnergyConnector(entityplayer.inventory, tile),new ContainerEnergyConnector(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiEnergyConnector(entityplayer.inventory, tile),new ContainerEnergyConnector(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityExternalIO tile = (TileEntityExternalIO) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiExternalIO(entityplayer.inventory, tile),new ContainerExternalIO(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiExternalIO(entityplayer.inventory, tile),new ContainerExternalIO(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
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);
SignalIndustries.displayGui(entityplayer,() -> new GuiFilter(entityplayer.inventory, tile),new ContainerFilter(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityFluidHatch tile = (TileEntityFluidHatch) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiFluidHatch(entityplayer.inventory, tile),new ContainerFluidHatch(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiFluidHatch(entityplayer.inventory, tile),new ContainerFluidHatch(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityFluidHatch tile = (TileEntityFluidHatch) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiFluidHatch(entityplayer.inventory, tile),new ContainerFluidHatch(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiFluidHatch(entityplayer.inventory, tile),new ContainerFluidHatch(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityItemBus tile = (TileEntityItemBus) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiItemBus(entityplayer.inventory, tile),new ContainerItemBus(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 @@ -53,12 +53,12 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
}
if (!world.isClientSide && type == PipeType.RESTRICT) {
TileEntityItemConduit tile = (TileEntityItemConduit) world.getBlockTileEntity(i,j,k);
SignalIndustries.displayGui(entityplayer, new GuiRestrictPipeConfig(entityplayer, tile, null), tile, tile.x,tile.y,tile.z);
SignalIndustries.displayGui(entityplayer, () -> new GuiRestrictPipeConfig(entityplayer, tile, null), tile, tile.x,tile.y,tile.z);
return true;
}
if(!world.isClientSide && type == PipeType.SENSOR) {
TileEntityItemConduit tile = (TileEntityItemConduit) world.getBlockTileEntity(i,j,k);
SignalIndustries.displayGui(entityplayer, new GuiSensorPipeConfig(entityplayer.inventory, tile), tile, tile.x,tile.y,tile.z);
SignalIndustries.displayGui(entityplayer, () -> new GuiSensorPipeConfig(entityplayer.inventory, tile), tile, tile.x,tile.y,tile.z);
return true;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityItemBus tile = (TileEntityItemBus) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiItemBus(entityplayer.inventory, tile),new ContainerItemBus(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 @@ -88,7 +88,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntitySIFluidTank tile = (TileEntitySIFluidTank) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiSIFluidTank(entityplayer.inventory, tile),new ContainerFluidTank(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiSIFluidTank(entityplayer.inventory, tile),new ContainerFluidTank(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityAlloySmelter tile = (TileEntityAlloySmelter) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiAlloySmelter(entityplayer.inventory, tile),new ContainerAlloySmelter(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiAlloySmelter(entityplayer.inventory, tile),new ContainerAlloySmelter(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityAssembler tile = (TileEntityAssembler) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiAssembler(entityplayer.inventory, tile),new ContainerAssembler(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiAssembler(entityplayer.inventory, tile),new ContainerAssembler(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
TileEntityAutoMiner tile = (TileEntityAutoMiner) world.getBlockTileEntity(i, j, k);

if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiAutoMiner(entityplayer.inventory, tile),new ContainerAutoMiner(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiAutoMiner(entityplayer.inventory, tile),new ContainerAutoMiner(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityCentrifuge tile = (TileEntityCentrifuge) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiCentrifuge(entityplayer.inventory, tile),new ContainerCentrifuge(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiCentrifuge(entityplayer.inventory, tile),new ContainerCentrifuge(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityCrusher tile = (TileEntityCrusher) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiCrusher(entityplayer.inventory, tile),new ContainerCrusher(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiCrusher(entityplayer.inventory, tile),new ContainerCrusher(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityCrystalChamber tile = (TileEntityCrystalChamber) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiCrystalChamber(entityplayer.inventory, tile),new ContainerCrystalChamber(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiCrystalChamber(entityplayer.inventory, tile),new ContainerCrystalChamber(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityCrystalCutter tile = (TileEntityCrystalCutter) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiCrystalCutter(entityplayer.inventory, tile),new ContainerCrystalCutter(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiCrystalCutter(entityplayer.inventory, tile),new ContainerCrystalCutter(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityBooster tile = (TileEntityBooster) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiBooster(entityplayer.inventory, tile),new ContainerBooster(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiBooster(entityplayer.inventory, tile),new ContainerBooster(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityStabilizer tile = (TileEntityStabilizer) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiStabilizer(entityplayer.inventory, tile),new ContainerStabilizer(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiStabilizer(entityplayer.inventory, tile),new ContainerStabilizer(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityDimensionalAnchor tile = (TileEntityDimensionalAnchor) world.getBlockTileEntity(i, j, k);
if(tile.multiblock != null && tile.multiblock.isValidAt(world,new BlockInstance(this,new Vec3i(i,j,k),tile),Direction.getDirectionFromSide(world.getBlockMetadata(i,j,k)))){
SignalIndustries.displayGui(entityplayer,new GuiDimAnchor(entityplayer.inventory, tile),new ContainerDimAnchor(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiDimAnchor(entityplayer.inventory, tile),new ContainerDimAnchor(entityplayer.inventory,tile),tile,i,j,k);
entityplayer.triggerAchievement(SignalIndustriesAchievementPage.HORIZONS);
} else {
entityplayer.addChatMessage("event.signalindustries.invalidMultiblock");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityEnergyInjector tile = (TileEntityEnergyInjector) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiEnergyInjector(entityplayer.inventory, tile),new ContainerEnergyInjector(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiEnergyInjector(entityplayer.inventory, tile),new ContainerEnergyInjector(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
TileEntityReinforcedExtractor tile = (TileEntityReinforcedExtractor) 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.getDirectionFromSide(world.getBlockMetadata(i,j,k)))){
SignalIndustries.displayGui(entityplayer,new GuiReinforcedExtractor(entityplayer.inventory, tile),new ContainerReinforcedExtractor(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiReinforcedExtractor(entityplayer.inventory, tile),new ContainerReinforcedExtractor(entityplayer.inventory,tile),tile,i,j,k);
entityplayer.triggerAchievement(SignalIndustriesAchievementPage.HORIZONS);
} else {
entityplayer.addChatMessage("event.signalindustries.invalidMultiblock");
Expand All @@ -118,7 +118,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
} else {
TileEntityExtractor tile = (TileEntityExtractor) world.getBlockTileEntity(i, j, k);
if (tile != null) {
SignalIndustries.displayGui(entityplayer, new GuiExtractor(entityplayer.inventory, tile), new ContainerExtractor(entityplayer.inventory, tile), tile, i, j, k);
SignalIndustries.displayGui(entityplayer, () -> new GuiExtractor(entityplayer.inventory, tile), new ContainerExtractor(entityplayer.inventory, tile), tile, i, j, k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityInfuser tile = (TileEntityInfuser) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiInfuser(entityplayer.inventory, tile),new ContainerInfuser(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiInfuser(entityplayer.inventory, tile),new ContainerInfuser(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityPlateFormer tile = (TileEntityPlateFormer) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiPlateFormer(entityplayer.inventory, tile),new ContainerPlateFormer(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiPlateFormer(entityplayer.inventory, tile),new ContainerPlateFormer(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityProgrammer tile = (TileEntityProgrammer) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiProgrammer(entityplayer.inventory, tile),new ContainerProgrammer(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiProgrammer(entityplayer.inventory, tile),new ContainerProgrammer(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntityPump tile = (TileEntityPump) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiPump(entityplayer.inventory, tile),new ContainerPump(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiPump(entityplayer.inventory, tile),new ContainerPump(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntitySignalumDynamo tile = (TileEntitySignalumDynamo) world.getBlockTileEntity(i, j, k);
if(tile != null) {
SignalIndustries.displayGui(entityplayer,new GuiSignalumDynamo(entityplayer.inventory, tile),new ContainerSignalumDynamo(entityplayer.inventory,tile),tile,i,j,k);
SignalIndustries.displayGui(entityplayer,() -> new GuiSignalumDynamo(entityplayer.inventory, tile),new ContainerSignalumDynamo(entityplayer.inventory,tile),tile,i,j,k);
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public boolean blockActivated(World world, int i, int j, int k, EntityPlayer ent
{
TileEntitySignalumReactor tile = (TileEntitySignalumReactor) world.getBlockTileEntity(i, j, k);
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);
SignalIndustries.displayGui(entityplayer, () -> new GuiSignalumReactor(entityplayer.inventory, tile), tile, i, j, k);
entityplayer.triggerAchievement(SignalIndustriesAchievementPage.HORIZONS);
} else {
entityplayer.addChatMessage("event.signalindustries.invalidMultiblock");
Expand Down
Loading
Loading