Skip to content
This repository has been archived by the owner on Apr 22, 2019. It is now read-only.

Commit

Permalink
Fix rotation of Glass Bell on placement
Browse files Browse the repository at this point in the history
  • Loading branch information
pahimar committed Oct 14, 2016
1 parent ecd7d5f commit a26d32d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
13 changes: 13 additions & 0 deletions src/main/java/com/pahimar/ee3/block/BlockGlassBell.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@

import com.pahimar.ee3.block.base.BlockDirectional;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.ItemStack;
import net.minecraft.util.BlockRenderLayer;
import net.minecraft.util.EnumFacing;
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;

Expand Down Expand Up @@ -41,4 +44,14 @@ public boolean isFullCube(IBlockState state) {
public BlockRenderLayer getBlockLayer() {
return BlockRenderLayer.CUTOUT;
}

@Override
public void onBlockPlacedBy(World world, BlockPos blockPos, IBlockState state, EntityLivingBase entity, ItemStack itemStack) {
// NOOP
}

@Override
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
return this.getDefaultState().withProperty(FACING, facing);
}
}
10 changes: 5 additions & 5 deletions src/main/resources/assets/ee3/blockstates/glass_bell.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@
"normal": [{}],
"inventory": [{}],
"facing": {
"north": {},
"south": {"y": 180},
"west": {"y": 270},
"east": {"y": 90},
"up": {"x": -90},
"north": {"x": 90},
"south": {"x": 90, "y": 180},
"west": {"x": 90, "y": -90},
"east": {"x": 90, "y": 90},
"up": {},
"down": {"x": 180}
}
}
Expand Down

0 comments on commit a26d32d

Please sign in to comment.