Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wand aspect list display added, IAspectContainer display fixed #3524

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ dependencies {
compileOnly ("mrtjp:ProjectRed:${config.projred.version}:dev") {
exclude module: 'CoFHCore'
}
compileOnly "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev"
// compileOnly "coloredlightscore:ColoredLightsCore:${config.coloredlights.version}:api"

compileOnly name: 'buildcraft', version: config.bc.version, classifier: 'dev', ext: 'jar'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,41 @@ import java.util

import li.cil.oc.api.driver.Converter
import net.minecraft.item.ItemStack
import thaumcraft.api.aspects.AspectList
import thaumcraft.api.aspects.{AspectList, IAspectContainer}
import thaumcraft.common.items.wands.ItemWandCasting

import scala.collection.convert.WrapAsScala._

object ConverterAspectItem extends Converter {
override def convert(value: scala.Any, output: util.Map[AnyRef, AnyRef]): Unit = value match {
case stack: ItemStack if stack.hasTagCompound =>
val aspects = new AspectList()
var aspects = new AspectList()
aspects.readFromNBT(stack.getTagCompound)
output += "aspects" -> aspects
if (aspects.size() > 0)
output += "aspects" -> aspects
stack.getItem match {
case wand : ItemWandCasting =>
aspects = wand.getAllVis(stack)
if (aspects.size() > 0) {
output += "aspects" -> aspects
}
case _ =>
}

case container : IAspectContainer =>
output += "aspects" -> container.getAspects

case aspects : AspectList =>
var i = 1
for (aspect <- aspects.getAspects) {
if (aspect != null) {
val aspectMap = new util.HashMap[AnyRef, AnyRef]()
aspectMap += "name" -> aspect.getName
aspectMap += "amount" -> aspects.getAmount(aspect).asInstanceOf[AnyRef]
output += i.asInstanceOf[AnyRef] -> aspectMap
i += 1;
}
}
case _ =>
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ object ModThaumcraft extends ModProxy {

override def initialize() {
Driver.add(new DriverAspectContainer)

Driver.add(new ConverterIAspectContainer)
Driver.add(ConverterAspectItem)
}
}