FUCK YOU MINECRAFT. Because *obviously* Potion.isBadEffect is client side only FOR NO FUCKING REASON. [/rant] So yeah, whitelist only it is.

This commit is contained in:
Florian Nücke 2015-09-18 13:02:34 +02:00
parent 6d46cfa478
commit 155bf0702c
2 changed files with 14 additions and 10 deletions

View File

@ -1022,15 +1022,10 @@ opencomputers {
# Radius in blocks of the disintegration behavior for each active input.
disintegrationRange: 1
# Blacklisted potions, i.e. potions that won't be used for the potion
# Whitelisted potions, i.e. potions that will be used for the potion
# behaviors nanomachines may trigger. This can contain strings or numbers.
# In the case of strings, it has to be the internal name of the potion,
# in case of a number it has to be the potion ID. Use this to disable
# *bad* potion effects, since they will all be enabled by default.
potionBlacklist: [
]
# Whitelisted potions, see potionBlacklist. Add *good* potion effects
# in case of a number it has to be the potion ID. Add any potion effects
# to make use of here, since they will all be disabled by default.
potionWhitelist: [
"potion.moveSpeed",
@ -1042,7 +1037,17 @@ opencomputers {
"potion.waterBreathing",
"potion.nightVision",
"potion.healthBoost",
"potion.absorption"
"potion.absorption",
"potion.blindness",
"potion.confusion",
"potion.digSlowDown",
"potion.harm",
"potion.hunger",
"potion.moveSlowdown",
"potion.poison",
"potion.weakness",
"potion.wither"
]
}

View File

@ -14,7 +14,6 @@ import scala.collection.convert.WrapAsScala._
object PotionProvider extends ScalaProvider("c29e4eec-5a46-479a-9b3d-ad0f06da784a") {
// Lazy to give other mods a chance to register their potions.
lazy val PotionWhitelist = filterPotions(Settings.get.nanomachinePotionWhitelist)
lazy val PotionBlacklist = filterPotions(Settings.get.nanomachinePotionBlacklist)
def filterPotions[T](list: Iterable[T]) = {
list.map {
@ -26,7 +25,7 @@ object PotionProvider extends ScalaProvider("c29e4eec-5a46-479a-9b3d-ad0f06da784
}.toSet
}
def isPotionEligible(potion: Potion) = potion != null && (if (potion.isBadEffect) !PotionBlacklist.contains(potion) else PotionWhitelist.contains(potion))
def isPotionEligible(potion: Potion) = potion != null && PotionWhitelist.contains(potion)
override def createScalaBehaviors(player: EntityPlayer) = {
Potion.potionTypes.filter(isPotionEligible).map(new PotionBehavior(_, player))