Added container transaction support for item frames (...)

Fixed ClassCastException when targeting an armor stand with #container
This commit is contained in:
Intelli 2022-02-17 20:56:20 -07:00
parent e462e68806
commit fb79071ee7
23 changed files with 423 additions and 359 deletions

View file

@ -253,20 +253,6 @@ public class Queue {
queueStandardData(consumerId, currentConsumer, new String[] { user, null }, new Object[] { block, type });
}
protected static void queueHangingRemove(String user, BlockState block, String blockData, int delay) {
int currentConsumer = Consumer.currentConsumer;
int consumerId = Consumer.newConsumerId(currentConsumer);
addConsumer(currentConsumer, new Object[] { consumerId, Process.HANGING_REMOVE, null, 0, null, 0, delay, blockData });
queueStandardData(consumerId, currentConsumer, new String[] { user, null }, block);
}
protected static void queueHangingSpawn(String user, BlockState block, Material type, String blockData, int data, int delay) {
int currentConsumer = Consumer.currentConsumer;
int consumerId = Consumer.newConsumerId(currentConsumer);
addConsumer(currentConsumer, new Object[] { consumerId, Process.HANGING_SPAWN, type, data, null, 0, delay, blockData });
queueStandardData(consumerId, currentConsumer, new String[] { user, null }, block);
}
protected static void queueMaterialInsert(int id, String name) {
int currentConsumer = Consumer.currentConsumer;
int consumerId = Consumer.newConsumerId(currentConsumer);

View file

@ -1,15 +0,0 @@
package net.coreprotect.consumer.process;
import org.bukkit.block.BlockState;
import net.coreprotect.utility.entity.HangingUtil;
class HangingRemoveProcess {
static void process(Object object, String hangingData, int delay) {
if (object instanceof BlockState) {
BlockState block = (BlockState) object;
HangingUtil.removeHanging(block, hangingData, delay);
}
}
}

View file

@ -1,16 +0,0 @@
package net.coreprotect.consumer.process;
import org.bukkit.Material;
import org.bukkit.block.BlockState;
import net.coreprotect.utility.entity.HangingUtil;
class HangingSpawnProcess {
static void process(Object object, Material type, int data, String hangingData, int delay) {
if (object instanceof BlockState) {
BlockState block = (BlockState) object;
HangingUtil.spawnHanging(block, type, hangingData, data, delay);
}
}
}

View file

@ -35,8 +35,6 @@ public class Process {
public static final int PLAYER_LOGOUT = 15;
public static final int ENTITY_KILL = 16;
public static final int ENTITY_SPAWN = 17;
public static final int HANGING_REMOVE = 18;
public static final int HANGING_SPAWN = 19;
public static final int NATURAL_BLOCK_BREAK = 20;
public static final int MATERIAL_INSERT = 21;
public static final int ART_INSERT = 22;
@ -195,12 +193,6 @@ public class Process {
case Process.ENTITY_SPAWN:
EntitySpawnProcess.process(statement, object, forceData);
break;
case Process.HANGING_REMOVE:
HangingRemoveProcess.process(object, (String) data[7], forceData);
break;
case Process.HANGING_SPAWN:
HangingSpawnProcess.process(object, blockType, blockData, (String) data[7], forceData);
break;
case Process.NATURAL_BLOCK_BREAK:
NaturalBlockBreakProcess.process(statement, preparedStmtBlocks, i, processId, id, user, object, blockType, blockData, (String) data[7]);
break;