mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2025-01-31 12:22:36 +01:00
Add plugin event for room voting
This commit is contained in:
parent
9807d52403
commit
96f6e1b9af
@ -42,6 +42,7 @@ import com.eu.habbo.messages.outgoing.rooms.users.*;
|
|||||||
import com.eu.habbo.messages.outgoing.users.MutedWhisperComposer;
|
import com.eu.habbo.messages.outgoing.users.MutedWhisperComposer;
|
||||||
import com.eu.habbo.plugin.events.navigator.NavigatorRoomCreatedEvent;
|
import com.eu.habbo.plugin.events.navigator.NavigatorRoomCreatedEvent;
|
||||||
import com.eu.habbo.plugin.events.rooms.RoomUncachedEvent;
|
import com.eu.habbo.plugin.events.rooms.RoomUncachedEvent;
|
||||||
|
import com.eu.habbo.plugin.events.rooms.UserVoteRoomEvent;
|
||||||
import com.eu.habbo.plugin.events.users.HabboAddedToRoomEvent;
|
import com.eu.habbo.plugin.events.users.HabboAddedToRoomEvent;
|
||||||
import com.eu.habbo.plugin.events.users.UserEnterRoomEvent;
|
import com.eu.habbo.plugin.events.users.UserEnterRoomEvent;
|
||||||
import com.eu.habbo.plugin.events.users.UserExitRoomEvent;
|
import com.eu.habbo.plugin.events.users.UserExitRoomEvent;
|
||||||
@ -432,6 +433,9 @@ public class RoomManager {
|
|||||||
if (this.hasVotedForRoom(habbo, room))
|
if (this.hasVotedForRoom(habbo, room))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
UserVoteRoomEvent event = new UserVoteRoomEvent(room, habbo);
|
||||||
|
if (Emulator.getPluginManager().fireEvent(event).isCancelled()) return;
|
||||||
|
|
||||||
room.setScore(room.getScore() + 1);
|
room.setScore(room.getScore() + 1);
|
||||||
room.setNeedsUpdate(true);
|
room.setNeedsUpdate(true);
|
||||||
habbo.getHabboStats().votedRooms.push(room.getId());
|
habbo.getHabboStats().votedRooms.push(room.getId());
|
||||||
|
@ -0,0 +1,15 @@
|
|||||||
|
package com.eu.habbo.plugin.events.rooms;
|
||||||
|
|
||||||
|
import com.eu.habbo.habbohotel.rooms.Room;
|
||||||
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
|
import com.eu.habbo.plugin.Event;
|
||||||
|
|
||||||
|
public class UserVoteRoomEvent extends Event {
|
||||||
|
public final Room room;
|
||||||
|
public final Habbo habbo;
|
||||||
|
|
||||||
|
public UserVoteRoomEvent(Room room, Habbo habbo) {
|
||||||
|
this.room = room;
|
||||||
|
this.habbo = habbo;
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user