forked from CloudburstMC/Nukkit
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial work on new inventory system
- Loading branch information
1 parent
3fbd521
commit ce0fab9
Showing
7 changed files
with
106 additions
and
2 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
src/main/java/cn/nukkit/network/protocol/types/ItemStackRequest.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,11 @@ | ||
package cn.nukkit.network.protocol.types; | ||
|
||
import lombok.ToString; | ||
|
||
@ToString | ||
public class ItemStackRequest { | ||
public int requestId; | ||
public ItemStackRequestAction[] actions; | ||
public String[] filterStrings; | ||
public int filterStringCause; | ||
} |
5 changes: 5 additions & 0 deletions
5
src/main/java/cn/nukkit/network/protocol/types/ItemStackRequestAction.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,5 @@ | ||
package cn.nukkit.network.protocol.types; | ||
|
||
public interface ItemStackRequestAction { | ||
ItemStackRequestActionType getType(); | ||
} |
24 changes: 24 additions & 0 deletions
24
src/main/java/cn/nukkit/network/protocol/types/ItemStackRequestActionType.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,24 @@ | ||
package cn.nukkit.network.protocol.types; | ||
|
||
public enum ItemStackRequestActionType { | ||
TAKE, | ||
PLACE, | ||
SWAP, | ||
DROP, | ||
DESTROY, | ||
CONSUME, | ||
CREATE, | ||
PLACE_IN_ITEM_CONTAINER, | ||
TAKE_FROM_ITEM_CONTAINER, | ||
LAB_TABLE_COMBINE, | ||
BEACON_PAYMENT, | ||
MINE_BLOCK, | ||
CRAFT_RECIPE, | ||
CRAFT_RECIPE_AUTO, | ||
CRAFT_CREATIVE, | ||
CRAFT_RECIPE_OPTIONAL, | ||
CRAFT_REPAIR_AND_DISENCHANT, | ||
CRAFT_LOOM, | ||
CRAFT_NON_IMPLEMENTED_DEPRECATED, | ||
CRAFT_RESULTS_DEPRECATED, | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/cn/nukkit/network/protocol/types/ItemStackResponse.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,15 @@ | ||
package cn.nukkit.network.protocol.types; | ||
|
||
import lombok.ToString; | ||
|
||
@ToString | ||
public class ItemStackResponse { | ||
public static final int RESULT_OK = 0; | ||
public static final int RESULT_ERROR = 1; | ||
|
||
private static final ItemStackResponseContainerInfo[] EMPTY_CONTAINERS = new ItemStackResponseContainerInfo[0]; | ||
|
||
public int result = RESULT_OK; | ||
public int requestId; | ||
public ItemStackResponseContainerInfo[] containerInfos = EMPTY_CONTAINERS; | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/cn/nukkit/network/protocol/types/ItemStackResponseContainerInfo.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 cn.nukkit.network.protocol.types; | ||
|
||
import lombok.ToString; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
@ToString | ||
public class ItemStackResponseContainerInfo { | ||
private static final ItemStackResponseSlotInfo[] EMPTY_SLOTS = new ItemStackResponseSlotInfo[0]; | ||
|
||
public int containerId; | ||
/** | ||
* @since 1.21.20 | ||
*/ | ||
@Nullable | ||
public Integer dynamicContainerId; | ||
public ItemStackResponseSlotInfo[] slots = EMPTY_SLOTS; | ||
} |
23 changes: 23 additions & 0 deletions
23
src/main/java/cn/nukkit/network/protocol/types/ItemStackResponseSlotInfo.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,23 @@ | ||
package cn.nukkit.network.protocol.types; | ||
|
||
import lombok.ToString; | ||
|
||
@ToString | ||
public class ItemStackResponseSlotInfo { | ||
public int slot; | ||
public int hotbarSlot; | ||
public int count; | ||
public int itemStackId; | ||
/** | ||
* @since 1.16.200 | ||
*/ | ||
public String customName = ""; | ||
/** | ||
* @since 1.21.50 | ||
*/ | ||
public String filteredCustomName = ""; | ||
/** | ||
* @since 1.16.210 | ||
*/ | ||
public int durabilityCorrection; | ||
} |
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