Containers may not providing name

This commit is contained in:
IzzelAliz 2021-01-31 13:37:52 +08:00
parent b0b2d380c2
commit 642e972f7e

View File

@ -87,7 +87,7 @@ public abstract class ContainerMixin implements ContainerBridge {
public final ITextComponent getTitle() {
if (this.title == null) {
ArclightMod.LOGGER.warn("Container {}/{} has no title.", this, this.getClass().getName());
ArclightMod.LOGGER.debug("Container {}/{} has no title.", this, this.getClass().getName());
if (this.containerType != null && this.containerType.getRegistryName() != null) {
return new StringTextComponent(this.containerType.getRegistryName().toString());
} else {
@ -99,9 +99,13 @@ public abstract class ContainerMixin implements ContainerBridge {
public final void setTitle(ITextComponent title) {
if (this.title == null) {
if (title == null) {
this.title = getTitle();
} else {
this.title = title;
}
}
}
@Redirect(method = "onContainerClosed", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/player/PlayerEntity;dropItem(Lnet/minecraft/item/ItemStack;Z)Lnet/minecraft/entity/item/ItemEntity;"))
private ItemEntity arclight$cleanBeforeDrop(PlayerEntity playerEntity, ItemStack itemStackIn, boolean unused) {