MCPcopy Create free account
hub / github.com/PaperMC/Paper / getNewData

Method getNewData

paper-api/src/main/java/org/bukkit/Material.java:2970–2988  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 4

getDataMethod · 0.95
getDataMethod · 0.45
getMaterialMethod · 0.45
getCarriedMaterialMethod · 0.45

Calls 2

newInstanceMethod · 0.80
getCauseMethod · 0.45

Tested by 1

getDataMethod · 0.36