Added model for reader writer
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package com.raoulvdberge.refinedstorage.block;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.RSBlocks;
|
||||
import com.raoulvdberge.refinedstorage.RSGui;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileReader;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -9,16 +10,24 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockReader extends BlockNode {
|
||||
import java.util.List;
|
||||
|
||||
public class BlockReader extends BlockCable {
|
||||
public BlockReader() {
|
||||
super("reader");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
public List<AxisAlignedBB> getNonUnionizedCollisionBoxes(IBlockState state) {
|
||||
return RSBlocks.CONSTRUCTOR.getNonUnionizedCollisionBoxes(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivatedDefault(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
if (!world.isRemote) {
|
||||
player.openGui(RS.INSTANCE, RSGui.READER_WRITER, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
|
||||
@@ -33,8 +42,13 @@ public class BlockReader extends BlockNode {
|
||||
return new TileReader();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasConnectivityState() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
return EnumPlacementType.ANY;
|
||||
return EnumPlacementType.ANY_FACE_PLAYER;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,25 +1,35 @@
|
||||
package com.raoulvdberge.refinedstorage.block;
|
||||
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.RSBlocks;
|
||||
import com.raoulvdberge.refinedstorage.RSGui;
|
||||
import com.raoulvdberge.refinedstorage.tile.TileWriter;
|
||||
import mcmultipart.microblock.MicroblockContainer;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockWriter extends BlockNode {
|
||||
import java.util.List;
|
||||
|
||||
public class BlockWriter extends BlockCable {
|
||||
public BlockWriter() {
|
||||
super("writer");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
public List<AxisAlignedBB> getNonUnionizedCollisionBoxes(IBlockState state) {
|
||||
return RSBlocks.CONSTRUCTOR.getNonUnionizedCollisionBoxes(state);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivatedDefault(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) {
|
||||
if (!world.isRemote) {
|
||||
player.openGui(RS.INSTANCE, RSGui.READER_WRITER, world, pos.getX(), pos.getY(), pos.getZ());
|
||||
|
||||
@@ -36,7 +46,7 @@ public class BlockWriter extends BlockNode {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public int getWeakPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
public int getWeakPowerDefault(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side, MicroblockContainer partContainer) {
|
||||
TileWriter writer = (TileWriter) world.getTileEntity(pos);
|
||||
|
||||
return side == writer.getDirection().getOpposite() ? writer.getRedstoneStrength() : 0;
|
||||
@@ -44,18 +54,17 @@ public class BlockWriter extends BlockNode {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public int getStrongPower(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
public int getStrongPowerDefault(IBlockState state, IBlockAccess world, BlockPos pos, EnumFacing side, MicroblockContainer partContainer) {
|
||||
return getWeakPower(state, world, pos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public boolean canProvidePower(IBlockState state) {
|
||||
public boolean hasConnectivityState() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumPlacementType getPlacementType() {
|
||||
return EnumPlacementType.ANY;
|
||||
return EnumPlacementType.ANY_FACE_PLAYER;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,6 +179,8 @@ public class ProxyClient extends ProxyCommon {
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.EXTERNAL_STORAGE), 0, new ModelResourceLocation("refinedstorage:external_storage", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.CONSTRUCTOR), 0, new ModelResourceLocation("refinedstorage:constructor", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.DESTRUCTOR), 0, new ModelResourceLocation("refinedstorage:destructor", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.READER), 0, new ModelResourceLocation("refinedstorage:reader", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.WRITER), 0, new ModelResourceLocation("refinedstorage:writer", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.SOLDERER), 0, new ModelResourceLocation("refinedstorage:solderer", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.DETECTOR), 0, new ModelResourceLocation("refinedstorage:detector", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RSBlocks.RELAY), 0, new ModelResourceLocation("refinedstorage:relay", "inventory"));
|
||||
|
||||
@@ -17,7 +17,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
|
||||
public class TileReader extends TileNode implements IReader {
|
||||
public class TileReader extends TileMultipartNode implements IReader {
|
||||
private static final String NBT_CHANNEL = "Channel";
|
||||
|
||||
static <T extends TileEntity & IReaderWriter> TileDataParameter<String> createChannelParameter() {
|
||||
|
||||
@@ -12,7 +12,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.capabilities.Capability;
|
||||
|
||||
public class TileWriter extends TileNode implements IWriter {
|
||||
public class TileWriter extends TileMultipartNode implements IWriter {
|
||||
private static final String NBT_CHANNEL = "Channel";
|
||||
|
||||
private static final TileDataParameter<String> CHANNEL = TileReader.createChannelParameter();
|
||||
|
||||
Reference in New Issue
Block a user