Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. package requious.data;
  2.  
  3. import com.google.gson.annotations.Expose;
  4. import com.google.gson.annotations.SerializedName;
  5. import crafttweaker.annotations.ZenRegister;
  6. import requious.Registry;
  7. import requious.compat.crafttweaker.ComponentFaceCT;
  8. import requious.data.component.ComponentEnergy;
  9. import requious.data.component.ComponentItem;
  10. import requious.recipe.AssemblyRecipe;
  11. import requious.data.component.ComponentBase;
  12. import stanhebben.zenscript.annotations.ZenClass;
  13. import stanhebben.zenscript.annotations.ZenMethod;
  14.  
  15. import java.util.ArrayList;
  16. import java.util.List;
  17.  
  18. @ZenRegister
  19. @ZenClass("mods.requious.Assembly")
  20. public class AssemblyData extends BaseData {
  21. @Expose(serialize = false, deserialize = false)
  22. public ComponentBase[][] slots = new ComponentBase[9][5];
  23. @Expose(serialize = false, deserialize = false)
  24. public List<AssemblyRecipe> recipes = new ArrayList<>();
  25.  
  26. public AssemblyProcessor constructProcessor() {
  27. AssemblyProcessor processor = new AssemblyProcessor(this);
  28. processor.setComponent(slots);
  29. processor.setup();
  30. return processor;
  31. }
  32.  
  33. @ZenMethod
  34. public static AssemblyData get(String identifier) {
  35. return Registry.getAssemblyData(identifier);
  36. }
  37.  
  38. @ZenMethod
  39. public ComponentItem setItemSlot(int x, int y, ComponentFaceCT face, int capacity) {
  40. ComponentItem component = new ComponentItem(face.get(),capacity);
  41. slots[x][y] = component;
  42. return component;
  43. }
  44.  
  45. @ZenMethod
  46. public ComponentEnergy setEnergySlot(int x, int y, ComponentFaceCT face, int capacity) {
  47. ComponentEnergy component = new ComponentEnergy(face.get(),capacity);
  48. slots[x][y] = component;
  49. return component;
  50. }
  51.  
  52. @ZenMethod
  53. public void addRecipe(AssemblyRecipe recipe) {
  54. recipes.add(recipe);
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement