Skip to content

Commit

Permalink
Backport issues: no ContainerEntity.
Browse files Browse the repository at this point in the history
  • Loading branch information
noobanidus committed Mar 30, 2024
1 parent b3b23b0 commit 30c0a16
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -11,7 +11,7 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.entity.player.Inventory;
import net.minecraft.world.ContainerHelper;
import net.minecraft.world.entity.vehicle.ContainerEntity;
import net.minecraft.world.entity.vehicle.AbstractMinecartContainer;
import net.minecraft.world.inventory.ChestMenu;
import net.minecraft.world.inventory.AbstractContainerMenu;
import net.minecraft.world.item.ItemStack;
Expand Down Expand Up @@ -160,8 +160,8 @@ public boolean stillValid(Player player) {
}
if (player.level instanceof ServerLevel serverLevel) {
Entity entity = serverLevel.getEntity(newChestData.getEntityId());
if (entity instanceof ContainerEntity container) {
return container.isChestVehicleStillValid(player);
if (entity instanceof AbstractMinecartContainer container) {
return container.stillValid(player);
} else {
return false;
}
Expand Down

0 comments on commit 30c0a16

Please sign in to comment.