1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-06 07:32:46 +00:00

Implements item dropping and pickup stacking

This commit is contained in:
2011-12-15 16:41:09 -02:00
parent 352735c8c9
commit f87b9dd755
19 changed files with 581 additions and 77 deletions

View File

@@ -16,6 +16,10 @@
*/
package com.l2jserver.model;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.common.base.Preconditions;
import com.l2jserver.model.id.ID;
@@ -28,6 +32,8 @@ import com.l2jserver.model.id.ID;
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public abstract class AbstractModel<T extends ID<?>> implements Model<T> {
private final Logger log = LoggerFactory.getLogger(this.getClass());
/**
* The object id
*/
@@ -58,6 +64,7 @@ public abstract class AbstractModel<T extends ID<?>> implements Model<T> {
public void setObjectDesire(ObjectDesire desire) {
if (desire == null)
desire = ObjectDesire.NONE;
log.debug("{} set desire to {}", this, desire);
this.desire = desire;
}
@@ -69,8 +76,10 @@ public abstract class AbstractModel<T extends ID<?>> implements Model<T> {
@SuppressWarnings("javadoc")
protected void desireUpdate() {
if (this.desire != ObjectDesire.INSERT
&& this.desire != ObjectDesire.DELETE)
&& this.desire != ObjectDesire.DELETE) {
log.debug("{} desires an update", this);
this.desire = ObjectDesire.UPDATE;
}
}
/**
@@ -79,8 +88,10 @@ public abstract class AbstractModel<T extends ID<?>> implements Model<T> {
*/
@SuppressWarnings("javadoc")
protected void desireInsert() {
if (this.desire != ObjectDesire.DELETE)
if (this.desire != ObjectDesire.DELETE) {
log.debug("{} desires an insert", this);
this.desire = ObjectDesire.INSERT;
}
}
@Override