mirror of
https://github.com/2006-Scape/2006Scape.git
synced 2026-07-05 00:31:57 +00:00
Replace clipping files with loading straight from the cache. (#540)
* Archive decompression from apollo * Removed unused object definition fields * Add more options to IndexedFileSystem New methods are to read directly to a bytearray rather than allocating a large number of ByteBuffers on server startup for map loading. decompress is from client and will be depre * Fix opcode 19 of object defs * Initial commit of loading maps from cache * Removed deprecated methods Methods were in IndexedFileSystem for testing to ensure the getFileBytes method worked correctly. * Some code cleanup to fix packaging. #TODO review methods in CompressionUtil to use the best Gzip decompression * map_index loading from cache * Update pom.xml Added commons compress dependency from maven for bzip2 decompression * Renaming some object definition values. * Update ObjectDefinition.java Removed rest of unused variables * Update ObjectDefinition.java * Object Definitions loading from cache * Remove dead code * Remove unneeded files Maps/Definitions now load from in the cache. * Firemaking clipping
This commit is contained in:
+17
-6
@@ -81,14 +81,24 @@ public class Firemaking {
|
||||
GameEngine.itemHandler.createGroundItem(c, logId, c.absX, c.absY, 1, c.playerId);
|
||||
}
|
||||
}
|
||||
final boolean walk;
|
||||
|
||||
int[] dir = { 0, 0 };
|
||||
if (Region.getClipping(x - 1, y, c.heightLevel, -1, 0)) {
|
||||
walk = true;
|
||||
} else {
|
||||
walk = false;
|
||||
dir[0] = -1;
|
||||
dir[1] = 0;
|
||||
} else if (Region.getClipping(x + 1, y, c.heightLevel, 1, 0)) {
|
||||
dir[0] = 1;
|
||||
dir[1] = 0;
|
||||
} else if (Region.getClipping(x, y - 1, c.heightLevel, 0, -1)) {
|
||||
dir[0] = 0;
|
||||
dir[1] = -1;
|
||||
} else if (Region.getClipping(x, y + 1, c.heightLevel, 0, 1)) {
|
||||
dir[0] = 0;
|
||||
dir[1] = 1;
|
||||
}
|
||||
|
||||
c.startAnimation(733);
|
||||
c.getPlayerAssistant().walkTo(walk ? -1 : 1, 0);
|
||||
c.getPlayerAssistant().walkTo(dir[0], dir[1]);
|
||||
c.stopFiremaking = false;
|
||||
CycleEventHandler.getSingleton().addEvent(c, new CycleEvent() {
|
||||
|
||||
@@ -121,7 +131,7 @@ public class Firemaking {
|
||||
|
||||
@Override
|
||||
public void execute(CycleEventContainer container) {
|
||||
c.turnPlayerTo(walk ? x + 1 : x - 1, y);
|
||||
c.turnPlayerTo(x - dir[0], y - dir[1]);
|
||||
c.logLit = true;
|
||||
stopFiremaking(c);
|
||||
container.stop();
|
||||
@@ -164,4 +174,5 @@ public class Firemaking {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user