-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: recipe
- Loading branch information
Showing
42 changed files
with
684 additions
and
81 deletions.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
api/src/main/java/org/allaymc/api/block/interfaces/BlockBrewingStandBehavior.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 |
---|---|---|
@@ -1,6 +1,8 @@ | ||
package org.allaymc.api.block.interfaces; | ||
|
||
import org.allaymc.api.block.BlockBehavior; | ||
import org.allaymc.api.block.component.BlockEntityHolderComponent; | ||
import org.allaymc.api.blockentity.interfaces.BlockEntityBrewingStand; | ||
|
||
public interface BlockBrewingStandBehavior extends BlockBehavior { | ||
public interface BlockBrewingStandBehavior extends BlockBehavior, BlockEntityHolderComponent<BlockEntityBrewingStand> { | ||
} |
18 changes: 18 additions & 0 deletions
18
...main/java/org/allaymc/api/blockentity/component/BlockEntityBrewingStandBaseComponent.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,18 @@ | ||
package org.allaymc.api.blockentity.component; | ||
|
||
/** | ||
* @author IWareQ | ||
*/ | ||
public interface BlockEntityBrewingStandBaseComponent extends BlockEntityBaseComponent { | ||
int getBrewTime(); | ||
|
||
void setBrewTime(int time); | ||
|
||
int getFuelAmount(); | ||
|
||
void setFuelAmount(int amount); | ||
|
||
int getFuelTotal(); | ||
|
||
void setFuelTotal(int amount); | ||
} |
10 changes: 10 additions & 0 deletions
10
api/src/main/java/org/allaymc/api/blockentity/interfaces/BlockEntityBrewingStand.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,10 @@ | ||
package org.allaymc.api.blockentity.interfaces; | ||
|
||
import org.allaymc.api.blockentity.BlockEntity; | ||
import org.allaymc.api.blockentity.component.BlockEntityBrewingStandBaseComponent; | ||
|
||
/** | ||
* @author IWareQ | ||
*/ | ||
public interface BlockEntityBrewingStand extends BlockEntity, BlockEntityBrewingStandBaseComponent { | ||
} |
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
41 changes: 41 additions & 0 deletions
41
api/src/main/java/org/allaymc/api/container/impl/BrewingStandContainer.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,41 @@ | ||
package org.allaymc.api.container.impl; | ||
|
||
import org.allaymc.api.container.FullContainerType; | ||
import org.allaymc.api.item.ItemStack; | ||
import org.jetbrains.annotations.Range; | ||
|
||
/** | ||
* @author IWareQ | ||
*/ | ||
public class BrewingStandContainer extends BlockContainer { | ||
public static final int REAGENT_SLOT = 0; | ||
public static final int FUEL_SLOT = 4; | ||
|
||
public BrewingStandContainer() { | ||
super(FullContainerType.BREWING_STAND); | ||
} | ||
|
||
public ItemStack getReagent() { | ||
return getItemStack(REAGENT_SLOT); | ||
} | ||
|
||
public void setReagent(ItemStack itemStack) { | ||
setItemStack(REAGENT_SLOT, itemStack); | ||
} | ||
|
||
public ItemStack getFuel() { | ||
return getItemStack(FUEL_SLOT); | ||
} | ||
|
||
public void setFuel(ItemStack itemStack) { | ||
setItemStack(FUEL_SLOT, itemStack); | ||
} | ||
|
||
public ItemStack getResult(@Range(from = 0, to = 2) int slot) { | ||
return getItemStack(slot + 1); | ||
} | ||
|
||
public void setResult(@Range(from = 0, to = 2) int slot, ItemStack itemStack) { | ||
setItemStack(slot + 1, itemStack); | ||
} | ||
} |
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
3 changes: 2 additions & 1 deletion
3
api/src/main/java/org/allaymc/api/item/recipe/IdentifiedRecipe.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 |
---|---|---|
@@ -1,11 +1,12 @@ | ||
package org.allaymc.api.item.recipe; | ||
|
||
import org.allaymc.api.item.recipe.impl.BaseRecipe; | ||
import org.allaymc.api.utils.Identified; | ||
|
||
/** | ||
* Represents an identified recipe. | ||
* | ||
* @author daoge_cmd | ||
*/ | ||
public interface IdentifiedRecipe extends Recipe, Identified { | ||
public interface IdentifiedRecipe extends BaseRecipe, Identified { | ||
} |
4 changes: 3 additions & 1 deletion
4
api/src/main/java/org/allaymc/api/item/recipe/NetworkRecipe.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
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
4 changes: 3 additions & 1 deletion
4
api/src/main/java/org/allaymc/api/item/recipe/TaggedRecipe.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
4 changes: 3 additions & 1 deletion
4
api/src/main/java/org/allaymc/api/item/recipe/UniqueRecipe.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
17 changes: 17 additions & 0 deletions
17
api/src/main/java/org/allaymc/api/item/recipe/impl/BaseRecipe.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,17 @@ | ||
package org.allaymc.api.item.recipe.impl; | ||
|
||
import org.allaymc.api.item.recipe.Recipe; | ||
import org.cloudburstmc.protocol.bedrock.data.inventory.crafting.CraftingDataType; | ||
import org.cloudburstmc.protocol.bedrock.data.inventory.crafting.recipe.RecipeData; | ||
|
||
/** | ||
* @author IWareQ | ||
*/ | ||
public interface BaseRecipe extends Recipe<RecipeData> { | ||
/** | ||
* Get the type of this recipe. | ||
* | ||
* @return the type of this recipe. | ||
*/ | ||
CraftingDataType getType(); | ||
} |
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.