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.ResultSet;
import java.sql.SQLException; import java.sql.SQLException;
public class InteractionHabboClubGate extends InteractionGate { public class InteractionHabboClubGate extends InteractionDefault {
public InteractionHabboClubGate(ResultSet set, Item baseItem) throws SQLException { public InteractionHabboClubGate(ResultSet set, Item baseItem) throws SQLException {
super(set, baseItem); super(set, baseItem);
this.setExtradata("0"); this.setExtradata("0");
@ -24,19 +24,16 @@ public class InteractionHabboClubGate extends InteractionGate {
} }
@Override @Override
public boolean canWalkOn(RoomUnit roomUnit, Room room, Object[] objects) { public boolean isWalkable() {
Habbo habbo = room.getHabbo(roomUnit); return true;
if (habbo != null) {
return habbo.getHabboStats().hasActiveClub();
}
return false;
} }
@Override @Override
public boolean isWalkable() { public boolean canWalkOn(RoomUnit roomUnit, Room room, Object[] objects) {
return true; Habbo habbo = room.getHabbo(roomUnit);
System.out.println(habbo != null && habbo.getHabboStats().hasActiveClub());
return habbo != null && habbo.getHabboStats().hasActiveClub();
} }
@Override @Override
@ -72,6 +69,6 @@ public class InteractionHabboClubGate extends InteractionGate {
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 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.Emulator;
import com.eu.habbo.habbohotel.items.Item; import com.eu.habbo.habbohotel.items.Item;
import com.eu.habbo.habbohotel.items.interactions.InteractionGuildGate; import com.eu.habbo.habbohotel.items.interactions.*;
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.pets.Pet; import com.eu.habbo.habbohotel.pets.Pet;
import com.eu.habbo.habbohotel.pets.RideablePet; import com.eu.habbo.habbohotel.pets.RideablePet;
import com.eu.habbo.habbohotel.users.DanceType; import com.eu.habbo.habbohotel.users.DanceType;
import com.eu.habbo.habbohotel.users.Habbo; import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboItem; 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.messages.outgoing.rooms.users.RoomUserStatusComposer;
import com.eu.habbo.plugin.Event; import com.eu.habbo.plugin.Event;
import com.eu.habbo.plugin.events.roomunit.RoomUnitLookAtPointEvent; 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 != 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)) { if (item.canWalkOn(this, room, null)) {
item.onWalkOn(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.setRotation(oldRotation);
this.tilesWalked--; this.tilesWalked--;
this.setGoalLocation(this.currentLocation); this.setGoalLocation(this.currentLocation);
this.status.remove(RoomUnitStatus.MOVE); this.status.remove(RoomUnitStatus.MOVE);
room.sendComposer(new RoomUserStatusComposer(this).compose()); room.sendComposer(new RoomUserStatusComposer(this).compose());
if (item instanceof InteractionHabboClubGate && habbo != null) {
habbo.getClient().sendResponse(new CustomNotificationComposer(CustomNotificationComposer.GATE_NO_HC));
}
return false; return false;
} }
} else { } else {