-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Bump protocol version to v440 * Add BlockIds * finish new block traits and block types * 1.17 block updates * Update GameRules (#5) * Implement ItemPalette and move runtimeID logic out of ItemRegistry * Item fixes * Item Updates Co-authored-by: Kazuk <[email protected]>
- Loading branch information
1 parent
5fa1890
commit 800703e
Showing
20 changed files
with
445 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
src/main/java/org/cloudburstmc/api/crafting/CraftingRecipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.cloudburstmc.api.crafting; | ||
|
||
import org.cloudburstmc.api.item.ItemStack; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author CreeperFace | ||
*/ | ||
public interface CraftingRecipe extends Recipe { | ||
|
||
boolean requiresCraftingTable(); | ||
|
||
List<? extends ItemStack> getExtraResults(); | ||
|
||
List<? extends ItemStack> getAllResults(); | ||
|
||
int getPriority(); | ||
|
||
/** | ||
* Returns whether the specified list of crafting grid inputs and outputs matches this recipe. Outputs DO NOT | ||
* include the primary result item. | ||
* | ||
* @param input 2D array of items taken from the crafting grid | ||
* @param output 2D array of items put back into the crafting grid (secondary results) | ||
* @return bool | ||
*/ | ||
boolean matchItems(ItemStack[][] input, ItemStack[][] output); | ||
} |
48 changes: 48 additions & 0 deletions
48
src/main/java/org/cloudburstmc/api/crafting/MixRecipe.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
package org.cloudburstmc.api.crafting; | ||
|
||
import lombok.ToString; | ||
import org.cloudburstmc.api.item.ItemStack; | ||
import org.cloudburstmc.api.util.Identifier; | ||
|
||
@ToString | ||
public abstract class MixRecipe implements Recipe { | ||
|
||
private final ItemStack input; | ||
private final ItemStack ingredient; | ||
private final ItemStack output; | ||
private final Identifier recipeId; | ||
|
||
public MixRecipe(Identifier id, ItemStack input, ItemStack ingredient, ItemStack output) { | ||
this.recipeId = id; | ||
this.input = input; | ||
this.ingredient = ingredient; | ||
this.output = output; | ||
} | ||
|
||
@Override | ||
public Identifier getId() { | ||
return this.recipeId; | ||
} | ||
|
||
public ItemStack getIngredient() { | ||
return ingredient; | ||
} | ||
|
||
public ItemStack getInput() { | ||
return input; | ||
} | ||
|
||
public ItemStack getResult() { | ||
return output; | ||
} | ||
|
||
@Override | ||
public RecipeType getType() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
|
||
@Override | ||
public Identifier getBlock() { | ||
throw new UnsupportedOperationException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.