use of org.apache.tapestry5.Block in project MechanicsMain by WeaponMechanics.
the class v1_10_R1 method getHitBox.
@Override
public HitBox getHitBox(org.bukkit.block.Block block) {
if (block.isEmpty() || block.isLiquid())
return null;
WorldServer worldServer = ((CraftWorld) block.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(block.getX(), block.getY(), block.getZ());
IBlockData blockData = worldServer.getType(blockPosition);
Block nmsBlock = blockData.getBlock();
// Passable block check -> false means passable (thats why !)
if (!(blockData.d(worldServer, blockPosition) != Block.k && nmsBlock.a(blockData, false)))
return null;
AxisAlignedBB aabb = blockData.c(worldServer, blockPosition);
// 1.12 -> e
// 1.11 -> d
// 1.9 - 1.10 -> c
int x = blockPosition.getX(), y = blockPosition.getY(), z = blockPosition.getZ();
HitBox hitBox = new HitBox(x + aabb.a, y + aabb.b, z + aabb.c, x + aabb.d, y + aabb.e, z + aabb.f);
hitBox.setBlockHitBox(block);
return hitBox;
}
use of org.apache.tapestry5.Block in project MechanicsMain by WeaponMechanics.
the class v1_11_R1 method getHitBox.
@Override
public HitBox getHitBox(org.bukkit.block.Block block) {
if (block.isEmpty() || block.isLiquid())
return null;
WorldServer worldServer = ((CraftWorld) block.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(block.getX(), block.getY(), block.getZ());
IBlockData blockData = worldServer.getType(blockPosition);
Block nmsBlock = blockData.getBlock();
// Passable block check -> false means passable (thats why !)
if (!(blockData.d(worldServer, blockPosition) != Block.k && nmsBlock.a(blockData, false)))
return null;
AxisAlignedBB aabb = blockData.d(worldServer, blockPosition);
// 1.12 -> e
// 1.11 -> d
// 1.9 - 1.10 -> c
int x = blockPosition.getX(), y = blockPosition.getY(), z = blockPosition.getZ();
HitBox hitBox = new HitBox(x + aabb.a, y + aabb.b, z + aabb.c, x + aabb.d, y + aabb.e, z + aabb.f);
hitBox.setBlockHitBox(block);
return hitBox;
}
use of org.apache.tapestry5.Block in project MechanicsMain by WeaponMechanics.
the class v1_12_R1 method getHitBox.
@Override
public HitBox getHitBox(org.bukkit.block.Block block) {
if (block.isEmpty() || block.isLiquid())
return null;
WorldServer worldServer = ((CraftWorld) block.getWorld()).getHandle();
BlockPosition blockPosition = new BlockPosition(block.getX(), block.getY(), block.getZ());
IBlockData blockData = worldServer.getType(blockPosition);
Block nmsBlock = blockData.getBlock();
// Passable block check -> false means passable (thats why !)
if (!(blockData.d(worldServer, blockPosition) != Block.k && nmsBlock.a(blockData, false)))
return null;
AxisAlignedBB aabb = blockData.e(worldServer, blockPosition);
// 1.12 -> e
// 1.11 -> d
// 1.9 - 1.10 -> c
int x = blockPosition.getX(), y = blockPosition.getY(), z = blockPosition.getZ();
HitBox hitBox = new HitBox(x + aabb.a, y + aabb.b, z + aabb.c, x + aabb.d, y + aabb.e, z + aabb.f);
hitBox.setBlockHitBox(block);
return hitBox;
}
use of org.apache.tapestry5.Block in project tapestry-5 by apache.
the class DocumentLinkerImpl method addContentToBody.
/**
* Adds {@code <script>} elements for the RequireJS library, then any statically includes JavaScript libraries
* (including JavaScript stack virtual assets), then the initialization script block.
*
* @param body
* element to add the dynamic scripting to
*/
protected void addContentToBody(Element body) {
if (enablePageloadingMask) {
// This adds a mask element to the page, based on the Bootstrap modal dialog backdrop. The mark
// is present immediately, but fades in visually after a short delay, and is removed
// after page initialization is complete. For a client that doesn't have JavaScript enabled,
// this will do nothing (though I suspect the page will not behave to expectations!).
Element script = body.element("script", "type", "text/javascript");
script.raw("document.write(\"<div class=\\\"pageloading-mask\\\"><div></div></div>\");");
script.moveToTop(body);
}
moduleManager.writeConfiguration(body, moduleConfigurationCallbacks);
for (String url : coreLibraryURLs) {
body.element("script", "type", "text/javascript", "src", url);
}
// Write the initialization at this point.
moduleManager.writeInitialization(body, libraryURLs, initsManager.getSortedInits());
}
use of org.apache.tapestry5.Block in project tapestry-5 by apache.
the class DynamicTemplateSaxParser method block.
private DynamicTemplateElement block(final String blockId) {
Location location = getLocation();
removeContent();
return createBlockElement(blockId, location);
}
Aggregations