/
EmptyContentType.java
43 lines (34 loc) · 1.03 KB
/
EmptyContentType.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package knightminer.inspirations.library.recipe.cauldron.contents;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import javax.annotation.Nullable;
/**
* Content type for the empty contents, exists to prevent errors from the empty contents having no type
*/
public class EmptyContentType extends CauldronContentType<Void> {
@Override
public ResourceLocation getTexture(Void type) {
return CauldronContentType.NO_TEXTURE;
}
@Override
public ITextComponent getDisplayName(Void value) {
return StringTextComponent.EMPTY;
}
@Override
public String getName(Void value) {
return "empty";
}
@Nullable
@Override
public Void getEntry(String name) {
return null;
}
@Override
public void write(ICauldronContents contents, PacketBuffer buffer) {}
@Override
public EmptyCauldronContents read(PacketBuffer buffer) {
return EmptyCauldronContents.INSTANCE;
}
}