mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-05 16:49:06 +00:00
Def cleanup (#585)
* Object definition cleanup * Update ShopAssistant.java * stackables * notables * unused files * more junk * almost done * working * moving old methods to deprecated * update * fixed pickpocket typos * Update Pickpocket.java * Remove redundant method. Fix stall stealing * Documentation for deprecated methods * WIP commit partial removal. Has test and dump classes * Final cleanup * Move definitions from data folder to cfg * Temporarily moving definition loaders to GameEngine This is until loading can be done asynchronously. * Correct indentation.
This commit is contained in:
@@ -3,7 +3,7 @@ package com.rs2.game.npcs;
|
||||
import com.rs2.event.CycleEvent;
|
||||
import com.rs2.event.CycleEventContainer;
|
||||
import com.rs2.event.CycleEventHandler;
|
||||
import com.rs2.game.items.ItemAssistant;
|
||||
import com.rs2.game.items.DeprecatedItems;
|
||||
import com.rs2.game.players.Player;
|
||||
import com.rs2.game.players.PlayerHandler;
|
||||
import com.rs2.util.Misc;
|
||||
@@ -66,7 +66,7 @@ public class Npc {
|
||||
|
||||
public void shearSheep(Player player, int itemNeeded, int itemGiven, int animation, final int currentId, final int newId, int transformTime) {
|
||||
if (!player.getItemAssistant().playerHasItem(itemNeeded)) {
|
||||
player.getPacketSender().sendMessage("You need " + ItemAssistant.getItemName(itemNeeded).toLowerCase() + " to do that.");
|
||||
player.getPacketSender().sendMessage("You need " + DeprecatedItems.getItemName(itemNeeded).toLowerCase() + " to do that.");
|
||||
return;
|
||||
}
|
||||
if (transformId == newId) {
|
||||
@@ -81,7 +81,7 @@ public class Npc {
|
||||
}
|
||||
requestTransform(newId);
|
||||
player.getItemAssistant().addItem(itemGiven, 1);
|
||||
player.getPacketSender().sendMessage("You get some " + ItemAssistant.getItemName(itemGiven).toLowerCase() + ".");
|
||||
player.getPacketSender().sendMessage("You get some " + DeprecatedItems.getItemName(itemGiven).toLowerCase() + ".");
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.rs2.game.npcs.drops;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.rs2.GameEngine;
|
||||
import com.rs2.game.items.ItemList;
|
||||
import com.rs2.util.Misc;
|
||||
import com.rs2.util.NpcDrop;
|
||||
|
||||
@@ -49,40 +47,11 @@ public class NPCDropsHandler {
|
||||
}
|
||||
|
||||
return new ItemDrop[]{
|
||||
new ItemDrop(i("bones"), 1, 0),
|
||||
new ItemDrop(526, 1, 0),
|
||||
new ItemDrop(995, new int[]{ 1, 10 }, 3),
|
||||
new ItemDrop(2677, 1, 512) };
|
||||
}
|
||||
|
||||
/**
|
||||
* short version of getItemId
|
||||
*
|
||||
* @param itemName name of the item
|
||||
*
|
||||
* @return itemId
|
||||
*/
|
||||
public static int i(String itemName) {
|
||||
return getItemId(itemName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Item id main method
|
||||
*
|
||||
* @param itemName name of the item
|
||||
*
|
||||
* @return itemId
|
||||
*/
|
||||
public static int getItemId(String itemName) {
|
||||
for (ItemList i : GameEngine.itemHandler.itemList) {
|
||||
if (i != null) {
|
||||
if (i.itemName.equalsIgnoreCase(itemName)) {
|
||||
return i.itemId;
|
||||
}
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Misc.random in shorter form
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user