JackOUT

Untitled

Feb 18th, 2023
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.21 KB | None | 0 0
  1. package games.coob.laserturrets.settings;
  2.  
  3. import org.bukkit.inventory.ItemStack;
  4. import org.mineacademy.fo.menu.model.SkullCreator;
  5.  
  6. import javax.annotation.Nullable;
  7.  
  8. public class Arrow extends TurretSettings {
  9.  
  10.     private ItemStack toolItem;
  11.     private String base64Texture;
  12.  
  13.     protected Arrow(final String turretName, @Nullable final TurretType type) {
  14.         super(turretName, type);
  15.     }
  16.  
  17.     @Override
  18.     protected void onLoad() {
  19.         final String texture = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvOGNjNzI1NzhhNjBjMGViMWEzZmEzODFhYTYyMmEwYzkyNzZkYTdmOTU4YWU5YTBjNzFlZTQ4ZTc3MWZiMmNjNSJ9fX0=";
  20.  
  21.         this.toolItem = this.getItemStack("Tool_Item", SkullCreator.itemFromBase64(texture));
  22.         this.base64Texture = this.getString("Head_Texture", texture);
  23.  
  24.         super.onLoad();
  25.     }
  26.  
  27.     @Override
  28.     protected void onSave() {
  29.         super.onSave();
  30.  
  31.         this.set("Tool_Item", this.toolItem);
  32.         this.set("Head_Texture", this.base64Texture);
  33.     }
  34.  
  35.     /*public void setToolItem(final CompMaterial material) { // TODO
  36.         this.material = material;
  37.  
  38.         this.save();
  39.     }*/
  40.  
  41.     @Override
  42.     public void setBase64Texture(final String texture) {
  43.         this.base64Texture = texture;
  44.  
  45.         this.save();
  46.     }
  47. }
  48.  
Add Comment
Please, Sign In to add comment