PropertyDirection .java

net.minecraft.block.properties.PropertyDirection (class, 41 lines): members: create. imports: Collections2, Predicates, Predicate, EnumFacing, Lists.

net.minecraft.block.propertiesclass41 linescommonextends PropertyEnum<EnumFacing>1.2 KB

API Surface (3)

PropertyDirection create(String name)
PropertyDirection create(String name, Predicate<EnumFacing> filter)
PropertyDirection create(String name, Collection<EnumFacing> values)

Code Graph: Dependencies (2)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

PropertyDirection.java41 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.block.properties;
2
3
import com.google.common.base.Predicate;
4
import com.google.common.base.Predicates;
5
import com.google.common.collect.Collections2;
6
import com.google.common.collect.Lists;
7
import java.util.Collection;
8
import net.minecraft.util.EnumFacing;
9
10
public class PropertyDirection extends PropertyEnum<EnumFacing>
11
{
12
    protected PropertyDirection(String name, Collection<EnumFacing> values)
13
    {
14
        super(name, EnumFacing.class, values);
15
    }
16
17
    /**
18
     * Create a new PropertyDirection with the given name
19
     */
20
    public static PropertyDirection create(String name)
21
    {
22
        return create(name, Predicates.<EnumFacing>alwaysTrue());
23
    }
24
25
    /**
26
     * Create a new PropertyDirection with all directions that match the given Predicate
27
     */
28
    public static PropertyDirection create(String name, Predicate<EnumFacing> filter)
29
    {
30
        return create(name, Collections2.<EnumFacing>filter(Lists.newArrayList(EnumFacing.values()), filter));
31
    }
32
33
    /**
34
     * Create a new PropertyDirection for the given direction values
35
     */
36
    public static PropertyDirection create(String name, Collection<EnumFacing> values)
37
    {
38
        return new PropertyDirection(name, values);
39
    }
40
}
41

Deobfuscated MCP 1.8.9 source of PropertyDirection from Marcelektro/MavenMCP-1.8.9 (net/minecraft/block/properties/PropertyDirection.java), stored verbatim.