Skip to content

Commit

Permalink
Merge branch '1.19' into spin
Browse files Browse the repository at this point in the history
  • Loading branch information
fill1890 committed Jun 19, 2022
2 parents 21f8e9e + d57138e commit beee8d0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.jvmargs=-Xmx1G
loader_version=0.14.7

# Mod Properties
mod_version = 1.1.0+1.19
mod_version = 1.1.1+1.19
maven_group = net.fill1890
archives_base_name = fabsit

Expand Down
10 changes: 8 additions & 2 deletions src/main/java/net/fill1890/fabsit/entity/PoseManagerEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class PoseManagerEntity extends ArmorStandEntity {
// visible npc for posing (if needed)
private PosingEntity poser;

protected boolean killing;

public PoseManagerEntity(World world, Vec3d pos, Pose pose, ServerPlayerEntity player) {
// create a new armour stand at the appropriate height
// TODO: no magic numbers
Expand Down Expand Up @@ -110,6 +112,8 @@ public boolean collides() {

@Override
public void kill() {
this.killing = true;

// if the pose was npc-based, remove the npc
if(poser != null) {
poser.destroy();
Expand All @@ -120,8 +124,10 @@ public void kill() {

@Override
public void tick() {
if(this.killing) return;

// kill when the player stops posing
if(used && getPassengerList().size() < 1) { this.kill(); }
if(used && getPassengerList().size() < 1) { this.kill(); return; }

// rotate the armour stand with the player so the player's legs line up
ServerPlayerEntity player = (ServerPlayerEntity) this.getFirstPassenger();
Expand All @@ -131,7 +137,7 @@ public void tick() {

// stop the player sitting if the block below is broken
BlockState sittingBlock = getEntityWorld().getBlockState(new BlockPos(getPos()).up());
if(sittingBlock.isAir()) { kill(); }
if(sittingBlock.isAir()) { kill(); return; }

// if pose is npc-based, update players with npc info
if(this.pose == Pose.LAYING || this.pose == Pose.SPINNING) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "fabsit",
"version": "1.1.0+1.19",
"version": "1.1.1+1.19",

"name": "FabSit",
"description": "Sit in Fabric",
Expand Down

0 comments on commit beee8d0

Please sign in to comment.