mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-16 18:44:42 +00:00
add larger buffer
This commit is contained in:
1 parent
61cdd8c487
commit
35f2dd4073
12 files changed
+398
No files matched your search
@@ -0,0 +1,55 @@
|
||||
package com.glodblock.github.common.block;
|
||||
|
||||
import appeng.block.AEBaseItemBlock;
|
||||
import com.glodblock.github.common.tile.TileLargeIngredientBuffer;
|
||||
import com.glodblock.github.inventory.InventoryHandler;
|
||||
import com.glodblock.github.inventory.gui.GuiType;
|
||||
import com.glodblock.github.util.BlockPos;
|
||||
import com.glodblock.github.util.NameConst;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockLargeIngredientBuffer extends FCBaseBlock {
|
||||
|
||||
public BlockLargeIngredientBuffer() {
|
||||
super(Material.iron, NameConst.BLOCK_LARGE_INGREDIENT_BUFFER);
|
||||
setTileEntity(TileLargeIngredientBuffer.class);
|
||||
setOpaque(false);
|
||||
setFullBlock(false);
|
||||
this.lightOpacity = 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(World world, int x, int y, int z, EntityPlayer player, int facing, float hitX, float hitY, float hitZ) {
|
||||
if (player.isSneaking()) {
|
||||
return false;
|
||||
}
|
||||
TileLargeIngredientBuffer tile = getTileEntity(world, x, y, z);
|
||||
if (tile != null) {
|
||||
if (!world.isRemote) {
|
||||
InventoryHandler.openGui(player, world, new BlockPos(x, y, z), EnumFacing.getFront(facing), GuiType.LARGE_INGREDIENT_BUFFER);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public BlockLargeIngredientBuffer register() {
|
||||
GameRegistry.registerBlock(this, AEBaseItemBlock.class, NameConst.BLOCK_LARGE_INGREDIENT_BUFFER);
|
||||
GameRegistry.registerTileEntity(TileLargeIngredientBuffer.class, NameConst.BLOCK_LARGE_INGREDIENT_BUFFER);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ItemStack stack(int size) {
|
||||
return new ItemStack(this, size);
|
||||
}
|
||||
|
||||
public ItemStack stack() {
|
||||
return new ItemStack(this, 1);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user