Skip to content
Browse files

Fixed Swaping updating carriedBy and made it so the Harvesters money bar

is not shown when carried by the player.
  • Loading branch information...
1 parent 8a92447 commit 368415a82b44af12994c3800b4356764e19d3443 @Delvar committed
View
4 src/com/mojang/mojam/entity/Player.java
@@ -179,7 +179,6 @@ public double xpSinceLastLevelUp(){
@Override
public void tick() {
-
// If the mouse is used, update player orientation before level tick
if (!mouseButtons.mouseHidden) {
// Update player mouse, in world pixels relative to player
@@ -560,6 +559,9 @@ private void handleCarrying() {
if(selected != null) {
if (selected instanceof ICarrySwap) {
carrying=((ICarrySwap)selected).tryToSwap(carrying);
+ if (carrying != null) {
+ carrying.onPickup(this);
+ }
}
} else {
if (!isCarrying())
View
4 src/com/mojang/mojam/entity/building/Harvester.java
@@ -156,8 +156,8 @@ public void render(AbstractScreen screen) {
screen.colorBlit(image, pos.x - image.getWidth() / 2, pos.y - image.getHeight() / 2 - yOffs, 0x77ff7200);
}
- if( team == MojamComponent.localTeam ) {
- addMoneyBar(screen);
+ if( team == MojamComponent.localTeam && !(isCarried() && this.carriedBy instanceof Player)) {
+ addMoneyBar(screen);
}
}
View
6 src/com/mojang/mojam/entity/mob/RailDroid.java
@@ -362,6 +362,9 @@ public void handleCollision(Entity entity, double xa, double ya) {
if (other instanceof ICarrySwap) {
carrying=((ICarrySwap)other).tryToSwap(carrying);
+ if (carrying != null) {
+ carrying.onPickup(this);
+ }
}
}
}
@@ -429,6 +432,9 @@ public Building tryToSwap(Building b) {
if ( canCarry(b) ) {
tmpBuilding = carrying;
carrying=b;
+ if (carrying != null) {
+ carrying.onPickup(this);
+ }
}
return tmpBuilding;
}

0 comments on commit 368415a

Please sign in to comment.
Something went wrong with that request. Please try again.