Basic sigils implementation
This commit is contained in:
parent
ae85224003
commit
5dff08380d
61 changed files with 1394 additions and 106 deletions
|
@ -0,0 +1,13 @@
|
|||
package WayofTime.bloodmagic.potion;
|
||||
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class PotionBloodMagic extends Potion {
|
||||
|
||||
public PotionBloodMagic(String name, ResourceLocation texture, boolean badEffect, int potionColor, int iconIndexX, int iconIndexY) {
|
||||
super(texture, badEffect, potionColor);
|
||||
this.setPotionName(name);
|
||||
this.setIconIndex(iconIndexX, iconIndexY);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package WayofTime.bloodmagic.potion;
|
||||
|
||||
import WayofTime.bloodmagic.registry.ModPotions;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.event.entity.living.LivingEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PotionEventHandlers {
|
||||
|
||||
public PotionEventHandlers() {
|
||||
MinecraftForge.EVENT_BUS.register(this);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingJumpEvent(LivingEvent.LivingJumpEvent event) {
|
||||
if (event.entityLiving.isPotionActive(ModPotions.boost)) {
|
||||
int i = event.entityLiving.getActivePotionEffect(ModPotions.boost).getAmplifier();
|
||||
event.entityLiving.motionY += (0.1f) * (2 + i);
|
||||
}
|
||||
|
||||
// if (event.entityLiving.isPotionActive(ModPotions.heavyHeart)) {
|
||||
// event.entityLiving.motionY = 0;
|
||||
// }
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEntityUpdate(LivingEvent.LivingUpdateEvent event) {
|
||||
// EntityLivingBase entityLiving = event.entityLiving;
|
||||
// double x = entityLiving.posX;
|
||||
// double y = entityLiving.posY;
|
||||
// double z = entityLiving.posZ;
|
||||
|
||||
|
||||
if (event.entityLiving.isPotionActive(ModPotions.boost)) {
|
||||
int i = event.entityLiving.getActivePotionEffect(ModPotions.boost).getAmplifier();
|
||||
{
|
||||
float percentIncrease = (i + 1) * 0.05f;
|
||||
|
||||
if (event.entityLiving instanceof EntityPlayer) {
|
||||
EntityPlayer entityPlayer = (EntityPlayer) event.entityLiving;
|
||||
entityPlayer.stepHeight = 1.0f;
|
||||
|
||||
if ((entityPlayer.onGround || entityPlayer.capabilities.isFlying) && entityPlayer.moveForward > 0F)
|
||||
entityPlayer.moveFlying(0F, 1F, entityPlayer.capabilities.isFlying ? (percentIncrease / 2.0f) : percentIncrease);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue