Removed EngineInterface references of singletons.

This commit is contained in:
MobiusDevelopment 2020-02-02 22:34:45 +00:00
parent a1541b2772
commit 8c2191c7da
2 changed files with 3 additions and 43 deletions

View File

@ -16,52 +16,11 @@
*/
package org.l2jmobius.gameserver.script;
import org.l2jmobius.gameserver.GameTimeController;
import org.l2jmobius.gameserver.RecipeController;
import org.l2jmobius.gameserver.datatables.ItemTable;
import org.l2jmobius.gameserver.datatables.SkillTable;
import org.l2jmobius.gameserver.datatables.sql.CharNameTable;
import org.l2jmobius.gameserver.datatables.sql.CharTemplateTable;
import org.l2jmobius.gameserver.datatables.sql.ClanTable;
import org.l2jmobius.gameserver.datatables.sql.LevelUpData;
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
import org.l2jmobius.gameserver.datatables.sql.SkillTreeTable;
import org.l2jmobius.gameserver.datatables.sql.SpawnTable;
import org.l2jmobius.gameserver.datatables.sql.TeleportLocationTable;
import org.l2jmobius.gameserver.datatables.xml.MapRegionData;
import org.l2jmobius.gameserver.idfactory.IdFactory;
import org.l2jmobius.gameserver.model.World;
import org.l2jmobius.gameserver.model.entity.Announcements;
/**
* @author Luis Arias
*/
public interface EngineInterface
{
// * keep the references of Singletons to prevent garbage collection
CharNameTable charNametable = CharNameTable.getInstance();
IdFactory idFactory = IdFactory.getInstance();
ItemTable itemTable = ItemTable.getInstance();
SkillTable skillTable = SkillTable.getInstance();
RecipeController recipeController = RecipeController.getInstance();
SkillTreeTable skillTreeTable = SkillTreeTable.getInstance();
CharTemplateTable charTemplates = CharTemplateTable.getInstance();
ClanTable clanTable = ClanTable.getInstance();
NpcTable npcTable = NpcTable.getInstance();
TeleportLocationTable teleTable = TeleportLocationTable.getInstance();
LevelUpData levelUpData = LevelUpData.getInstance();
World world = World.getInstance();
SpawnTable spawnTable = SpawnTable.getInstance();
GameTimeController gameTimeController = GameTimeController.getInstance();
Announcements announcements = Announcements.getInstance();
MapRegionData mapRegions = MapRegionData.getInstance();
void addQuestDrop(int npcID, int itemID, int min, int max, int chance, String questID, String[] states);
void addEventDrop(int[] items, int[] count, double chance, DateRange range);

View File

@ -19,6 +19,7 @@ package org.l2jmobius.gameserver.script.faenor;
import java.util.List;
import java.util.logging.Logger;
import org.l2jmobius.gameserver.datatables.sql.NpcTable;
import org.l2jmobius.gameserver.model.DropCategory;
import org.l2jmobius.gameserver.model.DropData;
import org.l2jmobius.gameserver.model.actor.templates.NpcTemplate;
@ -50,7 +51,7 @@ public class FaenorInterface implements EngineInterface
@Override
public void addQuestDrop(int npcID, int itemID, int min, int max, int chance, String questID, String[] states)
{
final NpcTemplate npc = npcTable.getTemplate(npcID);
final NpcTemplate npc = NpcTable.getInstance().getTemplate(npcID);
if (npc == null)
{
throw new NullPointerException();
@ -76,7 +77,7 @@ public class FaenorInterface implements EngineInterface
*/
public void addDrop(int npcID, int itemID, int min, int max, boolean sweep, int chance)
{
final NpcTemplate npc = npcTable.getTemplate(npcID);
final NpcTemplate npc = NpcTable.getInstance().getTemplate(npcID);
if (npc == null)
{
throw new NullPointerException();