Commit Graph
20 Commits
Author SHA1 Message Date
frymaster ce323f5f50 Alter double chest type/location code
This alters the behaviour of the ``getInventoryHolderLocation`` and ``getInventoryHolderType`` methods in a way which should have identical behaviour for double chests but which should also not raise an exception if there are triple (or larger) chests.  The type will be correct; the location will at least return *something* which is the location of one of the chests involved, but it'll probably be semi-arbitrary what coordinates are returned.

Fixes #563 - note issue #533 which this does **not** address
2015-07-11 17:43:30 +01:00
Ammar Askar 5bac149692 Fix up javadocs 2015-06-23 19:48:20 +05:00
Ammar Askar 9f41fffbc3 Reformat the entire project:
Use of braces is now enforced EVERYWHERE
Switched to 4spaces instead of tabs
2015-03-22 20:15:04 +05:00
Philip Cass 27866504c3 Merge branch 'master' into issue-442
- Update PR to use Actor system
- Amend actorFromProjectileSource to choose a friendly name when a block is the source of a projectile
- Added util method to try to suggest an appropriate item as the "weapon" in a projectile kill

Closes #442
Fixes #470 Fixes #471
2015-03-08 18:50:34 +00:00
frymaster d7f2ac5a65 Merge pull request #506 from DarkArc/1_7_2
Updated Smart Logging for 1.7.2 and resolved a bug with door logging
2014-01-20 02:16:41 -08:00
Philip Cass bbe7989878 Improvements to checks for inventory blocks and double inventory blocks
These commits replace all checks of the form type == someInventoryBlockId || type = anotherOne
with a call to getContainerBlocks().contains(Material.getMaterial(type))

This was done by searching the code for 54 which is the chest ID.
Remaining explicit mentions of id 54 are in regards to special-casing for double chests -
the code there has been expanded to also consider id 146, the trapped chest.
I didn't think it worth making a collection for double-block inventories, but if more are
added it should be considered - looking forward, this might be necessary when the mod API
comes in, assuming we have a way of figuring out what double inventories are anyway.

This fixes many blocks not having inventories logged when destroyed due to explosions,
or not being rollbackable, and tools not querying both sides of double trapped chests.
Rolling back e.g. a furnace is glitchy - the fuel, raw material and product do not get
placed in the correct slots.

- Update list of container blocks
- Make tool treat trapped chests as potential double chests
- Replace explicit id checks with a call to getContainerBlocks()
2014-01-14 10:51:47 +00:00
Dark Arc 3cffeccedb Updated Smart Logging for 1.7.2 and resolved a bug with door logging 2013-12-09 15:32:09 -05:00
Philip Cass c0b983e8e8 Allow for logging of item data greater than 256. Fixes #96, #235
This change involves refactoring many instances of "byte" to "short and altering a few ItemStack calls to use the int,int,short form instead of int,int,0,byte
Significantly it also involves altering the MaterialName system to allow shorts instead of bytes, and altering the rawdata() function to return the durability of an ItemStack rather than the data value of its Material.

One side effect of this is that tool durability is now logged, which will make for more accurate rollbacks.
2013-12-04 11:29:02 +00:00
Philip Cass 6025469dfa Expand chestaccess querying
Make a decison on whether or not to return chest access data based on the
BlockChangeType (ALL or CHESTACCESS) rather than partly on the block parameter
as these are the only two query types that don't enforce type != replaced

This is helpful because the list of blocks to request chest access for was
outdated and is duplicated in 3 different places, whereas the new method
will return whatever results have been logged regardless of type.

In addition, if the query type is CHESTACCESS (but not ALL), we can use
an alternate query that is vastly more efficient.  In tests (26 million
row log table, 400,000 row chest table) the query time for all chest results
was reduced from 30 seconds to 3.

Allows the chestaccess parameter to return data from the following inventory types:

- Brewing stand
- Trapped chest (fixes #483)
- Dropper
- Hopper
- Beacon

Note that this only affects lookup of logged items; the logging process has not
been touched, so #433 and similar have not been addressed

Also, update the list of valid container types, which will improve logging of
broken containers.
2013-11-07 13:51:02 +00:00
Dark Arc 2a2079c1a3 Updated Smart Logging for MC 1.6.1 2013-07-02 17:24:27 -04:00
Dark Arc e37a584f89 Fixed door logging 2013-05-19 13:29:16 -04:00
Dark Arc cf8fc322ab Added player and creature crop trample logging 2013-05-19 13:29:15 -04:00
Dark Arc a6f543feac Fixed an issue where smart logging could not make proper block comparison checks 2013-03-15 21:18:12 -04:00
Dark Arc 8a3a61f90f Updated Smart Logging for MC 1.5 2013-03-15 20:15:44 -04:00
Dark Arc e4ee6f944d [Experimental] Major improvements to LogBlock's accuracy. 2013-01-08 14:39:28 +11:00
Ammar Askar 18c86818fb Log falling blocks properly 2012-09-22 20:51:43 +10:00
Ammar Askar fce9d0877e Handle more relative breaking scenarios, courtesy of @Psithief 2012-08-20 06:57:16 +02:00
Ammar Askar baef9dd963 Log signs broken by relative block breaks 2012-08-08 19:48:25 +10:00
md_5 0290305b23 Bump to 1.56 and invert container ordering 2012-08-05 14:49:01 +10:00
md_5 61e9643b90 Mavenize this project so we can use Jenkins and easily enable developers to compile from source. 2012-07-28 14:52:38 +10:00