Initial 1.11.2 update
This commit is contained in:
@@ -17,6 +17,7 @@ import net.minecraftforge.fml.common.registry.IForgeRegistry;
|
||||
|
||||
/**
|
||||
* Class responsible for defining, storing and registering all of wizardry's potion effects.
|
||||
*
|
||||
* @author Electroblob
|
||||
* @since Wizardry 2.1
|
||||
*/
|
||||
@@ -25,48 +26,52 @@ public final class WizardryPotions {
|
||||
|
||||
/* Interestingly, setting the colour to black stops the particles from rendering. This is great, however, the black
|
||||
* colour then 'mixes' with other potions that are applied. Whilst this is a bit annoying, for the amount it is
|
||||
* likely to get noticed it is certainly preferable to always making showParticles false, because now I can give
|
||||
* the user the option (via commands) of having one of my potion effects without particles, and more importantly
|
||||
* the potion effect HUD still gets displayed. TODO: Backport to 1.7.10, assuming it also works in that version.
|
||||
* This means also changing whenever the potion effect is added such that it is NOT ambient. */
|
||||
|
||||
* likely to get noticed it is certainly preferable to always making showParticles false, because now I can give the
|
||||
* user the option (via commands) of having one of my potion effects without particles, and more importantly the
|
||||
* potion effect HUD still gets displayed. TODO: Backport to 1.7.10, assuming it also works in that version. This
|
||||
* means also changing whenever the potion effect is added such that it is NOT ambient. */
|
||||
|
||||
public static final Potion frost = new PotionFrost(true, 0); // Colour was 0x38ddec (was arbitrary anyway)
|
||||
|
||||
|
||||
public static final Potion transience = new PotionMagicEffectParticles(false, 0, 0){
|
||||
@Override
|
||||
public void spawnCustomParticle(World world, double x, double y, double z){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DUST, world, x, y, z, 0, 0, 0, (int)(16.0D / (Math.random() * 0.8D + 0.2D)), 0.8f, 0.8f, 1.0f);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DUST, world, x, y, z, 0, 0, 0,
|
||||
(int)(16.0D / (Math.random() * 0.8D + 0.2D)), 0.8f, 0.8f, 1.0f);
|
||||
}
|
||||
}.setBeneficial(); //0xffe89b
|
||||
|
||||
}.setBeneficial(); // 0xffe89b
|
||||
|
||||
public static final Potion fireskin = new PotionMagicEffectParticles(false, 0, 1){
|
||||
@Override
|
||||
public void spawnCustomParticle(World world, double x, double y, double z){
|
||||
world.spawnParticle(EnumParticleTypes.FLAME, x, y, z, 0, 0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void performEffect(EntityLivingBase entitylivingbase, int strength){
|
||||
entitylivingbase.extinguish(); // Stops melee mobs that are on fire from setting the player on fire,
|
||||
// without allowing the player to actually stand in fire or swim in lava without taking damage.
|
||||
};
|
||||
}.setBeneficial(); //0xff2f02
|
||||
|
||||
}.setBeneficial(); // 0xff2f02
|
||||
|
||||
public static final Potion ice_shroud = new PotionMagicEffectParticles(false, 0, 2){
|
||||
@Override
|
||||
public void spawnCustomParticle(World world, double x, double y, double z){
|
||||
float brightness = 0.5f + (world.rand.nextFloat()/2);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x, y, z, 0, 0, 0, 48 + world.rand.nextInt(12), brightness, brightness + 0.1f, 1.0f, true, 0);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, world, x, y, z, 0, -0.02, 0, 40 + world.rand.nextInt(10));
|
||||
float brightness = 0.5f + (world.rand.nextFloat() / 2);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x, y, z, 0, 0, 0,
|
||||
48 + world.rand.nextInt(12), brightness, brightness + 0.1f, 1.0f, true, 0);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, world, x, y, z, 0, -0.02, 0,
|
||||
40 + world.rand.nextInt(10));
|
||||
}
|
||||
}.setBeneficial(); //0x52f1ff
|
||||
|
||||
}.setBeneficial(); // 0x52f1ff
|
||||
|
||||
public static final Potion static_aura = new PotionMagicEffectParticles(false, 0, 3){
|
||||
@Override
|
||||
public void spawnCustomParticle(World world, double x, double y, double z){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, x, y, z, 0, 0, 0, 3);
|
||||
}
|
||||
}.setBeneficial(); //0x0070ff
|
||||
|
||||
}.setBeneficial(); // 0x0070ff
|
||||
|
||||
public static final Potion decay = new PotionDecay(true, 0x3c006c);
|
||||
public static final Potion sixth_sense = new PotionMagicEffect(false, 0xc6ff01, 4).setBeneficial();
|
||||
public static final Potion arcane_jammer = new PotionMagicEffect(false, 0xcf4aa2, 5);
|
||||
@@ -79,10 +84,11 @@ public final class WizardryPotions {
|
||||
* Sets both the registry and unlocalised names of the given potion, then registers it with the given registry. Use
|
||||
* this instead of {@link potion#setRegistryName(String)} and {@link potion#setUnlocalizedName(String)} during
|
||||
* construction, for convenience and consistency.
|
||||
*
|
||||
* @param registry The registry to register the given potion to.
|
||||
* @param potion The potion to register.
|
||||
* @param name The name of the potion, without the mod ID or the .name stuff. The registry name will be
|
||||
* {@code wizardry:[name]}. The unlocalised name will be {@code potion.wizardry:[name].name}.
|
||||
* {@code wizardry:[name]}. The unlocalised name will be {@code potion.wizardry:[name].name}.
|
||||
*/
|
||||
public static void registerPotion(IForgeRegistry<Potion> registry, Potion potion, String name){
|
||||
potion.setRegistryName(Wizardry.MODID, name);
|
||||
@@ -90,12 +96,12 @@ public final class WizardryPotions {
|
||||
potion.setPotionName("potion." + potion.getRegistryName().toString());
|
||||
registry.register(potion);
|
||||
}
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public static void register(RegistryEvent.Register<Potion> event){
|
||||
|
||||
IForgeRegistry<Potion> registry = event.getRegistry();
|
||||
|
||||
|
||||
registerPotion(registry, frost, "frost");
|
||||
registerPotion(registry, transience, "transience");
|
||||
registerPotion(registry, fireskin, "fireskin");
|
||||
|
||||
Reference in New Issue
Block a user