Skip to content

Commit

Permalink
ヨシ!
Browse files Browse the repository at this point in the history
  • Loading branch information
bea4dev committed Mar 12, 2020
1 parent 7c2c402 commit ac7aafb
Show file tree
Hide file tree
Showing 7 changed files with 371 additions and 296 deletions.
209 changes: 107 additions & 102 deletions src/main/java/be4rjp/sclat/data/MainWeapon.java
Original file line number Diff line number Diff line change
@@ -1,102 +1,107 @@
package be4rjp.sclat.data;

import org.bukkit.inventory.ItemStack;

/**
*
* @author Be4rJP
*/
public class MainWeapon {
private String WeaponName;
private String WeaponType;
private ItemStack weaponitem;
private double random;
private int distancetick;
private double shootspeed;
private int shoottick;
private int paintrandom;
private double maxpaintdis;
private float needink;
private double damage;
private int maxcharge;
private int rollershootquantity;
private float UsingWalkSpeed;
private int rollerWidth;
private boolean Tatehuri;
private double rollerdamage;
private float rollerneedink;



public MainWeapon(String weaponname){this.WeaponName = weaponname;}

public String getWeaponType(){return this.WeaponType;}

public ItemStack getWeaponIteamStack(){return this.weaponitem;}

public double getRandom(){return random;}

public int getDistanceTick(){return distancetick;}

public double getShootSpeed(){return shootspeed;}

public int getShootTick(){return shoottick;}

public int getPaintRandom(){return this.paintrandom;}

public double getMaxPaintDis(){return this.maxpaintdis;}

public float getNeedInk(){return this.needink;}

public double getDamage(){return this.damage;}

public int getMaxCharge(){return this.maxcharge;}

public int getRollerShootQuantity(){return this.rollershootquantity;}

public float getUsingWalkSpeed(){return this.UsingWalkSpeed;}

public int getRollerWidth(){return this.rollerWidth;}

public boolean getCanTatehuri(){return this.Tatehuri;}

public double getRollerDamage(){return this.rollerdamage;}

public float getRollerNeedInk(){return this.rollerneedink;}


public void setWeaponType(String WT){this.WeaponType = WT;}

public void setWeaponItemStack(ItemStack is){this.weaponitem = is;}

public void setRandom(double random){this.random = random;}

public void setDistanceTick(int distick){this.distancetick = distick;}

public void setShootSpeed(double speed){this.shootspeed = speed;}

public void setShootTick(int shoottick){this.shoottick = shoottick;}

public void setPaintRandom(int r){this.paintrandom = r;}

public void setMaxPaintDis(double max){this.maxpaintdis = max;}

public void setNeedInk(float ink){this.needink = ink;}

public void setDamage(double damage){this.damage = damage;}

public void setMaxCharge(int max){this.maxcharge = max;}

public void setRollerShootQuantity(int i){this.rollershootquantity = i;}

public void setUsingWalkSpeed(float f){this.UsingWalkSpeed = f;}

public void setRollerWidth(int w){this.rollerWidth = w;}

public void setCanTatehuri(boolean t){this.Tatehuri = t;}

public void setRollerDamage(double damage){this.rollerdamage = damage;}

public void setRollerNeedInk(float ink){this.rollerneedink = ink;}

}
package be4rjp.sclat.data;

import org.bukkit.inventory.ItemStack;

