mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-03 08:39:04 +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:
@@ -1,7 +1,8 @@
|
||||
package com.rs2.game.objects;
|
||||
|
||||
import org.apollo.cache.def.ObjectDefinition;
|
||||
|
||||
import com.rs2.game.players.Player;
|
||||
import com.rs2.world.clip.ObjectDefinition;
|
||||
|
||||
/**
|
||||
* ObjectDefaults
|
||||
@@ -17,7 +18,7 @@ public class ObjectDefaults {
|
||||
WEST = 3;
|
||||
|
||||
public static int getObjectType(Player player, int objectType) {
|
||||
String objectName = ObjectDefinition.getObjectDef(objectType).name;
|
||||
String objectName = ObjectDefinition.lookup(objectType).getName();
|
||||
if (objectName.contains("Wardrobe") || objectName.contains("chest") || objectName.contains("Cupboard") || objectName.contains("Coffin")) {
|
||||
return 10;
|
||||
} else if (objectName.contains("Curtain")) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.rs2.game.objects;
|
||||
|
||||
import com.rs2.world.clip.ObjectDefinition;
|
||||
import org.apollo.cache.def.ObjectDefinition;
|
||||
|
||||
public class Objects {
|
||||
|
||||
@@ -39,7 +39,7 @@ public class Objects {
|
||||
}
|
||||
|
||||
public int[] getObjectSize() {
|
||||
ObjectDefinition def = ObjectDefinition.getObjectDef(objectId);
|
||||
ObjectDefinition def = ObjectDefinition.lookup(objectId);
|
||||
if (def == null) {
|
||||
return new int[] {1, 1};
|
||||
}
|
||||
@@ -49,11 +49,11 @@ public class Objects {
|
||||
int xLength;
|
||||
int yLength;
|
||||
if (objectFace != 1 && objectFace != 3) {
|
||||
xLength = def.xLength();
|
||||
yLength = def.yLength();
|
||||
xLength = def.getWidth();
|
||||
yLength = def.getLength();
|
||||
} else {
|
||||
xLength = def.yLength();
|
||||
yLength = def.xLength();
|
||||
xLength = def.getLength();
|
||||
yLength = def.getWidth();
|
||||
}
|
||||
|
||||
return new int[] {xLength, yLength};
|
||||
|
||||
@@ -30,7 +30,7 @@ import com.rs2.game.content.traveling.DesertCactus;
|
||||
import com.rs2.game.globalworldobjects.ClimbOther;
|
||||
import com.rs2.game.globalworldobjects.ClimbOther.ClimbData;
|
||||
import com.rs2.game.globalworldobjects.PassDoor;
|
||||
import com.rs2.game.items.ItemAssistant;
|
||||
import com.rs2.game.items.DeprecatedItems;
|
||||
import com.rs2.game.items.impl.LightSources;
|
||||
import com.rs2.game.npcs.NpcHandler;
|
||||
import com.rs2.game.npcs.impl.MilkCow;
|
||||
@@ -2884,7 +2884,7 @@ public class ObjectsActions {
|
||||
if (player.ectofuntusBoneCrusherState.equals("Empty")) {
|
||||
player.getPacketSender().sendMessage("You need to load some bones.");
|
||||
} else if (player.ectofuntusBoneCrusherState.equals("Loaded")) {
|
||||
player.getPacketSender().sendMessage(ItemAssistant.getItemName(player.ectofuntusBoneUsed) + " loaded and ready to be grinded.");
|
||||
player.getPacketSender().sendMessage(DeprecatedItems.getItemName(player.ectofuntusBoneUsed) + " loaded and ready to be grinded.");
|
||||
} else if (player.ectofuntusBoneCrusherState.equals("Bin")) {
|
||||
player.getPacketSender().sendMessage("Bonemeal is ready to be collected from the bin.");
|
||||
} else {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package com.rs2.game.objects.impl;
|
||||
|
||||
import org.apollo.cache.def.ObjectDefinition;
|
||||
|
||||
import com.rs2.event.CycleEvent;
|
||||
import com.rs2.event.CycleEventContainer;
|
||||
import com.rs2.event.CycleEventHandler;
|
||||
import com.rs2.game.players.Player;
|
||||
import com.rs2.world.clip.ObjectDefinition;
|
||||
|
||||
/**
|
||||
* Levers
|
||||
@@ -22,7 +23,7 @@ public class Levers {
|
||||
};
|
||||
|
||||
public static void pullLever(final Player player, int objectType) {
|
||||
String objectName = ObjectDefinition.getObjectDef(objectType).name;
|
||||
String objectName = ObjectDefinition.lookup(objectType).getName();
|
||||
for (final int[] element : LEVERS) {
|
||||
if (player.objectX == element[0] && player.objectY == element[1] && objectName.equalsIgnoreCase("Lever")) {
|
||||
if (System.currentTimeMillis() - player.leverDelay > 3750) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.rs2.game.objects.impl;
|
||||
|
||||
import org.apollo.cache.def.ObjectDefinition;
|
||||
|
||||
import com.rs2.GameConstants;
|
||||
import com.rs2.GameEngine;
|
||||
import com.rs2.event.CycleEvent;
|
||||
@@ -9,7 +11,6 @@ import com.rs2.game.content.traveling.DesertHeat;
|
||||
import com.rs2.game.objects.ObjectDefaults;
|
||||
import com.rs2.game.players.Player;
|
||||
import com.rs2.util.Misc;
|
||||
import com.rs2.world.clip.ObjectDefinition;
|
||||
import com.rs2.world.clip.Region;
|
||||
|
||||
public class OtherObjects {
|
||||
@@ -118,7 +119,7 @@ public class OtherObjects {
|
||||
}
|
||||
|
||||
private static void handleSpecialObject(final Player player, final int objectType) {
|
||||
String objectName = ObjectDefinition.getObjectDef(objectType).name;
|
||||
String objectName = ObjectDefinition.lookup(objectType).getName();
|
||||
if (objectType == 160 && player.getX() == 3096) {
|
||||
player.getPlayerAssistant().walkTo(0, 1);
|
||||
CycleEventHandler.getSingleton().addEvent(player, new CycleEvent() {
|
||||
|
||||
Reference in New Issue
Block a user