mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-27 15:33:08 +00:00
Shim to avoid potion idmap shifting on startup. Closes #148
This commit is contained in:
1 parent
076a7ee23a
commit
ae89d0f18d
5 files changed
+63
-33
No files matched your search
@@ -0,0 +1,26 @@
|
||||
package vazkii.botania.api.brew;
|
||||
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraftforge.fml.common.registry.GameData;
|
||||
|
||||
// Version of PotionEffect that doesn't use number ID's
|
||||
// See https://github.com/MinecraftForge/MinecraftForge/issues/2374
|
||||
// todo 1.9 remove?
|
||||
public class PotionEffectShim {
|
||||
|
||||
public final Potion potion;
|
||||
public final int duration;
|
||||
public final int amplifier;
|
||||
|
||||
public PotionEffectShim(Potion potion, int duration, int amplifier) {
|
||||
this.potion = potion;
|
||||
this.duration = duration;
|
||||
this.amplifier = amplifier;
|
||||
}
|
||||
|
||||
public PotionEffect toVanilla() {
|
||||
return new PotionEffect(GameData.getPotionRegistry().getId(potion), duration, amplifier, true, true);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user