-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
aa6ff4a
commit 29189ae
Showing
79 changed files
with
2,693 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 83 additions & 0 deletions
83
src/main/java/sunsetsatellite/signalindustries/blocks/BlockFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
Oops, something went wrong.