summaryrefslogtreecommitdiff
path: root/src/main/java/jp/plusplus/fbs/block/BlockSchoolTable.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/jp/plusplus/fbs/block/BlockSchoolTable.java')
-rw-r--r--src/main/java/jp/plusplus/fbs/block/BlockSchoolTable.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/main/java/jp/plusplus/fbs/block/BlockSchoolTable.java b/src/main/java/jp/plusplus/fbs/block/BlockSchoolTable.java
new file mode 100644
index 0000000..c2f9ec3
--- /dev/null
+++ b/src/main/java/jp/plusplus/fbs/block/BlockSchoolTable.java
@@ -0,0 +1,54 @@
+package jp.plusplus.fbs.block;
+
+import jp.plusplus.fbs.FBS;
+import jp.plusplus.fbs.tileentity.TileEntityForRender;
+import net.minecraft.block.ITileEntityProvider;
+import net.minecraft.block.material.Material;
+import net.minecraft.entity.EntityLivingBase;
+import net.minecraft.item.ItemStack;
+import net.minecraft.tileentity.TileEntity;
+import net.minecraft.util.MathHelper;
+import net.minecraft.world.World;
+
+/**
+ * Created by plusplus_F on 2015/09/25.
+ */
+public class BlockSchoolTable extends BlockBase implements ITileEntityProvider {
+ public BlockSchoolTable() {
+ super(Material.wood);
+ setBlockName("schoolTable");
+ setBlockTextureName("bookshelfTop");
+ setHardness(1.0f);
+ setResistance(15.f);
+ }
+
+ @Override
+ public boolean isOpaqueCube() {
+ return false;
+ }
+
+ @Override
+ public boolean renderAsNormalBlock() {
+ return false;
+ }
+
+ @Override
+ public int getRenderType() {
+ return FBS.renderDecorationId;
+ }
+
+
+ public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack item) {
+ int l = MathHelper.floor_double((double) (entity.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
+
+ if (l == 0) world.setBlockMetadataWithNotify(x, y, z, 2, 2);
+ if (l == 1) world.setBlockMetadataWithNotify(x, y, z, 5, 2);
+ if (l == 2) world.setBlockMetadataWithNotify(x, y, z, 3, 2);
+ if (l == 3) world.setBlockMetadataWithNotify(x, y, z, 4, 2);
+ }
+
+ @Override
+ public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
+ return new TileEntityForRender();
+ }
+}