Advertisement
broken-arrow

Untitled

Jan 17th, 2022
594
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 25.29 KB | None | 0 0
  1. package org.brokenarrow.storage.Settings;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.  
  6. public final class SettingsContainerData {
  7.  
  8.     private final String containerType;
  9.     private final String icon;
  10.     private final String displayName;
  11.     private final String limitAmontOfItems;
  12.     private final String uppgrade;
  13.  
  14.     private final String takeLevelOrExp;
  15.     private final String soundWhenPlaceContainer;
  16.     private final String soundWhenOpenContainer;
  17.     private final String soundWhenCloseContainer;
  18.  
  19.     private final String expandCostUpgradePages;
  20.     private final String suctionRange;
  21.     private final String suctionBorderEffect;
  22.     private final String soundWhenContainerRunTask;
  23.     private final String blockVisualizationBlocktype;
  24.     private final String blockVisualizationMessageOnTop;
  25.     private String placeholderItemStack;
  26.     private final List<String> effectOnContainer;
  27.     private final List<String> lore;
  28.     private final List<String> blackListedItems;
  29.     private final List<String> effectWhenContainerRunTask;
  30.     private final List<String> effectWhenPlaceContainer;
  31.  
  32.     private final double costUpgrade;
  33.     private final double moneyToTakeFromPlayer;
  34.     private final int guiSize;
  35.     private final int numberOfPages;
  36.     private final int whenBrakeContainer;
  37.     private final int secPicupTeleportItems;
  38.     private final int experienceToTakePlayer;
  39.     private final int suctionBorderShowTime;
  40.     private final int linkedRange;
  41.     private final int amontOfLinks;
  42.     private final int maxOfPages;
  43.     private final int amountPlaceForFree;
  44.     private final long timeBeforeReset;
  45.     private final boolean defultGlowOnOff;
  46.     private final boolean shallCostBeActiveWhenPlaceContainer;
  47.     private boolean placeholderItemStackisGlow;
  48.     private final Builder builder;
  49.  
  50.     private SettingsContainerData(Builder builder) {
  51.         this.containerType = builder.containerType;
  52.         this.icon = builder.icon;
  53.         this.displayName = builder.displayName;
  54.         this.limitAmontOfItems = builder.limitAmontOfItems;
  55.         this.uppgrade = builder.uppgrade;
  56.         this.moneyToTakeFromPlayer = builder.moneyToTakeFromPlayer;
  57.         this.takeLevelOrExp = builder.takeLevelOrExp;
  58.         this.soundWhenPlaceContainer = builder.soundWhenPlaceContainer;
  59.         this.soundWhenOpenContainer = builder.soundWhenOpenContainer;
  60.         this.soundWhenCloseContainer = builder.soundWhenCloseContainer;
  61.         this.expandCostUpgradePages = builder.expandCostUpgradePages;
  62.         this.suctionRange = builder.suctionRange;
  63.         this.suctionBorderEffect = builder.suctionBorderEffect;
  64.         this.soundWhenContainerRunTask = builder.soundWhenContainerRunTask;
  65.         this.blockVisualizationBlocktype = builder.blockVisualizationBlocktype;
  66.         this.blockVisualizationMessageOnTop = builder.blockVisualizationMessageOnTop;
  67.         this.placeholderItemStack = builder.placeholderItemStack;
  68.         this.effectOnContainer = builder.effectOnContainer;
  69.         this.lore = builder.lore;
  70.         this.blackListedItems = builder.blackListedItems;
  71.         this.effectWhenContainerRunTask = builder.effectWhenContainerRunTask;
  72.         this.effectWhenPlaceContainer = builder.effectWhenPlaceContainer;
  73.         this.costUpgrade = builder.costUpgrade;
  74.         this.guiSize = builder.guiSize;
  75.         this.numberOfPages = builder.numberOfPages;
  76.         this.whenBrakeContainer = builder.whenBrakeContainer;
  77.         this.secPicupTeleportItems = builder.secPicupTeleportItems;
  78.         this.experienceToTakePlayer = builder.experienceToTakePlayer;
  79.         this.suctionBorderShowTime = builder.suctionBorderShowTime;
  80.         this.linkedRange = builder.linkedRange;
  81.         this.amontOfLinks = builder.amontOfLinks;
  82.         this.maxOfPages = builder.maxOfPages;
  83.         this.amountPlaceForFree = builder.amountPlaceForFree;
  84.         this.timeBeforeReset = builder.timeBeforeReset;
  85.         this.defultGlowOnOff = builder.defultGlowOnOff;
  86.         this.shallCostBeActiveWhenPlaceContainer = builder.shallCostBeActiveWhenPlaceContainer;
  87.  
  88.         this.placeholderItemStackisGlow = builder.placeholderItemStackisGlow;
  89.         this.builder = builder;
  90.     }
  91.  
  92.     /**
  93.      * Get what type container it is.
  94.      *
  95.      * @return the type of container.
  96.      * @see org.brokenarrow.storage.cache.ContainerRegistry.TypeOfContainer
  97.      */
  98.     public String getContainerType() {
  99.         return containerType;
  100.     }
  101.  
  102.     /**
  103.      * Get icon type this container type have.
  104.      *
  105.      * @return item enum name.
  106.      */
  107.     public String getIcon() {
  108.         return icon;
  109.     }
  110.  
  111.     /**
  112.      * Name it will have both as title inside inventory
  113.      * and as display mame when is a item.
  114.      *
  115.      * @return text you want to have as title.
  116.      */
  117.     public String getDisplayName() {
  118.         return displayName;
  119.     }
  120.  
  121.     /**
  122.      * get limit of amount of items, are used for storage unit/container.
  123.      * <p>
  124.      * If method return -1 it will be unlimit amount and everything over 1 limit
  125.      * the amount of items.
  126.      *
  127.      * @return aomut of items max can be stored.
  128.      */
  129.     public String getLimitAmontOfItems() {
  130.         return limitAmontOfItems;
  131.     }
  132.  
  133.     /**
  134.      * Get update for this container. It use the key inside the yml file
  135.      * to get current and next update.
  136.      *
  137.      * @return upgrade key from the yaml file.
  138.      */
  139.     public String getUppgrade() {
  140.         return uppgrade;
  141.     }
  142.  
  143.     /**
  144.      * Get if shall use exp or level from player.
  145.      * <p>
  146.      * This method set how much it will take {@link Builder#setExperienceToTakePlayer(int)}.
  147.      *
  148.      * @return EXP or LVL.
  149.      */
  150.     public String getTakeLevelOrExp() {
  151.         return takeLevelOrExp;
  152.     }
  153.  
  154.     /**
  155.      * Get sound type when place contanier.
  156.      *
  157.      * @return sound enum name.
  158.      */
  159.     public String getSoundWhenPlaceContainer() {
  160.         return soundWhenPlaceContainer;
  161.     }
  162.  
  163.     /**
  164.      * Get sound type when open contanier.
  165.      *
  166.      * @return sound enum name.
  167.      */
  168.     public String getSoundWhenOpenContainer() {
  169.         return soundWhenOpenContainer;
  170.     }
  171.  
  172.     /**
  173.      * Get sound type when close contanier.
  174.      *
  175.      * @return sound enum name.
  176.      */
  177.     public String getSoundWhenCloseContainer() {
  178.         return soundWhenCloseContainer;
  179.     }
  180.  
  181.     /**
  182.      * Set how much cost shall increase in percent. For every updated
  183.      *
  184.      * @return aomunt of percent it will increase.
  185.      */
  186.     public String getExpandCostUpgradePages() {
  187.         return expandCostUpgradePages;
  188.     }
  189.  
  190.     /**
  191.      * Get the max range it will pick up items.
  192.      * <p>
  193.      * If you want one chunk, set it to -1 or -1,2 if you want 9 chunks insted of
  194.      * only one (you can use biger number for example -1,5 it vill be 5 x biger area).
  195.      * Be carefully to not set the area too big it can cuse lag on the server.
  196.      * Set to -2 to disable or for example 5,8,5 will it be in blocks arund the container.
  197.      *
  198.      * @return the suction range.
  199.      */
  200.     public String getSuctionRange() {
  201.         return suctionRange;
  202.     }
  203.  
  204.     /**
  205.      * Get the type of effect you want to use to show the suction border.
  206.      *
  207.      * @return enum name on the effect and in 1.18 can it be matrial enum too.
  208.      */
  209.     public String getSuctionBorderEffect() {
  210.         return suctionBorderEffect;
  211.     }
  212.  
  213.     /**
  214.      * Get sound type when run a task (for example after it have sold or craft or pick up item).
  215.      *
  216.      * @return sound enum name.
  217.      */
  218.     public String getSoundWhenContainerRunTask() {
  219.         return soundWhenContainerRunTask;
  220.     }
  221.  
  222.     /**
  223.      * Get type of block it shall use for visualization (it is used to show
  224.      * what container you have linked to).
  225.      *
  226.      * @return enum name on the block.
  227.      */
  228.     public String getBlockVisualizationBlocktype() {
  229.         return blockVisualizationBlocktype;
  230.     }
  231.  
  232.     /**
  233.      * Get message some are ontop of the block you link too.
  234.      *
  235.      * @return message you want on top of the container.
  236.      */
  237.     public String getBlockVisualizationMessageOnTop() {
  238.         return blockVisualizationMessageOnTop;
  239.     }
  240.  
  241.     /**
  242.      * Get effects some will spawn random arund the container.
  243.      *
  244.      * @return list of visible effects some shall spawn on the container.
  245.      */
  246.     public List<String> getEffectOnContainer() {
  247.         return effectOnContainer;
  248.     }
  249.  
  250.     /**
  251.      * Get lore on the item.
  252.      *
  253.      * @return list of text.
  254.      */
  255.     public List<String> getLore() {
  256.         return lore;
  257.     }
  258.  
  259.     /**
  260.      * Get items some shall be blacklisted (Is for filter and crafting list to allow or disallow items can be added).
  261.      *
  262.      * @return List of items some are blacklisted.
  263.      */
  264.     public List<String> getBlackListedItems() {
  265.         return blackListedItems;
  266.     }
  267.  
  268.     /**
  269.      * When container run a task, like crafting,sell or pick up items.
  270.      * Get effects it shall run on the chest.
  271.      *
  272.      * @return list of diffrent effects or same effect several times.
  273.      */
  274.     public List<String> getEffectWhenContainerRunTask() {
  275.         return effectWhenContainerRunTask;
  276.     }
  277.  
  278.     /**
  279.      * Get list of effects shall show when place container.
  280.      *
  281.      * @return list of diffrent effects or same effect several times.
  282.      */
  283.     public List<String> getEffectWhenPlaceContainer() {
  284.         return effectWhenPlaceContainer;
  285.     }
  286.  
  287.     /**
  288.      * Get cost for upgrade the container.
  289.      *
  290.      * @return cost with decimals.
  291.      */
  292.     public double getCostUpgrade() {
  293.         return costUpgrade;
  294.     }
  295.  
  296.     /**
  297.      * Get cost for place the container.
  298.      *
  299.      * @return cost with decimals.
  300.      */
  301.     public double getMoneyToTakeFromPlayer() {
  302.         return moneyToTakeFromPlayer;
  303.     }
  304.  
  305.     /**
  306.      * Get size on the inventory.
  307.      *
  308.      * @return size of the inventory.
  309.      */
  310.     public int getGuiSize() {
  311.         return guiSize;
  312.     }
  313.  
  314.     /**
  315.      * Get defult amount of pages container have.
  316.      *
  317.      * @return amount of pages.
  318.      */
  319.     public int getNumberOfPages() {
  320.         return numberOfPages;
  321.     }
  322.  
  323.     /**
  324.      * Get dropmode for the container.
  325.      * 1 Will dropp items on grund.
  326.      * 2 It will be stored "inside" the container.
  327.      *
  328.      * @return a number.
  329.      */
  330.     public int getWhenBrakeContainer() {
  331.         return whenBrakeContainer;
  332.     }
  333.  
  334.     /**
  335.      * Get time how often it will teleport and pic up items.
  336.      *
  337.      * @return number of seconds.
  338.      */
  339.     public int getSecPicupTeleportItems() {
  340.         return secPicupTeleportItems;
  341.     }
  342.  
  343.     /**
  344.      * How much it will cost when place container when is no free placement left.
  345.      *
  346.      * @return amunt of xp or levels to take.
  347.      */
  348.     public int getExperienceToTakePlayer() {
  349.         return experienceToTakePlayer;
  350.     }
  351.  
  352.     /**
  353.      * Get how long time it will show border in seconds.
  354.      *
  355.      * @return number of seconds.
  356.      */
  357.     public int getSuctionBorderShowTime() {
  358.         return suctionBorderShowTime;
  359.     }
  360.  
  361.     /**
  362.      * Get max range you can link your link/suction container to the container you link.
  363.      *
  364.      * @return number of blocks away the container you link to can be.
  365.      */
  366.     public int getLinkedRange() {
  367.         return linkedRange;
  368.     }
  369.  
  370.     /**
  371.      * Get max amount of links you can do with this container.
  372.      *
  373.      * @return amount of links you can have.
  374.      */
  375.     public int getAmontOfLinks() {
  376.         return amontOfLinks;
  377.     }
  378.  
  379.     /**
  380.      * Get max amount of pages the container can have.
  381.      *
  382.      * @return amount of pages the container can have max.
  383.      */
  384.     public int getMaxOfPages() {
  385.         return maxOfPages;
  386.     }
  387.  
  388.     /**
  389.      * Get amount of free placements.
  390.      *
  391.      * @return amount of free placements.
  392.      */
  393.     public int getAmountPlaceForFree() {
  394.         return amountPlaceForFree;
  395.     }
  396.  
  397.     /**
  398.      * Get time before it will reset your placements. it will be in seconds.
  399.      *
  400.      * @return time in seconds it will be reseted.
  401.      */
  402.     public long getTimeBeforeReset() {
  403.         return timeBeforeReset;
  404.     }
  405.  
  406.     /**
  407.      * Get if item shall glow or not in inventory.
  408.      *
  409.      * @return true if item shall have glow effect.
  410.      */
  411.     public boolean isDefultGlowOnOff() {
  412.         return defultGlowOnOff;
  413.     }
  414.  
  415.     /**
  416.      * Get if cost and xp shall be active for that type of container when place.
  417.      *
  418.      * @return true if cost are active on container.
  419.      */
  420.     public boolean isShallCostBeActiveWhenPlaceContainer() {
  421.         return shallCostBeActiveWhenPlaceContainer;
  422.     }
  423.  
  424.     /**
  425.      * Get old values from builder class.
  426.      *
  427.      * @return instance of bulder class.
  428.      */
  429.     public Builder getBuilder() {
  430.         return builder;
  431.     }
  432.  
  433.     public static class Builder {
  434.  
  435.         private String containerType;
  436.         private String icon;
  437.         private String displayName;
  438.         private String limitAmontOfItems;
  439.         private String uppgrade;
  440.         private String takeLevelOrExp;
  441.         private String soundWhenPlaceContainer;
  442.         private String soundWhenOpenContainer;
  443.         private String soundWhenCloseContainer;
  444.  
  445.         private String expandCostUpgradePages;
  446.         private String suctionRange;
  447.         private String suctionBorderEffect;
  448.         private String soundWhenContainerRunTask;
  449.         private String blockVisualizationBlocktype;
  450.         private String blockVisualizationMessageOnTop;
  451.         private String placeholderItemStack;
  452.  
  453.         private List<String> effectOnContainer = new ArrayList<>();
  454.         private List<String> lore = new ArrayList<>();
  455.         private List<String> blackListedItems = new ArrayList<>();
  456.         private List<String> effectWhenContainerRunTask = new ArrayList<>();
  457.         private List<String> effectWhenPlaceContainer = new ArrayList<>();
  458.  
  459.         private double moneyToTakeFromPlayer;
  460.         private double costUpgrade;
  461.         private int guiSize;
  462.         private int numberOfPages;
  463.         private int whenBrakeContainer;
  464.         private int secPicupTeleportItems;
  465.         private int experienceToTakePlayer;
  466.         private int suctionBorderShowTime;
  467.         private int linkedRange;
  468.         private int amontOfLinks;
  469.         private int maxOfPages;
  470.         private int amountPlaceForFree;
  471.         private long timeBeforeReset;
  472.         private boolean defultGlowOnOff;
  473.         private boolean shallCostBeActiveWhenPlaceContainer;
  474.         private boolean placeholderItemStackisGlow;
  475.  
  476.  
  477.         /**
  478.          * Set Type of container you want this container should be.
  479.          *
  480.          * @param containerType the type of container.
  481.          * @return builder class.
  482.          * @see org.brokenarrow.storage.cache.ContainerRegistry.TypeOfContainer
  483.          */
  484.         public Builder setContainerType(String containerType) {
  485.             this.containerType = containerType;
  486.             return this;
  487.         }
  488.  
  489.         /**
  490.          * Set icon type you want this container type should have.
  491.          *
  492.          * @param icon the item enum name.
  493.          * @return builder class.
  494.          */
  495.         public Builder setIcon(String icon) {
  496.             this.icon = icon;
  497.             return this;
  498.         }
  499.  
  500.         /**
  501.          * Name it will have both as title inside inventory
  502.          * and as display mame when is a item.
  503.          *
  504.          * @param displayName text you want to have as title.
  505.          * @return builder class.
  506.          */
  507.         public Builder setDisplayName(String displayName) {
  508.             this.displayName = displayName;
  509.             return this;
  510.         }
  511.  
  512.         /**
  513.          * Set placeholder items. Inside storage unit Container.
  514.          *
  515.          * @param placeholderItemStack the enum name.
  516.          */
  517.         public void setPlaceholderItemStack(String placeholderItemStack) {
  518.             this.placeholderItemStack = placeholderItemStack;
  519.         }
  520.  
  521.         /**
  522.          * Set limit of amount of items, are used for storage unit/container.
  523.          * If set to -1 it will be unlimit amount and everything over 1 limit
  524.          * the amount of items.
  525.          *
  526.          * @param limitAmontOfItems the limit of items.
  527.          * @return builder class.
  528.          */
  529.         public Builder setLimitAmontOfItems(String limitAmontOfItems) {
  530.             this.limitAmontOfItems = limitAmontOfItems;
  531.             return this;
  532.         }
  533.  
  534.         /**
  535.          * Set update for this container. It use the key inside the yml file
  536.          * to get current and next update.
  537.          *
  538.          * @param uppgrade the upgrade key to use.
  539.          * @return builder class.
  540.          */
  541.         public Builder setUppgrade(String uppgrade) {
  542.             this.uppgrade = uppgrade;
  543.             return this;
  544.         }
  545.  
  546.         /**
  547.          * Set to EXP for experience and LVL for levels.
  548.          * <p>
  549.          * This method set how much it will take {@link #setExperienceToTakePlayer(int)}.
  550.          *
  551.          * @param takeLevelOrExp with method it should use.
  552.          * @return builder class.
  553.          */
  554.         public Builder setTakeLevelOrExp(String takeLevelOrExp) {
  555.             this.takeLevelOrExp = takeLevelOrExp;
  556.             return this;
  557.         }
  558.  
  559.         /**
  560.          * Set sound type when place contanier.
  561.          *
  562.          * @param soundWhenPlaceContainer sound enum name you want to use.
  563.          * @return builder class.
  564.          */
  565.  
  566.         public Builder setSoundWhenPlaceContainer(String soundWhenPlaceContainer) {
  567.             this.soundWhenPlaceContainer = soundWhenPlaceContainer;
  568.             return this;
  569.         }
  570.  
  571.         /**
  572.          * Set sound type when open contanier.
  573.          *
  574.          * @param soundWhenOpenContainer sound enum name you want to use.
  575.          * @return builder class.
  576.          */
  577.         public Builder setSoundWhenOpenContainer(String soundWhenOpenContainer) {
  578.             this.soundWhenOpenContainer = soundWhenOpenContainer;
  579.             return this;
  580.         }
  581.  
  582.         /**
  583.          * Set sound type when close contanier.
  584.          *
  585.          * @param soundWhenCloseContainer sound enum name you want to use.
  586.          * @return builder class.
  587.          */
  588.         public Builder setSoundWhenCloseContainer(String soundWhenCloseContainer) {
  589.             this.soundWhenCloseContainer = soundWhenCloseContainer;
  590.             return this;
  591.         }
  592.  
  593.         /**
  594.          * Set how much cost shall increase in percent. For every updated
  595.          *
  596.          * @param expandCostUpgradePages upgrade cost.
  597.          * @return builder class.
  598.          */
  599.         public Builder setExpandCostUpgradePages(String expandCostUpgradePages) {
  600.             this.expandCostUpgradePages = expandCostUpgradePages;
  601.             return this;
  602.         }
  603.  
  604.  
  605.         /**
  606.          * Set the max range it will pick up items.
  607.          * <p>
  608.          * If you want one chunk, set it to -1 or -1,2 if you want 9 chunks insted of
  609.          * only one (you can use biger number for example -1,5 it vill be 5 x biger area).
  610.          * Be carefully to not set the area too big it can cuse lag on the server.
  611.          * Set to -2 to disable or for example 5,8,5 will it be in blocks arund the container.
  612.          *
  613.          * @param suctionRange the suction range.
  614.          * @return builder class.
  615.          */
  616.         public Builder setSuctionRange(String suctionRange) {
  617.             this.suctionRange = suctionRange;
  618.             return this;
  619.         }
  620.  
  621.         /**
  622.          * Set the type of effect you want to use to show the suction border.
  623.          *
  624.          * @param suctionBorderEffect enum name on the effect you want to use and in 1.18 you can use Matrial too.
  625.          * @return builder class.
  626.          */
  627.         public Builder setSuctionBorderEffect(String suctionBorderEffect) {
  628.             this.suctionBorderEffect = suctionBorderEffect;
  629.             return this;
  630.         }
  631.  
  632.         /**
  633.          * Set sound type when run a task (for example after it have sold or craft or pick up item).
  634.          *
  635.          * @param soundWhenContainerRunTask sound enum name you want to use.
  636.          * @return builder class.
  637.          */
  638.         public Builder setSoundWhenContainerRunTask(String soundWhenContainerRunTask) {
  639.             this.soundWhenContainerRunTask = soundWhenContainerRunTask;
  640.             return this;
  641.         }
  642.  
  643.         /**
  644.          * Set type of block it shall use for visualization (it is used to show
  645.          * what container you have linked to).
  646.          *
  647.          * @param blockVisualizationBlocktype enum name on the block you want to use.
  648.          * @return builder class.
  649.          */
  650.         public Builder setBlockVisualizationBlocktype(String blockVisualizationBlocktype) {
  651.             this.blockVisualizationBlocktype = blockVisualizationBlocktype;
  652.             return this;
  653.         }
  654.  
  655.         /**
  656.          * Set message some will show ontop of the block you link too.
  657.          *
  658.          * @param blockVisualizationMessageOnTop message you want on top of the container.
  659.          * @return builder class.
  660.          */
  661.         public Builder setBlockVisualizationMessageOnTop(String blockVisualizationMessageOnTop) {
  662.             this.blockVisualizationMessageOnTop = blockVisualizationMessageOnTop;
  663.             return this;
  664.         }
  665.  
  666.         /**
  667.          * Set effects it shall run some will spawn random arund the container.
  668.          *
  669.          * @param effectOnContainer List of visible effects on the container.
  670.          * @return builder class.
  671.          */
  672.         public Builder setEffectOnContainer(List<String> effectOnContainer) {
  673.             this.effectOnContainer = effectOnContainer;
  674.             return this;
  675.         }
  676.  
  677.         /**
  678.          * Set lore on the item.
  679.          *
  680.          * @param lore list of text you want on the item.
  681.          * @return builder class.
  682.          */
  683.         public Builder setLore(List<String> lore) {
  684.             this.lore = lore;
  685.             return this;
  686.         }
  687.  
  688.         /**
  689.          * Set items some shall be blacklisted (Is for filter and crafting list to allow or disallow items can be added)
  690.          *
  691.          * @param blackListedItems List of items you not allow be added.
  692.          * @return builder class.
  693.          */
  694.         public Builder setBlackListedItems(List<String> blackListedItems) {
  695.             this.blackListedItems = blackListedItems;
  696.             return this;
  697.         }
  698.  
  699.         /**
  700.          * When container run a task, like crafting,sell or pick up items.
  701.          * Set effects it shall run on the chest.
  702.          *
  703.          * @param effectWhenContainerRunTask type of effects.
  704.          * @return builder class.
  705.          */
  706.         public Builder setEffectWhenContainerRunTask(List<String> effectWhenContainerRunTask) {
  707.             this.effectWhenContainerRunTask = effectWhenContainerRunTask;
  708.             return this;
  709.         }
  710.  
  711.         /**
  712.          * Set list of effects shall show when place container.
  713.          *
  714.          * @param effectWhenPlaceContainer type of effects.
  715.          * @return builder class.
  716.          */
  717.         public Builder setEffectWhenPlaceContainer(List<String> effectWhenPlaceContainer) {
  718.             this.effectWhenPlaceContainer = effectWhenPlaceContainer;
  719.             return this;
  720.         }
  721.  
  722.         /**
  723.          * Amount of maney to take when player place the container.
  724.          *
  725.          * @param moneyToTakeFromPlayer amount it will take (support decimals).
  726.          * @return builder class.
  727.          */
  728.         public Builder setMoneyToTakeFromPlayer(double moneyToTakeFromPlayer) {
  729.             this.moneyToTakeFromPlayer = moneyToTakeFromPlayer;
  730.             return this;
  731.         }
  732.  
  733.         /**
  734.          * Set cost for upgrade the container. You can use 1.0 as example.
  735.          *
  736.          * @param costUpgrade the cost with decimals
  737.          * @return builder class.
  738.          */
  739.         public Builder setCostUpgrade(double costUpgrade) {
  740.             this.costUpgrade = costUpgrade;
  741.             return this;
  742.         }
  743.  
  744.         /**
  745.          * Set size on the inventory from 9 to 53.
  746.          *
  747.          * @param guiSize size of the inventory.
  748.          * @return builder class.
  749.          */
  750.         public Builder setGuiSize(int guiSize) {
  751.             this.guiSize = guiSize;
  752.             return this;
  753.         }
  754.  
  755.         /**
  756.          * Set defult amount of pages container shall have before you need upgrade it for more pages.
  757.          *
  758.          * @param numberOfPages amount of pages defult.
  759.          * @return builder class.
  760.          */
  761.         public Builder setNumberOfPages(int numberOfPages) {
  762.             this.numberOfPages = numberOfPages;
  763.             return this;
  764.         }
  765.  
  766.         /**
  767.          * Set this how items shall drop.
  768.          * 1 Will dropp items on grund.
  769.          * 2 It will be stored "inside" the container.
  770.          *
  771.          * @param whenBrakeContainer drop mode it shall use.
  772.          * @return builder class.
  773.          */
  774.         public Builder setWhenBrakeContainer(int whenBrakeContainer) {
  775.             this.whenBrakeContainer = whenBrakeContainer;
  776.             return this;
  777.         }
  778.  
  779.         /**
  780.          * Set time how often it shall teleport and pic up items.
  781.          *
  782.          * @param secPicupTeleportItems seconds it will take when pickup items.
  783.          * @return builder class.
  784.          */
  785.         public Builder setSecPicupTeleportItems(int secPicupTeleportItems) {
  786.             this.secPicupTeleportItems = secPicupTeleportItems;
  787.             return this;
  788.         }
  789.  
  790.         /**
  791.          * How much it will cost when place container when is no free placement left.
  792.          *
  793.          * @param experienceToTakePlayer amount of exp or level/levels (depending on setting).
  794.          * @return builder class.
  795.          */
  796.         public Builder setExperienceToTakePlayer(int experienceToTakePlayer) {
  797.             this.experienceToTakePlayer = experienceToTakePlayer;
  798.             return this;
  799.         }
  800.  
  801.         /**
  802.          * Set how long time it will show border in seconds.
  803.          *
  804.          * @param suctionBorderShowTime seconds it will show border.
  805.          * @return builder class.
  806.          */
  807.         public Builder setSuctionBorderShowTime(int suctionBorderShowTime) {
  808.             this.suctionBorderShowTime = suctionBorderShowTime;
  809.             return this;
  810.         }
  811.  
  812.         /**
  813.          * Set range you can link your container to.
  814.          *
  815.          * @param linkedRange distans you can link from.
  816.          * @return builder class.
  817.          */
  818.         public Builder setLinkedRange(int linkedRange) {
  819.             this.linkedRange = linkedRange;
  820.             return this;
  821.         }
  822.  
  823.         /**
  824.          * Set max amount of links you can do with this container.
  825.          *
  826.          * @param amontOfLinks number of links max.
  827.          * @return builder class.
  828.          */
  829.         public Builder setAmontOfLinks(int amontOfLinks) {
  830.             this.amontOfLinks = amontOfLinks;
  831.             return this;
  832.         }
  833.  
  834.         /**
  835.          * Set max amount of pages the container can have.
  836.          *
  837.          * @param maxOfPages number of pages max.
  838.          * @return builder class.
  839.          */
  840.         public Builder setMaxOfPages(int maxOfPages) {
  841.             this.maxOfPages = maxOfPages;
  842.             return this;
  843.         }
  844.  
  845.         /**
  846.          * Set amount of placements you can make for free.
  847.          *
  848.          * @param amountPlaceForFree number of placements.
  849.          * @return builder class.
  850.          */
  851.         public Builder setAmountPlaceForFree(int amountPlaceForFree) {
  852.             this.amountPlaceForFree = amountPlaceForFree;
  853.             return this;
  854.         }
  855.  
  856.         /**
  857.          * Set time before it will reset your placements. it will be in seconds.
  858.          *
  859.          * @param timeBeforeReset set seconds it will reset.
  860.          * @return builder class.
  861.          */
  862.  
  863.         public Builder setTimeBeforeReset(long timeBeforeReset) {
  864.             this.timeBeforeReset = timeBeforeReset;
  865.             return this;
  866.         }
  867.  
  868.         /**
  869.          * Set if item shall glow or not.
  870.          *
  871.          * @param defultGlowOnOff if it true item will glow.
  872.          * @return builder class.
  873.          */
  874.         public Builder setDefultGlowOnOff(boolean defultGlowOnOff) {
  875.             this.defultGlowOnOff = defultGlowOnOff;
  876.             return this;
  877.         }
  878.  
  879.         /**
  880.          * Set if cost and xp shall be active for that type of container when place.
  881.          *
  882.          * @param shallCostBeActiveWhenPlaceContainer true if this containertype shall have cost when place.
  883.          * @return builder class.
  884.          */
  885.         public Builder setShallCostBeActiveWhenPlaceContainer(boolean shallCostBeActiveWhenPlaceContainer) {
  886.             this.shallCostBeActiveWhenPlaceContainer = shallCostBeActiveWhenPlaceContainer;
  887.             return this;
  888.         }
  889.  
  890.         /**
  891.          * Set if placeholder items shall glow. Inside storage unit Container.
  892.          *
  893.          * @param placeholderItemStackisGlow set to true if it shall glow.
  894.          * @return builder class.
  895.          */
  896.         public Builder setPlaceholderItemStackisGlow(boolean placeholderItemStackisGlow) {
  897.             this.placeholderItemStackisGlow = placeholderItemStackisGlow;
  898.             return this;
  899.         }
  900.  
  901.         public SettingsContainerData build() {
  902.             return new SettingsContainerData(this);
  903.         }
  904.     }
  905.  
  906. }
  907.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement