Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Beny 2019-05-26 20:53:57 +01:00
commit 4df2ef69e5
13 changed files with 46 additions and 5 deletions

View File

@ -19,7 +19,7 @@ public class UpdateItemsCommand extends Command {
synchronized (Emulator.getGameEnvironment().getRoomManager().getActiveRooms()) {
for (Room room : Emulator.getGameEnvironment().getRoomManager().getActiveRooms()) {
if (room.isLoaded() && room.getUserCount() > 0) {
if (room.isLoaded() && room.getUserCount() > 0 && room.getLayout() != null) {
room.sendComposer(new RoomRelativeMapComposer(room).compose());
}
}

View File

@ -40,5 +40,7 @@ public class InteractionBlackHole extends InteractionGate {
AchievementManager.progressAchievement(this.getUserId(), holeCountAchievement, holeDifference);
}
}
super.onPlace(room);
}
}

View File

@ -55,6 +55,8 @@ public class InteractionMoodLight extends HabboItem {
}
}
}
super.onPlace(room);
}
@Override

View File

@ -59,6 +59,7 @@ public class InteractionWater extends InteractionDefault {
@Override
public void onPlace(Room room) {
this.recalculate(room);
super.onPlace(room);
}
public void refreshWaters(Room room) {

View File

@ -25,6 +25,7 @@ public class InteractionWaterItem extends InteractionDefault {
@Override
public void onPlace(Room room) {
this.update();
super.onPlace(room);
}
@Override

View File

@ -143,6 +143,7 @@ public class InteractionWiredHighscore extends HabboItem {
@Override
public void onPlace(Room room) {
this.reloadData(room);
super.onPlace(room);
}
@Override

View File

@ -138,6 +138,8 @@ public abstract class InteractionGameTimer extends HabboItem implements Runnable
this.setExtradata(this.timeNow + "\t" + this.baseTime);
room.updateItem(this);
super.onPlace(room);
}
@Override

View File

@ -88,6 +88,10 @@ public class WiredEffectWhisper extends InteractionWiredEffect {
if (habbo != null) {
habbo.getClient().sendResponse(new RoomUserWhisperComposer(new RoomChatMessage(this.message.replace("%user%", habbo.getHabboInfo().getUsername()).replace("%online_count%", Emulator.getGameEnvironment().getHabboManager().getOnlineCount() + "").replace("%room_count%", Emulator.getGameEnvironment().getRoomManager().getActiveRooms().size() + ""), habbo, habbo, RoomChatMessageBubbles.WIRED)));
if (habbo.getRoomUnit().isIdle()) {
habbo.getRoomUnit().getRoom().unIdle(habbo);
}
return true;
}
} else {

View File

@ -3994,6 +3994,16 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
return this.furniOwnerCount.get(userId);
}
public int getUserUniqueFurniCount(int userId) {
THashSet<Item> items = new THashSet<>();
for (HabboItem item : this.roomItems.valueCollection()) {
if (!items.contains(item.getBaseItem()) && item.getUserId() == userId) items.add(item.getBaseItem());
}
return items.size();
}
public void ejectUserFurni(int userId) {
THashSet<HabboItem> items = new THashSet<>();

View File

@ -323,6 +323,24 @@ public abstract class HabboItem implements Runnable, IEventTriggers {
AchievementManager.progressAchievement(this.getUserId(), roomDecoAchievement, difference);
}
}
Achievement roomDecoUniqueAchievement = Emulator.getGameEnvironment().getAchievementManager().getAchievement("RoomDecoFurniTypeCount");
int uniqueFurniCollecterProgress;
if (owner == null) {
uniqueFurniCollecterProgress = AchievementManager.getAchievementProgressForHabbo(this.getUserId(), roomDecoUniqueAchievement);
} else {
uniqueFurniCollecterProgress = owner.getHabboStats().getAchievementProgress(roomDecoUniqueAchievement);
}
int uniqueDifference = room.getUserUniqueFurniCount(this.getUserId()) - uniqueFurniCollecterProgress;
if (uniqueDifference > 0) {
if (owner != null) {
AchievementManager.progressAchievement(owner, roomDecoUniqueAchievement, uniqueDifference);
} else {
AchievementManager.progressAchievement(this.getUserId(), roomDecoUniqueAchievement, uniqueDifference);
}
}
}
public void onPickUp(Room room) {

View File

@ -74,6 +74,7 @@ public class RequestGuildBuyEvent extends MessageHandler {
Guild guild = Emulator.getGameEnvironment().getGuildManager().createGuild(this.client.getHabbo(), roomId, r.getName(), name, description, badge, colorOne, colorTwo);
r.setGuild(guild.getId());
r.removeAllRights();
r.setNeedsUpdate(true);
if (Emulator.getConfig().getBoolean("imager.internal.enabled")) {

View File

@ -11,10 +11,9 @@ public class ModToolRequestRoomInfoEvent extends MessageHandler {
@Override
public void handle() throws Exception {
if (this.client.getHabbo().hasPermission(Permission.ACC_SUPPORTTOOL)) {
//int roomId = this.packet.readInt();
int roomId = this.packet.readInt();
Room room = this.client.getHabbo().getHabboInfo().getCurrentRoom();
//Emulator.getGameEnvironment().getRoomManager().getRoom(roomId);
Room room = Emulator.getGameEnvironment().getRoomManager().getRoom(roomId);
if (room != null) {
this.client.sendResponse(new ModToolRoomInfoComposer(room));

View File

@ -12,7 +12,7 @@ public class RequestRoomHeightmapEvent extends MessageHandler {
if (this.client.getHabbo().getHabboInfo().getLoadingRoom() > 0) {
Room room = Emulator.getGameEnvironment().getRoomManager().loadRoom(this.client.getHabbo().getHabboInfo().getLoadingRoom());
if (room != null) {
if (room != null && room.getLayout() != null) {
this.client.sendResponse(new RoomRelativeMapComposer(room));
this.client.sendResponse(new RoomHeightMapComposer(room));