Stop anvil guis from giving out input items

This commit is contained in:
fullwall 2022-07-26 15:08:13 +08:00
parent 5dbc578fd2
commit ddf5660c66
8 changed files with 39 additions and 4 deletions

View File

@ -865,6 +865,11 @@ public class NMSImpl implements NMSBridge {
handle) {
private CraftInventoryView bukkitEntity;
@Override
protected void a(EntityHuman entityhuman, net.minecraft.server.v1_12_R1.World world,
IInventory iinventory) {
}
@Override
public void e() {
super.e();

View File

@ -900,6 +900,11 @@ public class NMSImpl implements NMSBridge {
handle) {
private CraftInventoryView bukkitEntity;
@Override
protected void a(EntityHuman entityhuman, net.minecraft.server.v1_13_R2.World world,
IInventory iinventory) {
}
@Override
public void d() {
super.d();

View File

@ -969,6 +969,11 @@ public class NMSImpl implements NMSBridge {
final ContainerAnvil container = new ContainerAnvil(handle.nextContainerCounter(), handle.inventory, access) {
private CraftInventoryView bukkitEntity;
@Override
protected void a(EntityHuman entityhuman, net.minecraft.server.v1_14_R1.World world,
IInventory iinventory) {
}
@Override
public void e() {
super.e();

View File

@ -981,6 +981,11 @@ public class NMSImpl implements NMSBridge {
final ContainerAnvil container = new ContainerAnvil(handle.nextContainerCounter(), handle.inventory, access) {
private CraftInventoryView bukkitEntity;
@Override
protected void a(EntityHuman entityhuman, net.minecraft.server.v1_15_R1.World world,
IInventory iinventory) {
}
@Override
public void e() {
super.e();

View File

@ -1005,6 +1005,11 @@ public class NMSImpl implements NMSBridge {
ContainerAccess.at(handle.world, new BlockPosition(0, 0, 0))) {
private CraftInventoryView bukkitEntity;
@Override
protected void a(EntityHuman entityhuman, net.minecraft.server.v1_16_R3.World world,
IInventory iinventory) {
}
@Override
public void e() {
super.e();

View File

@ -1010,6 +1010,10 @@ public class NMSImpl implements NMSBridge {
ContainerLevelAccess.create(handle.level, new BlockPos(0, 0, 0))) {
private CraftInventoryView bukkitEntity;
@Override
protected void clearContainer(net.minecraft.world.entity.player.Player entityhuman, Container iinventory) {
}
@Override
public void createResult() {
super.createResult();

View File

@ -1017,6 +1017,10 @@ public class NMSImpl implements NMSBridge {
ContainerLevelAccess.create(handle.level, new BlockPos(0, 0, 0))) {
private CraftInventoryView bukkitEntity;
@Override
protected void clearContainer(net.minecraft.world.entity.player.Player entityhuman, Container iinventory) {
}
@Override
public void createResult() {
super.createResult();

View File

@ -1033,6 +1033,10 @@ public class NMSImpl implements NMSBridge {
ContainerLevelAccess.create(handle.level, new BlockPos(0, 0, 0))) {
private CraftInventoryView bukkitEntity;
@Override
protected void clearContainer(net.minecraft.world.entity.player.Player entityhuman, Container iinventory) {
}
@Override
public void createResult() {
super.createResult();
@ -1041,15 +1045,13 @@ public class NMSImpl implements NMSBridge {
@Override
public CraftInventoryView getBukkitView() {
if (this.bukkitEntity != null) {
return this.bukkitEntity;
} else {
if (this.bukkitEntity == null) {
this.bukkitEntity = new CraftInventoryView(this.player.getBukkitEntity(),
new CitizensInventoryAnvil(this.access.getLocation(), this.inputSlots, this.resultSlots,
this, anvil),
this);
return this.bukkitEntity;
}
return this.bukkitEntity;
}
};
container.getBukkitView().setItem(0, anvil.getItem(0));