/**
*
* @author Be4rJP
*/
public class MainWeapon {
private String WeaponName;
private String WeaponType;
private ItemStack weaponitem;
private double random;
private int distancetick;
private double shootspeed;
private int shoottick;
private int paintrandom;
private double maxpaintdis;
private float needink;
private double damage;
private int maxcharge;
private int rollershootquantity;
private float UsingWalkSpeed;
private int rollerWidth;
private boolean Tatehuri;
private double rollerdamage;
private float rollerneedink;
private boolean scope;



public MainWeapon(String weaponname){this.WeaponName = weaponname;}

public String getWeaponType(){return this.WeaponType;}

public ItemStack getWeaponIteamStack(){return this.weaponitem;}

public double getRandom(){return random;}

public int getDistanceTick(){return distancetick;}

public double getShootSpeed(){return shootspeed;}

public int getShootTick(){return shoottick;}

public int getPaintRandom(){return this.paintrandom;}

public double getMaxPaintDis(){return this.maxpaintdis;}

public float getNeedInk(){return this.needink;}

public double getDamage(){return this.damage;}

public int getMaxCharge(){return this.maxcharge;}

public int getRollerShootQuantity(){return this.rollershootquantity;}

public float getUsingWalkSpeed(){return this.UsingWalkSpeed;}

public int getRollerWidth(){return this.rollerWidth;}

public boolean getCanTatehuri(){return this.Tatehuri;}

public double getRollerDamage(){return this.rollerdamage;}

public float getRollerNeedInk(){return this.rollerneedink;}

public boolean getScope(){return this.scope;}


public void setWeaponType(String WT){this.WeaponType = WT;}

public void setWeaponItemStack(ItemStack is){this.weaponitem = is;}

public void setRandom(double random){this.random = random;}

public void setDistanceTick(int distick){this.distancetick = distick;}

public void setShootSpeed(double speed){this.shootspeed = speed;}

public void setShootTick(int shoottick){this.shoottick = shoottick;}

public void setPaintRandom(int r){this.paintrandom = r;}

public void setMaxPaintDis(double max){this.maxpaintdis = max;}

public void setNeedInk(float ink){this.needink = ink;}

public void setDamage(double damage){this.damage = damage;}

public void setMaxCharge(int max){this.maxcharge = max;}

public void setRollerShootQuantity(int i){this.rollershootquantity = i;}

public void setUsingWalkSpeed(float f){this.UsingWalkSpeed = f;}

public void setRollerWidth(int w){this.rollerWidth = w;}

public void setCanTatehuri(boolean t){this.Tatehuri = t;}

public void setRollerDamage(double damage){this.rollerdamage = damage;}

public void setRollerNeedInk(float ink){this.rollerneedink = ink;}

public void setScope(boolean is){this.scope = is;}

}
13 changes: 13 additions & 0 deletions src/main/java/be4rjp/sclat/data/PlayerData.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public class PlayerData {
private boolean sp = false;
private boolean canusesub = true;
private boolean charge = false;
private boolean poison = false;
private boolean canrollershoot = true;


public PlayerData(Player player){this.player = player;}
Expand Down Expand Up @@ -83,6 +85,10 @@ public class PlayerData {

public boolean getIsCharging(){return this.charge;}

public boolean getPoison(){return this.poison;}

public boolean getCanRollerShoot(){return this.canrollershoot;}


public void setSettings(PlayerSettings settings){this.settings = settings;}

Expand Down Expand Up @@ -126,6 +132,10 @@ public class PlayerData {

public void setIsCharging(boolean is){this.charge = is;}

public void setPoison(boolean is){this.poison = is;}

public void setCanRollerShoot(boolean is){this.canrollershoot = is;}

public void addKillCount(){this.killcount++;}

public void addPaintCount(){this.paintcount++;}
Expand All @@ -149,6 +159,9 @@ public void reset(){
this.spgauge = 0;
this.sp = false;
this.canusesub = true;
this.charge = false;
this.poison = false;
this.canrollershoot = true;
}

}
130 changes: 68 additions & 62 deletions src/main/java/be4rjp/sclat/manager/MainWeaponMgr.java
Original file line number Diff line number Diff line change
@@ -1,62 +1,68 @@

package be4rjp.sclat.manager;

import static be4rjp.sclat.Main.conf;
import be4rjp.sclat.data.DataMgr;
import be4rjp.sclat.data.MainWeapon;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

/**
*
* @author Be4rJP
*/
public class MainWeaponMgr {
public synchronized static void SetupMainWeapon(){
for (String weaponname : conf.getWeaponConfig().getConfigurationSection("MainWeapon").getKeys(false)){
String WeaponType = conf.getWeaponConfig().getString("MainWeapon." + weaponname + ".WeaponType");
Material WeaponMaterial = Material.getMaterial(conf.getWeaponConfig().getString("MainWeapon." + weaponname + ".WeaponMaterial"));
double random = conf.getWeaponConfig().getDouble("MainWeapon." + weaponname + ".ShootRandom");
int distick = conf.getWeaponConfig().getInt("MainWeapon." + weaponname + ".ShootDistance");
double shootspeed = conf.getWeaponConfig().getDouble("MainWeapon." + weaponname + ".ShootSpeed");
int shoottick = conf.getWeaponConfig().getInt("MainWeapon." + weaponname + ".ShootTick");
int paintrandom = conf.getWeaponConfig().getInt("MainWeapon." + weaponname + ".PaintRandom");
double maxpaintdis = conf.getWeaponConfig().getInt("MainWeapon." + weaponname + ".MaxPaintDistance");
float needink = (float)conf.getWeaponConfig().getDouble("MainWeapon." + weaponname + ".NeedInk");
double damage = conf.getWeaponConfig().getDouble("MainWeapon." + weaponname + ".Damage");
int maxcharge = conf.getWeaponConfig().getInt("MainWeapon." + weaponname + ".MaxCharge");
int rollershootQuantity = conf.getWeaponConfig().getInt("MainWeapon." + weaponname + ".RollerShootQuantity");
float usinwalkspeed = (float)conf.getWeaponConfig().getDouble("MainWeapon." + weaponname + ".UsingWalkSpeed");
int rollerWidth = conf.getWeaponConfig().getInt("MainWeapon." + weaponname + ".RollerWidth");
boolean tatehuri = conf.getWeaponConfig().getBoolean("MainWeapon." + weaponname + ".RollerTatehuri");
double rollerdamage = conf.getWeaponConfig().getDouble("MainWeapon." + weaponname + ".RollerDamage");
float rollerneedink = (float)conf.getWeaponConfig().getDouble("MainWeapon." + weaponname + ".RollerNeedInk");


MainWeapon mw = new MainWeapon(weaponname);
mw.setWeaponType(WeaponType);
ItemStack is = new ItemStack(WeaponMaterial);
ItemMeta itemMeta = is.getItemMeta();
itemMeta.setDisplayName(weaponname);
is.setItemMeta(itemMeta);
mw.setWeaponItemStack(is);
mw.setRandom(random);
mw.setDistanceTick(distick);
mw.setShootSpeed(shootspeed);
mw.setShootTick(shoottick);
mw.setPaintRandom(paintrandom);
mw.setMaxPaintDis(maxpaintdis);
mw.setNeedInk(needink);
mw.setDamage(damage);
mw.setMaxCharge(maxcharge);
mw.setRollerShootQuantity(rollershootQuantity);
mw.setUsingWalkSpeed(usinwalkspeed);
mw.setRollerWidth(rollerWidth);
mw.setRollerDamage(rollerdamage);
mw.setRollerNeedInk(rollerneedink);
mw.setCanTatehuri(tatehuri);
DataMgr.setMainWeapon(weaponname, mw);
}
}
}

package be4rjp.sclat.manager;

import static be4rjp.sclat.Main.conf;
import be4rjp.sclat.data.DataMgr;
import be4rjp.sclat.data.MainWeapon;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

/**
*
* @author Be4rJP
*/
public class MainWeaponMgr {
public synchronized static void SetupMainWeapon(){
for (String weaponname : conf.getWeaponConfig().getConfigurationSection("MainWeapon").getKeys(false)){
String WeaponType = conf.getWeaponConfig().getString("MainWeapon." + weaponname + ".WeaponType");
Material WeaponMaterial = Material.getMaterial(conf.getWeaponConfig().getString("MainWeapon." + weaponname + ".WeaponMaterial"));
double random = conf.getWeaponConfig().getDouble("MainWeapon." + weaponname + ".ShootRandom");
int distick = conf.getWeaponConfig().getInt("MainWeapon." + weaponname + ".ShootDistance");
double shootspeed = conf.getWeaponConfig().getDouble("MainWeapon." + weaponname + ".ShootSpeed");
int shoottick = conf.getWeaponConfig().getInt("MainWeapon." + weaponname + ".ShootTick");
int paintrandom = conf.getWeaponConfig().getInt("MainWeapon." + weaponname + ".PaintRandom");
double maxpaintdis = conf.getWeaponConfig().getInt("MainWeapon." + weaponname + ".MaxPaintDistance");
float needink = (float)conf.getWeaponConfig().getDouble("MainWeapon." + weaponname + ".NeedInk");
double damage = conf.getWeaponConfig().getDouble("MainWeapon." + weaponname + ".Damage");
int maxcharge = conf.getWeaponConfig().getInt("MainWeapon." + weaponname + ".MaxCharge");
int rollershootQuantity = conf.getWeaponConfig().getInt("MainWeapon." + weaponname + ".RollerShootQuantity");
float usinwalkspeed = (float)conf.getWeaponConfig().getDouble("MainWeapon." + weaponname + ".UsingWalkSpeed");
int rollerWidth = conf.getWeaponConfig().getInt("MainWeapon." + weaponname + ".RollerWidth");
boolean tatehuri = conf.getWeaponConfig().getBoolean("MainWeapon." + weaponname + ".RollerTatehuri");
double rollerdamage = conf.getWeaponConfig().getDouble("MainWeapon." + weaponname + ".RollerDamage");
float rollerneedink = (float)conf.getWeaponConfig().getDouble("MainWeapon." + weaponname + ".RollerNeedInk");



MainWeapon mw = new MainWeapon(weaponname);
mw.setWeaponType(WeaponType);
ItemStack is = new ItemStack(WeaponMaterial);
ItemMeta itemMeta = is.getItemMeta();
itemMeta.setDisplayName(weaponname);
is.setItemMeta(itemMeta);
mw.setWeaponItemStack(is);
mw.setRandom(random);
mw.setDistanceTick(distick);
mw.setShootSpeed(shootspeed);
mw.setShootTick(shoottick);
mw.setPaintRandom(paintrandom);
mw.setMaxPaintDis(maxpaintdis);
mw.setNeedInk(needink);
mw.setDamage(damage);
mw.setMaxCharge(maxcharge);
mw.setRollerShootQuantity(rollershootQuantity);
mw.setUsingWalkSpeed(usinwalkspeed);
mw.setRollerWidth(rollerWidth);
mw.setRollerDamage(rollerdamage);
mw.setRollerNeedInk(rollerneedink);
mw.setCanTatehuri(tatehuri);

if(conf.getWeaponConfig().contains("MainWeapon." + weaponname + ".Scope"))
mw.setScope(conf.getWeaponConfig().getBoolean("MainWeapon." + weaponname + ".Scope"));


DataMgr.setMainWeapon(weaponname, mw);
}
}
}
Loading

0 comments on commit ac7aafb

Please sign in to comment.