Fix Models [GraveStone{BlockData},Crossbow{NPE},Guillotine{Blades}]

This commit is contained in:
Ste3et_C0st 2019-11-14 09:59:36 +01:00
parent 2887aa1c0b
commit f485d2fbde
5 changed files with 25 additions and 32 deletions

View File

@ -34,4 +34,11 @@ GraveStone:
Y-Offset: 0.0 Y-Offset: 0.0
Z-Offset: 0.0 Z-Offset: 0.0
Type: BARRIER Type: BARRIER
Data: 0 Data: 0
'1':
X-Offset: 0.0
Y-Offset: 0.0
Z-Offset: 1.0
Type: WALL_SIGN
Data: 0
Rotation: SOUTH

View File

@ -40,3 +40,8 @@ GraveStone:
yOffset: 0.0 yOffset: 0.0
zOffset: 0.0 zOffset: 0.0
material: BARRIER material: BARRIER
'1':
xOffset: 0.0
yOffset: 0.0
zOffset: 1.0
material: WALL_SIGN[facing=south]

View File

@ -56,10 +56,7 @@ public class Crossbow extends Furniture{
Location start = getRelative(getCenter(), getBlockFace(), 0,0); Location start = getRelative(getCenter(), getBlockFace(), 0,0);
start.setYaw(getYaw()); start.setYaw(getYaw());
start = start.add(0, 1.8, 0); start = start.add(0, 1.8, 0);
Arrow a = null; Arrow a = (Arrow) getWorld().spawnEntity(start, EntityType.ARROW);;
if(mat.equals(Material.ARROW)){
a = (Arrow) getWorld().spawnEntity(start, EntityType.ARROW);
}
a.setCritical(true); a.setCritical(true);
a.setVelocity(v); a.setVelocity(v);
a.setShooter(p); a.setShooter(p);

View File

@ -61,9 +61,18 @@ public class Guillotine extends Furniture implements Listener{
Bukkit.getPluginManager().registerEvents(this, main.getInstance()); Bukkit.getPluginManager().registerEvents(this, main.getInstance());
return; return;
} }
getfAsList().stream().filter(entity -> entity.getCustomName().startsWith("iron")).forEach(entity -> {
String[] a = entity.getCustomName().split(":");
String b = a + ":" + entity.getLocation().getX() + ":" + entity.getLocation().getY() + ":" + entity.getLocation().getZ();
entity.setCustomName(b);
});
setDefault(); setDefault();
initializeInventory(); initializeInventory();
Bukkit.getPluginManager().registerEvents(this, getPlugin()); Bukkit.getPluginManager().registerEvents(this, getPlugin());
} }
private void initializeInventory(){ private void initializeInventory(){

View File

@ -33,34 +33,9 @@ public class graveStone extends Furniture{
} }
private void setBlock(){ private void setBlock(){
Location location = getLocation().clone(); this.signLoc = getObjID().getBlockList().stream().filter(b -> b.getBlock().getType().name().contains("SIGN")).findFirst().orElse(null);
if(getBlockFace().equals(BlockFace.WEST)){location = getLutil().getRelativ(location, getBlockFace(), .0, -1.02);} if(this.signLoc != null) this.sign = this.signLoc.getBlock();
if(getBlockFace().equals(BlockFace.SOUTH)){location = getLutil().getRelativ(location, getBlockFace(), -1.0, -1.02);}
if(getBlockFace().equals(BlockFace.EAST)){location = getLutil().getRelativ(location, getBlockFace(), -1.0, .0);}
Location center = getLutil().getRelativ(location, getBlockFace(), .18D, .955D);
center.setYaw(getLutil().FaceToYaw(getBlockFace().getOppositeFace()) + 90);
Location kreutz2 = getLutil().getRelativ(center, getBlockFace(), -.23, -1.27);
Location sign = getLutil().getRelativ(kreutz2.getBlock().getLocation(), getBlockFace(), 0D, 1D);
this.signLoc = sign;
if(!sign.getBlock().getType().name().contains("SIGN")){
sign.getBlock().setType(Material.valueOf(Type.version.equalsIgnoreCase("1.13") ? "WALL_SIGN" : "OAK_WALL_SIGN"));
this.sign = sign.getBlock();
if(FurnitureHook.isNewVersion()) {
org.bukkit.block.data.Directional direct = (org.bukkit.block.data.Directional) this.sign.getBlockData();
direct.setFacing(getBlockFace());
this.sign.setBlockData(direct);
}else {
BlockState state = this.sign.getState();
LocationUtil util = getLutil();
state.setRawData(util.getFacebyte(util.yawToFace(getYaw() + 90)));
state.update();
}
}else{
this.sign = sign.getBlock();
}
this.lines = getText(); this.lines = getText();
getObjID().addBlock(Arrays.asList(this.sign));
} }
@Override @Override