-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
89 additions
and
108 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
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
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
25 changes: 25 additions & 0 deletions
25
src/main/java/net/touhou/mystiasizakaya/orders/Addorder.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,25 @@ | ||
package net.touhou.mystiasizakaya.orders; | ||
|
||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraftforge.registries.ForgeRegistries; | ||
import net.touhou.mystiasizakaya.network.Variables; | ||
|
||
import net.minecraft.world.item.ItemStack; | ||
|
||
import java.util.List; | ||
|
||
public class Addorder { | ||
public static void execute(ItemStack beverages, ItemStack cuisines, double id, Player player) { | ||
List<String> orders_list = player.getCapability(Variables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new Variables.PlayerVariables()).orders; | ||
List<String> ordersbeverages_list = player.getCapability(Variables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new Variables.PlayerVariables()).ordersbeverages; | ||
String cuisines_str = ForgeRegistries.ITEMS.getKey(cuisines.getItem()).toString(); | ||
String beverages_str = ForgeRegistries.ITEMS.getKey(beverages.getItem()).toString(); | ||
orders_list.set((int) id, cuisines_str); | ||
ordersbeverages_list.set((int) id, beverages_str); | ||
player.getCapability(Variables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { | ||
capability.orders = orders_list; | ||
capability.ordersbeverages = ordersbeverages_list; | ||
capability.syncPlayerVariables(player); | ||
}); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/net/touhou/mystiasizakaya/orders/Deleteorder.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,22 @@ | ||
package net.touhou.mystiasizakaya.orders; | ||
|
||
import net.minecraft.world.entity.player.Player; | ||
import net.touhou.mystiasizakaya.network.Variables; | ||
|
||
import java.util.List; | ||
|
||
public class Deleteorder { | ||
public static void execute(double id, Player player) { | ||
List<String> orders_list = player.getCapability(Variables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new Variables.PlayerVariables()).orders; | ||
List<String> ordersbeverages_list = player.getCapability(Variables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new Variables.PlayerVariables()).ordersbeverages; | ||
String cuisines_str = "minecraft:air"; | ||
String beverages_str = "minecraft:air"; | ||
orders_list.set((int) id, cuisines_str); | ||
ordersbeverages_list.set((int) id, beverages_str); | ||
player.getCapability(Variables.PLAYER_VARIABLES_CAPABILITY, null).ifPresent(capability -> { | ||
capability.orders = orders_list; | ||
capability.ordersbeverages = ordersbeverages_list; | ||
capability.syncPlayerVariables(player); | ||
}); | ||
} | ||
} |
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
12 changes: 0 additions & 12 deletions
12
src/main/java/net/touhou/mystiasizakaya/procedures/AddordersProcedure.java
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/main/java/net/touhou/mystiasizakaya/procedures/DeleteordersProcedure.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.