|
8 | 8 | import gregtech.api.fluids.store.FluidStorageKeys; |
9 | 9 | import gregtech.api.unification.Element; |
10 | 10 | import gregtech.api.unification.Elements; |
| 11 | +import gregtech.api.unification.OreDictUnifier; |
11 | 12 | import gregtech.api.unification.material.info.MaterialFlag; |
12 | 13 | import gregtech.api.unification.material.info.MaterialFlags; |
13 | 14 | import gregtech.api.unification.material.info.MaterialIconSet; |
|
29 | 30 | import gregtech.api.unification.material.properties.WireProperties; |
30 | 31 | import gregtech.api.unification.material.properties.WoodProperty; |
31 | 32 | import gregtech.api.unification.material.registry.MaterialRegistry; |
| 33 | +import gregtech.api.unification.ore.OrePrefix; |
32 | 34 | import gregtech.api.unification.stack.MaterialStack; |
33 | 35 | import gregtech.api.util.FluidTooltipUtil; |
34 | 36 | import gregtech.api.util.GTUtility; |
35 | 37 | import gregtech.api.util.LocalizationUtils; |
36 | 38 | import gregtech.api.util.SmallDigits; |
37 | 39 |
|
38 | 40 | import net.minecraft.enchantment.Enchantment; |
| 41 | +import net.minecraft.item.ItemStack; |
39 | 42 | import net.minecraft.util.ResourceLocation; |
40 | 43 | import net.minecraftforge.fluids.Fluid; |
41 | 44 | import net.minecraftforge.fluids.FluidStack; |
@@ -278,6 +281,27 @@ public FluidStack getFluid(@NotNull FluidStorageKey key, int amount) { |
278 | 281 | return new FluidStack(getFluid(key), amount); |
279 | 282 | } |
280 | 283 |
|
| 284 | + /** |
| 285 | + * Gets the item form of this material in the form of an {@link OrePrefix} |
| 286 | + * |
| 287 | + * @param prefix the ore prefix to use |
| 288 | + * @return an item stack of the ore prefix using this material |
| 289 | + */ |
| 290 | + public @NotNull ItemStack getItemForm(@NotNull OrePrefix prefix) { |
| 291 | + return OreDictUnifier.get(prefix, this); |
| 292 | + } |
| 293 | + |
| 294 | + /** |
| 295 | + * Gets the item form of this material in the form of an {@link OrePrefix} |
| 296 | + * |
| 297 | + * @param prefix the ore prefix to use |
| 298 | + * @param count the amount the ItemStack will have |
| 299 | + * @return an item stack of the ore prefix using this material |
| 300 | + */ |
| 301 | + public @NotNull ItemStack getItemForm(@NotNull OrePrefix prefix, int count) { |
| 302 | + return OreDictUnifier.get(prefix, this, count); |
| 303 | + } |
| 304 | + |
281 | 305 | public int getBlockHarvestLevel() { |
282 | 306 | if (!hasProperty(PropertyKey.DUST)) { |
283 | 307 | throw new IllegalArgumentException( |
|
0 commit comments