Record Class PistonCrushingRecipe
java.lang.Object
java.lang.Record
tech.anonymoushacker1279.immersiveweapons.item.crafting.PistonCrushingRecipe
- All Implemented Interfaces:
net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
public record PistonCrushingRecipe(net.minecraft.resources.ResourceLocation recipeId, net.minecraft.world.level.block.Block block, net.minecraft.world.item.ItemStack result, int minCount, int maxCount)
extends Record
implements net.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionPistonCrushingRecipe(net.minecraft.resources.ResourceLocation recipeId, net.minecraft.world.level.block.Block block, net.minecraft.world.item.ItemStack result, int minCount, int maxCount) Constructor for PistonCrushingRecipe. -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.ItemStackassemble(net.minecraft.world.Container container, net.minecraft.core.RegistryAccess registryAccess) net.minecraft.world.level.block.Blockblock()Returns the value of theblockrecord component.booleancanCraftInDimensions(int width, int height) Used to determine if this recipe can fit in a grid of the given width/height.final booleanIndicates whether some other object is "equal to" this one.net.minecraft.world.level.block.BlockgetBlock()Get the recipe's block.net.minecraft.resources.ResourceLocationgetId()Get the recipe ID.intGet a random drop amount based on the min and max count (inclusive).net.minecraft.world.item.ItemStackgetResultItem(net.minecraft.core.RegistryAccess registryAccess) net.minecraft.world.item.crafting.RecipeSerializer<?>Get the recipe serializer.net.minecraft.world.item.ItemStackGet the toast symbol.net.minecraft.world.item.crafting.RecipeType<?>getType()Get the recipe type.final inthashCode()Returns a hash code value for this object.booleanbooleanmatches(net.minecraft.world.Container container, net.minecraft.world.level.Level level) Used to check if a recipe matches current crafting inventory.booleanmatches(net.minecraft.world.level.block.Block block) intmaxCount()Returns the value of themaxCountrecord component.intminCount()Returns the value of theminCountrecord component.net.minecraft.resources.ResourceLocationrecipeId()Returns the value of therecipeIdrecord component.net.minecraft.world.item.ItemStackresult()Returns the value of theresultrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.world.item.crafting.Recipe
getGroup, getIngredients, getRemainingItems, isIncomplete, showNotification
-
Constructor Details
-
PistonCrushingRecipe
public PistonCrushingRecipe(net.minecraft.resources.ResourceLocation recipeId, net.minecraft.world.level.block.Block block, net.minecraft.world.item.ItemStack result, int minCount, int maxCount) Constructor for PistonCrushingRecipe. The values for minCount and maxCount are inclusive.- Parameters:
recipeId- theResourceLocationfor the recipeblock- the block to be crushedresult- anItemStackof the resultminCount- the minimum number of items droppedmaxCount- the maximum number of items dropped
-
-
Method Details
-
matches
public boolean matches(net.minecraft.world.Container container, net.minecraft.world.level.Level level) Used to check if a recipe matches current crafting inventory. Since this is never used in an inventory, it always returns false.- Specified by:
matchesin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>- Parameters:
container- theContainerinstancelevel- the currentLevel- Returns:
- boolean
-
matches
public boolean matches(net.minecraft.world.level.block.Block block) -
assemble
public net.minecraft.world.item.ItemStack assemble(net.minecraft.world.Container container, net.minecraft.core.RegistryAccess registryAccess) - Specified by:
assemblein interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
-
getResultItem
public net.minecraft.world.item.ItemStack getResultItem(net.minecraft.core.RegistryAccess registryAccess) - Specified by:
getResultItemin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
-
canCraftInDimensions
public boolean canCraftInDimensions(int width, int height) Used to determine if this recipe can fit in a grid of the given width/height.- Specified by:
canCraftInDimensionsin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>- Parameters:
width- the width of the gridheight- the height of the grid- Returns:
- boolean
-
getBlock
public net.minecraft.world.level.block.Block getBlock()Get the recipe's block.- Returns:
- Block
-
getRandomDropAmount
public int getRandomDropAmount()Get a random drop amount based on the min and max count (inclusive). -
getToastSymbol
public net.minecraft.world.item.ItemStack getToastSymbol()Get the toast symbol.- Specified by:
getToastSymbolin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>- Returns:
- ItemStack
-
getId
public net.minecraft.resources.ResourceLocation getId()Get the recipe ID.- Specified by:
getIdin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>- Returns:
- ResourceLocation
-
getSerializer
public net.minecraft.world.item.crafting.RecipeSerializer<?> getSerializer()Get the recipe serializer.- Specified by:
getSerializerin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>- Returns:
- RecipeSerializer
-
getType
public net.minecraft.world.item.crafting.RecipeType<?> getType()Get the recipe type.- Specified by:
getTypein interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>- Returns:
- RecipeType
-
isSpecial
public boolean isSpecial()- Specified by:
isSpecialin interfacenet.minecraft.world.item.crafting.Recipe<net.minecraft.world.Container>
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
recipeId
public net.minecraft.resources.ResourceLocation recipeId()Returns the value of therecipeIdrecord component.- Returns:
- the value of the
recipeIdrecord component
-
block
public net.minecraft.world.level.block.Block block()Returns the value of theblockrecord component.- Returns:
- the value of the
blockrecord component
-
result
public net.minecraft.world.item.ItemStack result()Returns the value of theresultrecord component.- Returns:
- the value of the
resultrecord component
-
minCount
public int minCount()Returns the value of theminCountrecord component.- Returns:
- the value of the
minCountrecord component
-
maxCount
public int maxCount()Returns the value of themaxCountrecord component.- Returns:
- the value of the
maxCountrecord component
-