From eaa915e7f7e3900d01368f1fe941b33f7ec8fe27 Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 9 Apr 2022 01:18:38 +0000 Subject: [PATCH 1/2] Upload New File --- ...nteractionEffectVendingMachineNoSides.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionEffectVendingMachineNoSides.java diff --git a/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionEffectVendingMachineNoSides.java b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionEffectVendingMachineNoSides.java new file mode 100644 index 00000000..799c2116 --- /dev/null +++ b/src/main/java/com/eu/habbo/habbohotel/items/interactions/InteractionEffectVendingMachineNoSides.java @@ -0,0 +1,43 @@ +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.rooms.RoomUnit; +import gnu.trove.set.hash.THashSet; + +import java.sql.ResultSet; +import java.sql.SQLException; + +public class InteractionEffectVendingMachineNoSides extends InteractionVendingMachine { + public InteractionEffectVendingMachineNoSides(ResultSet set, Item baseItem) throws SQLException { + super(set, baseItem); + this.setExtradata("0"); + } + + public InteractionEffectVendingMachineNoSides(int id, int userId, Item item, String extradata, int limitedStack, int limitedSells) { + super(id, userId, item, extradata, limitedStack, limitedSells); + this.setExtradata("0"); + } + + @Override + public void giveVendingMachineItem(Room room, RoomUnit unit) { + room.giveEffect(unit, this.getBaseItem().getRandomVendingItem(), 30); + } + + @Override + public THashSet getActivatorTiles(Room room) { + + THashSet tiles = new THashSet(); + for(int x = -1; x <= 1; x++) { + for(int y = -1; y <= 1; y++) { + RoomTile tile = room.getLayout().getTile((short)(this.getX() + x), (short)(this.getY() + y)); + if(tile != null) { + tiles.add(tile); + } + } + } + + return tiles; + } +} \ No newline at end of file From 451422b328ee34bf733a6531eff8c2abd916ae6f Mon Sep 17 00:00:00 2001 From: Oliver Date: Sat, 9 Apr 2022 01:21:19 +0000 Subject: [PATCH 2/2] Added effect_vendingmachine_no_sides --- src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java b/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java index e62b1f0a..16ec285d 100644 --- a/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java +++ b/src/main/java/com/eu/habbo/habbohotel/items/ItemManager.java @@ -180,6 +180,7 @@ public class ItemManager { this.interactionsList.add(new ItemInteraction("handitem_tile", InteractionHanditemTile.class)); this.interactionsList.add(new ItemInteraction("effect_giver", InteractionEffectGiver.class)); this.interactionsList.add(new ItemInteraction("effect_vendingmachine", InteractionEffectVendingMachine.class)); + this.interactionsList.add(new ItemInteraction("effect_vendingmachine_no_sides", InteractionEffectVendingMachineNoSides.class)); this.interactionsList.add(new ItemInteraction("crackable_monster", InteractionMonsterCrackable.class)); this.interactionsList.add(new ItemInteraction("snowboard_slope", InteractionSnowboardSlope.class)); this.interactionsList.add(new ItemInteraction("pressureplate_group", InteractionGroupPressurePlate.class));