Initial 1.11.2 update
This commit is contained in:
@@ -19,38 +19,40 @@ import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@Mod.EventBusSubscriber
|
||||
public class PotionFrost extends Potion implements ICustomPotionParticles {
|
||||
|
||||
|
||||
private static final ResourceLocation ICON = new ResourceLocation(Wizardry.MODID, "textures/gui/frost_icon.png");
|
||||
|
||||
public PotionFrost(boolean isBadEffect, int liquidColour) {
|
||||
public PotionFrost(boolean isBadEffect, int liquidColour){
|
||||
super(isBadEffect, liquidColour);
|
||||
// This needs to be here because registerPotionAttributeModifier doesn't like it if the potion has no name yet.
|
||||
this.setPotionName("potion.wizardry:frost");
|
||||
// With -0.5 as the 'amount', frost 1 slows the entity down by a half and frost 2 roots it to the spot
|
||||
this.registerPotionAttributeModifier(SharedMonsterAttributes.MOVEMENT_SPEED, "35dded48-2f19-4541-8510-b29e2dc2cd51", -Constants.FROST_SLOWNESS_PER_LEVEL, 2);
|
||||
this.registerPotionAttributeModifier(SharedMonsterAttributes.MOVEMENT_SPEED,
|
||||
"35dded48-2f19-4541-8510-b29e2dc2cd51", -Constants.FROST_SLOWNESS_PER_LEVEL, 2);
|
||||
// More UUIDs: 85602e0b-4801-4a87-94f3-bf617c97014e
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performEffect(EntityLivingBase entitylivingbase, int strength) {
|
||||
public void performEffect(EntityLivingBase entitylivingbase, int strength){
|
||||
// Nothing here because this potion works on attribute modifiers.
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void spawnCustomParticle(World world, double x, double y, double z) {
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, world, x, y, z, 0, -0.02, 0, 15 + world.rand.nextInt(5));
|
||||
public void spawnCustomParticle(World world, double x, double y, double z){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, world, x, y, z, 0, -0.02, 0,
|
||||
15 + world.rand.nextInt(5));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderInventoryEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc) {
|
||||
mc.renderEngine.bindTexture(ICON);
|
||||
WizardryUtilities.drawTexturedRect(x + 6, y + 7, 0, 0, 18, 18, 18, 18);
|
||||
}
|
||||
|
||||
public void renderInventoryEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc){
|
||||
mc.renderEngine.bindTexture(ICON);
|
||||
WizardryUtilities.drawTexturedRect(x + 6, y + 7, 0, 0, 18, 18, 18, 18);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderHUDEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc, float alpha) {
|
||||
public void renderHUDEffect(int x, int y, PotionEffect effect, net.minecraft.client.Minecraft mc, float alpha){
|
||||
mc.renderEngine.bindTexture(ICON);
|
||||
WizardryUtilities.drawTexturedRect(x + 3, y + 3, 0, 0, 18, 18, 18, 18);
|
||||
}
|
||||
@@ -59,7 +61,8 @@ public class PotionFrost extends Potion implements ICustomPotionParticles {
|
||||
public static void onBreakSpeedEvent(BreakSpeed event){
|
||||
if(event.getEntityPlayer().isPotionActive(WizardryPotions.frost)){
|
||||
// Amplifier + 1 because it starts at 0
|
||||
event.setNewSpeed(event.getOriginalSpeed() * (1 - Constants.FROST_FATIGUE_PER_LEVEL*(event.getEntityPlayer().getActivePotionEffect(WizardryPotions.frost).getAmplifier() + 1)));
|
||||
event.setNewSpeed(event.getOriginalSpeed() * (1 - Constants.FROST_FATIGUE_PER_LEVEL
|
||||
* (event.getEntityPlayer().getActivePotionEffect(WizardryPotions.frost).getAmplifier() + 1)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user