Rename and clean up MapleCoconuts
This commit is contained in:
@@ -26,7 +26,7 @@ import client.Client;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import server.events.gm.Coconut;
|
||||
import server.events.gm.MapleCoconuts;
|
||||
import server.events.gm.Coconuts;
|
||||
import server.maps.MapleMap;
|
||||
import tools.PacketCreator;
|
||||
|
||||
@@ -43,7 +43,7 @@ public final class CoconutHandler extends AbstractPacketHandler {
|
||||
int id = p.readShort();
|
||||
MapleMap map = c.getPlayer().getMap();
|
||||
Coconut event = map.getCoconut();
|
||||
MapleCoconuts nut = event.getCoconut(id);
|
||||
Coconuts nut = event.getCoconut(id);
|
||||
if (!nut.isHittable()){
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public class Coconut extends MapleEvent {
|
||||
private int countBombing = 80;
|
||||
private int countFalling = 401;
|
||||
private int countStopped = 20;
|
||||
private final List<MapleCoconuts> coconuts = new LinkedList<>();
|
||||
private final List<Coconuts> coconuts = new LinkedList<>();
|
||||
|
||||
public Coconut(MapleMap map) {
|
||||
super(1, 50);
|
||||
@@ -52,7 +52,7 @@ public class Coconut extends MapleEvent {
|
||||
public void startEvent() {
|
||||
map.startEvent();
|
||||
for (int i = 0; i < 506; i++) {
|
||||
coconuts.add(new MapleCoconuts(i));
|
||||
coconuts.add(new Coconuts(i));
|
||||
}
|
||||
map.broadcastMessage(PacketCreator.hitCoconut(true, 0, 0));
|
||||
setCoconutsHittable(true);
|
||||
@@ -181,16 +181,16 @@ public class Coconut extends MapleEvent {
|
||||
countStopped--;
|
||||
}
|
||||
|
||||
public MapleCoconuts getCoconut(int id) {
|
||||
public Coconuts getCoconut(int id) {
|
||||
return coconuts.get(id);
|
||||
}
|
||||
|
||||
public List<MapleCoconuts> getAllCoconuts() {
|
||||
public List<Coconuts> getAllCoconuts() {
|
||||
return coconuts;
|
||||
}
|
||||
|
||||
public void setCoconutsHittable(boolean hittable) {
|
||||
for (MapleCoconuts nut : coconuts) {
|
||||
for (Coconuts nut : coconuts) {
|
||||
nut.setHittable(hittable);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,17 +22,15 @@
|
||||
package server.events.gm;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author kevintjuh93
|
||||
*/
|
||||
public class MapleCoconuts {
|
||||
|
||||
private int id;
|
||||
public class Coconuts {
|
||||
private final int id;
|
||||
private int hits = 0;
|
||||
private boolean hittable = false;
|
||||
private long hittime = System.currentTimeMillis();
|
||||
|
||||
public MapleCoconuts(int id) {
|
||||
public Coconuts(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user