Fix abstract method on inventories
This commit is contained in:
parent
ad1da3ce18
commit
3c4f2ba31b
@ -13,23 +13,23 @@ public interface IInventoryBridge {
|
||||
|
||||
int MAX_STACK = 64;
|
||||
|
||||
List<ItemStack> bridge$getContents();
|
||||
List<ItemStack> getContents();
|
||||
|
||||
void bridge$onOpen(CraftHumanEntity who);
|
||||
void onOpen(CraftHumanEntity who);
|
||||
|
||||
void bridge$onClose(CraftHumanEntity who);
|
||||
void onClose(CraftHumanEntity who);
|
||||
|
||||
List<HumanEntity> bridge$getViewers();
|
||||
List<HumanEntity> getViewers();
|
||||
|
||||
InventoryHolder bridge$getOwner();
|
||||
InventoryHolder getOwner();
|
||||
|
||||
void bridge$setOwner(InventoryHolder owner);
|
||||
void setOwner(InventoryHolder owner);
|
||||
|
||||
void bridge$setMaxStackSize(int size);
|
||||
void setMaxStackSize(int size);
|
||||
|
||||
Location bridge$getLocation();
|
||||
Location getLocation();
|
||||
|
||||
IRecipe<?> bridge$getCurrentRecipe();
|
||||
IRecipe<?> getCurrentRecipe();
|
||||
|
||||
void bridge$setCurrentRecipe(IRecipe<?> recipe);
|
||||
void setCurrentRecipe(IRecipe<?> recipe);
|
||||
}
|
||||
|
||||
@ -16,7 +16,7 @@ public class ComposterBlockMixin {
|
||||
@Redirect(method = "createInventory", at = @At(value = "NEW", target = "net/minecraft/block/ComposterBlock.EmptyInventory"))
|
||||
public ComposterBlock.EmptyInventory arclight$newEmpty(BlockState blockState, IWorld world, BlockPos blockPos) {
|
||||
ComposterBlock.EmptyInventory inventory = new ComposterBlock.EmptyInventory();
|
||||
((IInventoryBridge) inventory).bridge$setOwner(new CraftBlockInventoryHolder(world, blockPos, inventory));
|
||||
((IInventoryBridge) inventory).setOwner(new CraftBlockInventoryHolder(world, blockPos, inventory));
|
||||
return inventory;
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,6 +16,6 @@ public abstract class ComposterBlock_EmptyInventoryMixin extends InventoryMixin
|
||||
|
||||
public void arclight$constructor(IWorld world, BlockPos blockPos) {
|
||||
arclight$constructor();
|
||||
this.bridge$setOwner(new CraftBlockInventoryHolder(world, blockPos, this));
|
||||
this.setOwner(new CraftBlockInventoryHolder(world, blockPos, this));
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,6 +16,6 @@ public abstract class ComposterBlock_FullInventoryMixin extends InventoryMixin {
|
||||
|
||||
@Inject(method = "<init>(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/item/ItemStack;)V", at = @At("RETURN"))
|
||||
public void arclight$setOwner(BlockState blockState, IWorld world, BlockPos blockPos, ItemStack itemStack, CallbackInfo ci) {
|
||||
this.bridge$setOwner(new CraftBlockInventoryHolder(world, blockPos, this));
|
||||
this.setOwner(new CraftBlockInventoryHolder(world, blockPos, this));
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,6 +15,6 @@ public abstract class ComposterBlock_PartialInventoryMixin extends InventoryMixi
|
||||
|
||||
@Inject(method = "<init>(Lnet/minecraft/block/BlockState;Lnet/minecraft/world/IWorld;Lnet/minecraft/util/math/BlockPos;)V", at = @At("RETURN"))
|
||||
public void arclight$setOwner(BlockState blockState, IWorld world, BlockPos blockPos, CallbackInfo ci) {
|
||||
this.bridge$setOwner(new CraftBlockInventoryHolder(world, blockPos, this));
|
||||
this.setOwner(new CraftBlockInventoryHolder(world, blockPos, this));
|
||||
}
|
||||
}
|
||||
|
||||
@ -55,9 +55,9 @@ public class DropperBlockMixin {
|
||||
if (iinventory instanceof DoubleSidedInventory) {
|
||||
destinationInventory = new CraftInventoryDoubleChest((DoubleSidedInventory) iinventory);
|
||||
} else {
|
||||
destinationInventory = ((IInventoryBridge) iinventory).bridge$getOwner().getInventory();
|
||||
destinationInventory = ((IInventoryBridge) iinventory).getOwner().getInventory();
|
||||
}
|
||||
InventoryMoveItemEvent event = new InventoryMoveItemEvent(((IInventoryBridge) dispensertileentity).bridge$getOwner().getInventory(), craftItemStack, destinationInventory, true);
|
||||
InventoryMoveItemEvent event = new InventoryMoveItemEvent(((IInventoryBridge) dispensertileentity).getOwner().getInventory(), craftItemStack, destinationInventory, true);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
|
||||
@ -84,6 +84,7 @@ public abstract class AbstractMinecartEntityMixin extends EntityMixin {
|
||||
|
||||
/**
|
||||
* @author IzzelAliz
|
||||
* @reason
|
||||
*/
|
||||
@Overwrite
|
||||
public boolean attackEntityFrom(DamageSource source, float amount) {
|
||||
|
||||
@ -44,34 +44,34 @@ public abstract class ContainerMinecartEntityMixin extends AbstractMinecartEntit
|
||||
private int maxStack;
|
||||
|
||||
@Override
|
||||
public List<ItemStack> bridge$getContents() {
|
||||
public List<ItemStack> getContents() {
|
||||
return this.minecartContainerItems;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onOpen(CraftHumanEntity who) {
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
transaction.add(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onClose(CraftHumanEntity who) {
|
||||
public void onClose(CraftHumanEntity who) {
|
||||
transaction.remove(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> bridge$getViewers() {
|
||||
public List<HumanEntity> getViewers() {
|
||||
return transaction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryHolder bridge$getOwner() {
|
||||
public InventoryHolder getOwner() {
|
||||
org.bukkit.entity.Entity cart = getBukkitEntity();
|
||||
if (cart instanceof InventoryHolder) return (InventoryHolder) cart;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setOwner(InventoryHolder owner) {
|
||||
public void setOwner(InventoryHolder owner) {
|
||||
|
||||
}
|
||||
|
||||
@ -82,22 +82,22 @@ public abstract class ContainerMinecartEntityMixin extends AbstractMinecartEntit
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setMaxStackSize(int size) {
|
||||
public void setMaxStackSize(int size) {
|
||||
maxStack = size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location bridge$getLocation() {
|
||||
public Location getLocation() {
|
||||
return getBukkitEntity().getLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipe<?> bridge$getCurrentRecipe() {
|
||||
public IRecipe<?> getCurrentRecipe() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setCurrentRecipe(IRecipe<?> recipe) {
|
||||
public void setCurrentRecipe(IRecipe<?> recipe) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ public abstract class AbstractVillagerEntityMixin extends CreatureEntityMixin im
|
||||
|
||||
@Inject(method = "<init>", at = @At("RETURN"))
|
||||
private void arclight$init(EntityType<? extends AbstractVillagerEntity> type, World worldIn, CallbackInfo ci) {
|
||||
((IInventoryBridge) this.villagerInventory).bridge$setOwner((InventoryHolder) this.getBukkitEntity());
|
||||
((IInventoryBridge) this.villagerInventory).setOwner((InventoryHolder) this.getBukkitEntity());
|
||||
}
|
||||
|
||||
private CraftMerchant craftMerchant;
|
||||
|
||||
@ -29,6 +29,7 @@ public abstract class SlimeEntityMixin extends MobEntityMixin {
|
||||
|
||||
/**
|
||||
* @author IzzelAliz
|
||||
* @reason
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
@Override
|
||||
|
||||
@ -34,7 +34,7 @@ public abstract class AbstractHorseEntityMixin extends AnimalEntityMixin {
|
||||
@Redirect(method = "initHorseChest", at = @At(value = "NEW", target = "net/minecraft/inventory/Inventory"))
|
||||
private Inventory arclight$createInv(int slots) {
|
||||
Inventory inventory = new Inventory(slots);
|
||||
((IInventoryBridge) inventory).bridge$setOwner((InventoryHolder) this.getBukkitEntity());
|
||||
((IInventoryBridge) inventory).setOwner((InventoryHolder) this.getBukkitEntity());
|
||||
return inventory;
|
||||
}
|
||||
|
||||
|
||||
@ -77,7 +77,7 @@ public abstract class PlayerInventoryMixin implements IInventory, IInventoryBrid
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> bridge$getContents() {
|
||||
public List<ItemStack> getContents() {
|
||||
List<ItemStack> combined = new ArrayList<>(mainInventory.size() + offHandInventory.size() + armorInventory.size());
|
||||
for (List<ItemStack> sub : this.allInventories) {
|
||||
combined.addAll(sub);
|
||||
@ -86,27 +86,27 @@ public abstract class PlayerInventoryMixin implements IInventory, IInventoryBrid
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onOpen(CraftHumanEntity who) {
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
transactions.add(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onClose(CraftHumanEntity who) {
|
||||
public void onClose(CraftHumanEntity who) {
|
||||
transactions.remove(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> bridge$getViewers() {
|
||||
public List<HumanEntity> getViewers() {
|
||||
return transactions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryHolder bridge$getOwner() {
|
||||
public InventoryHolder getOwner() {
|
||||
return ((PlayerEntityBridge) this.player).bridge$getBukkitEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setOwner(InventoryHolder owner) { }
|
||||
public void setOwner(InventoryHolder owner) { }
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
@ -115,18 +115,18 @@ public abstract class PlayerInventoryMixin implements IInventory, IInventoryBrid
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setMaxStackSize(int size) {
|
||||
public void setMaxStackSize(int size) {
|
||||
maxStack = size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location bridge$getLocation() {
|
||||
public Location getLocation() {
|
||||
return ((PlayerEntityBridge) this.player).bridge$getBukkitEntity().getLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipe<?> bridge$getCurrentRecipe() { return null; }
|
||||
public IRecipe<?> getCurrentRecipe() { return null; }
|
||||
|
||||
@Override
|
||||
public void bridge$setCurrentRecipe(IRecipe<?> recipe) { }
|
||||
public void setCurrentRecipe(IRecipe<?> recipe) { }
|
||||
}
|
||||
|
||||
@ -27,26 +27,26 @@ public abstract class CraftResultInventoryMixin implements IInventoryBridge, IIn
|
||||
private int maxStack = MAX_STACK;
|
||||
|
||||
@Override
|
||||
public List<ItemStack> bridge$getContents() {
|
||||
public List<ItemStack> getContents() {
|
||||
return this.stackResult;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onOpen(CraftHumanEntity who) { }
|
||||
public void onOpen(CraftHumanEntity who) { }
|
||||
|
||||
@Override
|
||||
public void bridge$onClose(CraftHumanEntity who) { }
|
||||
public void onClose(CraftHumanEntity who) { }
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> bridge$getViewers() {
|
||||
public List<HumanEntity> getViewers() {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryHolder bridge$getOwner() { return null; }
|
||||
public InventoryHolder getOwner() { return null; }
|
||||
|
||||
@Override
|
||||
public void bridge$setOwner(InventoryHolder owner) { }
|
||||
public void setOwner(InventoryHolder owner) { }
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
@ -55,16 +55,16 @@ public abstract class CraftResultInventoryMixin implements IInventoryBridge, IIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setMaxStackSize(int size) {
|
||||
public void setMaxStackSize(int size) {
|
||||
this.maxStack = size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location bridge$getLocation() { return null; }
|
||||
public Location getLocation() { return null; }
|
||||
|
||||
@Override
|
||||
public IRecipe<?> bridge$getCurrentRecipe() { return null; }
|
||||
public IRecipe<?> getCurrentRecipe() { return null; }
|
||||
|
||||
@Override
|
||||
public void bridge$setCurrentRecipe(IRecipe<?> recipe) { }
|
||||
public void setCurrentRecipe(IRecipe<?> recipe) { }
|
||||
}
|
||||
|
||||
@ -64,27 +64,27 @@ public abstract class CraftingInventoryMixin implements CraftingInventoryBridge,
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> bridge$getContents() {
|
||||
public List<ItemStack> getContents() {
|
||||
return this.stackList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onOpen(CraftHumanEntity who) {
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
this.transaction.add(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onClose(CraftHumanEntity who) {
|
||||
public void onClose(CraftHumanEntity who) {
|
||||
this.transaction.remove(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> bridge$getViewers() {
|
||||
public List<HumanEntity> getViewers() {
|
||||
return transaction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryHolder bridge$getOwner() {
|
||||
public InventoryHolder getOwner() {
|
||||
if (bukkitOwner == null) {
|
||||
bukkitOwner = owner == null ? null : ((PlayerEntityBridge) owner).bridge$getBukkitEntity();
|
||||
}
|
||||
@ -92,7 +92,7 @@ public abstract class CraftingInventoryMixin implements CraftingInventoryBridge,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setOwner(InventoryHolder owner) {
|
||||
public void setOwner(InventoryHolder owner) {
|
||||
this.bukkitOwner = owner;
|
||||
}
|
||||
|
||||
@ -103,25 +103,25 @@ public abstract class CraftingInventoryMixin implements CraftingInventoryBridge,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setMaxStackSize(int size) {
|
||||
public void setMaxStackSize(int size) {
|
||||
this.maxStack = size;
|
||||
((IInventoryBridge) this.resultInventory).bridge$setMaxStackSize(size);
|
||||
((IInventoryBridge) this.resultInventory).setMaxStackSize(size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location bridge$getLocation() {
|
||||
public Location getLocation() {
|
||||
return this.field_70465_c instanceof WorkbenchContainer
|
||||
? ((IWorldPosCallableBridge) ((WorkbenchContainerBridge) field_70465_c).bridge$getContainerAccess()).bridge$getLocation()
|
||||
: ((PlayerEntityBridge) owner).bridge$getBukkitEntity().getLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipe<?> bridge$getCurrentRecipe() {
|
||||
public IRecipe<?> getCurrentRecipe() {
|
||||
return this.currentRecipe;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setCurrentRecipe(IRecipe<?> recipe) {
|
||||
public void setCurrentRecipe(IRecipe<?> recipe) {
|
||||
this.currentRecipe = recipe;
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,7 +24,7 @@ public abstract class DoubleSidedInventoryMixin implements IInventoryBridge, IIn
|
||||
private List<HumanEntity> transactions = new ArrayList<>();
|
||||
|
||||
@Override
|
||||
public List<ItemStack> bridge$getContents() {
|
||||
public List<ItemStack> getContents() {
|
||||
int size = this.getSizeInventory();
|
||||
List<ItemStack> ret = new ArrayList<>(size);
|
||||
for (int i = 0; i < size; i++) {
|
||||
@ -34,29 +34,29 @@ public abstract class DoubleSidedInventoryMixin implements IInventoryBridge, IIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onOpen(CraftHumanEntity who) {
|
||||
((IInventoryBridge) this.field_70477_b).bridge$onOpen(who);
|
||||
((IInventoryBridge) this.field_70478_c).bridge$onOpen(who);
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
((IInventoryBridge) this.field_70477_b).onOpen(who);
|
||||
((IInventoryBridge) this.field_70478_c).onOpen(who);
|
||||
this.transactions.add(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onClose(CraftHumanEntity who) {
|
||||
((IInventoryBridge) this.field_70477_b).bridge$onClose(who);
|
||||
((IInventoryBridge) this.field_70478_c).bridge$onClose(who);
|
||||
public void onClose(CraftHumanEntity who) {
|
||||
((IInventoryBridge) this.field_70477_b).onClose(who);
|
||||
((IInventoryBridge) this.field_70478_c).onClose(who);
|
||||
this.transactions.remove(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> bridge$getViewers() {
|
||||
public List<HumanEntity> getViewers() {
|
||||
return transactions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryHolder bridge$getOwner() { return null; }
|
||||
public InventoryHolder getOwner() { return null; }
|
||||
|
||||
@Override
|
||||
public void bridge$setOwner(InventoryHolder owner) { }
|
||||
public void setOwner(InventoryHolder owner) { }
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
@ -64,19 +64,19 @@ public abstract class DoubleSidedInventoryMixin implements IInventoryBridge, IIn
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setMaxStackSize(int size) {
|
||||
((IInventoryBridge) this.field_70477_b).bridge$setMaxStackSize(size);
|
||||
((IInventoryBridge) this.field_70478_c).bridge$setMaxStackSize(size);
|
||||
public void setMaxStackSize(int size) {
|
||||
((IInventoryBridge) this.field_70477_b).setMaxStackSize(size);
|
||||
((IInventoryBridge) this.field_70478_c).setMaxStackSize(size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location bridge$getLocation() {
|
||||
return ((IInventoryBridge) this.field_70477_b).bridge$getLocation();
|
||||
public Location getLocation() {
|
||||
return ((IInventoryBridge) this.field_70477_b).getLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipe<?> bridge$getCurrentRecipe() { return null; }
|
||||
public IRecipe<?> getCurrentRecipe() { return null; }
|
||||
|
||||
@Override
|
||||
public void bridge$setCurrentRecipe(IRecipe<?> recipe) { }
|
||||
public void setCurrentRecipe(IRecipe<?> recipe) { }
|
||||
}
|
||||
|
||||
@ -35,12 +35,12 @@ public abstract class EnderChestInventoryMixin extends InventoryMixin implements
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryHolder bridge$getOwner() {
|
||||
public InventoryHolder getOwner() {
|
||||
return ((PlayerEntityBridge) owner).bridge$getBukkitEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location bridge$getLocation() {
|
||||
public Location getLocation() {
|
||||
return CraftBlock.at(this.associatedChest.getWorld(), this.associatedChest.getPos()).getLocation();
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,44 +10,50 @@ import org.bukkit.entity.HumanEntity;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Mixin(IInventory.class)
|
||||
public interface IInventoryMixin extends IInventoryBridge {
|
||||
|
||||
@Override
|
||||
default List<ItemStack> getContents() {
|
||||
return bridge$getContents();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
default void onOpen(CraftHumanEntity who) {
|
||||
bridge$onClose(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
default void onClose(CraftHumanEntity who) {
|
||||
bridge$onClose(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
default List<HumanEntity> getViewers() {
|
||||
return bridge$getViewers();
|
||||
return new ArrayList<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
default InventoryHolder getOwner() {
|
||||
return bridge$getOwner();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
default void setMaxStackSize(int size) {
|
||||
bridge$setMaxStackSize(size);
|
||||
}
|
||||
|
||||
@Override
|
||||
default Location getLocation() {
|
||||
return bridge$getLocation();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
default IRecipe<?> getCurrentRecipe() {
|
||||
return bridge$getCurrentRecipe();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
default void setCurrentRecipe(IRecipe<?> recipe) {
|
||||
bridge$setCurrentRecipe(recipe);
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,32 +40,32 @@ public abstract class InventoryMixin implements IInventory, IInventoryBridge {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> bridge$getContents() {
|
||||
public List<ItemStack> getContents() {
|
||||
return this.inventoryContents;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onOpen(CraftHumanEntity who) {
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
transaction.add(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onClose(CraftHumanEntity who) {
|
||||
public void onClose(CraftHumanEntity who) {
|
||||
transaction.remove(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> bridge$getViewers() {
|
||||
public List<HumanEntity> getViewers() {
|
||||
return transaction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryHolder bridge$getOwner() {
|
||||
public InventoryHolder getOwner() {
|
||||
return bukkitOwner;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setOwner(InventoryHolder owner) {
|
||||
public void setOwner(InventoryHolder owner) {
|
||||
this.bukkitOwner = owner;
|
||||
}
|
||||
|
||||
@ -76,22 +76,22 @@ public abstract class InventoryMixin implements IInventory, IInventoryBridge {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setMaxStackSize(int size) {
|
||||
public void setMaxStackSize(int size) {
|
||||
this.maxStack = size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location bridge$getLocation() {
|
||||
public Location getLocation() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipe<?> bridge$getCurrentRecipe() {
|
||||
public IRecipe<?> getCurrentRecipe() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setCurrentRecipe(IRecipe<?> recipe) {
|
||||
public void setCurrentRecipe(IRecipe<?> recipe) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,33 +33,33 @@ public abstract class MerchantInventoryMixin implements IInventoryBridge, IInven
|
||||
private int maxStack = MAX_STACK;
|
||||
|
||||
@Override
|
||||
public List<ItemStack> bridge$getContents() {
|
||||
public List<ItemStack> getContents() {
|
||||
return this.slots;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onOpen(CraftHumanEntity who) {
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
transactions.add(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onClose(CraftHumanEntity who) {
|
||||
public void onClose(CraftHumanEntity who) {
|
||||
transactions.remove(who);
|
||||
this.merchant.setCustomer(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> bridge$getViewers() {
|
||||
public List<HumanEntity> getViewers() {
|
||||
return transactions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryHolder bridge$getOwner() {
|
||||
public InventoryHolder getOwner() {
|
||||
return this.merchant instanceof AbstractVillagerEntity ? ((CraftAbstractVillager) ((EntityBridge) this.merchant).bridge$getBukkitEntity()) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setOwner(InventoryHolder owner) { }
|
||||
public void setOwner(InventoryHolder owner) { }
|
||||
|
||||
@Override
|
||||
public int getInventoryStackLimit() {
|
||||
@ -68,19 +68,19 @@ public abstract class MerchantInventoryMixin implements IInventoryBridge, IInven
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setMaxStackSize(int size) {
|
||||
public void setMaxStackSize(int size) {
|
||||
this.maxStack = size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location bridge$getLocation() {
|
||||
public Location getLocation() {
|
||||
return this.merchant instanceof AbstractVillagerEntity ? ((EntityBridge) this.merchant).bridge$getBukkitEntity().getLocation() : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipe<?> bridge$getCurrentRecipe() { return null; }
|
||||
public IRecipe<?> getCurrentRecipe() { return null; }
|
||||
|
||||
@Override
|
||||
public void bridge$setCurrentRecipe(IRecipe<?> recipe) {
|
||||
public void setCurrentRecipe(IRecipe<?> recipe) {
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ public abstract class CartographyContainer2Mixin implements IInventoryBridge {
|
||||
@Shadow(aliases = {"this$0", "field_213924_a"}, remap = false) private CartographyContainer outerThis;
|
||||
|
||||
@Override
|
||||
public Location bridge$getLocation() {
|
||||
public Location getLocation() {
|
||||
return ((IWorldPosCallableBridge) ((CartographyContainerBridge) outerThis).bridge$getContainerAccess()).bridge$getLocation();
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,10 +25,10 @@ public abstract class ContainerMixin implements ContainerBridge {
|
||||
public void transferTo(Container other, CraftHumanEntity player) {
|
||||
InventoryView source = this.getBukkitView();
|
||||
InventoryView destination = ((ContainerBridge) other).bridge$getBukkitView();
|
||||
((IInventoryBridge) ((CraftInventory) source.getTopInventory()).getInventory()).bridge$onClose(player);
|
||||
((IInventoryBridge) ((CraftInventory) source.getBottomInventory()).getInventory()).bridge$onClose(player);
|
||||
((IInventoryBridge) ((CraftInventory) destination.getTopInventory()).getInventory()).bridge$onClose(player);
|
||||
((IInventoryBridge) ((CraftInventory) destination.getBottomInventory()).getInventory()).bridge$onClose(player);
|
||||
((IInventoryBridge) ((CraftInventory) source.getTopInventory()).getInventory()).onClose(player);
|
||||
((IInventoryBridge) ((CraftInventory) source.getBottomInventory()).getInventory()).onClose(player);
|
||||
((IInventoryBridge) ((CraftInventory) destination.getTopInventory()).getInventory()).onClose(player);
|
||||
((IInventoryBridge) ((CraftInventory) destination.getBottomInventory()).getInventory()).onClose(player);
|
||||
}
|
||||
|
||||
private ITextComponent title;
|
||||
|
||||
@ -14,7 +14,7 @@ public abstract class EnchantmentContainer1Mixin extends InventoryMixin {
|
||||
@Shadow(aliases = {"this$0", "field_70484_a"}, remap = false) private EnchantmentContainer outerThis;
|
||||
|
||||
@Override
|
||||
public Location bridge$getLocation() {
|
||||
public Location getLocation() {
|
||||
return ((IWorldPosCallableBridge) ((EnchantmentContainerBridge) outerThis).bridge$getContainerAccess()).bridge$getLocation();
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ public abstract class GrindstoneContainer1Mixin extends InventoryMixin {
|
||||
@Shadow(aliases = {"this$0", "field_213912_a"}, remap = false) private GrindstoneContainer outerThis;
|
||||
|
||||
@Override
|
||||
public Location bridge$getLocation() {
|
||||
public Location getLocation() {
|
||||
return ((IWorldPosCallableBridge) ((GrindstoneContainerBridge) outerThis).bridge$getContainerAccess()).bridge$getLocation();
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,6 +37,6 @@ public class HorseInventoryContainerMixin extends ContainerMixin {
|
||||
return bukkitEntity;
|
||||
}
|
||||
return bukkitEntity = new CraftInventoryView(((PlayerEntityBridge) player.player).bridge$getBukkitEntity(),
|
||||
((IInventoryBridge) this.horseInventory).bridge$getOwner().getInventory(), (Container) (Object) this);
|
||||
((IInventoryBridge) this.horseInventory).getOwner().getInventory(), (Container) (Object) this);
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ public abstract class LoomContainer1Mixin extends InventoryMixin {
|
||||
@Shadow(aliases = {"this$0", "field_213913_a"}, remap = false) private LoomContainer outerThis;
|
||||
|
||||
@Override
|
||||
public Location bridge$getLocation() {
|
||||
public Location getLocation() {
|
||||
return ((IWorldPosCallableBridge) ((LoomContainerBridge) outerThis).bridge$getWorldPos()).bridge$getLocation();
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,7 @@ public abstract class LoomContainer2Mixin extends InventoryMixin {
|
||||
@Shadow(aliases = {"this$0", "field_213914_a"}, remap = false) private LoomContainer outerThis;
|
||||
|
||||
@Override
|
||||
public Location bridge$getLocation() {
|
||||
public Location getLocation() {
|
||||
return ((IWorldPosCallableBridge) ((LoomContainerBridge) outerThis).bridge$getWorldPos()).bridge$getLocation();
|
||||
}
|
||||
}
|
||||
|
||||
@ -84,7 +84,7 @@ public abstract class RecipeManagerMixin implements RecipeManagerBridge {
|
||||
Optional<T> optional = this.getRecipes(recipeTypeIn).values().stream().flatMap((p_215372_3_) -> {
|
||||
return Util.streamOptional(recipeTypeIn.matches(p_215372_3_, worldIn, inventoryIn));
|
||||
}).findFirst();
|
||||
((IInventoryBridge) inventoryIn).bridge$setCurrentRecipe(optional.orElse(null));
|
||||
((IInventoryBridge) inventoryIn).setCurrentRecipe(optional.orElse(null));
|
||||
return optional;
|
||||
}
|
||||
|
||||
|
||||
@ -45,11 +45,14 @@ public abstract class DedicatedServerMixin extends MinecraftServerMixin {
|
||||
|
||||
@Inject(method = "systemExitNow", at = @At("RETURN"))
|
||||
public void arclight$exitNow(CallbackInfo ci) {
|
||||
new Thread(() -> {
|
||||
try {
|
||||
Thread.sleep(10000);
|
||||
Thread.sleep(5000);
|
||||
} catch (InterruptedException ignored) {
|
||||
} finally {
|
||||
Runtime.getRuntime().halt(0);
|
||||
// todo halt 太暴力了
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
}, "Exit Thread").start();
|
||||
System.exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,27 +171,27 @@ public abstract class AbstractFurnaceTileEntityMixin extends LockableTileEntityM
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> bridge$getContents() {
|
||||
public List<ItemStack> getContents() {
|
||||
return this.items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onOpen(CraftHumanEntity who) {
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
transaction.add(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onClose(CraftHumanEntity who) {
|
||||
public void onClose(CraftHumanEntity who) {
|
||||
transaction.remove(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> bridge$getViewers() {
|
||||
public List<HumanEntity> getViewers() {
|
||||
return transaction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setOwner(InventoryHolder owner) {
|
||||
public void setOwner(InventoryHolder owner) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -201,7 +201,7 @@ public abstract class AbstractFurnaceTileEntityMixin extends LockableTileEntityM
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setMaxStackSize(int size) {
|
||||
public void setMaxStackSize(int size) {
|
||||
this.maxStack = size;
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,22 +25,22 @@ public abstract class BarrelTileEntityMixin extends LockableTileEntityMixin impl
|
||||
private int maxStack = MAX_STACK;
|
||||
|
||||
@Override
|
||||
public List<ItemStack> bridge$getContents() {
|
||||
public List<ItemStack> getContents() {
|
||||
return this.barrelContents;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onOpen(CraftHumanEntity who) {
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
transaction.add(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onClose(CraftHumanEntity who) {
|
||||
public void onClose(CraftHumanEntity who) {
|
||||
transaction.remove(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> bridge$getViewers() {
|
||||
public List<HumanEntity> getViewers() {
|
||||
return transaction;
|
||||
}
|
||||
|
||||
@ -51,11 +51,11 @@ public abstract class BarrelTileEntityMixin extends LockableTileEntityMixin impl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setMaxStackSize(int i) {
|
||||
public void setMaxStackSize(int i) {
|
||||
maxStack = i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setOwner(InventoryHolder owner) {
|
||||
public void setOwner(InventoryHolder owner) {
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,27 +77,27 @@ public abstract class BrewingStandTileEntityMixin extends LockableTileEntityMixi
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> bridge$getContents() {
|
||||
public List<ItemStack> getContents() {
|
||||
return this.brewingItemStacks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onOpen(CraftHumanEntity who) {
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
transaction.add(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onClose(CraftHumanEntity who) {
|
||||
public void onClose(CraftHumanEntity who) {
|
||||
transaction.remove(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> bridge$getViewers() {
|
||||
public List<HumanEntity> getViewers() {
|
||||
return transaction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setOwner(InventoryHolder owner) {
|
||||
public void setOwner(InventoryHolder owner) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -107,7 +107,7 @@ public abstract class BrewingStandTileEntityMixin extends LockableTileEntityMixi
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setMaxStackSize(int size) {
|
||||
public void setMaxStackSize(int size) {
|
||||
this.maxStack = size;
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,27 +60,27 @@ public abstract class ChestTileEntityMixin extends LockableTileEntityMixin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> bridge$getContents() {
|
||||
public List<ItemStack> getContents() {
|
||||
return this.chestContents;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onOpen(CraftHumanEntity who) {
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
transaction.add(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onClose(CraftHumanEntity who) {
|
||||
public void onClose(CraftHumanEntity who) {
|
||||
transaction.remove(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> bridge$getViewers() {
|
||||
public List<HumanEntity> getViewers() {
|
||||
return transaction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setOwner(InventoryHolder owner) {
|
||||
public void setOwner(InventoryHolder owner) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -90,7 +90,7 @@ public abstract class ChestTileEntityMixin extends LockableTileEntityMixin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setMaxStackSize(int size) {
|
||||
public void setMaxStackSize(int size) {
|
||||
this.maxStack = size;
|
||||
}
|
||||
|
||||
|
||||
@ -23,27 +23,27 @@ public abstract class DispenserTileEntityMixin extends LockableTileEntityMixin {
|
||||
private int maxStack = MAX_STACK;
|
||||
|
||||
@Override
|
||||
public List<ItemStack> bridge$getContents() {
|
||||
public List<ItemStack> getContents() {
|
||||
return this.stacks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onOpen(CraftHumanEntity who) {
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
transaction.add(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onClose(CraftHumanEntity who) {
|
||||
public void onClose(CraftHumanEntity who) {
|
||||
transaction.remove(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> bridge$getViewers() {
|
||||
public List<HumanEntity> getViewers() {
|
||||
return transaction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setOwner(InventoryHolder owner) {
|
||||
public void setOwner(InventoryHolder owner) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -53,7 +53,7 @@ public abstract class DispenserTileEntityMixin extends LockableTileEntityMixin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setMaxStackSize(int size) {
|
||||
public void setMaxStackSize(int size) {
|
||||
this.maxStack = size;
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ public abstract class HopperTileEntityMixin extends LockableTileEntityMixin {
|
||||
if (destination instanceof DoubleSidedInventory) {
|
||||
destinationInventory = new CraftInventoryDoubleChest(((DoubleSidedInventory) destination));
|
||||
} else {
|
||||
destinationInventory = ((IInventoryBridge) destination).bridge$getOwner().getInventory();
|
||||
destinationInventory = ((IInventoryBridge) destination).getOwner().getInventory();
|
||||
}
|
||||
|
||||
InventoryMoveItemEvent event = new InventoryMoveItemEvent(this.getOwner().getInventory(), original.clone(), destinationInventory, true);
|
||||
@ -94,10 +94,10 @@ public abstract class HopperTileEntityMixin extends LockableTileEntityMixin {
|
||||
if (source instanceof DoubleSidedInventory) {
|
||||
sourceInventory = new CraftInventoryDoubleChest(((DoubleSidedInventory) source));
|
||||
} else {
|
||||
sourceInventory = ((IInventoryBridge) source).bridge$getOwner().getInventory();
|
||||
sourceInventory = ((IInventoryBridge) source).getOwner().getInventory();
|
||||
}
|
||||
|
||||
InventoryMoveItemEvent event = new InventoryMoveItemEvent(sourceInventory, original.clone(), ((IInventoryBridge) destination).bridge$getOwner().getInventory(), false);
|
||||
InventoryMoveItemEvent event = new InventoryMoveItemEvent(sourceInventory, original.clone(), ((IInventoryBridge) destination).getOwner().getInventory(), false);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (arclight$moveItem = event.isCancelled()) {
|
||||
if (destination instanceof HopperTileEntity) {
|
||||
@ -112,7 +112,7 @@ public abstract class HopperTileEntityMixin extends LockableTileEntityMixin {
|
||||
|
||||
@Inject(method = "captureItem", cancellable = true, at = @At("HEAD"))
|
||||
private static void arclight$pickupItem(IInventory inventory, ItemEntity itemEntity, CallbackInfoReturnable<Boolean> cir) {
|
||||
InventoryPickupItemEvent event = new InventoryPickupItemEvent(((IInventoryBridge) inventory).bridge$getOwner().getInventory(), (Item) ((EntityBridge) itemEntity).bridge$getBukkitEntity());
|
||||
InventoryPickupItemEvent event = new InventoryPickupItemEvent(((IInventoryBridge) inventory).getOwner().getInventory(), (Item) ((EntityBridge) itemEntity).bridge$getBukkitEntity());
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
if (event.isCancelled()) {
|
||||
cir.setReturnValue(false);
|
||||
@ -120,27 +120,27 @@ public abstract class HopperTileEntityMixin extends LockableTileEntityMixin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> bridge$getContents() {
|
||||
public List<ItemStack> getContents() {
|
||||
return this.inventory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onOpen(CraftHumanEntity who) {
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
transaction.add(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onClose(CraftHumanEntity who) {
|
||||
public void onClose(CraftHumanEntity who) {
|
||||
transaction.remove(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> bridge$getViewers() {
|
||||
public List<HumanEntity> getViewers() {
|
||||
return transaction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setOwner(InventoryHolder owner) {
|
||||
public void setOwner(InventoryHolder owner) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -150,7 +150,7 @@ public abstract class HopperTileEntityMixin extends LockableTileEntityMixin {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setMaxStackSize(int size) {
|
||||
public void setMaxStackSize(int size) {
|
||||
this.maxStack = size;
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,32 +38,32 @@ public abstract class LecternTileEntity1Mixin implements IInventoryBridge, IInve
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> bridge$getContents() {
|
||||
public List<ItemStack> getContents() {
|
||||
return Collections.singletonList(outerThis.getBook());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onOpen(CraftHumanEntity who) {
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
transaction.add(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onClose(CraftHumanEntity who) {
|
||||
public void onClose(CraftHumanEntity who) {
|
||||
transaction.remove(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> bridge$getViewers() {
|
||||
public List<HumanEntity> getViewers() {
|
||||
return transaction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryHolder bridge$getOwner() {
|
||||
public InventoryHolder getOwner() {
|
||||
return ((TileEntityBridge) outerThis).bridge$getOwner();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setOwner(InventoryHolder owner) {
|
||||
public void setOwner(InventoryHolder owner) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -73,21 +73,21 @@ public abstract class LecternTileEntity1Mixin implements IInventoryBridge, IInve
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setMaxStackSize(int size) {
|
||||
public void setMaxStackSize(int size) {
|
||||
this.maxStack = size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Location bridge$getLocation() {
|
||||
public Location getLocation() {
|
||||
return new Location(((WorldBridge) outerThis.getWorld()).bridge$getWorld(), outerThis.getPos().getX(), outerThis.getPos().getY(), outerThis.getPos().getZ());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipe<?> bridge$getCurrentRecipe() {
|
||||
public IRecipe<?> getCurrentRecipe() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setCurrentRecipe(IRecipe<?> recipe) {
|
||||
public void setCurrentRecipe(IRecipe<?> recipe) {
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,16 +12,16 @@ import org.spongepowered.asm.mixin.Mixin;
|
||||
public abstract class LockableTileEntityMixin extends TileEntityMixin implements IInventoryBridge, IInventory {
|
||||
|
||||
@Override
|
||||
public Location bridge$getLocation() {
|
||||
public Location getLocation() {
|
||||
return CraftBlock.at(this.world, this.pos).getLocation();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IRecipe<?> bridge$getCurrentRecipe() {
|
||||
public IRecipe<?> getCurrentRecipe() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setCurrentRecipe(IRecipe<?> recipe) {
|
||||
public void setCurrentRecipe(IRecipe<?> recipe) {
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,27 +23,27 @@ public abstract class ShulkerBoxTileEntityMixin extends LockableTileEntityMixin
|
||||
private int maxStack = MAX_STACK;
|
||||
|
||||
@Override
|
||||
public List<ItemStack> bridge$getContents() {
|
||||
public List<ItemStack> getContents() {
|
||||
return this.items;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onOpen(CraftHumanEntity who) {
|
||||
public void onOpen(CraftHumanEntity who) {
|
||||
transaction.add(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$onClose(CraftHumanEntity who) {
|
||||
public void onClose(CraftHumanEntity who) {
|
||||
transaction.remove(who);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<HumanEntity> bridge$getViewers() {
|
||||
public List<HumanEntity> getViewers() {
|
||||
return transaction;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setOwner(InventoryHolder owner) {
|
||||
public void setOwner(InventoryHolder owner) {
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -53,7 +53,7 @@ public abstract class ShulkerBoxTileEntityMixin extends LockableTileEntityMixin
|
||||
}
|
||||
|
||||
@Override
|
||||
public void bridge$setMaxStackSize(int size) {
|
||||
public void setMaxStackSize(int size) {
|
||||
this.maxStack = size;
|
||||
}
|
||||
}
|
||||
|
||||
@ -60,9 +60,4 @@ public abstract class TileEntityMixin implements TileEntityBridge {
|
||||
if (state instanceof InventoryHolder) return (InventoryHolder) state;
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InventoryHolder bridge$getOwner() {
|
||||
return getOwner();
|
||||
}
|
||||
}
|
||||
|
||||
@ -122,7 +122,7 @@ public abstract class ServerWorldMixin extends WorldMixin implements ServerWorld
|
||||
public void arclight$closeOnChunkUnloading(Chunk chunkIn, CallbackInfo ci) {
|
||||
for (TileEntity tileentity : chunkIn.getTileEntityMap().values()) {
|
||||
if (tileentity instanceof IInventory) {
|
||||
for (HumanEntity h : Lists.newArrayList(((IInventoryBridge) tileentity).bridge$getViewers())) {
|
||||
for (HumanEntity h : Lists.newArrayList(((IInventoryBridge) tileentity).getViewers())) {
|
||||
if (h instanceof CraftHumanEntity) {
|
||||
((CraftHumanEntity) h).getHandle().closeScreen();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user