Skip to content

Commit

Permalink
fixed modifyitem lore issue
Browse files Browse the repository at this point in the history
yaw in customsummon is now of type float
  • Loading branch information
BerndiVader committed Sep 27, 2019
1 parent 2d66baa commit 73931be
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 31 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#Tue Sep 17 20:51:48 CEST 2019
#Fri Sep 27 19:02:43 CEST 2019
appName=MythicMobsExtension
artbuild=3813
artbuild=3832
artver=1.440-SNAPSHOT
Original file line number Diff line number Diff line change
Expand Up @@ -78,30 +78,7 @@ public void setDurability(String durability) {
this.durability=Optional.ofNullable(durability);
}

private void parseVars(SkillMetadata data,AbstractEntity target) {
if(name.isPresent()) {
this.name=Optional.of(new PlaceholderString(this.name.get()).get(data,target));
}
if(lore.isPresent()) {
String[]lores=lore.get();
int size=lores.length;
for(int i1=0;i1<size;i1++) {
lores[i1]=new PlaceholderString(lores[i1]).get(data,target);
}
this.lore=Optional.of(lores);
}
if(durability.isPresent()) {
setDurability(new PlaceholderString(this.durability.get()).get(data,target));
}
if(bag_name.isPresent()) {
this.bag_name=Optional.of(new PlaceholderString(this.bag_name.get()).get(data,target));
}
if(this.slot.isPresent()) setSlot(new PlaceholderString(this.slot.get()).get(data,target));
}

public ItemStack applyMods(SkillMetadata data,AbstractEntity target,ItemStack item_stack) {
boolean use_vars=data!=null;
AbstractEntity caster=use_vars?data.getCaster().getEntity():null;
switch(action) {
case SET:
if(material.isPresent()) item_stack.setType(material.get());
Expand All @@ -113,10 +90,11 @@ public ItemStack applyMods(SkillMetadata data,AbstractEntity target,ItemStack it
item_stack.setItemMeta(item_meta);
}
if(lore.isPresent()) {
String[]lore=this.lore.get();
String[]lore=this.lore.get().clone();
int size=lore.length;
for(int i1=0;i1<size;i1++) {
lore[i1]=new PlaceholderString(lore[i1]).get(data,target);
String temp=new PlaceholderString(lore[i1]).get(data,target);
lore[i1]=temp;
}
ItemMeta item_meta=item_stack.getItemMeta();
item_meta.setLore(Arrays.asList(lore));
Expand Down Expand Up @@ -152,7 +130,7 @@ public ItemStack applyMods(SkillMetadata data,AbstractEntity target,ItemStack it
item_stack.setItemMeta(item_meta);
}
if(lore.isPresent()) {
String[]lore=this.lore.get();
String[]lore=this.lore.get().clone();
int size=lore.length;
for(int i1=0;i1<size;i1++) {
lore[i1]=new PlaceholderString(lore[i1]).get(data,target);
Expand Down Expand Up @@ -202,7 +180,7 @@ public ItemStack applyMods(SkillMetadata data,AbstractEntity target,ItemStack it
item_stack.setItemMeta(item_meta);
}
if(lore.isPresent()&&item_stack.getItemMeta().hasLore()) {
String[]lore=this.lore.get();
String[]lore=this.lore.get().clone();
int size=lore.length;
for(int i1=0;i1<size;i1++) {
lore[i1]=new PlaceholderString(lore[i1]).get(data,target);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@
MythicMob mm;
MythicEntity me;
String tag,amount;
int noise,yNoise,yaw;
int noise,yNoise;
boolean yUpOnly,onSurface,inheritThreatTable,copyThreatTable,useEyeDirection,setowner,invisible,leashtocaster;
float yaw;
double addx,addy,addz,inFrontBlocks;
String reason;

Expand All @@ -54,7 +55,7 @@ public CustomSummonMechanic(String skill, MythicLineConfig mlc) {
this.addx = mlc.getDouble(new String[] { "addx", "ax", "relx", "rx" }, 0);
this.addy = mlc.getDouble(new String[] { "addy", "ay", "rely", "ry" }, 0);
this.addz = mlc.getDouble(new String[] { "addz", "az", "relz", "rz" }, 0);
this.yaw=mlc.getInteger("yaw",-1337);
this.yaw=mlc.getFloat("yaw",-1337);
this.useEyeDirection = mlc.getBoolean(new String[] { "useeyedirection", "eyedirection", "ued" }, false);
this.inFrontBlocks = mlc.getDouble(new String[] { "infrontblocks", "infront", "ifb" }, 0D);
this.setowner = mlc.getBoolean(new String[] { "setowner", "so" }, false);
Expand Down

0 comments on commit 73931be

Please sign in to comment.