001    package org.bukkit.block;
002    
003    import java.util.HashMap;
004    import java.util.Map;
005    
006    public enum PistonMoveReaction {
007    
008        /**
009         * Indicates that the block can be pushed or pulled.
010         */
011        MOVE(0),
012        /**
013         * Indicates the block is fragile and will break if pushed on.
014         */
015        BREAK(1),
016        /**
017         * Indicates that the block will resist being pushed or pulled.
018         */
019        BLOCK(2);
020    
021        private int id;
022        private static Map<Integer, PistonMoveReaction> byId = new HashMap<Integer, PistonMoveReaction>();
023        static {
024            for (PistonMoveReaction reaction : PistonMoveReaction.values()) {
025                byId.put(reaction.id, reaction);
026            }
027        }
028    
029        private PistonMoveReaction(int id) {
030            this.id = id;
031        }
032    
033        /**
034         * @return The ID of the move reaction
035         * @deprecated Magic value
036         */
037        @Deprecated
038        public int getId() {
039            return this.id;
040        }
041    
042        /**
043         * @param id An ID
044         * @return The move reaction with that ID
045         * @deprecated Magic value
046         */
047        @Deprecated
048        public static PistonMoveReaction getById(int id) {
049            return byId.get(id);
050        }
051    }