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();
|
||||
|
||||
89
src/main/resources/assets/refinedstorage/blockstates/reader.json
Executable file
89
src/main/resources/assets/refinedstorage/blockstates/reader.json
Executable file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"textures": {
|
||||
"all": "refinedstorage:blocks/cable_new",
|
||||
"particle": "refinedstorage:blocks/cable_new",
|
||||
"front": "refinedstorage:blocks/reader",
|
||||
"line": "refinedstorage:blocks/importer_exporter_external_storage"
|
||||
},
|
||||
"model": "refinedstorage:cable_core",
|
||||
"uvlock": true
|
||||
},
|
||||
"variants": {
|
||||
"inventory": [
|
||||
{
|
||||
"model": "refinedstorage:constructor_destructor",
|
||||
"transform": "forge:default-block"
|
||||
}
|
||||
],
|
||||
"connected": {
|
||||
"true": {
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"direction": {
|
||||
"north": {
|
||||
"submodel": "refinedstorage:constructor_destructor_north"
|
||||
},
|
||||
"east": {
|
||||
"submodel": "refinedstorage:constructor_destructor_east"
|
||||
},
|
||||
"south": {
|
||||
"submodel": "refinedstorage:constructor_destructor_south"
|
||||
},
|
||||
"west": {
|
||||
"submodel": "refinedstorage:constructor_destructor_west"
|
||||
},
|
||||
"up": {
|
||||
"submodel": "refinedstorage:constructor_destructor_up"
|
||||
},
|
||||
"down": {
|
||||
"submodel": "refinedstorage:constructor_destructor_down"
|
||||
}
|
||||
},
|
||||
"north": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_north"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"east": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_east"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"south": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_south"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"west": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_west"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"up": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_up"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"down": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_down"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
89
src/main/resources/assets/refinedstorage/blockstates/writer.json
Executable file
89
src/main/resources/assets/refinedstorage/blockstates/writer.json
Executable file
@@ -0,0 +1,89 @@
|
||||
{
|
||||
"forge_marker": 1,
|
||||
"defaults": {
|
||||
"textures": {
|
||||
"all": "refinedstorage:blocks/cable_new",
|
||||
"particle": "refinedstorage:blocks/cable_new",
|
||||
"front": "refinedstorage:blocks/writer",
|
||||
"line": "refinedstorage:blocks/importer_exporter_external_storage"
|
||||
},
|
||||
"model": "refinedstorage:cable_core",
|
||||
"uvlock": true
|
||||
},
|
||||
"variants": {
|
||||
"inventory": [
|
||||
{
|
||||
"model": "refinedstorage:constructor_destructor",
|
||||
"transform": "forge:default-block"
|
||||
}
|
||||
],
|
||||
"connected": {
|
||||
"true": {
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"direction": {
|
||||
"north": {
|
||||
"submodel": "refinedstorage:constructor_destructor_north"
|
||||
},
|
||||
"east": {
|
||||
"submodel": "refinedstorage:constructor_destructor_east"
|
||||
},
|
||||
"south": {
|
||||
"submodel": "refinedstorage:constructor_destructor_south"
|
||||
},
|
||||
"west": {
|
||||
"submodel": "refinedstorage:constructor_destructor_west"
|
||||
},
|
||||
"up": {
|
||||
"submodel": "refinedstorage:constructor_destructor_up"
|
||||
},
|
||||
"down": {
|
||||
"submodel": "refinedstorage:constructor_destructor_down"
|
||||
}
|
||||
},
|
||||
"north": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_north"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"east": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_east"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"south": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_south"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"west": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_west"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"up": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_up"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
},
|
||||
"down": {
|
||||
"true": {
|
||||
"submodel": "refinedstorage:cable_down"
|
||||
},
|
||||
"false": {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
src/main/resources/assets/refinedstorage/textures/blocks/reader.png
Executable file
BIN
src/main/resources/assets/refinedstorage/textures/blocks/reader.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 212 B |
BIN
src/main/resources/assets/refinedstorage/textures/blocks/writer.png
Executable file
BIN
src/main/resources/assets/refinedstorage/textures/blocks/writer.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 203 B |
Reference in New Issue
Block a user