mirror of
https://github.com/Ste3et/furniture.git
synced 2024-11-25 03:55:24 +01:00
Fix Models [GraveStone{BlockData},Crossbow{NPE},Guillotine{Blades}]
This commit is contained in:
parent
2887aa1c0b
commit
f485d2fbde
@ -35,3 +35,10 @@ GraveStone:
|
||||
Z-Offset: 0.0
|
||||
Type: BARRIER
|
||||
Data: 0
|
||||
'1':
|
||||
X-Offset: 0.0
|
||||
Y-Offset: 0.0
|
||||
Z-Offset: 1.0
|
||||
Type: WALL_SIGN
|
||||
Data: 0
|
||||
Rotation: SOUTH
|
@ -40,3 +40,8 @@ GraveStone:
|
||||
yOffset: 0.0
|
||||
zOffset: 0.0
|
||||
material: BARRIER
|
||||
'1':
|
||||
xOffset: 0.0
|
||||
yOffset: 0.0
|
||||
zOffset: 1.0
|
||||
material: WALL_SIGN[facing=south]
|
@ -56,10 +56,7 @@ public class Crossbow extends Furniture{
|
||||
Location start = getRelative(getCenter(), getBlockFace(), 0,0);
|
||||
start.setYaw(getYaw());
|
||||
start = start.add(0, 1.8, 0);
|
||||
Arrow a = null;
|
||||
if(mat.equals(Material.ARROW)){
|
||||
a = (Arrow) getWorld().spawnEntity(start, EntityType.ARROW);
|
||||
}
|
||||
Arrow a = (Arrow) getWorld().spawnEntity(start, EntityType.ARROW);;
|
||||
a.setCritical(true);
|
||||
a.setVelocity(v);
|
||||
a.setShooter(p);
|
||||
|
@ -61,9 +61,18 @@ public class Guillotine extends Furniture implements Listener{
|
||||
Bukkit.getPluginManager().registerEvents(this, main.getInstance());
|
||||
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();
|
||||
initializeInventory();
|
||||
Bukkit.getPluginManager().registerEvents(this, getPlugin());
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void initializeInventory(){
|
||||
|
@ -33,34 +33,9 @@ public class graveStone extends Furniture{
|
||||
}
|
||||
|
||||
private void setBlock(){
|
||||
Location location = getLocation().clone();
|
||||
if(getBlockFace().equals(BlockFace.WEST)){location = getLutil().getRelativ(location, getBlockFace(), .0, -1.02);}
|
||||
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.signLoc = getObjID().getBlockList().stream().filter(b -> b.getBlock().getType().name().contains("SIGN")).findFirst().orElse(null);
|
||||
if(this.signLoc != null) this.sign = this.signLoc.getBlock();
|
||||
this.lines = getText();
|
||||
getObjID().addBlock(Arrays.asList(this.sign));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user