geforkt von Mirrors/FastAsyncWorldEdit
Fix incorrect instantiation of BlockBag and EditSession in two of the tools.
Used EditSessionFactory rather than getting the EditSession from the local session.
Dieser Commit ist enthalten in:
Ursprung
2fedcf8019
Commit
0d347a3837
@ -46,10 +46,9 @@ public class BlockReplacer implements DoubleActionBlockTool {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) {
|
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) {
|
||||||
BlockBag bag = session.getBlockBag(player);
|
BlockBag bag = session.getBlockBag(player);
|
||||||
|
|
||||||
World world = (World) clicked.getExtent();
|
EditSession editSession = session.createEditSession(player);
|
||||||
EditSession editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(world, -1, bag, player);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
editSession.setBlock(clicked.toVector(), targetBlock);
|
editSession.setBlock(clicked.toVector(), targetBlock);
|
||||||
@ -68,7 +67,7 @@ BlockBag bag = session.getBlockBag(player);
|
|||||||
@Override
|
@Override
|
||||||
public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) {
|
public boolean actSecondary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) {
|
||||||
World world = (World) clicked.getExtent();
|
World world = (World) clicked.getExtent();
|
||||||
EditSession editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(world, -1, player);
|
EditSession editSession = session.createEditSession(player);
|
||||||
targetBlock = (editSession).getBlock(clicked.toVector());
|
targetBlock = (editSession).getBlock(clicked.toVector());
|
||||||
BlockType type = BlockType.fromID(targetBlock.getType());
|
BlockType type = BlockType.fromID(targetBlock.getType());
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ public class QueryTool implements BlockTool {
|
|||||||
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) {
|
public boolean actPrimary(Platform server, LocalConfiguration config, Player player, LocalSession session, com.sk89q.worldedit.util.Location clicked) {
|
||||||
|
|
||||||
World world = (World) clicked.getExtent();
|
World world = (World) clicked.getExtent();
|
||||||
EditSession editSession = WorldEdit.getInstance().getEditSessionFactory().getEditSession(world, 0, player);
|
EditSession editSession = session.createEditSession(player);
|
||||||
BaseBlock block = (editSession).rawGetBlock(clicked.toVector());
|
BaseBlock block = (editSession).rawGetBlock(clicked.toVector());
|
||||||
BlockType type = BlockType.fromID(block.getType());
|
BlockType type = BlockType.fromID(block.getType());
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren