Rename and clean up MapleFamily
This commit is contained in:
@@ -23,7 +23,7 @@ package net.server.channel.handlers;
|
||||
|
||||
import client.Character;
|
||||
import client.Client;
|
||||
import client.MapleFamily;
|
||||
import client.Family;
|
||||
import client.MapleFamilyEntry;
|
||||
import config.YamlConfig;
|
||||
import net.AbstractPacketHandler;
|
||||
@@ -76,7 +76,7 @@ public final class AcceptFamilyHandler extends AbstractPacketHandler {
|
||||
}
|
||||
} else { //absorb target family
|
||||
MapleFamilyEntry targetEntry = chr.getFamilyEntry();
|
||||
MapleFamily targetFamily = targetEntry.getFamily();
|
||||
Family targetFamily = targetEntry.getFamily();
|
||||
if(targetFamily.getLeader() != targetEntry) return;
|
||||
if(inviter.getFamily().getTotalGenerations() + targetFamily.getTotalGenerations() <= YamlConfig.config.server.FAMILY_MAX_GENERATIONS) {
|
||||
targetEntry.join(inviter.getFamilyEntry());
|
||||
@@ -92,7 +92,7 @@ public final class AcceptFamilyHandler extends AbstractPacketHandler {
|
||||
chr.sendPacket(PacketCreator.sendFamilyMessage(76, 0));
|
||||
return;
|
||||
}
|
||||
MapleFamily newFamily = new MapleFamily(-1, c.getWorld());
|
||||
Family newFamily = new Family(-1, c.getWorld());
|
||||
c.getWorldServer().addFamily(newFamily.getID(), newFamily);
|
||||
MapleFamilyEntry inviterEntry = new MapleFamilyEntry(newFamily, inviter.getId(), inviter.getName(), inviter.getLevel(), inviter.getJob());
|
||||
inviterEntry.setCharacter(inviter);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.Client;
|
||||
import client.MapleFamily;
|
||||
import client.Family;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import tools.PacketCreator;
|
||||
@@ -10,7 +10,7 @@ public class FamilyPreceptsHandler extends AbstractPacketHandler {
|
||||
|
||||
@Override
|
||||
public void handlePacket(InPacket p, Client c) {
|
||||
MapleFamily family = c.getPlayer().getFamily();
|
||||
Family family = c.getPlayer().getFamily();
|
||||
if(family == null) return;
|
||||
if(family.getLeader().getChr() != c.getPlayer()) return; //only the leader can set the precepts
|
||||
String newPrecepts = p.readString();
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
package net.server.channel.handlers;
|
||||
|
||||
import client.Client;
|
||||
import client.MapleFamily;
|
||||
import client.Family;
|
||||
import client.MapleFamilyEntry;
|
||||
import config.YamlConfig;
|
||||
import net.AbstractPacketHandler;
|
||||
@@ -32,7 +32,7 @@ public class FamilySeparateHandler extends AbstractPacketHandler {
|
||||
@Override
|
||||
public void handlePacket(InPacket p, Client c) {
|
||||
if(!YamlConfig.config.server.USE_FAMILY_SYSTEM) return;
|
||||
MapleFamily oldFamily = c.getPlayer().getFamily();
|
||||
Family oldFamily = c.getPlayer().getFamily();
|
||||
if(oldFamily == null) return;
|
||||
MapleFamilyEntry forkOn = null;
|
||||
boolean isSenior;
|
||||
|
||||
@@ -247,7 +247,7 @@ public final class PlayerLoggedinHandler extends AbstractPacketHandler {
|
||||
|
||||
c.sendPacket(PacketCreator.loadFamily(player));
|
||||
if (player.getFamilyId() > 0) {
|
||||
MapleFamily f = wserv.getFamily(player.getFamilyId());
|
||||
Family f = wserv.getFamily(player.getFamilyId());
|
||||
if (f != null) {
|
||||
MapleFamilyEntry familyEntry = f.getEntryByID(player.getId());
|
||||
if (familyEntry != null) {
|
||||
|
||||
Reference in New Issue
Block a user