Commits

md_5 authored 277baff1a14
Update to Minecraft 1.8

For more information please see http://www.spigotmc.org/
No tags

src/main/java/org/bukkit/block/banner/Pattern.java

Added
1 +package org.bukkit.block.banner;
2 +
3 +import org.bukkit.DyeColor;
4 +import org.bukkit.configuration.serialization.SerializableAs;
5 +
6 +@SerializableAs("Pattern")
7 +public class Pattern {
8 +
9 + private final DyeColor color;
10 + private final PatternType pattern;
11 +
12 + /**
13 + * Creates a new pattern from the specified color and
14 + * pattern type
15 + *
16 + * @param color the pattern color
17 + * @param pattern the pattern type
18 + */
19 + public Pattern(DyeColor color, PatternType pattern) {
20 + this.color = color;
21 + this.pattern = pattern;
22 + }
23 +
24 + /**
25 + * Returns the color of the pattern
26 + *
27 + * @return the color of the pattern
28 + */
29 + public DyeColor getColor() {
30 + return color;
31 + }
32 +
33 + /**
34 + * Returns the type of pattern
35 + *
36 + * @return the pattern type
37 + */
38 + public PatternType getPattern() {
39 + return pattern;
40 + }
41 +
42 + @Override
43 + public int hashCode() {
44 + int hash = 3;
45 + hash = 97 * hash + (this.color != null ? this.color.hashCode() : 0);
46 + hash = 97 * hash + (this.pattern != null ? this.pattern.hashCode() : 0);
47 + return hash;
48 + }
49 +
50 + @Override
51 + public boolean equals(Object obj) {
52 + if (obj == null) {
53 + return false;
54 + }
55 + if (getClass() != obj.getClass()) {
56 + return false;
57 + }
58 + final Pattern other = (Pattern) obj;
59 + return this.color == other.color && this.pattern == other.pattern;
60 + }
61 +}

Everything looks good. We'll let you know here if there's anything you should know about.

Add shortcut