mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-27 00:40:52 +01:00
Add vending machines without sides
This commit is contained in:
parent
b87cbd398b
commit
df8f80f9cb
@ -178,6 +178,7 @@ public class ItemManager {
|
||||
this.interactionsList.add(new ItemInteraction("effect_tile_group", InteractionEffectTile.class));
|
||||
this.interactionsList.add(new ItemInteraction("crackable_subscription_box", InteractionRedeemableSubscriptionBox.class));
|
||||
this.interactionsList.add(new ItemInteraction("random_state", InteractionRandomState.class));
|
||||
this.interactionsList.add(new ItemInteraction("vendingmachine_no_sides", InteractionNoSidesVendingMachine.class));
|
||||
|
||||
this.interactionsList.add(new ItemInteraction("game_timer", InteractionGameTimer.class));
|
||||
|
||||
|
@ -0,0 +1,24 @@
|
||||
package com.eu.habbo.habbohotel.items.interactions;
|
||||
|
||||
import com.eu.habbo.habbohotel.items.Item;
|
||||
import com.eu.habbo.habbohotel.rooms.Room;
|
||||
import com.eu.habbo.habbohotel.rooms.RoomTile;
|
||||
import com.eu.habbo.habbohotel.users.Habbo;
|
||||
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
|
||||
public class InteractionNoSidesVendingMachine extends InteractionVendingMachine {
|
||||
public InteractionNoSidesVendingMachine(ResultSet set, Item baseItem) throws SQLException {
|
||||
super(set, baseItem);
|
||||
}
|
||||
|
||||
public InteractionNoSidesVendingMachine(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) {
|
||||
super(id, userId, item, extradata, limitedStack, limitedSells);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RoomTile getRequiredTile(Habbo habbo, Room room) {
|
||||
return habbo.getRoomUnit().getClosestAdjacentTile(this.getX(), this.getY(), true);
|
||||
}
|
||||
}
|
@ -46,7 +46,7 @@ public class InteractionVendingMachine extends HabboItem {
|
||||
super.onClick(client, room, objects);
|
||||
|
||||
if (client != null) {
|
||||
RoomTile tile = getSquareInFront(room.getLayout(), this);
|
||||
RoomTile tile = this.getRequiredTile(client.getHabbo(), room);
|
||||
|
||||
if (tile != null) {
|
||||
if (tile.equals(client.getHabbo().getRoomUnit().getCurrentLocation())) {
|
||||
@ -207,4 +207,8 @@ public class InteractionVendingMachine extends HabboItem {
|
||||
public void giveVendingMachineItem(Habbo habbo, Room room) {
|
||||
Emulator.getThreading().run(new RoomUnitGiveHanditem(habbo.getRoomUnit(), room, this.getBaseItem().getRandomVendingItem()));
|
||||
}
|
||||
|
||||
public RoomTile getRequiredTile(Habbo habbo, Room room) {
|
||||
return getSquareInFront(room.getLayout(), this);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user