Fix HC gates

This commit is contained in:
Alejandro 2019-08-04 17:23:04 +03:00
parent 184a426af5
commit 7abdb2815e
2 changed files with 17 additions and 17 deletions

View File

@ -12,7 +12,7 @@ import com.eu.habbo.threading.runnables.CloseGate;
import java.sql.ResultSet;
import java.sql.SQLException;
public class InteractionHabboClubGate extends InteractionGate {
public class InteractionHabboClubGate extends InteractionDefault {
public InteractionHabboClubGate(ResultSet set, Item baseItem) throws SQLException {
super(set, baseItem);
this.setExtradata("0");
@ -24,19 +24,16 @@ public class InteractionHabboClubGate extends InteractionGate {
}
@Override
public boolean canWalkOn(RoomUnit roomUnit, Room room, Object[] objects) {
Habbo habbo = room.getHabbo(roomUnit);
if (habbo != null) {
return habbo.getHabboStats().hasActiveClub();
}
return false;
public boolean isWalkable() {
return true;
}
@Override
public boolean isWalkable() {
return true;
public boolean canWalkOn(RoomUnit roomUnit, Room room, Object[] objects) {
Habbo habbo = room.getHabbo(roomUnit);
System.out.println(habbo != null && habbo.getHabboStats().hasActiveClub());
return habbo != null && habbo.getHabboStats().hasActiveClub();
}
@Override
@ -72,6 +69,6 @@ public class InteractionHabboClubGate extends InteractionGate {
public void onWalkOff(RoomUnit roomUnit, Room room, Object[] objects) throws Exception {
super.onWalkOff(roomUnit, room, objects);
Emulator.getThreading().run(new CloseGate(this, room), 500);
Emulator.getThreading().run(new CloseGate(this, room), 1000);
}
}

View File

@ -2,15 +2,13 @@ package com.eu.habbo.habbohotel.rooms;
import com.eu.habbo.Emulator;
import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.items.interactions.InteractionGuildGate;
import com.eu.habbo.habbohotel.items.interactions.InteractionTeleport;
import com.eu.habbo.habbohotel.items.interactions.InteractionWater;
import com.eu.habbo.habbohotel.items.interactions.InteractionWaterItem;
import com.eu.habbo.habbohotel.items.interactions.*;
import com.eu.habbo.habbohotel.pets.Pet;
import com.eu.habbo.habbohotel.pets.RideablePet;
import com.eu.habbo.habbohotel.users.DanceType;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboItem;
import com.eu.habbo.messages.outgoing.generic.alerts.CustomNotificationComposer;
import com.eu.habbo.messages.outgoing.rooms.users.RoomUserStatusComposer;
import com.eu.habbo.plugin.Event;
import com.eu.habbo.plugin.events.roomunit.RoomUnitLookAtPointEvent;
@ -285,12 +283,17 @@ public class RoomUnit {
if (item != habboItem || !RoomLayout.pointInSquare(item.getX(), item.getY(), item.getX() + item.getBaseItem().getWidth() - 1, item.getY() + item.getBaseItem().getLength() - 1, this.getX(), this.getY())) {
if (item.canWalkOn(this, room, null)) {
item.onWalkOn(this, room, null);
} else if (item instanceof InteractionGuildGate) {
} else if (item instanceof InteractionGuildGate || item instanceof InteractionHabboClubGate) {
this.setRotation(oldRotation);
this.tilesWalked--;
this.setGoalLocation(this.currentLocation);
this.status.remove(RoomUnitStatus.MOVE);
room.sendComposer(new RoomUserStatusComposer(this).compose());
if (item instanceof InteractionHabboClubGate && habbo != null) {
habbo.getClient().sendResponse(new CustomNotificationComposer(CustomNotificationComposer.GATE_NO_HC));
}
return false;
}
} else {