Commits
1 1 | package org.bukkit.craftbukkit.inventory.view.builder; |
2 2 | |
3 3 | import com.google.common.base.Preconditions; |
4 4 | import net.minecraft.server.level.EntityPlayer; |
5 5 | import net.minecraft.world.inventory.Container; |
6 6 | import net.minecraft.world.inventory.Containers; |
7 7 | import org.bukkit.craftbukkit.entity.CraftHumanEntity; |
8 8 | import org.bukkit.craftbukkit.util.CraftChatMessage; |
9 9 | import org.bukkit.entity.HumanEntity; |
10 10 | import org.bukkit.inventory.InventoryView; |
11 11 | import org.bukkit.inventory.view.builder.InventoryViewBuilder; |
12 - | import org.jetbrains.annotations.NotNull; |
13 12 | |
14 13 | public abstract class CraftAbstractInventoryViewBuilder<V extends InventoryView> implements InventoryViewBuilder<V> { |
15 14 | |
16 15 | protected final Containers<?> handle; |
17 16 | |
18 17 | protected boolean checkReachable = false; |
19 18 | protected String title = null; |
20 19 | |
21 20 | public CraftAbstractInventoryViewBuilder(Containers<?> handle) { |
22 21 | this.handle = handle; |
23 22 | } |
24 23 | |
25 - | |
26 24 | |
27 - | public InventoryViewBuilder<V> title( final String title) { |
25 + | public InventoryViewBuilder<V> title(final String title) { |
28 26 | this.title = title; |
29 27 | return this; |
30 28 | } |
31 29 | |
32 30 | |
33 31 | public V build(final HumanEntity player) { |
34 32 | Preconditions.checkArgument(player != null, "The given player must not be null"); |
35 33 | Preconditions.checkArgument(this.title != null, "The given title must not be null"); |
36 34 | Preconditions.checkArgument(player instanceof CraftHumanEntity, "The given player must be a CraftHumanEntity"); |
37 35 | final CraftHumanEntity craftHuman = (CraftHumanEntity) player; |