Skip to content

Commit fdca412

Browse files
committed
Add rotate function to headlamps
1 parent bca713d commit fdca412

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ mod_name=Create Bits 'n' Bobs
3434
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
3535
mod_license=All Rights Reserved
3636
# The mod version. See https://semver.org/
37-
mod_version=1.0.2
37+
mod_version=1.0.3
3838
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
3939
# This should match the base package used for the mod sources.
4040
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html

src/main/java/com/kipti/bnb/content/light/headlamp/HeadlampBlock.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import net.minecraft.world.item.context.UseOnContext;
2323
import net.minecraft.world.level.BlockGetter;
2424
import net.minecraft.world.level.Level;
25+
import net.minecraft.world.level.block.Rotation;
2526
import net.minecraft.world.level.block.entity.BlockEntityType;
2627
import net.minecraft.world.level.block.state.BlockState;
2728
import net.minecraft.world.level.material.FluidState;
@@ -186,6 +187,12 @@ protected VoxelShape getShape(BlockState state, BlockGetter level, BlockPos pos,
186187
Shapes.block();
187188
}
188189

190+
@Override
191+
protected BlockState rotate(BlockState state, Rotation rotation) {
192+
return super.rotate(state, rotation)
193+
.setValue(FACING, rotation.rotate(state.getValue(FACING)));
194+
}
195+
189196
@Override
190197
public boolean hasDynamicShape() {
191198
return true;

0 commit comments

Comments
 (0)