Stuff
This commit is contained in:
@@ -1,19 +1,27 @@
|
||||
package refinedstorage.block;
|
||||
|
||||
import net.minecraft.block.properties.PropertyBool;
|
||||
import net.minecraft.block.state.BlockStateContainer;
|
||||
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.EnumParticleTypes;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
import refinedstorage.RefinedStorage;
|
||||
import refinedstorage.RefinedStorageGui;
|
||||
import refinedstorage.tile.TileSolderer;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockSolderer extends BlockNode {
|
||||
public static final PropertyBool WORKING = PropertyBool.create("working");
|
||||
|
||||
public BlockSolderer() {
|
||||
super("solderer");
|
||||
}
|
||||
@@ -32,8 +40,33 @@ public class BlockSolderer extends BlockNode {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isBlockSolid(IBlockAccess worldIn, BlockPos pos, EnumFacing side) {
|
||||
protected BlockStateContainer createBlockState() {
|
||||
return super.createBlockStateBuilder()
|
||||
.add(WORKING)
|
||||
.build();
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) {
|
||||
double d0 = (double) pos.getX() + 0.5D;
|
||||
double d1 = (double) pos.getY() + rand.nextDouble() * 6.0D / 16.0D;
|
||||
double d2 = (double) pos.getZ() + 0.5D;
|
||||
double d4 = rand.nextDouble() * 0.6D - 0.3D;
|
||||
|
||||
if (state.getValue(WORKING)) {
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, d0 - 0.52D, d1, d2 + d4, 0.0D, 0.0D, 0.0D, new int[0]);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@@ -3,6 +3,7 @@ package refinedstorage.proxy;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.block.model.ModelBakery;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraft.client.renderer.block.statemap.StateMap;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
@@ -101,6 +102,11 @@ public class ClientProxy extends CommonProxy {
|
||||
ModelLoader.setCustomModelResourceLocation(RefinedStorageItems.UPGRADE, ItemUpgrade.TYPE_STACK, new ModelResourceLocation("refinedstorage:stack_upgrade", "inventory"));
|
||||
|
||||
// Blocks
|
||||
ModelLoader.setCustomStateMapper(RefinedStorageBlocks.SOLDERER, (new StateMap.Builder())
|
||||
.ignore(RefinedStorageBlocks.SOLDERER.WORKING)
|
||||
.build()
|
||||
);
|
||||
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.CABLE), 0, new ModelResourceLocation("refinedstorage:cable", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.GRID), EnumGridType.NORMAL.getId(), new ModelResourceLocation("refinedstorage:grid", "inventory"));
|
||||
ModelLoader.setCustomModelResourceLocation(Item.getItemFromBlock(RefinedStorageBlocks.GRID), EnumGridType.CRAFTING.getId(), new ModelResourceLocation("refinedstorage:grid", "inventory"));
|
||||
|
@@ -138,6 +138,22 @@ public class TileSolderer extends TileNode {
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NBTTagCompound writeUpdate(NBTTagCompound tag) {
|
||||
super.writeUpdate(tag);
|
||||
|
||||
tag.setBoolean(NBT_WORKING, working);
|
||||
|
||||
return tag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readUpdate(NBTTagCompound tag) {
|
||||
working = tag.getBoolean(NBT_WORKING);
|
||||
|
||||
super.readUpdate(tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readContainerData(ByteBuf buf) {
|
||||
super.readContainerData(buf);
|
||||
|
Reference in New Issue
Block a user