mirror of
https://git.krews.org/morningstar/Arcturus-Community.git
synced 2024-11-22 23:10:52 +01:00
Replace all Runnables with lambda .
This commit is contained in:
parent
4b278a2109
commit
df2641f215
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[submodule "morningstar-default-database"]
|
||||||
|
path = morningstar-default-database
|
||||||
|
url = https://git.krews.org/morningstar/morningstar-default-database
|
@ -75,22 +75,15 @@ public class ButlerBot extends Bot {
|
|||||||
tasks.add(new RoomUnitGiveHanditem(serveEvent.habbo.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), serveEvent.itemId));
|
tasks.add(new RoomUnitGiveHanditem(serveEvent.habbo.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), serveEvent.itemId));
|
||||||
tasks.add(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), 0));
|
tasks.add(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), 0));
|
||||||
|
|
||||||
tasks.add(new Runnable() {
|
tasks.add(() -> b.talk(Emulator.getTexts().getValue("bots.butler.given").replace("%key%", key).replace("%username%", serveEvent.habbo.getHabboInfo().getUsername())));
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
b.talk(Emulator.getTexts().getValue("bots.butler.given").replace("%key%", key).replace("%username%", serveEvent.habbo.getHabboInfo().getUsername()));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
List<Runnable> failedReached = new ArrayList();
|
List<Runnable> failedReached = new ArrayList();
|
||||||
failedReached.add(new Runnable() {
|
failedReached.add(() -> {
|
||||||
public void run() {
|
|
||||||
if (b.getRoomUnit().getCurrentLocation().distance(serveEvent.habbo.getRoomUnit().getCurrentLocation()) <= Emulator.getConfig().getInt("hotel.bot.butler.servedistance", 8)) {
|
if (b.getRoomUnit().getCurrentLocation().distance(serveEvent.habbo.getRoomUnit().getCurrentLocation()) <= Emulator.getConfig().getInt("hotel.bot.butler.servedistance", 8)) {
|
||||||
for (Runnable t : tasks) {
|
for (Runnable t : tasks) {
|
||||||
t.run();
|
t.run();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
Emulator.getThreading().run(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), serveEvent.itemId));
|
Emulator.getThreading().run(new RoomUnitGiveHanditem(this.getRoomUnit(), serveEvent.habbo.getHabboInfo().getCurrentRoom(), serveEvent.itemId));
|
||||||
|
@ -59,9 +59,7 @@ public class MassGiftCommand extends Command {
|
|||||||
keys.put("message", Emulator.getTexts().getValue("generic.gift.received.anonymous"));
|
keys.put("message", Emulator.getTexts().getValue("generic.gift.received.anonymous"));
|
||||||
ServerMessage giftNotificiationMessage = new BubbleAlertComposer(BubbleAlertKeys.RECEIVED_BADGE.key, keys).compose();
|
ServerMessage giftNotificiationMessage = new BubbleAlertComposer(BubbleAlertKeys.RECEIVED_BADGE.key, keys).compose();
|
||||||
|
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
for (Map.Entry<Integer, Habbo> set : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().entrySet()) {
|
for (Map.Entry<Integer, Habbo> set : Emulator.getGameEnvironment().getHabboManager().getOnlineHabbos().entrySet()) {
|
||||||
Habbo habbo = set.getValue();
|
Habbo habbo = set.getValue();
|
||||||
|
|
||||||
@ -77,7 +75,6 @@ public class MassGiftCommand extends Command {
|
|||||||
habbo.getClient().sendResponse(new InventoryRefreshComposer());
|
habbo.getClient().sendResponse(new InventoryRefreshComposer());
|
||||||
habbo.getClient().sendResponse(giftNotificiationMessage);
|
habbo.getClient().sendResponse(giftNotificiationMessage);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
@ -44,12 +44,9 @@ public class InteractionEffectGiver extends InteractionDefault {
|
|||||||
this.setExtradata("1");
|
this.setExtradata("1");
|
||||||
room.updateItem(this);
|
room.updateItem(this);
|
||||||
|
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
InteractionEffectGiver.this.setExtradata("0");
|
InteractionEffectGiver.this.setExtradata("0");
|
||||||
room.updateItem(instance);
|
room.updateItem(instance);
|
||||||
}
|
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -42,12 +42,9 @@ public class InteractionHanditem extends InteractionDefault {
|
|||||||
this.setExtradata("1");
|
this.setExtradata("1");
|
||||||
room.updateItem(this);
|
room.updateItem(this);
|
||||||
|
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
InteractionHanditem.this.setExtradata("0");
|
InteractionHanditem.this.setExtradata("0");
|
||||||
room.updateItem(instance);
|
room.updateItem(instance);
|
||||||
}
|
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,13 +20,10 @@ public class InteractionHanditemTile extends InteractionHanditem {
|
|||||||
@Override
|
@Override
|
||||||
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
||||||
InteractionHanditemTile instance = this;
|
InteractionHanditemTile instance = this;
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (roomUnit.getCurrentLocation().x == instance.getX() && roomUnit.getCurrentLocation().y == instance.getY()) {
|
if (roomUnit.getCurrentLocation().x == instance.getX() && roomUnit.getCurrentLocation().y == instance.getY()) {
|
||||||
instance.handle(room, roomUnit);
|
instance.handle(room, roomUnit);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -56,24 +56,14 @@ public class InteractionPressurePlate extends HabboItem {
|
|||||||
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
public void onWalkOn(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
||||||
super.onWalkOn(roomUnit, room, objects);
|
super.onWalkOn(roomUnit, room, objects);
|
||||||
|
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> updateState(room), 100);
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
updateState(room);
|
|
||||||
}
|
|
||||||
}, 100);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onWalkOff(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
public void onWalkOff(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
|
||||||
super.onWalkOff(roomUnit, room, objects);
|
super.onWalkOff(roomUnit, room, objects);
|
||||||
|
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> updateState(room), 100);
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
updateState(room);
|
|
||||||
}
|
|
||||||
}, 100);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -48,12 +48,9 @@ public class InteractionTileEffectProvider extends InteractionCustomValues {
|
|||||||
room.updateItem(this);
|
room.updateItem(this);
|
||||||
|
|
||||||
final InteractionTileEffectProvider proxy = this;
|
final InteractionTileEffectProvider proxy = this;
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
proxy.values.put("state", "0");
|
proxy.values.put("state", "0");
|
||||||
room.updateItem(proxy);
|
room.updateItem(proxy);
|
||||||
}
|
|
||||||
}, 500);
|
}, 500);
|
||||||
|
|
||||||
room.giveEffect(roomUnit, effectId, -1);
|
room.giveEffect(roomUnit, effectId, -1);
|
||||||
|
@ -52,12 +52,9 @@ public class InteractionTrap extends InteractionDefault {
|
|||||||
|
|
||||||
|
|
||||||
roomUnit.setCanWalk(false);
|
roomUnit.setCanWalk(false);
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
room.giveEffect(roomUnit, 0, -1);
|
room.giveEffect(roomUnit, 0, -1);
|
||||||
roomUnit.setCanWalk(true);
|
roomUnit.setCanWalk(true);
|
||||||
}
|
|
||||||
}, delay);
|
}, delay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -150,9 +150,7 @@ public class InteractionPetBreedingNest extends HabboItem {
|
|||||||
HabboItem box = this;
|
HabboItem box = this;
|
||||||
Pet petOne = this.petOne;
|
Pet petOne = this.petOne;
|
||||||
Pet petTwo = this.petTwo;
|
Pet petTwo = this.petTwo;
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Pet offspring = Emulator.getGameEnvironment().getPetManager().createPet(petOne.getPetData().getOffspringType(), (int) Math.min(Math.round(Math.max(1d, PetManager.getNormalDistributionForBreeding(petOne.getLevel(), petTwo.getLevel()).sample())), 20), name, habbo.getClient());
|
Pet offspring = Emulator.getGameEnvironment().getPetManager().createPet(petOne.getPetData().getOffspringType(), (int) Math.min(Math.round(Math.max(1d, PetManager.getNormalDistributionForBreeding(petOne.getLevel(), petTwo.getLevel()).sample())), 20), name, habbo.getClient());
|
||||||
|
|
||||||
//habbo.getClient().sendResponse(new PetPackageNameValidationComposer(box.getId(), PetPackageNameValidationComposer.CLOSE_WIDGET, ""));
|
//habbo.getClient().sendResponse(new PetPackageNameValidationComposer(box.getId(), PetPackageNameValidationComposer.CLOSE_WIDGET, ""));
|
||||||
@ -168,7 +166,6 @@ public class InteractionPetBreedingNest extends HabboItem {
|
|||||||
String achievement = boxType.substring(0, 1).toUpperCase() + boxType.substring(1) + "Breeder";
|
String achievement = boxType.substring(0, 1).toUpperCase() + boxType.substring(1) + "Breeder";
|
||||||
AchievementManager.progressAchievement(habbo, Emulator.getGameEnvironment().getAchievementManager().getAchievement(achievement));
|
AchievementManager.progressAchievement(habbo, Emulator.getGameEnvironment().getAchievementManager().getAchievement(achievement));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}, 2000);
|
}, 2000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -45,14 +45,11 @@ public class InteractionPetToy extends InteractionDefault {
|
|||||||
pet.getRoomUnit().setStatus(RoomUnitStatus.PLAY, "0");
|
pet.getRoomUnit().setStatus(RoomUnitStatus.PLAY, "0");
|
||||||
pet.packetUpdate = true;
|
pet.packetUpdate = true;
|
||||||
HabboItem item = this;
|
HabboItem item = this;
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
pet.addHappyness(25);
|
pet.addHappyness(25);
|
||||||
item.setExtradata("0");
|
item.setExtradata("0");
|
||||||
room.updateItem(item);
|
room.updateItem(item);
|
||||||
new PetClearPosture(pet, RoomUnitStatus.PLAY, null, true).run();
|
new PetClearPosture(pet, RoomUnitStatus.PLAY, null, true).run();
|
||||||
}
|
|
||||||
}, 2500 + (Emulator.getRandom().nextInt(20) * 500));
|
}, 2500 + (Emulator.getRandom().nextInt(20) * 500));
|
||||||
this.setExtradata("1");
|
this.setExtradata("1");
|
||||||
room.updateItemState(this);
|
room.updateItemState(this);
|
||||||
|
@ -72,12 +72,7 @@ public class WiredEffectChangeFurniDirection extends InteractionWiredEffect {
|
|||||||
boolean hasHabbos = false;
|
boolean hasHabbos = false;
|
||||||
for (Habbo habbo : room.getHabbosAt(targetTile)) {
|
for (Habbo habbo : room.getHabbosAt(targetTile)) {
|
||||||
hasHabbos = true;
|
hasHabbos = true;
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> WiredHandler.handle(WiredTriggerType.COLLISION, habbo.getRoomUnit(), room, new Object[]{entry.getKey()}));
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
WiredHandler.handle(WiredTriggerType.COLLISION, habbo.getRoomUnit(), room, new Object[]{entry.getKey()});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!hasHabbos) {
|
if (!hasHabbos) {
|
||||||
|
@ -58,12 +58,7 @@ public class WiredEffectMoveFurniAway extends InteractionWiredEffect {
|
|||||||
if (target != null) {
|
if (target != null) {
|
||||||
if (RoomLayout.tilesAdjecent(target.getRoomUnit().getCurrentLocation(), room.getLayout().getTile(item.getX(), item.getY())) && (target.getRoomUnit().getX() == item.getX() || target.getRoomUnit().getY() == item.getY())) {
|
if (RoomLayout.tilesAdjecent(target.getRoomUnit().getCurrentLocation(), room.getLayout().getTile(item.getX(), item.getY())) && (target.getRoomUnit().getX() == item.getX() || target.getRoomUnit().getY() == item.getY())) {
|
||||||
final Habbo finalTarget = target;
|
final Habbo finalTarget = target;
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> WiredHandler.handle(WiredTriggerType.COLLISION, finalTarget.getRoomUnit(), room, new Object[]{item}), 500);
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
WiredHandler.handle(WiredTriggerType.COLLISION, finalTarget.getRoomUnit(), room, new Object[]{item});
|
|
||||||
}
|
|
||||||
}, 500);
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -717,15 +717,12 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (oldZ != roomUnit.getZ()) {
|
if (oldZ != roomUnit.getZ()) {
|
||||||
this.scheduledTasks.add(new Runnable() {
|
this.scheduledTasks.add(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
try {
|
try {
|
||||||
item.onWalkOn(roomUnit, Room.this, null);
|
item.onWalkOn(roomUnit, Room.this, null);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1039,12 +1036,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
if (this.loaded) {
|
if (this.loaded) {
|
||||||
try {
|
try {
|
||||||
Emulator.getThreading().run(
|
Emulator.getThreading().run(
|
||||||
new Runnable() {
|
Room.this::cycle);
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Room.this.cycle();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Emulator.getLogging().logErrorLine(e);
|
Emulator.getLogging().logErrorLine(e);
|
||||||
}
|
}
|
||||||
@ -1175,12 +1167,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
habbo.getRoomUnit().kickCount++;
|
habbo.getRoomUnit().kickCount++;
|
||||||
|
|
||||||
if (habbo.getRoomUnit().kickCount >= 5) {
|
if (habbo.getRoomUnit().kickCount >= 5) {
|
||||||
this.scheduledTasks.add(new Runnable() {
|
this.scheduledTasks.add(() -> Emulator.getGameEnvironment().getRoomManager().leaveRoom(habbo, room));
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
Emulator.getGameEnvironment().getRoomManager().leaveRoom(habbo, room);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1471,9 +1458,7 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
HabboItem item = room.getTopItemAt(tileInFront.x, tileInFront.y);
|
HabboItem item = room.getTopItemAt(tileInFront.x, tileInFront.y);
|
||||||
|
|
||||||
if (item != null && itemsNewTile.contains(item)) {
|
if (item != null && itemsNewTile.contains(item)) {
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (unit.getGoal() == rollerTile) {
|
if (unit.getGoal() == rollerTile) {
|
||||||
try {
|
try {
|
||||||
item.onWalkOn(unit, room, null);
|
item.onWalkOn(unit, room, null);
|
||||||
@ -1481,7 +1466,6 @@ public class Room implements Comparable<Room>, ISerialize, Runnable {
|
|||||||
Emulator.getLogging().logErrorLine(e);
|
Emulator.getLogging().logErrorLine(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}, this.getRollerSpeed() == 0 ? 250 : InteractionRoller.DELAY);
|
}, this.getRollerSpeed() == 0 ? 250 : InteractionRoller.DELAY);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,6 @@ import com.eu.habbo.habbohotel.navigation.NavigatorSavedSearch;
|
|||||||
import com.eu.habbo.habbohotel.permissions.Permission;
|
import com.eu.habbo.habbohotel.permissions.Permission;
|
||||||
import com.eu.habbo.habbohotel.users.Habbo;
|
import com.eu.habbo.habbohotel.users.Habbo;
|
||||||
import com.eu.habbo.habbohotel.users.HabboManager;
|
import com.eu.habbo.habbohotel.users.HabboManager;
|
||||||
import com.eu.habbo.habbohotel.users.inventory.EffectsComponent;
|
|
||||||
import com.eu.habbo.messages.NoAuthMessage;
|
import com.eu.habbo.messages.NoAuthMessage;
|
||||||
import com.eu.habbo.messages.ServerMessage;
|
import com.eu.habbo.messages.ServerMessage;
|
||||||
import com.eu.habbo.messages.incoming.MessageHandler;
|
import com.eu.habbo.messages.incoming.MessageHandler;
|
||||||
@ -36,7 +35,6 @@ import com.eu.habbo.plugin.events.users.UserLoginEvent;
|
|||||||
import gnu.trove.map.hash.THashMap;
|
import gnu.trove.map.hash.THashMap;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@NoAuthMessage
|
@NoAuthMessage
|
||||||
@ -178,15 +176,12 @@ public class SecureLoginEvent extends MessageHandler {
|
|||||||
|
|
||||||
if (Emulator.getConfig().getBoolean("hotel.welcome.alert.enabled")) {
|
if (Emulator.getConfig().getBoolean("hotel.welcome.alert.enabled")) {
|
||||||
final Habbo finalHabbo = habbo;
|
final Habbo finalHabbo = habbo;
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (Emulator.getConfig().getBoolean("hotel.welcome.alert.oldstyle")) {
|
if (Emulator.getConfig().getBoolean("hotel.welcome.alert.oldstyle")) {
|
||||||
SecureLoginEvent.this.client.sendResponse(new MessagesForYouComposer(HabboManager.WELCOME_MESSAGE.replace("%username%", finalHabbo.getHabboInfo().getUsername()).replace("%user%", finalHabbo.getHabboInfo().getUsername()).split("<br/>")));
|
SecureLoginEvent.this.client.sendResponse(new MessagesForYouComposer(HabboManager.WELCOME_MESSAGE.replace("%username%", finalHabbo.getHabboInfo().getUsername()).replace("%user%", finalHabbo.getHabboInfo().getUsername()).split("<br/>")));
|
||||||
} else {
|
} else {
|
||||||
SecureLoginEvent.this.client.sendResponse(new GenericAlertComposer(HabboManager.WELCOME_MESSAGE.replace("%username%", finalHabbo.getHabboInfo().getUsername()).replace("%user%", finalHabbo.getHabboInfo().getUsername())));
|
SecureLoginEvent.this.client.sendResponse(new GenericAlertComposer(HabboManager.WELCOME_MESSAGE.replace("%username%", finalHabbo.getHabboInfo().getUsername()).replace("%user%", finalHabbo.getHabboInfo().getUsername())));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}, Emulator.getConfig().getInt("hotel.welcome.alert.delay", 5000));
|
}, Emulator.getConfig().getInt("hotel.welcome.alert.delay", 5000));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,9 +70,7 @@ public class ReportEvent extends MessageHandler {
|
|||||||
|
|
||||||
if (cfhTopic != null) {
|
if (cfhTopic != null) {
|
||||||
if (cfhTopic.action != CfhActionType.MODS) {
|
if (cfhTopic.action != CfhActionType.MODS) {
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (issue.state == ModToolTicketState.OPEN) {
|
if (issue.state == ModToolTicketState.OPEN) {
|
||||||
if (cfhTopic.action == CfhActionType.AUTO_IGNORE) {
|
if (cfhTopic.action == CfhActionType.AUTO_IGNORE) {
|
||||||
ReportEvent.this.client.getHabbo().getHabboStats().ignoreUser(reported.getHabboInfo().getId());
|
ReportEvent.this.client.getHabbo().getHabboStats().ignoreUser(reported.getHabboInfo().getId());
|
||||||
@ -82,7 +80,6 @@ public class ReportEvent extends MessageHandler {
|
|||||||
ReportEvent.this.client.sendResponse(new ModToolIssueHandledComposer(cfhTopic.reply).compose());
|
ReportEvent.this.client.sendResponse(new ModToolIssueHandledComposer(cfhTopic.reply).compose());
|
||||||
Emulator.getGameEnvironment().getModToolManager().closeTicketAsHandled(issue, null);
|
Emulator.getGameEnvironment().getModToolManager().closeTicketAsHandled(issue, null);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}, 30 * 1000);
|
}, 30 * 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -99,9 +96,7 @@ public class ReportEvent extends MessageHandler {
|
|||||||
|
|
||||||
if (cfhTopic != null) {
|
if (cfhTopic != null) {
|
||||||
if (cfhTopic.action != CfhActionType.MODS) {
|
if (cfhTopic.action != CfhActionType.MODS) {
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
if (issue.state == ModToolTicketState.OPEN) {
|
if (issue.state == ModToolTicketState.OPEN) {
|
||||||
if (cfhTopic.action == CfhActionType.AUTO_IGNORE) {
|
if (cfhTopic.action == CfhActionType.AUTO_IGNORE) {
|
||||||
ReportEvent.this.client.getHabbo().getHabboStats().ignoreUser(issue.reportedId);
|
ReportEvent.this.client.getHabbo().getHabboStats().ignoreUser(issue.reportedId);
|
||||||
@ -114,7 +109,6 @@ public class ReportEvent extends MessageHandler {
|
|||||||
ReportEvent.this.client.sendResponse(new ModToolIssueHandledComposer(cfhTopic.reply).compose());
|
ReportEvent.this.client.sendResponse(new ModToolIssueHandledComposer(cfhTopic.reply).compose());
|
||||||
Emulator.getGameEnvironment().getModToolManager().closeTicketAsHandled(issue, null);
|
Emulator.getGameEnvironment().getModToolManager().closeTicketAsHandled(issue, null);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}, 30 * 1000);
|
}, 30 * 1000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -38,15 +38,12 @@ public class ThreadPooling {
|
|||||||
public ScheduledFuture run(Runnable run, long delay) {
|
public ScheduledFuture run(Runnable run, long delay) {
|
||||||
try {
|
try {
|
||||||
if (this.canAdd) {
|
if (this.canAdd) {
|
||||||
return this.scheduledPool.schedule(new Runnable() {
|
return this.scheduledPool.schedule(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
try {
|
try {
|
||||||
run.run();
|
run.run();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Emulator.getLogging().logErrorLine(e);
|
Emulator.getLogging().logErrorLine(e);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}, delay, TimeUnit.MILLISECONDS);
|
}, delay, TimeUnit.MILLISECONDS);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -29,12 +29,9 @@ public class HopperActionOne implements Runnable {
|
|||||||
this.client.getHabbo().getRoomUnit().setZ(this.teleportOne.getZ());
|
this.client.getHabbo().getRoomUnit().setZ(this.teleportOne.getZ());
|
||||||
this.client.getHabbo().getRoomUnit().setPreviousLocationZ(this.teleportOne.getZ());
|
this.client.getHabbo().getRoomUnit().setPreviousLocationZ(this.teleportOne.getZ());
|
||||||
|
|
||||||
Emulator.getThreading().run(new Runnable() {
|
Emulator.getThreading().run(() -> {
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
HopperActionOne.this.client.getHabbo().getRoomUnit().removeStatus(RoomUnitStatus.MOVE);
|
HopperActionOne.this.client.getHabbo().getRoomUnit().removeStatus(RoomUnitStatus.MOVE);
|
||||||
HopperActionOne.this.room.sendComposer(new RoomUserStatusComposer(HopperActionOne.this.client.getHabbo().getRoomUnit()).compose());
|
HopperActionOne.this.room.sendComposer(new RoomUserStatusComposer(HopperActionOne.this.client.getHabbo().getRoomUnit()).compose());
|
||||||
}
|
|
||||||
}, 750);
|
}, 750);
|
||||||
|
|
||||||
Emulator.getThreading().run(new HopperActionTwo(this.teleportOne, this.room, this.client), 1250);
|
Emulator.getThreading().run(new HopperActionTwo(this.teleportOne, this.room, this.client), 1250);
|
||||||
|
Loading…
Reference in New Issue
Block a user