The last of the Imperfect Rituals + Tile handles lightning
This commit is contained in:
parent
6fc22c170e
commit
b419e9aae9
|
@ -4,11 +4,15 @@ import WayofTime.bloodmagic.api.registry.ImperfectRitualRegistry;
|
|||
import WayofTime.bloodmagic.api.ritual.imperfect.ImperfectRitual;
|
||||
import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitualNight;
|
||||
import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitualRain;
|
||||
import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitualResistance;
|
||||
import WayofTime.bloodmagic.ritual.imperfect.ImperfectRitualZombie;
|
||||
|
||||
public class ModRituals {
|
||||
|
||||
public static ImperfectRitual imperfectNight;
|
||||
public static ImperfectRitual imperfectRain;
|
||||
public static ImperfectRitual imperfectResistance;
|
||||
public static ImperfectRitual imperfectZombie;
|
||||
|
||||
public static void initRituals() {
|
||||
|
||||
|
@ -19,5 +23,9 @@ public class ModRituals {
|
|||
ImperfectRitualRegistry.registerRitual(imperfectNight);
|
||||
imperfectRain = new ImperfectRitualRain();
|
||||
ImperfectRitualRegistry.registerRitual(imperfectRain);
|
||||
imperfectResistance = new ImperfectRitualResistance();
|
||||
ImperfectRitualRegistry.registerRitual(imperfectResistance);
|
||||
imperfectZombie = new ImperfectRitualZombie();
|
||||
ImperfectRitualRegistry.registerRitual(imperfectZombie);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,14 +16,9 @@ public class ImperfectRitualNight extends ImperfectRitual {
|
|||
@Override
|
||||
public boolean onActivate(IImperfectRitualStone imperfectRitualStone, EntityPlayer player) {
|
||||
|
||||
boolean retFlag = false;
|
||||
|
||||
if (!imperfectRitualStone.getWorld().isRemote) {
|
||||
imperfectRitualStone.getWorld().addWeatherEffect(new EntityLightningBolt(imperfectRitualStone.getWorld(), imperfectRitualStone.getPos().getX(), imperfectRitualStone.getPos().getY() + 2, imperfectRitualStone.getPos().getZ()));
|
||||
if (!imperfectRitualStone.getWorld().isRemote)
|
||||
imperfectRitualStone.getWorld().setWorldTime((imperfectRitualStone.getWorld().getWorldTime() / 24000) * 24000 + 13800);
|
||||
retFlag = true;
|
||||
}
|
||||
|
||||
return retFlag;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,12 +15,8 @@ public class ImperfectRitualRain extends ImperfectRitual {
|
|||
|
||||
@Override
|
||||
public boolean onActivate(IImperfectRitualStone imperfectRitualStone, EntityPlayer player) {
|
||||
boolean retFlag = false;
|
||||
|
||||
if (!imperfectRitualStone.getWorld().isRemote) {
|
||||
imperfectRitualStone.getWorld().addWeatherEffect(new EntityLightningBolt(imperfectRitualStone.getWorld(), imperfectRitualStone.getPos().getX(), imperfectRitualStone.getPos().getY() + 2, imperfectRitualStone.getPos().getZ()));
|
||||
imperfectRitualStone.getWorld().getWorldInfo().setRaining(true);
|
||||
retFlag = true;
|
||||
}
|
||||
|
||||
if (imperfectRitualStone.getWorld().isRemote) {
|
||||
|
@ -28,6 +24,6 @@ public class ImperfectRitualRain extends ImperfectRitual {
|
|||
imperfectRitualStone.getWorld().setThunderStrength(1.0F);
|
||||
}
|
||||
|
||||
return retFlag;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package WayofTime.bloodmagic.ritual.imperfect;
|
||||
|
||||
import WayofTime.bloodmagic.api.BlockStack;
|
||||
import WayofTime.bloodmagic.api.ritual.imperfect.IImperfectRitualStone;
|
||||
import WayofTime.bloodmagic.api.ritual.imperfect.ImperfectRitual;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
public class ImperfectRitualResistance extends ImperfectRitual {
|
||||
|
||||
public ImperfectRitualResistance() {
|
||||
super("resistance", new BlockStack(Blocks.bedrock), 5000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivate(IImperfectRitualStone imperfectRitualStone, EntityPlayer player) {
|
||||
|
||||
player.addPotionEffect(new PotionEffect(Potion.resistance.id, 1200, 1));
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package WayofTime.bloodmagic.ritual.imperfect;
|
||||
|
||||
import WayofTime.bloodmagic.api.BlockStack;
|
||||
import WayofTime.bloodmagic.api.ritual.imperfect.IImperfectRitualStone;
|
||||
import WayofTime.bloodmagic.api.ritual.imperfect.ImperfectRitual;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
|
||||
public class ImperfectRitualZombie extends ImperfectRitual {
|
||||
|
||||
public ImperfectRitualZombie() {
|
||||
super("zombie", new BlockStack(Blocks.coal_block), 5000);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onActivate(IImperfectRitualStone imperfectRitualStone, EntityPlayer player) {
|
||||
EntityZombie zombie = new EntityZombie(imperfectRitualStone.getWorld());
|
||||
zombie.setPosition(imperfectRitualStone.getPos().getX() + 0.5, imperfectRitualStone.getPos().getY() + 2.1, imperfectRitualStone.getPos().getZ() + 0.5);
|
||||
zombie.addPotionEffect(new PotionEffect(Potion.fireResistance.getId(), 2000));
|
||||
zombie.addPotionEffect(new PotionEffect(Potion.damageBoost.getId(), 20000, 7));
|
||||
zombie.addPotionEffect(new PotionEffect(Potion.resistance.getId(), 20000, 3));
|
||||
|
||||
if (!imperfectRitualStone.getWorld().isRemote)
|
||||
imperfectRitualStone.getWorld().spawnEntityInWorld(zombie);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -5,6 +5,7 @@ import WayofTime.bloodmagic.api.ritual.imperfect.IImperfectRitualStone;
|
|||
import WayofTime.bloodmagic.api.ritual.imperfect.ImperfectRitual;
|
||||
import WayofTime.bloodmagic.api.util.helper.NetworkHelper;
|
||||
import lombok.NoArgsConstructor;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockPos;
|
||||
|
@ -20,7 +21,9 @@ public class TileImperfectRitualStone extends TileEntity implements IImperfectRi
|
|||
|
||||
if (imperfectRitual != null && ImperfectRitualRegistry.ritualEnabled(imperfectRitual)) {
|
||||
NetworkHelper.getSoulNetwork(player.getDisplayNameString(), world).syphonAndDamage(imperfectRitual.getActivationCost());
|
||||
return imperfectRitual.onActivate(this, player);
|
||||
if (imperfectRitual.onActivate(this, player))
|
||||
if (imperfectRitual.isLightshow())
|
||||
getWorld().addWeatherEffect(new EntityLightningBolt(getWorld(), getPos().getX(), getPos().getY() + 2, getPos().getZ()));
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue