-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: allow sacrificial bowls to be rotated * feat: make item bob in facing direction * fix: improve item bobbing location * fix: final fix to item bobbing location
- Loading branch information
1 parent
2416807
commit 4e95537
Showing
6 changed files
with
160 additions
and
13 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
src/generated/resources/assets/occultism/blockstates/sacrificial_bowl.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"variants": { | ||
"facing=down": { | ||
"model": "occultism:block/sacrificial_bowl", | ||
"x": 180 | ||
}, | ||
"facing=east": { | ||
"model": "occultism:block/sacrificial_bowl", | ||
"x": 90, | ||
"y": 90 | ||
}, | ||
"facing=north": { | ||
"model": "occultism:block/sacrificial_bowl", | ||
"x": 90 | ||
}, | ||
"facing=south": { | ||
"model": "occultism:block/sacrificial_bowl", | ||
"x": 90, | ||
"y": 180 | ||
}, | ||
"facing=up": { | ||
"model": "occultism:block/sacrificial_bowl" | ||
}, | ||
"facing=west": { | ||
"model": "occultism:block/sacrificial_bowl", | ||
"x": 90, | ||
"y": 270 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
src/main/java/com/klikli_dev/occultism/common/block/DirectionalBlockShape.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package com.klikli_dev.occultism.common.block; | ||
|
||
import net.minecraft.core.Direction; | ||
import net.minecraft.world.level.block.Block; | ||
import net.minecraft.world.phys.shapes.VoxelShape; | ||
|
||
public class DirectionalBlockShape { | ||
|
||
protected final float length; | ||
protected final float width; | ||
protected final float height; | ||
protected final float center; | ||
protected final VoxelShape up; | ||
protected final VoxelShape down; | ||
protected final VoxelShape west; | ||
protected final VoxelShape east; | ||
protected final VoxelShape north; | ||
protected final VoxelShape south; | ||
|
||
|
||
public DirectionalBlockShape(float length, float width, float height) { | ||
this(length, width, height, 8.0F); | ||
} | ||
|
||
public DirectionalBlockShape(float length, float width, float height, float center) { | ||
this.length = length; | ||
this.width = width; | ||
this.height = height; | ||
this.center = center; | ||
|
||
this.up = Block.box(center - width / 2, 0.0F, center - length / 2, center + width / 2, height, center + length / 2); | ||
this.down = Block.box(center - width / 2, 16.0F - height, center - length / 2, center + width / 2, 16.0F, center + length / 2); | ||
this.west = Block.box(16.0F - height, center - width / 2, center - length / 2, 16.0F, center + width / 2, center + length / 2); | ||
this.east = Block.box(0.0F, center - width / 2, center - length / 2, height, center + width / 2, center + length / 2); | ||
this.north = Block.box(center - width / 2, center - length / 2, 16.0F - height, center + width / 2, center + length / 2, 16.0F); | ||
this.south = Block.box(center - width / 2, center - length / 2, 0.0F, center + width / 2, center + length / 2, height); | ||
} | ||
|
||
public VoxelShape getShape(Direction direction) { | ||
return switch (direction) { | ||
case UP -> this.up; | ||
case DOWN -> this.down; | ||
case WEST -> this.west; | ||
case EAST -> this.east; | ||
case NORTH -> this.north; | ||
case SOUTH -> this.south; | ||
}; | ||
} | ||
|
||
public VoxelShape up() { | ||
return this.up; | ||
} | ||
|
||
public VoxelShape down() { | ||
return this.down; | ||
} | ||
|
||
public VoxelShape west() { | ||
return this.west; | ||
} | ||
|
||
public VoxelShape east() { | ||
return this.east; | ||
} | ||
|
||
public VoxelShape north() { | ||
return this.north; | ||
} | ||
|
||
public VoxelShape south() { | ||
return this.south; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
src/main/resources/assets/occultism/blockstates/sacrificial_bowl.json
This file was deleted.
Oops, something went wrong.