use of WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone in project BloodMagic by WayofTime.
the class EntityMinorDemonGrunt method onUpdate.
/**
* Called to update the entity's position/logic.
*/
@Override
public void onUpdate() {
if (!this.enthralled) {
TileEntity tile = this.worldObj.getTileEntity(this.demonPortal.xCoord, this.demonPortal.yCoord, this.demonPortal.zCoord);
if (tile instanceof TEDemonPortal) {
((TEDemonPortal) tile).enthrallDemon(this);
this.enthralled = true;
} else if (tile instanceof IMasterRitualStone) {
IMasterRitualStone stone = (IMasterRitualStone) tile;
LocalRitualStorage stor = stone.getLocalStorage();
if (stor instanceof LocalStorageAlphaPact) {
LocalStorageAlphaPact storage = (LocalStorageAlphaPact) stor;
storage.thrallDemon(this);
}
}
}
super.onUpdate();
}
use of WayofTime.alchemicalWizardry.api.rituals.IMasterRitualStone in project BloodMagic by WayofTime.
the class RitualDivinerRender method render.
@SubscribeEvent
public void render(RenderWorldLastEvent event) {
Minecraft minecraft = Minecraft.getMinecraft();
EntityClientPlayerMP player = minecraft.thePlayer;
World world = player.worldObj;
if (minecraft.objectMouseOver == null || minecraft.objectMouseOver.typeOfHit != MovingObjectPosition.MovingObjectType.BLOCK) {
return;
}
TileEntity tileEntity = world.getTileEntity(minecraft.objectMouseOver.blockX, minecraft.objectMouseOver.blockY, minecraft.objectMouseOver.blockZ);
if (!(tileEntity instanceof IMasterRitualStone)) {
return;
}
Vector3 vec3 = new Vector3(minecraft.objectMouseOver.blockX, minecraft.objectMouseOver.blockY, minecraft.objectMouseOver.blockZ);
double posX = player.lastTickPosX + (player.posX - player.lastTickPosX) * event.partialTicks;
double posY = player.lastTickPosY + (player.posY - player.lastTickPosY) * event.partialTicks;
double posZ = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * event.partialTicks;
if (player.inventory.getCurrentItem() != null && player.inventory.getCurrentItem().getItem() instanceof ItemRitualDiviner) {
ItemRitualDiviner ritualDiviner = (ItemRitualDiviner) player.inventory.getCurrentItem().getItem();
int direction = ritualDiviner.getDirection(player.inventory.getCurrentItem());
RitualEffect ritualEffect = getEffectFromString(ritualDiviner.getCurrentRitual(player.inventory.getCurrentItem()));
if (ritualEffect == null) {
return;
}
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
for (RitualComponent ritualComponent : ritualEffect.getRitualComponentList()) {
Vector3 vX = vec3.add(new Vector3(ritualComponent.getX(direction), ritualComponent.getY(), ritualComponent.getZ(direction)));
double minX = vX.x - posX;
double minY = vX.y - posY;
double minZ = vX.z - posZ;
if (!world.getBlock(vX.x, vX.y, vX.z).isOpaqueCube()) {
RenderFakeBlocks.drawFakeBlock(vX, ModBlocks.ritualStone, ritualComponent.getStoneType(), minX, minY, minZ, world);
}
}
GL11.glPopMatrix();
}
}
Aggregations