You've already forked Arcturus-Morningstar-Extended
mirror of
https://github.com/duckietm/Arcturus-Morningstar-Extended.git
synced 2026-06-20 15:36:17 +00:00
🆙 Updated the Position Event for buildtools
This commit is contained in:
+13
-4
@@ -5,6 +5,9 @@ import com.eu.habbo.habbohotel.rooms.Room;
|
|||||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||||
import com.eu.habbo.habbohotel.users.HabboItem;
|
import com.eu.habbo.habbohotel.users.HabboItem;
|
||||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||||
|
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertComposer;
|
||||||
|
import com.eu.habbo.messages.outgoing.generic.alerts.BubbleAlertKeys;
|
||||||
|
import com.eu.habbo.messages.outgoing.rooms.items.FloorItemUpdateComposer;
|
||||||
|
|
||||||
public class UpdateFurniturePositionEvent extends MessageHandler {
|
public class UpdateFurniturePositionEvent extends MessageHandler {
|
||||||
@Override
|
@Override
|
||||||
@@ -24,11 +27,17 @@ public class UpdateFurniturePositionEvent extends MessageHandler {
|
|||||||
RoomTile tile = room.getLayout().getTile((short) x, (short) y);
|
RoomTile tile = room.getLayout().getTile((short) x, (short) y);
|
||||||
if (tile == null) return;
|
if (tile == null) return;
|
||||||
|
|
||||||
FurnitureMovementError result =
|
FurnitureMovementError error = room.canPlaceFurnitureAt(item, this.client.getHabbo(), tile, rotation);
|
||||||
room.moveFurniTo(item, tile, rotation, z, this.client.getHabbo(), true, true);
|
if (error != FurnitureMovementError.NONE) {
|
||||||
|
this.client.sendResponse(new BubbleAlertComposer(BubbleAlertKeys.FURNITURE_PLACEMENT_ERROR.key, error.errorCode));
|
||||||
if (result != FurnitureMovementError.NONE) {
|
this.client.sendResponse(new FloorItemUpdateComposer(item));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
error = room.moveFurniTo(item, tile, rotation, z, this.client.getHabbo(), true, true);
|
||||||
|
if (error != FurnitureMovementError.NONE) {
|
||||||
|
this.client.sendResponse(new BubbleAlertComposer(BubbleAlertKeys.FURNITURE_PLACEMENT_ERROR.key, error.errorCode));
|
||||||
|
this.client.sendResponse(new FloorItemUpdateComposer(item));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user