Constructs a new MaterialData relevant for this Material, with the given initial data @param raw Initial data to construct the MaterialData with @return New MaterialData with the given data @deprecated Magic value
(final byte raw)
| 2968 | * @deprecated Magic value |
| 2969 | */ |
| 2970 | @Deprecated(since = "1.6.2") |
| 2971 | @NotNull |
| 2972 | public MaterialData getNewData(final byte raw) { |
| 2973 | Preconditions.checkArgument(legacy, "Cannot get new data of Modern Material"); |
| 2974 | try { |
| 2975 | return ctor.newInstance(this, raw); |
| 2976 | } catch (InstantiationException ex) { |
| 2977 | final Throwable t = ex.getCause(); |
| 2978 | if (t instanceof RuntimeException) { |
| 2979 | throw (RuntimeException) t; |
| 2980 | } |
| 2981 | if (t instanceof Error) { |
| 2982 | throw (Error) t; |
| 2983 | } |
| 2984 | throw new AssertionError(t); |
| 2985 | } catch (Throwable t) { |
| 2986 | throw new AssertionError(t); |
| 2987 | } |
| 2988 | } |
| 2989 | |
| 2990 | /** |
| 2991 | * Checks if this Material is a placable block |