mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-14 17:56:34 -04:00
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:
parent
6d46cfa478
commit
155bf0702c
@ -1022,15 +1022,10 @@ opencomputers {
|
|||||||
# Radius in blocks of the disintegration behavior for each active input.
|
# Radius in blocks of the disintegration behavior for each active input.
|
||||||
disintegrationRange: 1
|
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.
|
# 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 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
|
# in case of a number it has to be the potion ID. Add any potion effects
|
||||||
# *bad* potion effects, since they will all be enabled by default.
|
|
||||||
potionBlacklist: [
|
|
||||||
]
|
|
||||||
|
|
||||||
# Whitelisted potions, see potionBlacklist. Add *good* potion effects
|
|
||||||
# to make use of here, since they will all be disabled by default.
|
# to make use of here, since they will all be disabled by default.
|
||||||
potionWhitelist: [
|
potionWhitelist: [
|
||||||
"potion.moveSpeed",
|
"potion.moveSpeed",
|
||||||
@ -1042,7 +1037,17 @@ opencomputers {
|
|||||||
"potion.waterBreathing",
|
"potion.waterBreathing",
|
||||||
"potion.nightVision",
|
"potion.nightVision",
|
||||||
"potion.healthBoost",
|
"potion.healthBoost",
|
||||||
"potion.absorption"
|
"potion.absorption",
|
||||||
|
|
||||||
|
"potion.blindness",
|
||||||
|
"potion.confusion",
|
||||||
|
"potion.digSlowDown",
|
||||||
|
"potion.harm",
|
||||||
|
"potion.hunger",
|
||||||
|
"potion.moveSlowdown",
|
||||||
|
"potion.poison",
|
||||||
|
"potion.weakness",
|
||||||
|
"potion.wither"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,7 +14,6 @@ import scala.collection.convert.WrapAsScala._
|
|||||||
object PotionProvider extends ScalaProvider("c29e4eec-5a46-479a-9b3d-ad0f06da784a") {
|
object PotionProvider extends ScalaProvider("c29e4eec-5a46-479a-9b3d-ad0f06da784a") {
|
||||||
// Lazy to give other mods a chance to register their potions.
|
// Lazy to give other mods a chance to register their potions.
|
||||||
lazy val PotionWhitelist = filterPotions(Settings.get.nanomachinePotionWhitelist)
|
lazy val PotionWhitelist = filterPotions(Settings.get.nanomachinePotionWhitelist)
|
||||||
lazy val PotionBlacklist = filterPotions(Settings.get.nanomachinePotionBlacklist)
|
|
||||||
|
|
||||||
def filterPotions[T](list: Iterable[T]) = {
|
def filterPotions[T](list: Iterable[T]) = {
|
||||||
list.map {
|
list.map {
|
||||||
@ -26,7 +25,7 @@ object PotionProvider extends ScalaProvider("c29e4eec-5a46-479a-9b3d-ad0f06da784
|
|||||||
}.toSet
|
}.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) = {
|
override def createScalaBehaviors(player: EntityPlayer) = {
|
||||||
Potion.potionTypes.filter(isPotionEligible).map(new PotionBehavior(_, player))
|
Potion.potionTypes.filter(isPotionEligible).map(new PotionBehavior(_, player))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user