Updating the BS

This commit is contained in:
Alastors committed 2023-03-05 12:27:06 -05:00
1 parent 8e2bb2310a
commit a6cf603c63
49 files changed
+706 -608

No files matched your search

+125 -26
View File
@@ -1,4 +1,4 @@
//version: 1676031737
//version: 1678003329
/*
DO NOT CHANGE THIS FILE!
Also, you may replace this file at any time if there is an update available.
@@ -20,6 +20,7 @@ import cpw.mods.fml.relauncher.Side
import org.gradle.api.tasks.options.Option;
import org.gradle.internal.logging.text.StyledTextOutput.Style
import org.gradle.internal.logging.text.StyledTextOutputFactory
import org.gradle.internal.xml.XmlTransformer
import org.jetbrains.gradle.ext.*
import java.nio.file.Files
@@ -31,7 +32,6 @@ import javax.inject.Inject
buildscript {
repositories {
mavenLocal()
mavenCentral()
maven {
@@ -52,6 +52,8 @@ buildscript {
name 'Scala CI dependencies'
url 'https://repo1.maven.org/maven2/'
}
mavenLocal()
}
}
plugins {
@@ -71,7 +73,7 @@ plugins {
id 'com.diffplug.spotless' version '6.7.2' apply false
id 'com.modrinth.minotaur' version '2.+' apply false
id 'com.matthewprenger.cursegradle' version '1.4.0' apply false
id 'com.gtnewhorizons.retrofuturagradle' version '1.1.6'
id 'com.gtnewhorizons.retrofuturagradle' version '1.2.3'
}
boolean settingsupdated = verifySettingsGradle()
settingsupdated = verifyGitAttributes() || settingsupdated
@@ -127,6 +129,9 @@ propertyDefaultIfUnset("gradleTokenGroupName", "")
propertyDefaultIfUnset("enableModernJavaSyntax", false) // On by default for new projects only
propertyDefaultIfUnset("enableGenericInjection", false) // On by default for new projects only
// this is meant to be set using the user wide property file. by default we do nothing.
propertyDefaultIfUnset("ideaOverrideBuildType", "") // Can be nothing, "gradle" or "idea"
project.extensions.add(Blowdryer, "Blowdryer", Blowdryer) // Make blowdryer available in "apply from:" scripts
if (!disableSpotless) {
apply plugin: 'com.diffplug.spotless'
@@ -148,7 +153,7 @@ java {
} else {
languageVersion.set(projectJavaVersion)
}
vendor.set(JvmVendorSpec.ADOPTIUM)
vendor.set(JvmVendorSpec.AZUL)
}
if (!noPublishedSources) {
withSourcesJar()
@@ -217,7 +222,7 @@ if (enableModernJavaSyntax.toBoolean()) {
javaCompiler.set(javaToolchains.compilerFor {
languageVersion.set(JavaLanguageVersion.of(17))
vendor.set(JvmVendorSpec.ADOPTIUM)
vendor.set(JvmVendorSpec.AZUL)
})
}
}
@@ -249,12 +254,14 @@ if (apiPackage) {
}
if (accessTransformersFile) {
String targetFile = "src/main/resources/META-INF/" + accessTransformersFile
if (!getFile(targetFile).exists()) {
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
for (atFile in accessTransformersFile.split(",")) {
String targetFile = "src/main/resources/META-INF/" + atFile.trim()
if (!getFile(targetFile).exists()) {
throw new GradleException("Could not resolve \"accessTransformersFile\"! Could not find " + targetFile)
}
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(targetFile)
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(targetFile)
}
tasks.deobfuscateMergedJarToSrg.accessTransformerFiles.from(targetFile)
tasks.srgifyBinpatchedJar.accessTransformerFiles.from(targetFile)
} else {
boolean atsFound = false
for (File at : sourceSets.getByName("main").resources.files) {
@@ -382,6 +389,10 @@ minecraft {
injectMissingGenerics.set(true)
}
username = developmentEnvironmentUserName.toString()
lwjgl3Version = "3.3.2-SNAPSHOT"
// Enable assertions in the current mod
extraRunJvmArguments.add("-ea:${modGroup}")
@@ -455,8 +466,9 @@ repositories.configureEach { repo ->
apply from: 'repositories.gradle'
configurations {
runtimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
testRuntimeClasspath.extendsFrom(runtimeOnlyNonPublishable)
for (config in [compileClasspath, runtimeClasspath, testCompileClasspath, testRuntimeClasspath]) {
config.extendsFrom(runtimeOnlyNonPublishable)
if (usesShadowedDependencies.toBoolean()) {
config.extendsFrom(shadowImplementation)
// TODO: remove Compile after all uses are refactored to Implementation
@@ -509,6 +521,13 @@ repositories {
}
}
}
maven {
name 'sonatype'
url 'https://oss.sonatype.org/content/repositories/snapshots/'
content {
includeGroup "org.lwjgl"
}
}
if (includeWellKnownRepositories.toBoolean()) {
maven {
name "CurseMaven"
@@ -545,20 +564,20 @@ dependencies {
annotationProcessor('org.ow2.asm:asm-debug-all:5.0.3')
annotationProcessor('com.google.guava:guava:24.1.1-jre')
annotationProcessor('com.google.code.gson:gson:2.8.6')
annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.12:processor')
annotationProcessor('com.gtnewhorizon:gtnhmixins:2.1.13:processor')
if (usesMixinDebug.toBoolean()) {
runtimeOnlyNonPublishable('org.jetbrains:intellij-fernflower:1.2.1.16')
}
}
if (usesMixins.toBoolean() || forceEnableMixins.toBoolean()) {
implementation('com.gtnewhorizon:gtnhmixins:2.1.12')
implementation('com.gtnewhorizon:gtnhmixins:2.1.13')
}
}
pluginManager.withPlugin('org.jetbrains.kotlin.kapt') {
if (usesMixins.toBoolean()) {
dependencies {
kapt('com.gtnewhorizon:gtnhmixins:2.1.12:processor')
kapt('com.gtnewhorizon:gtnhmixins:2.1.13:processor')
}
}
}
@@ -667,17 +686,22 @@ ext.java17Toolchain = (JavaToolchainSpec spec) -> {
spec.vendor.set(JvmVendorSpec.matching("jetbrains"))
}
ext.java17DependenciesCfg = configurations.create("java17Dependencies")
ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies")
ext.java17DependenciesCfg = configurations.create("java17Dependencies") {
extendsFrom(configurations.getByName("runtimeClasspath")) // Ensure consistent transitive dependency resolution
canBeConsumed = false
}
ext.java17PatchDependenciesCfg = configurations.create("java17PatchDependencies") {
canBeConsumed = false
}
dependencies {
def lwjgl3ifyVersion = '1.1.21'
def lwjgl3ifyVersion = '1.1.35'
def asmVersion = '9.4'
if (modId != 'lwjgl3ify') {
java17Dependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}")
}
if (modId != 'hodgepodge') {
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.31')
java17Dependencies('com.github.GTNewHorizons:Hodgepodge:2.0.40')
}
java17PatchDependencies('net.minecraft:launchwrapper:1.15') {transitive = false}
@@ -688,14 +712,14 @@ dependencies {
java17PatchDependencies("org.ow2.asm:asm-util:${asmVersion}")
java17PatchDependencies('org.ow2.asm:asm-deprecated:7.1')
java17PatchDependencies("org.apache.commons:commons-lang3:3.12.0")
java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches")
java17PatchDependencies("com.github.GTNewHorizons:lwjgl3ify:${lwjgl3ifyVersion}:forgePatches") {transitive = false}
}
ext.java17JvmArgs = [
// Java 9+ support
"--illegal-access=warn",
"-Dfile.encoding=UTF-8",
"-Djava.security.manager=allow",
"-Dfile.encoding=UTF-8",
"--add-opens", "java.base/jdk.internal.loader=ALL-UNNAMED",
"--add-opens", "java.base/java.net=ALL-UNNAMED",
"--add-opens", "java.base/java.nio=ALL-UNNAMED",
@@ -706,6 +730,7 @@ ext.java17JvmArgs = [
"--add-opens", "java.base/java.util=ALL-UNNAMED",
"--add-opens", "java.base/jdk.internal.reflect=ALL-UNNAMED",
"--add-opens", "java.base/sun.nio.ch=ALL-UNNAMED",
"--add-opens", "jdk.naming.dns/com.sun.jndi.dns=ALL-UNNAMED,java.naming",
"--add-opens", "java.desktop/sun.awt.image=ALL-UNNAMED",
"--add-modules", "jdk.dynalink",
"--add-opens", "jdk.dynalink/jdk.dynalink.beans=ALL-UNNAMED",
@@ -750,8 +775,8 @@ public abstract class RunHotswappableMinecraftTask extends RunMinecraftTask {
public boolean setEnableHotswap(boolean enable) { enableHotswap = enable }
@Inject
public RunHotswappableMinecraftTask(Side side, String superTask) {
super(side)
public RunHotswappableMinecraftTask(Side side, String superTask, org.gradle.api.invocation.Gradle gradle) {
super(side, gradle)
this.lwjglVersion = 3
this.javaLauncher = project.javaToolchains.launcherFor(project.java17Toolchain)
@@ -782,6 +807,8 @@ runClient17Task.configure {
description = "Runs the modded client using Java 17, lwjgl3ify and Hodgepodge"
dependsOn(setupHotswapAgentTask, mcpTasks.launcherSources.classesTaskName, minecraftTasks.taskDownloadVanillaAssets, mcpTasks.taskPackagePatchedMc, 'jar')
mainClass = "GradleStart"
username = minecraft.username
userUUID = minecraft.userUUID
}
def runServer17Task = tasks.register("runServer17", RunHotswappableMinecraftTask, Side.SERVER, "runServer")
@@ -828,7 +855,7 @@ if (usesShadowedDependencies.toBoolean()) {
tasks.register('relocateShadowJar', ConfigureShadowRelocation) {
target = tasks.shadowJar
prefix = modGroup + ".shadow"
enabled = minimizeShadowedDependencies.toBoolean()
enabled = relocateShadowedDependencies.toBoolean()
}
tasks.named("shadowJar", ShadowJar).configure {
manifest {
@@ -844,7 +871,7 @@ if (usesShadowedDependencies.toBoolean()) {
project.configurations.shadeCompile
]
archiveClassifier.set('dev')
if (minimizeShadowedDependencies.toBoolean()) {
if (relocateShadowedDependencies.toBoolean()) {
dependsOn(relocateShadowJar)
}
}
@@ -905,6 +932,19 @@ idea {
}
project {
settings {
if (ideaOverrideBuildType != "") {
delegateActions {
if ("gradle".equalsIgnoreCase(ideaOverrideBuildType)) {
delegateBuildRunToGradle = true
testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.GRADLE
} else if ("idea".equalsIgnoreCase(ideaOverrideBuildType)) {
delegateBuildRunToGradle = false
testRunner = org.jetbrains.gradle.ext.ActionDelegationConfig.TestRunner.PLATFORM
} else {
throw GradleScriptException('Accepted value for ideaOverrideBuildType is one of gradle or idea.')
}
}
}
runConfigurations {
"1. Run Client"(Gradle) {
taskNames = ["runClient"]
@@ -943,7 +983,7 @@ idea {
}
"Run Client (IJ Native)"(Application) {
mainClass = "GradleStart"
moduleName = project.name + ".main"
moduleName = project.name + ".ideVirtualMain"
afterEvaluate {
workingDirectory = tasks.runClient.workingDir.absolutePath
programParameters = tasks.runClient.calculateArgs(project).collect { '"' + it + '"' }.join(' ')
@@ -954,7 +994,7 @@ idea {
}
"Run Server (IJ Native)"(Application) {
mainClass = "GradleStartServer"
moduleName = project.name + ".main"
moduleName = project.name + ".ideVirtualMain"
afterEvaluate {
workingDirectory = tasks.runServer.workingDir.absolutePath
programParameters = tasks.runServer.calculateArgs(project).collect { '"' + it + '"' }.join(' ')
@@ -971,6 +1011,51 @@ idea {
]
}
}
withIDEADir { File ideaDir ->
if (!ideaDir.path.contains(".idea")) {
// If an .ipr file exists, the project root directory is passed here instead of the .idea subdirectory
ideaDir = new File(ideaDir, ".idea")
}
if (ideaDir.isDirectory()) {
def miscFile = new File(ideaDir, "misc.xml")
if (miscFile.isFile()) {
boolean dirty = false
def miscTransformer = new XmlTransformer()
miscTransformer.addAction { root ->
Node rootNode = root.asNode()
def rootManager = rootNode
.component.find { it.@name == 'ProjectRootManager' }
if (!rootManager) {
rootManager = rootNode.appendNode('component', ['name': 'ProjectRootManager', 'version': '2'])
dirty = true
}
def output = rootManager.output
if (!output) {
output = rootManager.appendNode('output')
dirty = true
}
if (!output.@url) {
// Only modify the output url if it doesn't yet have one, or if the existing one is blank somehow.
// This is a sensible default for most setups
output.@url = 'file://$PROJECT_DIR$/build/ideaBuild'
dirty = true
}
}
def result = miscTransformer.transform(miscFile.text)
if (dirty) {
miscFile.write(result)
}
} else {
miscFile.text = """<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2">
<output url="file://\$PROJECT_DIR\$/out" />
</component>
</project>
"""
}
}
}
}
}
}
@@ -1118,10 +1203,21 @@ def addCurseForgeRelation(String type, String name) {
}
// Updating
def buildscriptGradleVersion = "8.0.1"
tasks.named('wrapper', Wrapper).configure {
gradleVersion = buildscriptGradleVersion
}
tasks.register('updateBuildScript') {
group = 'GTNH Buildscript'
description = 'Updates the build script to the latest version'
if (gradle.gradleVersion != buildscriptGradleVersion && !Boolean.getBoolean('DISABLE_BUILDSCRIPT_GRADLE_UPDATE')) {
dependsOn('wrapper')
}
doLast {
if (performBuildScriptUpdate()) return
@@ -1134,6 +1230,9 @@ if (!project.getGradle().startParameter.isOffline() && !Boolean.getBoolean('DISA
performBuildScriptUpdate()
} else {
out.style(Style.SuccessHeader).println("Build script update available! Run 'gradle updateBuildScript'")
if (gradle.gradleVersion != buildscriptGradleVersion) {
out.style(Style.SuccessHeader).println("updateBuildScript can update gradle from ${gradle.gradleVersion} to ${buildscriptGradleVersion}\n")
}
}
}
+3 -3
View File
@@ -1,3 +1,4 @@
pluginManagement {
repositories {
maven {
@@ -20,9 +21,8 @@ plugins {
id 'org.gradle.toolchains.foojay-resolver-convention' version '0.4.0' // Provides java toolchains
}
apply plugin: 'com.diffplug.blowdryerSetup'
blowdryerSetup {
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.1.5')
repoSubfolder 'gtnhShared'
github('GTNewHorizons/ExampleMod1.7.10', 'tag', '0.2.0')
//devLocal '.' // Use this when testing config updates locally
}
@@ -4,5 +4,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
public interface IPurifyingGear {
int getPurity(ItemStack var1, EntityPlayer var2);
}
@@ -1,15 +1,18 @@
package thaumicinsurgence.api;
import java.util.ArrayList;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import thaumcraft.api.ThaumcraftApiHelper;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.crafting.InfusionRecipe;
public class InfusionAlphaRecipe extends InfusionRecipe {
protected AspectList aspects;
protected String research;
private ItemStack[] components;
@@ -17,8 +20,8 @@ public class InfusionAlphaRecipe extends InfusionRecipe {
protected Object recipeOutput;
protected int instability;
public InfusionAlphaRecipe(
String research, Object output, int inst, AspectList aspects2, ItemStack input, ItemStack[] recipe) {
public InfusionAlphaRecipe(String research, Object output, int inst, AspectList aspects2, ItemStack input,
ItemStack[] recipe) {
super(research, output, inst, aspects2, input, recipe);
this.research = research;
this.recipeOutput = output;
@@ -33,46 +36,46 @@ public class InfusionAlphaRecipe extends InfusionRecipe {
return false;
} else if (this.research.length() > 0
&& !ThaumcraftApiHelper.isResearchComplete(player.getCommandSenderName(), this.research)) {
return false;
} else {
ItemStack i2 = central.copy();
if (this.getRecipeInput().getItemDamage() == 32767) {
i2.setItemDamage(32767);
}
if (!areItemStacksEqual(i2, this.getRecipeInput(), true)) {
return false;
} else {
ArrayList<ItemStack> ii = new ArrayList();
for (ItemStack is : input) {
ii.add(is.copy());
}
for (ItemStack comp : this.getComponents()) {
boolean b = false;
for (int a = 0; a < ii.size(); ++a) {
i2 = ((ItemStack) ii.get(a)).copy();
if (comp.getItemDamage() == 32767) {
i2.setItemDamage(32767);
}
if (areItemStacksEqual(i2, comp, true)) {
ii.remove(a);
b = true;
break;
}
return false;
} else {
ItemStack i2 = central.copy();
if (this.getRecipeInput().getItemDamage() == 32767) {
i2.setItemDamage(32767);
}
if (!b) {
if (!areItemStacksEqual(i2, this.getRecipeInput(), true)) {
return false;
} else {
ArrayList<ItemStack> ii = new ArrayList();
for (ItemStack is : input) {
ii.add(is.copy());
}
for (ItemStack comp : this.getComponents()) {
boolean b = false;
for (int a = 0; a < ii.size(); ++a) {
i2 = ((ItemStack) ii.get(a)).copy();
if (comp.getItemDamage() == 32767) {
i2.setItemDamage(32767);
}
if (areItemStacksEqual(i2, comp, true)) {
ii.remove(a);
b = true;
break;
}
}
if (!b) {
return false;
}
}
return ii.size() == 0;
}
}
return ii.size() == 0;
}
}
}
public static boolean areItemStacksEqual(ItemStack stack0, ItemStack stack1, boolean fuzzy) {
@@ -90,17 +93,15 @@ public class InfusionAlphaRecipe extends InfusionRecipe {
if (fuzzy) {
Integer od = Integer.valueOf(OreDictionary.getOreID(stack0));
if (od.intValue() != -1) {
ItemStack[] ores =
(ItemStack[]) OreDictionary.getOres(od).toArray(new ItemStack[0]);
if (ThaumcraftApiHelper.containsMatch(false, new ItemStack[] {stack1}, ores)) {
ItemStack[] ores = (ItemStack[]) OreDictionary.getOres(od).toArray(new ItemStack[0]);
if (ThaumcraftApiHelper.containsMatch(false, new ItemStack[] { stack1 }, ores)) {
return true;
}
}
}
boolean damage = stack0.getItemDamage() == stack1.getItemDamage() || stack1.getItemDamage() == 32767;
return stack0.getItem() != stack1.getItem()
? false
return stack0.getItem() != stack1.getItem() ? false
: (!damage ? false : stack0.stackSize <= stack0.getMaxStackSize());
}
}
@@ -1,13 +1,14 @@
package thaumicinsurgence.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import thaumicinsurgence.main.utils.TabThaumicInsurgence;
import thaumicinsurgence.main.utils.VersionInfo;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockArcaneMarble extends Block {
@@ -1,13 +1,14 @@
package thaumicinsurgence.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import thaumicinsurgence.main.utils.TabThaumicInsurgence;
import thaumicinsurgence.main.utils.VersionInfo;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockArcaneMarbleBrick extends Block {
@@ -1,7 +1,5 @@
package thaumicinsurgence.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -13,9 +11,12 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import thaumicinsurgence.main.utils.TabThaumicInsurgence;
import thaumicinsurgence.main.utils.VersionInfo;
import thaumicinsurgence.tileentity.TileEntityInfusionFucker;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockInfusionFucker extends BlockContainer {
@@ -37,8 +38,8 @@ public class BlockInfusionFucker extends BlockContainer {
}
@Override
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7,
float par8, float par9) {
return false;
}
@@ -1,8 +1,7 @@
package thaumicinsurgence.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
@@ -11,11 +10,14 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import thaumcraft.common.blocks.BlockStoneDevice;
import thaumcraft.common.lib.utils.InventoryUtils;
import thaumicinsurgence.main.Config;
import thaumicinsurgence.main.utils.TabThaumicInsurgence;
import thaumicinsurgence.tileentity.TileEntityInfusionMatrixAlpha;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockInfusionMatrixAlpha extends BlockStoneDevice {
@@ -66,8 +68,8 @@ public class BlockInfusionMatrixAlpha extends BlockStoneDevice {
}
@Override
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int side, float par7, float par8, float par9) {
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float par7,
float par8, float par9) {
if (world.isRemote) {
return true;
} else {
@@ -78,8 +80,8 @@ public class BlockInfusionMatrixAlpha extends BlockStoneDevice {
}
@Override
public void addCollisionBoxesToList(
World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List arraylist, Entity par7Entity) {
public void addCollisionBoxesToList(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List arraylist,
Entity par7Entity) {
int metadata = world.getBlockMetadata(i, j, k);
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
@@ -1,8 +1,7 @@
package thaumicinsurgence.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
@@ -11,10 +10,13 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import thaumcraft.common.blocks.BlockStoneDevice;
import thaumcraft.common.lib.utils.InventoryUtils;
import thaumicinsurgence.main.Config;
import thaumicinsurgence.tileentity.TileEntityInfusionPillarAlpha;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockInfusionPillarAlpha extends BlockStoneDevice {
@@ -65,8 +67,8 @@ public class BlockInfusionPillarAlpha extends BlockStoneDevice {
}
@Override
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int side, float par7, float par8, float par9) {
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float par7,
float par8, float par9) {
if (world.isRemote) {
return true;
} else {
@@ -74,12 +76,12 @@ public class BlockInfusionPillarAlpha extends BlockStoneDevice {
// TileEntity tileEntity = world.getTileEntity(x, y, z);
return super.onBlockActivated(world, x, y, z, player, side, par7, par8, par9);
}
// return super.onBlockActivated(world, x, y, z, player, side, par7, par8, par9);
// return super.onBlockActivated(world, x, y, z, player, side, par7, par8, par9);
}
@Override
public void addCollisionBoxesToList(
World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List arraylist, Entity par7Entity) {
public void addCollisionBoxesToList(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List arraylist,
Entity par7Entity) {
int metadata = world.getBlockMetadata(i, j, k);
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity);
@@ -1,7 +1,5 @@
package thaumicinsurgence.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
@@ -10,14 +8,18 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import thaumcraft.common.blocks.BlockStoneDevice;
import thaumcraft.common.lib.utils.InventoryUtils;
import thaumcraft.common.tiles.*;
import thaumicinsurgence.main.Config;
import thaumicinsurgence.main.utils.TabThaumicInsurgence;
import thaumicinsurgence.main.utils.VersionInfo;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockPedestalAlpha extends BlockStoneDevice {
public IIcon[] iconPedestal = new IIcon[2];
public BlockPedestalAlpha() {
@@ -36,7 +38,7 @@ public class BlockPedestalAlpha extends BlockStoneDevice {
} else {
return this.iconPedestal[0];
}
// return this.iconPedestal[1];
// return this.iconPedestal[1];
}
public IIcon getIcon(IBlockAccess iblockaccess, int i, int j, int k, int side) {
@@ -77,8 +79,8 @@ public class BlockPedestalAlpha extends BlockStoneDevice {
super.setBlockBoundsBasedOnState(world, i, j, k);
}
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int side, float par7, float par8, float par9) {
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float par7,
float par8, float par9) {
// player.addChatMessage(new ChatComponentText("this is happening I guess"));
if (world.isRemote) {
return true;
@@ -1,7 +1,5 @@
package thaumicinsurgence.block;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
@@ -13,12 +11,16 @@ import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import thaumcraft.api.crafting.IInfusionStabiliser;
import thaumicinsurgence.main.utils.TabThaumicInsurgence;
import thaumicinsurgence.main.utils.VersionInfo;
import thaumicinsurgence.tileentity.TileEntityStabilizerTesting;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockStabilizerTesting extends BlockContainer implements IInfusionStabiliser {
public TileEntity createNewTileEntity(World world, int metadata) {
return new TileEntityStabilizerTesting();
}
@@ -36,8 +38,8 @@ public class BlockStabilizerTesting extends BlockContainer implements IInfusionS
}
@Override
public boolean onBlockActivated(
World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) {
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7,
float par8, float par9) {
boolean activate = false;
return activate;
@@ -1,31 +1,33 @@
package thaumicinsurgence.common;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import thaumicinsurgence.api.IPurifyingGear;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
public class EventHandlerRunic extends thaumcraft.common.lib.events.EventHandlerRunic {
@SubscribeEvent
public void tooltipEvent(ItemTooltipEvent event) {
int purity = getFinalPurity(event.itemStack, event.entityPlayer);
if (purity > 0) {
event.toolTip.add(
EnumChatFormatting.GOLD + StatCollector.translateToLocal("item.purifying") + " " + purity);
event.toolTip
.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("item.purifying") + " " + purity);
}
int charge = getFinalCharge(event.itemStack);
if (charge > 0) {
event.toolTip.add(
EnumChatFormatting.GOLD + StatCollector.translateToLocal("item.runic.charge") + " +" + charge);
event.toolTip
.add(EnumChatFormatting.GOLD + StatCollector.translateToLocal("item.runic.charge") + " +" + charge);
}
int warp = getFinalWarp(event.itemStack, event.entityPlayer);
if (warp > 0) {
event.toolTip.add(
EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("item.warping") + " " + warp);
event.toolTip
.add(EnumChatFormatting.DARK_PURPLE + StatCollector.translateToLocal("item.warping") + " " + warp);
}
}
@@ -1,19 +1,22 @@
package thaumicinsurgence.item;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import thaumicinsurgence.item.types.ResourceType;
import thaumicinsurgence.main.utils.TabThaumicInsurgence;
import thaumicinsurgence.main.utils.VersionInfo;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemMiscResources extends Item {
private IIcon[] icons = new IIcon[ResourceType.values().length];
public ItemMiscResources() {
@@ -34,11 +37,11 @@ public class ItemMiscResources extends Item {
@Override
@SideOnly(Side.CLIENT)
@SuppressWarnings({"unchecked"})
@SuppressWarnings({ "unchecked" })
public void getSubItems(Item item, CreativeTabs tabs, List list) {
for (ResourceType type : ResourceType.values()) {
if (type.showInList) {
// list.add(this.getStackForType(type));
// list.add(this.getStackForType(type));
}
}
}
@@ -1,9 +1,8 @@
package thaumicinsurgence.item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.List;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
@@ -20,6 +19,7 @@ import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.IIcon;
import net.minecraft.util.StatCollector;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.common.Thaumcraft;
@@ -32,8 +32,11 @@ import thaumcraft.common.lib.network.playerdata.PacketAspectPool;
import thaumcraft.common.lib.network.playerdata.PacketResearchComplete;
import thaumcraft.common.lib.research.ResearchManager;
import thaumcraft.common.lib.utils.InventoryUtils;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemResource extends Item {
public IIcon[] icon = new IIcon[1];
private IIcon iconOverlay;
@@ -60,8 +63,7 @@ public class ItemResource extends Item {
@SideOnly(Side.CLIENT)
public IIcon getIcon(ItemStack stack, int pass) {
return pass != 0 && this.getAspects(stack) != null
? this.iconOverlay
return pass != 0 && this.getAspects(stack) != null ? this.iconOverlay
: this.getIconFromDamage(stack.getItemDamage());
}
@@ -92,8 +94,7 @@ public class ItemResource extends Item {
public void onUpdate(ItemStack stack, World world, Entity entity, int par4, boolean par5) {
super.onUpdate(stack, world, entity, par4, par5);
if (!entity.worldObj.isRemote
&& (stack.getItemDamage() == 11 || stack.getItemDamage() == 12)
if (!entity.worldObj.isRemote && (stack.getItemDamage() == 11 || stack.getItemDamage() == 12)
&& entity instanceof EntityLivingBase
&& !((EntityLivingBase) entity).isEntityUndead()
&& !((EntityLivingBase) entity).isPotionActive(Config.potionTaintPoisonID)
@@ -137,66 +138,58 @@ public class ItemResource extends Item {
EntityAspectOrb orb = new EntityAspectOrb(world, entity.posX, entity.posY, entity.posZ, aspect, 1);
world.spawnEntityInWorld(orb);
}
} else if (r == 42
&& entity instanceof EntityPlayer
&& !ResearchManager.isResearchComplete(
((EntityPlayer) entity).getCommandSenderName(), "FOCUSPRIMAL")
&& !ResearchManager.isResearchComplete(
((EntityPlayer) entity).getCommandSenderName(), "@FOCUSPRIMAL")) {
((EntityPlayer) entity)
.addChatMessage(new ChatComponentTranslation(
"§5§o" + StatCollector.translateToLocal("tc.primalcharm.trigger"), new Object[0]));
PacketHandler.INSTANCE.sendTo(new PacketResearchComplete("@FOCUSPRIMAL"), (EntityPlayerMP) entity);
Thaumcraft.proxy.getResearchManager().completeResearch((EntityPlayer) entity, "@FOCUSPRIMAL");
}
} else if (r == 42 && entity instanceof EntityPlayer
&& !ResearchManager
.isResearchComplete(((EntityPlayer) entity).getCommandSenderName(), "FOCUSPRIMAL")
&& !ResearchManager
.isResearchComplete(((EntityPlayer) entity).getCommandSenderName(), "@FOCUSPRIMAL")) {
((EntityPlayer) entity).addChatMessage(
new ChatComponentTranslation(
"§5§o" + StatCollector.translateToLocal("tc.primalcharm.trigger"),
new Object[0]));
PacketHandler.INSTANCE
.sendTo(new PacketResearchComplete("@FOCUSPRIMAL"), (EntityPlayerMP) entity);
Thaumcraft.proxy.getResearchManager()
.completeResearch((EntityPlayer) entity, "@FOCUSPRIMAL");
}
}
}
public boolean onItemUse(
ItemStack itemstack,
EntityPlayer player,
World world,
int x,
int y,
int z,
int par7,
float par8,
float par9,
float par10) {
public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7,
float par8, float par9, float par10) {
if (itemstack.getItemDamage() != 1) {
return super.onItemUse(itemstack, player, world, x, y, z, par7, par8, par9, par10);
} else {
Block var11 = world.getBlock(x, y, z);
if (var11 == Blocks.snow_layer && (world.getBlockMetadata(x, y, z) & 7) < 1) {
par7 = 1;
} else if (var11 != Blocks.vine
&& var11 != Blocks.tallgrass
} else if (var11 != Blocks.vine && var11 != Blocks.tallgrass
&& var11 != Blocks.deadbush
&& !var11.isReplaceable(world, x, y, z)) {
if (par7 == 0) {
--y;
}
if (par7 == 0) {
--y;
}
if (par7 == 1) {
++y;
}
if (par7 == 1) {
++y;
}
if (par7 == 2) {
--z;
}
if (par7 == 2) {
--z;
}
if (par7 == 3) {
++z;
}
if (par7 == 3) {
++z;
}
if (par7 == 4) {
--x;
}
if (par7 == 4) {
--x;
}
if (par7 == 5) {
++x;
}
}
if (par7 == 5) {
++x;
}
}
if (itemstack.stackSize == 0) {
return false;
@@ -234,19 +227,8 @@ public class ItemResource extends Item {
}
}
public boolean placeBlockAt(
ItemStack stack,
EntityPlayer player,
World world,
int x,
int y,
int z,
int side,
float hitX,
float hitY,
float hitZ,
Block bid,
int metadata) {
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side,
float hitX, float hitY, float hitZ, Block bid, int metadata) {
if (!world.setBlock(x, y, z, bid, metadata, 3)) {
return false;
} else {
@@ -283,8 +265,9 @@ public class ItemResource extends Item {
new PacketAspectPool(
a.getTag(),
Short.valueOf(q),
Short.valueOf(Thaumcraft.proxy.playerKnowledge.getAspectPoolFor(
player.getCommandSenderName(), a))),
Short.valueOf(
Thaumcraft.proxy.playerKnowledge
.getAspectPoolFor(player.getCommandSenderName(), a))),
(EntityPlayerMP) player);
}
}
@@ -1,7 +1,5 @@
package thaumicinsurgence.item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
@@ -9,13 +7,17 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.config.Config;
import thaumcraft.common.config.ConfigBlocks;
import thaumcraft.common.items.ItemSanitySoap;
import thaumicinsurgence.main.utils.TabThaumicInsurgence;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemSanitySoapAlpha extends ItemSanitySoap {
@SideOnly(Side.CLIENT)
public IIcon icon;
@@ -109,8 +111,8 @@ public class ItemSanitySoapAlpha extends ItemSanitySoap {
true);
}
} else {
player.worldObj.playSound(
player.posX, player.posY, player.posZ, "thaumcraft:craftstart", 0.25F, 1.0F, false);
player.worldObj
.playSound(player.posX, player.posY, player.posZ, "thaumcraft:craftstart", 0.25F, 1.0F, false);
for (int a = 0; a < Thaumcraft.proxy.particleCount(20); ++a) {
Thaumcraft.proxy.crucibleBubble(
@@ -1,7 +1,5 @@
package thaumicinsurgence.item;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
@@ -9,13 +7,17 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.config.Config;
import thaumcraft.common.config.ConfigBlocks;
import thaumcraft.common.items.ItemSanitySoap;
import thaumicinsurgence.main.utils.TabThaumicInsurgence;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemSanitySoapBeta extends ItemSanitySoap {
@SideOnly(Side.CLIENT)
public IIcon icon;
@@ -107,8 +109,8 @@ public class ItemSanitySoapBeta extends ItemSanitySoap {
Thaumcraft.addWarpToPlayer(player, 2, true);
}
} else {
player.worldObj.playSound(
player.posX, player.posY, player.posZ, "thaumcraft:craftstart", 0.25F, 1.0F, false);
player.worldObj
.playSound(player.posX, player.posY, player.posZ, "thaumcraft:craftstart", 0.25F, 1.0F, false);
for (int a = 0; a < Thaumcraft.proxy.particleCount(20); ++a) {
Thaumcraft.proxy.crucibleBubble(
@@ -1,7 +1,5 @@
package thaumicinsurgence.item.armor;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -9,14 +7,18 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import thaumcraft.api.*;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.nodes.IRevealer;
import thaumcraft.common.items.armor.ItemGoggles;
import thaumicinsurgence.main.utils.TabThaumicInsurgence;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemBIGSHOT extends ItemGoggles
implements IRepairable, IVisDiscountGear, IRevealer, IGoggles, IRunicArmor, IWarpingGear {
public IIcon icon;
public ItemBIGSHOT(final ArmorMaterial material, final int j, final int k) {
@@ -54,8 +56,7 @@ public class ItemBIGSHOT extends ItemGoggles
public void onUpdate(final ItemStack stack, final World world, final Entity entity, final int i, final boolean b) {
super.onUpdate(stack, world, entity, i, b);
if (!world.isRemote
&& stack.isItemDamaged()
if (!world.isRemote && stack.isItemDamaged()
&& entity.ticksExisted % 20 == 0
&& entity instanceof EntityLivingBase) {
stack.damageItem(-1, (EntityLivingBase) entity);
@@ -1,7 +1,5 @@
package thaumicinsurgence.item.armor;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -9,15 +7,19 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import thaumcraft.api.*;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.nodes.IRevealer;
import thaumcraft.common.items.armor.ItemGoggles;
import thaumicinsurgence.api.IPurifyingGear;
import thaumicinsurgence.main.utils.TabThaumicInsurgence;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemBIGSHOT2 extends ItemGoggles
implements IRepairable, IVisDiscountGear, IRevealer, IGoggles, IRunicArmor, IPurifyingGear {
public IIcon icon;
public ItemBIGSHOT2(final ArmorMaterial material, final int j, final int k) {
@@ -55,8 +57,7 @@ public class ItemBIGSHOT2 extends ItemGoggles
public void onUpdate(final ItemStack stack, final World world, final Entity entity, final int i, final boolean b) {
super.onUpdate(stack, world, entity, i, b);
if (!world.isRemote
&& stack.isItemDamaged()
if (!world.isRemote && stack.isItemDamaged()
&& entity.ticksExisted % 20 == 0
&& entity instanceof EntityLivingBase) {
stack.damageItem(-1, (EntityLivingBase) entity);
@@ -1,7 +1,5 @@
package thaumicinsurgence.item.armor;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -9,6 +7,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import thaumcraft.api.IGoggles;
import thaumcraft.api.IRepairable;
import thaumcraft.api.IRunicArmor;
@@ -17,9 +16,12 @@ import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.nodes.IRevealer;
import thaumcraft.common.items.armor.ItemGoggles;
import thaumicinsurgence.main.utils.TabThaumicInsurgence;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemEightBitRedCrown extends ItemGoggles
implements IRepairable, IVisDiscountGear, IRevealer, IGoggles, IRunicArmor {
public IIcon icon;
public ItemEightBitRedCrown(final ArmorMaterial material, final int j, final int k) {
@@ -52,8 +54,7 @@ public class ItemEightBitRedCrown extends ItemGoggles
public void onUpdate(final ItemStack stack, final World world, final Entity entity, final int i, final boolean b) {
super.onUpdate(stack, world, entity, i, b);
if (!world.isRemote
&& stack.isItemDamaged()
if (!world.isRemote && stack.isItemDamaged()
&& entity.ticksExisted % 20 == 0
&& entity instanceof EntityLivingBase) {
stack.damageItem(-1, (EntityLivingBase) entity);
@@ -1,7 +1,5 @@
package thaumicinsurgence.item.armor;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
@@ -9,6 +7,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import thaumcraft.api.IGoggles;
import thaumcraft.api.IRepairable;
import thaumcraft.api.IRunicArmor;
@@ -17,9 +16,12 @@ import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.nodes.IRevealer;
import thaumcraft.common.items.armor.ItemGoggles;
import thaumicinsurgence.main.utils.TabThaumicInsurgence;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemRedCrown extends ItemGoggles
implements IRepairable, IVisDiscountGear, IRevealer, IGoggles, IRunicArmor {
public IIcon icon;
public ItemRedCrown(final ArmorMaterial material, final int j, final int k) {
@@ -52,8 +54,7 @@ public class ItemRedCrown extends ItemGoggles
public void onUpdate(final ItemStack stack, final World world, final Entity entity, final int i, final boolean b) {
super.onUpdate(stack, world, entity, i, b);
if (!world.isRemote
&& stack.isItemDamaged()
if (!world.isRemote && stack.isItemDamaged()
&& entity.ticksExisted % 20 == 0
&& entity instanceof EntityLivingBase) {
stack.damageItem(-1, (EntityLivingBase) entity);
@@ -1,10 +1,11 @@
package thaumicinsurgence.item.baubles;
import baubles.common.items.ItemRing;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import thaumcraft.api.IVisDiscountGear;
import thaumcraft.api.aspects.Aspect;
import baubles.common.items.ItemRing;
public class SilverRing extends ItemRing implements IVisDiscountGear {
@@ -1,7 +1,5 @@
package thaumicinsurgence.item.tools;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
@@ -12,6 +10,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import thaumcraft.common.config.ConfigBlocks;
import thaumcraft.common.tiles.TileInfusionMatrix;
import thaumcraft.common.tiles.TilePedestal;
@@ -21,8 +20,11 @@ import thaumicinsurgence.main.Config;
import thaumicinsurgence.main.utils.TabThaumicInsurgence;
import thaumicinsurgence.tileentity.TileEntityInfusionMatrixAlpha;
import thaumicinsurgence.tileentity.TileEntityInfusionPillarAlpha;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemAlastorsWand extends Item {
public TileEntity matrix;
public ItemAlastorsWand() {
@@ -41,17 +43,8 @@ public class ItemAlastorsWand extends Item {
}
@Override
public boolean onItemUseFirst(
ItemStack stack,
EntityPlayer player,
World world,
int targetX,
int targetY,
int targetZ,
int side,
float hitX,
float hitY,
float hitZ) {
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int targetX, int targetY,
int targetZ, int side, float hitX, float hitY, float hitZ) {
if (!world.isRemote) {
matrix = world.getTileEntity(targetX, targetY, targetZ);
Block bottom[] = new Block[4], middle[] = new Block[4];
@@ -59,8 +52,7 @@ public class ItemAlastorsWand extends Item {
boolean bottomLayer = true, middleLayer = true, topLayer = true;
if (matrix instanceof TileInfusionMatrix) {
String[] users =
MinecraftServer.getServer().getConfigurationManager().getAllUsernames();
String[] users = MinecraftServer.getServer().getConfigurationManager().getAllUsernames();
player.addChatMessage(new ChatComponentText("That's a big ass mudspaw right der"));
// gets the bottom four bricks
@@ -101,23 +93,23 @@ public class ItemAlastorsWand extends Item {
world.setBlock(targetX - 1, targetY - 1, targetZ + 1, ConfigBlocks.blockStoneDevice, 4, 3);
world.setBlock(targetX + 1, targetY - 2, targetZ + 1, Config.pillarAlpha, 3, 3);
justTheTip =
(TileEntityInfusionPillarAlpha) world.getTileEntity(targetX + 1, targetY - 2, targetZ + 1);
justTheTip = (TileEntityInfusionPillarAlpha) world
.getTileEntity(targetX + 1, targetY - 2, targetZ + 1);
// 4 is the right orientation for this one.
justTheTip.orientation = 4;
world.setBlock(targetX + 1, targetY - 2, targetZ - 1, Config.pillarAlpha, 3, 3);
justTheTip =
(TileEntityInfusionPillarAlpha) world.getTileEntity(targetX + 1, targetY - 2, targetZ - 1);
justTheTip = (TileEntityInfusionPillarAlpha) world
.getTileEntity(targetX + 1, targetY - 2, targetZ - 1);
// 5 is the right orientation for this one.
justTheTip.orientation = 5;
world.setBlock(targetX - 1, targetY - 2, targetZ - 1, Config.pillarAlpha, 3, 3);
justTheTip =
(TileEntityInfusionPillarAlpha) world.getTileEntity(targetX - 1, targetY - 2, targetZ - 1);
justTheTip = (TileEntityInfusionPillarAlpha) world
.getTileEntity(targetX - 1, targetY - 2, targetZ - 1);
// 0 is the right orientation for this one.
justTheTip.orientation = 0;
world.setBlock(targetX - 1, targetY - 2, targetZ + 1, Config.pillarAlpha, 3, 3);
justTheTip =
(TileEntityInfusionPillarAlpha) world.getTileEntity(targetX - 1, targetY - 2, targetZ + 1);
justTheTip = (TileEntityInfusionPillarAlpha) world
.getTileEntity(targetX - 1, targetY - 2, targetZ + 1);
// 3 is the right orientation for this one.
justTheTip.orientation = 3;
}
@@ -133,10 +125,9 @@ public class ItemAlastorsWand extends Item {
ItemStack bs = new ItemStack(Config.matrixAlpha, 1, 2);
new ItemStack(ConfigBlocks.blockStoneDevice, 1, 1);
ItemStack[][][] blueprint = new ItemStack[][][] {
{{null, null, null}, {null, bs, null}, {null, null, null}},
{{br1, null, br1}, {null, null, null}, {br1, null, br1}},
{{br2, null, br2}, {null, null, null}, {br2, null, br2}}
};
{ { null, null, null }, { null, bs, null }, { null, null, null } },
{ { br1, null, br1 }, { null, null, null }, { br1, null, br1 } },
{ { br2, null, br2 }, { null, null, null }, { br2, null, br2 } } };
for (int yy = 0; yy < 3; ++yy) {
for (int xx = 0; xx < 3; ++xx) {
@@ -165,11 +156,8 @@ public class ItemAlastorsWand extends Item {
}
public static void replaceInfusionAltar(World world, int x, int y, int z) {
int[][][] blueprint = new int[][][] {
{{0, 0, 0}, {0, 9, 0}, {0, 0, 0}},
{{1, 0, 1}, {0, 0, 0}, {1, 0, 1}},
{{2, 0, 3}, {0, 0, 0}, {4, 0, 5}}
};
int[][][] blueprint = new int[][][] { { { 0, 0, 0 }, { 0, 9, 0 }, { 0, 0, 0 } },
{ { 1, 0, 1 }, { 0, 0, 0 }, { 1, 0, 1 } }, { { 2, 0, 3 }, { 0, 0, 0 }, { 4, 0, 5 } } };
for (int yy = 0; yy < 3; ++yy) {
for (int xx = 0; xx < 3; ++xx) {
@@ -182,16 +170,16 @@ public class ItemAlastorsWand extends Item {
if (blueprint[yy][xx][zz] > 1 && blueprint[yy][xx][zz] < 9) {
world.setBlock(x + xx, y - yy + 2, z + zz, ConfigBlocks.blockStoneDevice, 3, 3);
TileEntityInfusionPillarAlpha tip =
(TileEntityInfusionPillarAlpha) world.getTileEntity(x + xx, y - yy + 2, z + zz);
TileEntityInfusionPillarAlpha tip = (TileEntityInfusionPillarAlpha) world
.getTileEntity(x + xx, y - yy + 2, z + zz);
tip.orientation = (byte) blueprint[yy][xx][zz];
world.markBlockForUpdate(x + xx, y - yy + 2, z + zz);
world.addBlockEvent(x + xx, y - yy + 2, z + zz, ConfigBlocks.blockStoneDevice, 1, 0);
}
if (blueprint[yy][xx][zz] == 9) {
TileEntityInfusionMatrixAlpha tis =
(TileEntityInfusionMatrixAlpha) world.getTileEntity(x + xx, y - yy + 2, z + zz);
TileEntityInfusionMatrixAlpha tis = (TileEntityInfusionMatrixAlpha) world
.getTileEntity(x + xx, y - yy + 2, z + zz);
tis.active = true;
world.markBlockForUpdate(x + xx, y - yy + 2, z + zz);
}
@@ -1,7 +1,5 @@
package thaumicinsurgence.item.tools;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
@@ -12,14 +10,18 @@ import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatComponentTranslation;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.nodes.INode;
import thaumcraft.common.lib.research.ResearchManager;
import thaumcraft.common.tiles.TileInfusionMatrix;
import thaumicinsurgence.main.utils.TabThaumicInsurgence;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class ItemThaumicInterfacer extends Item {
public TileEntity matrix;
@SideOnly(Side.CLIENT)
@@ -38,45 +40,48 @@ public class ItemThaumicInterfacer extends Item {
}
@Override
public boolean onItemUseFirst(
ItemStack stack,
EntityPlayer player,
World world,
int targetX,
int targetY,
int targetZ,
int side,
float hitX,
float hitY,
float hitZ) {
public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int targetX, int targetY,
int targetZ, int side, float hitX, float hitY, float hitZ) {
if (!world.isRemote) {
matrix = world.getTileEntity(targetX, targetY, targetZ);
if (matrix instanceof TileInfusionMatrix) {
String[] users =
MinecraftServer.getServer().getConfigurationManager().getAllUsernames();
String[] users = MinecraftServer.getServer().getConfigurationManager().getAllUsernames();
player.addChatMessage(new ChatComponentText("That's a big ass mudspaw right der"));
player.addChatMessage(new ChatComponentText(users[0]));
player.addChatMessage(new ChatComponentText(
"Infusion Matrix Instability: " + String.valueOf(((TileInfusionMatrix) matrix).instability)));
} else if (world.getTileEntity(targetX, targetY, targetZ) instanceof INode) {
AspectList al = ResearchManager.reduceToPrimals(
((INode) world.getTileEntity(targetX, targetY, targetZ)).getAspects());
player.addChatMessage(
new ChatComponentTranslation("Energized Primal Aspects Equivalents within this node:"
+ " Aer: " + (int) Math.sqrt(al.getAmount(Aspect.AIR))
+ " Terra: " + (int) Math.sqrt(al.getAmount(Aspect.EARTH))
+ " Ignis: " + (int) Math.sqrt(al.getAmount(Aspect.FIRE))
+ " Aqua: " + (int) Math.sqrt(al.getAmount(Aspect.WATER))
+ " Ordo: " + (int) Math.sqrt(al.getAmount(Aspect.ORDER))
+ " Perditio: " + (int) Math.sqrt(al.getAmount(Aspect.ENTROPY))));
new ChatComponentText(
"Infusion Matrix Instability: "
+ String.valueOf(((TileInfusionMatrix) matrix).instability)));
} else if (world.getTileEntity(targetX, targetY, targetZ) instanceof INode) {
AspectList al = ResearchManager
.reduceToPrimals(((INode) world.getTileEntity(targetX, targetY, targetZ)).getAspects());
player.addChatMessage(
new ChatComponentTranslation(
"Energized Primal Aspects Equivalents within this node:" + " Aer: "
+ (int) Math.sqrt(al.getAmount(Aspect.AIR))
+ " Terra: "
+ (int) Math.sqrt(al.getAmount(Aspect.EARTH))
+ " Ignis: "
+ (int) Math.sqrt(al.getAmount(Aspect.FIRE))
+ " Aqua: "
+ (int) Math.sqrt(al.getAmount(Aspect.WATER))
+ " Ordo: "
+ (int) Math.sqrt(al.getAmount(Aspect.ORDER))
+ " Perditio: "
+ (int) Math.sqrt(al.getAmount(Aspect.ENTROPY))));
return true;
} else if (true) {
player.addChatMessage(new ChatComponentTranslation("equipment"
+ " slot one: " + player.getEquipmentInSlot(1)
+ " slot two: " + player.getEquipmentInSlot(2)
+ " slot three: " + player.getEquipmentInSlot(3)
+ " slot four: " + player.getEquipmentInSlot(4)));
player.addChatMessage(
new ChatComponentTranslation(
"equipment" + " slot one: "
+ player.getEquipmentInSlot(1)
+ " slot two: "
+ player.getEquipmentInSlot(2)
+ " slot three: "
+ player.getEquipmentInSlot(3)
+ " slot four: "
+ player.getEquipmentInSlot(4)));
} else {
player.addChatMessage(new ChatComponentText("COCK A DOODLE DO MOTHER FUCKER"));
}
@@ -3,6 +3,7 @@ package thaumicinsurgence.item.types;
import thaumicinsurgence.main.utils.LocalizationManager;
public enum ResourceType {
TC_DUST_AIR("TCairDust", true),
TC_DUST_WATER("TCwaterDust", true),
TC_DUST_FIRE("TCfireDust", true),
@@ -11,11 +12,10 @@ public enum ResourceType {
TC_DUST_CHAOS("TCchaosDust", true),
// Dummy items for Thaumanomicon research icons.
// These won't ever actually exist in-game, and so they can be moved around.
// These won't ever actually exist in-game, and so they can be moved around.
RESEARCH_STARTNODE("startNode", false),
RESEARCH_BEEINFUSION("beeInfusion", false),
RESEARCH_INSURGENCE("insurgence", false),
;
RESEARCH_INSURGENCE("insurgence", false),;
private ResourceType(String n, boolean show) {
this.name = n;
@@ -1,15 +1,8 @@
package thaumicinsurgence.main;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;
import thaumicinsurgence.renderers.blockrenderers.BlockAlphaPedestalRenderer;
import thaumicinsurgence.renderers.blockrenderers.BlockMatrixAlphaRenderer;
import thaumicinsurgence.renderers.blockrenderers.BlockPillarAlphaRenderer;
@@ -19,10 +12,19 @@ import thaumicinsurgence.renderers.tileentityrenderers.TilePillarAlphaRenderer;
import thaumicinsurgence.tileentity.TileEntityInfusionMatrixAlpha;
import thaumicinsurgence.tileentity.TileEntityInfusionPillarAlpha;
import thaumicinsurgence.tileentity.TileEntityPedestalAlpha;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SuppressWarnings("unused")
@SideOnly(Side.CLIENT)
public class ClientProxy extends CommonProxy {
@Override
public void preInit(FMLPreInitializationEvent event) {
super.preInit(event);
@@ -39,8 +41,8 @@ public class ClientProxy extends CommonProxy {
specialRenderers();
}
public void registerTileEntitySpecialRenderer(
Class<? extends TileEntity> tile, TileEntitySpecialRenderer renderer) {
public void registerTileEntitySpecialRenderer(Class<? extends TileEntity> tile,
TileEntitySpecialRenderer renderer) {
ClientRegistry.bindTileEntitySpecialRenderer(tile, renderer);
}
@@ -1,14 +1,15 @@
package thaumicinsurgence.main;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import thaumicinsurgence.main.utils.CraftingManager;
import thaumicinsurgence.main.utils.LogHelper;
import thaumicinsurgence.main.utils.compat.ModHelperManager;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
@SuppressWarnings("unused")
public class CommonProxy {
public void preInit(FMLPreInitializationEvent event) {
LogHelper.info("Preinit started");
Config.Init(event.getSuggestedConfigurationFile());
@@ -1,12 +1,10 @@
package thaumicinsurgence.main;
import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.GameRegistry;
import java.io.File;
import net.minecraft.item.Item;
import net.minecraftforge.common.config.Configuration;
import thaumcraft.api.ThaumcraftApi;
import thaumicinsurgence.block.*;
import thaumicinsurgence.block.BlockInfusionFucker;
@@ -23,6 +21,10 @@ import thaumicinsurgence.tileentity.TileEntityInfusionFucker;
import thaumicinsurgence.tileentity.TileEntityInfusionMatrixAlpha;
import thaumicinsurgence.tileentity.TileEntityInfusionPillarAlpha;
import thaumicinsurgence.tileentity.TileEntityPedestalAlpha;
import cpw.mods.fml.client.event.ConfigChangedEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.registry.GameRegistry;
/**
* A class to hold some data related to mod state & functions.
@@ -30,6 +32,7 @@ import thaumicinsurgence.tileentity.TileEntityPedestalAlpha;
* @author MysteriousAges
*/
public class Config {
public static final String CATEGORY_MODULES = "modules";
public static boolean thaumcraftActive;
@@ -106,7 +109,7 @@ public class Config {
alastorsWand = new ItemAlastorsWand();
GameRegistry.registerItem(alastorsWand, alastorsWand.getUnlocalizedName());
// miscResources = new ItemMiscResources();
// miscResources = new ItemMiscResources();
soapAlpha = new ItemSanitySoapAlpha();
GameRegistry.registerItem(soapAlpha, soapAlpha.getUnlocalizedName());
@@ -127,8 +130,7 @@ public class Config {
}
private static void doModuleConfigs() {
thaumcraftActive =
configuration.get(CATEGORY_MODULES, "Thaumcraft", true).getBoolean();
thaumcraftActive = configuration.get(CATEGORY_MODULES, "Thaumcraft", true).getBoolean();
}
public static void setupInfusionFucker() {
@@ -138,13 +140,13 @@ public class Config {
matrixAlpha = new BlockInfusionMatrixAlpha();
GameRegistry.registerBlock(matrixAlpha, "matrixAlpha");
GameRegistry.registerTileEntity(
TileEntityInfusionPillarAlpha.class, TileEntityInfusionPillarAlpha.tileEntityName);
GameRegistry
.registerTileEntity(TileEntityInfusionPillarAlpha.class, TileEntityInfusionPillarAlpha.tileEntityName);
pillarAlpha = new BlockInfusionPillarAlpha();
GameRegistry.registerBlock(pillarAlpha, "pillarAlpha");
GameRegistry.registerTileEntity(
TileEntityInfusionMatrixAlpha.class, TileEntityInfusionMatrixAlpha.tileEntityName);
GameRegistry
.registerTileEntity(TileEntityInfusionMatrixAlpha.class, TileEntityInfusionMatrixAlpha.tileEntityName);
marblePedestal = new BlockPedestalAlpha();
GameRegistry.registerBlock(marblePedestal, "marblePedestal");
@@ -1,5 +1,7 @@
package thaumicinsurgence.main;
import thaumicinsurgence.main.utils.LogHelper;
import thaumicinsurgence.main.utils.VersionInfo;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.SidedProxy;
import cpw.mods.fml.common.event.FMLInitializationEvent;
@@ -7,8 +9,6 @@ import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping;
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
import thaumicinsurgence.main.utils.LogHelper;
import thaumicinsurgence.main.utils.VersionInfo;
@SuppressWarnings("unused")
@Mod(
@@ -1,9 +1,11 @@
package thaumicinsurgence.main.utils;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.block.Block;
import cpw.mods.fml.common.registry.GameRegistry;
public class BlockInterface {
public static Block getBlock(String item) {
return GameRegistry.findBlock("Forestry", item);
}
@@ -6,6 +6,7 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class ChunkCoords {
public final int dimension;
public final int x;
public final int y;
@@ -8,22 +8,17 @@ public class CraftingManager {
}
private static void setupVanillaCrafting() {
// ItemStack input;
// ItemStack output;
// ItemStack input;
// ItemStack output;
// Magic capsules
/* output = new ItemStack(Config.magicCapsule);
output.stackSize = 4;
GameRegistry.addRecipe(new ShapedOreRecipe(output,
"WWW",
'W', "waxMagical"
)); */
/* output = output.copy();
output.stackSize = 12;
GameRegistry.addRecipe(output,
"aaa", "aFa", "aaa",
'F', input,
'a', ItemInterface.getItemStack("ash")
); */
/*
* output = new ItemStack(Config.magicCapsule); output.stackSize = 4; GameRegistry.addRecipe(new
* ShapedOreRecipe(output, "WWW", 'W', "waxMagical" ));
*/
/*
* output = output.copy(); output.stackSize = 12; GameRegistry.addRecipe(output, "aaa", "aFa", "aaa", 'F',
* input, 'a', ItemInterface.getItemStack("ash") );
*/
}
}
@@ -1,10 +1,12 @@
package thaumicinsurgence.main.utils;
import cpw.mods.fml.common.registry.GameRegistry;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import cpw.mods.fml.common.registry.GameRegistry;
public class ItemInterface {
public static ItemStack getItemStack(String item) {
return GameRegistry.findItemStack("Forestry", item, 1);
}
@@ -7,10 +7,11 @@ public class ItemStackUtils {
/**
* Attempts to add all items to the inventory, starting at startSlot and considering slotCount item slots.
*
* @return Number of items successfully added to the inventory.
*/
public static int tryAddItemStacksToInvenotry(
IInventory inventory, ItemStack[] items, int startSlot, int slotCount) {
public static int tryAddItemStacksToInvenotry(IInventory inventory, ItemStack[] items, int startSlot,
int slotCount) {
int itemsAdded = 0;
for (ItemStack item : items) {
@@ -22,10 +23,11 @@ public class ItemStackUtils {
/**
* Attempts to add all items to the inventory, starting at startSlot and considering slotCount item slots.
*
* @return true if and only if all items were successfully added to the inventory.
*/
public static boolean tryAddAllItemStacksToInventory(
IInventory inventory, ItemStack[] items, int startSlot, int slotCount) {
public static boolean tryAddAllItemStacksToInventory(IInventory inventory, ItemStack[] items, int startSlot,
int slotCount) {
int itemsToAdd = 0;
int itemsAdded = 0;
@@ -39,6 +41,7 @@ public class ItemStackUtils {
/**
* Attempts to add an item to an inventory, starting at startSlot and considering slotCount item slots.
*
* @return number of items in the stack successfully added to the inventory.
*/
public static int addItemToInventory(IInventory inventory, ItemStack item, int startSlot, int slotCount) {
@@ -3,6 +3,7 @@ package thaumicinsurgence.main.utils;
import net.minecraft.util.StatCollector;
public class LocalizationManager {
public static String getLocalizedString(String key) {
if (StatCollector.canTranslate(key)) {
return StatCollector.translateToLocal(key);
@@ -1,9 +1,11 @@
package thaumicinsurgence.main.utils;
import cpw.mods.fml.common.FMLLog;
import org.apache.logging.log4j.Level;
import cpw.mods.fml.common.FMLLog;
public class LogHelper {
public static void log(Level logLevel, Object object) {
FMLLog.log(VersionInfo.ModName, logLevel, String.valueOf(object));
}
@@ -2,9 +2,11 @@ package thaumicinsurgence.main.utils;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import thaumcraft.common.Thaumcraft;
public class TabThaumicInsurgence extends CreativeTabs {
public static TabThaumicInsurgence tabThaumicInsurgence = new TabThaumicInsurgence();
public TabThaumicInsurgence() {
@@ -1,6 +1,7 @@
package thaumicinsurgence.main.utils;
public class VersionInfo {
public static final String ModID = "GRADLETOKEN_MODID";
public static final String ModName = "GRADLETOKEN_MODNAME";
public static final String Version = "GRADLETOKEN_VERSION";
@@ -4,6 +4,7 @@ import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import thaumcraft.api.ThaumcraftApi;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
@@ -41,8 +42,7 @@ public class ThaumcraftHelper implements IModHelper {
CHARM,
VOID_INGOT,
VOID_SEED,
COIN,
;
COIN,;
}
@SuppressWarnings("unused")
@@ -78,8 +78,7 @@ public class ThaumcraftHelper implements IModHelper {
_28,
_29,
_30,
NATIVE_GOLD,
;
NATIVE_GOLD,;
}
@SuppressWarnings("unused")
@@ -90,8 +89,7 @@ public class ThaumcraftHelper implements IModHelper {
EARTH,
ORDER,
CHAOS,
BALANCED,
;
BALANCED,;
}
@SuppressWarnings("unused")
@@ -110,8 +108,7 @@ public class ThaumcraftHelper implements IModHelper {
_11,
MNEMONIC_MATRIX,
LAMP_OF_FERTILITY,
VIS_RELAY,
;
VIS_RELAY,;
}
@SuppressWarnings("unused")
@@ -124,8 +121,7 @@ public class ThaumcraftHelper implements IModHelper {
BORE,
PLANKS_GREATWOOD,
PLANKS_SILVERWOOD,
BANNER,
;
BANNER,;
}
@SuppressWarnings("unused")
@@ -135,17 +131,16 @@ public class ThaumcraftHelper implements IModHelper {
_2,
_3,
WARDING_STONE_FENCE,
ENERGIZED_NODE,
;
ENERGIZED_NODE,;
}
@SuppressWarnings("unused")
public enum Entity {
BRAINY_ZOMBIE("entBrainyZombie", "EntityBrainyZombie"),
GIANT_BRAINY_ZOMBIE("entGiantBrainyZombie", "EntityGiantBrainyZombie"),
WISP("entWisp", "EntityWisp"),
FIREBAT("entFirebat", "EntityFireBat"),
;
FIREBAT("entFirebat", "EntityFireBat"),;
private static final String packageName = "thaumcraft.common.entities.monster.";
@@ -169,15 +164,13 @@ public class ThaumcraftHelper implements IModHelper {
SHIMMERLEAF,
CINDERPEARL,
PURIFYING_PLANT,
VISHROOM,
;
VISHROOM,;
}
@SuppressWarnings("unused")
public enum TreeType {
GREATWOOD,
SILVERWOOD,
;
SILVERWOOD,;
}
public static Block plant;
@@ -255,24 +248,17 @@ public class ThaumcraftHelper implements IModHelper {
"TI_InfusionIntercepter",
new ItemStack(Config.infusionIntercepter),
10,
new AspectList()
.add(Aspect.MAGIC, 100)
.add(Aspect.HUNGER, 100)
.add(Aspect.TOOL, 75)
.add(Aspect.TRAP, 50)
.add(Aspect.MECHANISM, 50)
.add(Aspect.EXCHANGE, 25),
new AspectList().add(Aspect.MAGIC, 100).add(Aspect.HUNGER, 100).add(Aspect.TOOL, 75)
.add(Aspect.TRAP, 50).add(Aspect.MECHANISM, 50).add(Aspect.EXCHANGE, 25),
new ItemStack(metal, 1, MetalDeviceType.ALCHEMICAL_CONSTRUCT.ordinal()),
new ItemStack[] {
new ItemStack(metal, 1, MetalDeviceType.ALEMBIC.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALCHEMICAL_CONSTRUCT.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALEMBIC.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALCHEMICAL_CONSTRUCT.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALEMBIC.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALCHEMICAL_CONSTRUCT.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALEMBIC.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALCHEMICAL_CONSTRUCT.ordinal())
});
new ItemStack[] { new ItemStack(metal, 1, MetalDeviceType.ALEMBIC.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALCHEMICAL_CONSTRUCT.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALEMBIC.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALCHEMICAL_CONSTRUCT.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALEMBIC.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALCHEMICAL_CONSTRUCT.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALEMBIC.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALCHEMICAL_CONSTRUCT.ordinal()) });
thaumicInterfacer = ThaumcraftApi.addInfusionCraftingRecipe(
"TI_ThaumicInterfacer",
@@ -280,10 +266,8 @@ public class ThaumcraftHelper implements IModHelper {
64,
new AspectList().add(Aspect.FIRE, 8),
new ItemStack(ConfigItems.itemThaumometer),
new ItemStack[] {
new ItemStack(metal, 1, MetalDeviceType.ALEMBIC.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALEMBIC.ordinal())
});
new ItemStack[] { new ItemStack(metal, 1, MetalDeviceType.ALEMBIC.ordinal()),
new ItemStack(metal, 1, MetalDeviceType.ALEMBIC.ordinal()) });
soapAlpha = ThaumcraftApi.addCrucibleRecipe(
"TI_SanitizingSoapAlpha",
@@ -295,21 +279,14 @@ public class ThaumcraftHelper implements IModHelper {
"TI_SanitizingSoapBeta",
new ItemStack(Config.soapBetaBitch),
new ItemStack(Config.soapAlpha),
new AspectList()
.add(Aspect.ELDRITCH, 32)
.add(Aspect.EXCHANGE, 64)
.add(Aspect.HEAL, 64));
new AspectList().add(Aspect.ELDRITCH, 32).add(Aspect.EXCHANGE, 64).add(Aspect.HEAL, 64));
bigShot = ThaumcraftApi.addCrucibleRecipe(
"TI_DeliciousKromer",
new ItemStack(Config.hyperLinkBlocked),
new ItemStack(ConfigItems.itemGoggles),
new AspectList()
.add(Aspect.GREED, 128)
.add(Aspect.ELDRITCH, 64)
.add(Aspect.DARKNESS, 64)
.add(Aspect.EXCHANGE, 64)
.add(Aspect.TRAP, 32));
new AspectList().add(Aspect.GREED, 128).add(Aspect.ELDRITCH, 64).add(Aspect.DARKNESS, 64)
.add(Aspect.EXCHANGE, 64).add(Aspect.TRAP, 32));
}
public static void setupResearch() {
@@ -361,20 +338,21 @@ public class ThaumcraftHelper implements IModHelper {
infusionIntercepterPage = new ResearchItem(
"TI_InfusionIntercepter",
category,
new AspectList()
.add(Aspect.MAGIC, 1)
.add(Aspect.HUNGER, 1)
.add(Aspect.TOOL, 1)
.add(Aspect.TRAP, 1)
.add(Aspect.MECHANISM, 1)
.add(Aspect.EXCHANGE, 1),
new AspectList().add(Aspect.MAGIC, 1).add(Aspect.HUNGER, 1).add(Aspect.TOOL, 1).add(Aspect.TRAP, 1)
.add(Aspect.MECHANISM, 1).add(Aspect.EXCHANGE, 1),
0,
0,
0,
new ItemStack(Config.infusionIntercepter));
redCrownPage = new ResearchItem(
"TI_RedCrown", category, new AspectList(), 5, 5, 5, new ItemStack(Config.redCrownItem));
"TI_RedCrown",
category,
new AspectList(),
5,
5,
5,
new ItemStack(Config.redCrownItem));
thaumicInterfacerPage = new ResearchItem(
"TI_ThaumicInterfacer",
@@ -388,12 +366,8 @@ public class ThaumcraftHelper implements IModHelper {
littleSponge = new ResearchItem(
"TI_DeliciousKromer",
category,
new AspectList()
.add(Aspect.GREED, 1)
.add(Aspect.ELDRITCH, 1)
.add(Aspect.DARKNESS, 1)
.add(Aspect.EXCHANGE, 1)
.add(Aspect.TRAP, 1),
new AspectList().add(Aspect.GREED, 1).add(Aspect.ELDRITCH, 1).add(Aspect.DARKNESS, 1)
.add(Aspect.EXCHANGE, 1).add(Aspect.TRAP, 1),
0,
3,
0,
@@ -1,14 +1,15 @@
package thaumicinsurgence.renderers.blockrenderers;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
import thaumcraft.client.renderers.block.BlockStoneDeviceRenderer;
import thaumcraft.common.tiles.*;
import thaumicinsurgence.block.BlockPedestalAlpha;
import thaumicinsurgence.main.Config;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class BlockAlphaPedestalRenderer extends BlockStoneDeviceRenderer {
@@ -55,8 +56,8 @@ public class BlockAlphaPedestalRenderer extends BlockStoneDeviceRenderer {
}
@SideOnly(Side.CLIENT)
public boolean renderWorldBlock(
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
RenderBlocks renderer) {
block.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.25F, 1.0F);
renderer.setRenderBoundsFromBlock(block);
renderer.renderStandardBlock(block, x, y, z);
@@ -1,29 +1,32 @@
package thaumicinsurgence.renderers.blockrenderers;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import thaumcraft.client.renderers.block.BlockRenderer;
import thaumicinsurgence.main.Config;
import thaumicinsurgence.tileentity.TileEntityInfusionMatrixAlpha;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class BlockMatrixAlphaRenderer extends BlockRenderer implements ISimpleBlockRenderingHandler {
@SideOnly(Side.CLIENT)
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
TileEntityRendererDispatcher.instance.renderTileEntityAt(
new TileEntityInfusionMatrixAlpha(), 0.0D, 0.0D, 0.0D, 0.0F);
TileEntityRendererDispatcher.instance
.renderTileEntityAt(new TileEntityInfusionMatrixAlpha(), 0.0D, 0.0D, 0.0D, 0.0F);
}
@SideOnly(Side.CLIENT)
public boolean renderWorldBlock(
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
RenderBlocks renderer) {
return true;
}
@@ -1,29 +1,32 @@
package thaumicinsurgence.renderers.blockrenderers;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.world.IBlockAccess;
import org.lwjgl.opengl.GL11;
import thaumcraft.client.renderers.block.BlockRenderer;
import thaumicinsurgence.main.Config;
import thaumicinsurgence.tileentity.TileEntityInfusionPillarAlpha;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class BlockPillarAlphaRenderer extends BlockRenderer implements ISimpleBlockRenderingHandler {
@SideOnly(Side.CLIENT)
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
TileEntityRendererDispatcher.instance.renderTileEntityAt(
new TileEntityInfusionPillarAlpha(), 0.0D, 0.0D, 0.0D, 0.0F);
TileEntityRendererDispatcher.instance
.renderTileEntityAt(new TileEntityInfusionPillarAlpha(), 0.0D, 0.0D, 0.0D, 0.0F);
}
@SideOnly(Side.CLIENT)
public boolean renderWorldBlock(
IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
RenderBlocks renderer) {
return true;
}
@@ -1,7 +1,5 @@
package thaumicinsurgence.renderers.tileentityrenderers;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.item.EntityItem;
@@ -9,12 +7,17 @@ import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import org.lwjgl.opengl.GL11;
import thaumcraft.client.renderers.tile.TilePedestalRenderer;
import thaumicinsurgence.tileentity.TileEntityPedestalAlpha;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class TileAlphaPedestalRenderer extends TilePedestalRenderer {
@SideOnly(Side.CLIENT)
public void renderTileEntityAt(TileEntityPedestalAlpha ped, double par2, double par4, double par6, float par8) {
if (ped != null && ped.getWorldObj() != null && ped.getStackInSlot(0) != null) {
@@ -1,11 +1,9 @@
package thaumicinsurgence.renderers.tileentityrenderers;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import java.util.HashMap;
import java.util.Map;
import java.util.Random;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
@@ -13,15 +11,21 @@ import net.minecraft.client.renderer.Tessellator;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
import org.lwjgl.opengl.GL11;
import thaumcraft.client.lib.UtilsFX;
import thaumcraft.client.renderers.models.ModelCube;
import thaumcraft.client.renderers.tile.TileRunicMatrixRenderer;
import thaumicinsurgence.main.utils.VersionInfo;
import thaumicinsurgence.tileentity.TileEntityInfusionMatrixAlpha;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class TileMatrixAlphaRenderer extends TileRunicMatrixRenderer {
private ModelCube model = new ModelCube(0);
private ModelCube model_over = new ModelCube(32);
static Map<String, ResourceLocation> boundTextures = new HashMap();
@@ -89,8 +93,8 @@ public class TileMatrixAlphaRenderer extends TileRunicMatrixRenderer {
}
@SideOnly(Side.CLIENT)
public void renderInfusionMatrix(
TileEntityInfusionMatrixAlpha is, double par2, double par4, double par6, float par8) {
public void renderInfusionMatrix(TileEntityInfusionMatrixAlpha is, double par2, double par4, double par6,
float par8) {
GL11.glPushMatrix();
UtilsFX.bindTexture(VersionInfo.ModID, "model/infusion-2-gilded.png");
GL11.glTranslatef((float) par2 + 0.5F, (float) par4 + 0.5F, (float) par6 + 0.5F);
@@ -102,8 +106,8 @@ public class TileMatrixAlphaRenderer extends TileRunicMatrixRenderer {
}
// this is a reference to instability, was originally 50.0 and 50.0F respectively
float instability =
Math.min(6.0F, 1.0F + (float) is.instability * 0.66F * ((float) Math.min(is.craftCount, 100) / 100.0F));
float instability = Math
.min(6.0F, 1.0F + (float) is.instability * 0.66F * ((float) Math.min(is.craftCount, 100) / 100.0F));
float b1 = 0.0F;
float b2 = 0.0F;
float b3 = 0.0F;
@@ -116,18 +120,15 @@ public class TileMatrixAlphaRenderer extends TileRunicMatrixRenderer {
for (int c = 0; c < 2; ++c) {
if (is.active) {
// this is a reference to instability
b1 = MathHelper.sin((ticks + (float) (a * 10)) / (15.0F - instability / 2.0F))
* 0.01F
b1 = MathHelper.sin((ticks + (float) (a * 10)) / (15.0F - instability / 2.0F)) * 0.01F
* is.startUp
* instability;
// this is a reference to instability
b2 = MathHelper.sin((ticks + (float) (b * 10)) / (14.0F - instability / 2.0F))
* 0.01F
b2 = MathHelper.sin((ticks + (float) (b * 10)) / (14.0F - instability / 2.0F)) * 0.01F
* is.startUp
* instability;
// this is a reference to instability
b3 = MathHelper.sin((ticks + (float) (c * 10)) / (13.0F - instability / 2.0F))
* 0.01F
b3 = MathHelper.sin((ticks + (float) (c * 10)) / (13.0F - instability / 2.0F)) * 0.01F
* is.startUp
* instability;
}
@@ -166,18 +167,15 @@ public class TileMatrixAlphaRenderer extends TileRunicMatrixRenderer {
for (int b = 0; b < 2; ++b) {
for (int c = 0; c < 2; ++c) {
// this is a reference to instability
b1 = MathHelper.sin((ticks + (float) (a * 10)) / (15.0F - instability / 2.0F))
* 0.01F
b1 = MathHelper.sin((ticks + (float) (a * 10)) / (15.0F - instability / 2.0F)) * 0.01F
* is.startUp
* instability;
// this is a reference to instability
b2 = MathHelper.sin((ticks + (float) (b * 10)) / (14.0F - instability / 2.0F))
* 0.01F
b2 = MathHelper.sin((ticks + (float) (b * 10)) / (14.0F - instability / 2.0F)) * 0.01F
* is.startUp
* instability;
// this is a reference to instability
b3 = MathHelper.sin((ticks + (float) (c * 10)) / (13.0F - instability / 2.0F))
* 0.01F
b3 = MathHelper.sin((ticks + (float) (c * 10)) / (13.0F - instability / 2.0F)) * 0.01F
* is.startUp
* instability;
aa = a == 0 ? -1 : 1;
@@ -207,9 +205,7 @@ public class TileMatrixAlphaRenderer extends TileRunicMatrixRenderer {
0.1F,
1.0F,
(MathHelper.sin((ticks + (float) (a * 2) + (float) (b * 3) + (float) (c * 4)) / 4.0F)
* 0.1F
+ 0.2F)
* is.startUp);
* 0.1F + 0.2F) * is.startUp);
this.model_over.render();
GL11.glPopMatrix();
}
@@ -1,19 +1,22 @@
package thaumicinsurgence.renderers.tileentityrenderers;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.AdvancedModelLoader;
import net.minecraftforge.client.model.IModelCustom;
import org.lwjgl.opengl.GL11;
import thaumcraft.client.lib.UtilsFX;
import thaumcraft.client.renderers.tile.TileInfusionPillarRenderer;
import thaumicinsurgence.main.utils.VersionInfo;
import thaumicinsurgence.tileentity.TileEntityInfusionPillarAlpha;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class TilePillarAlphaRenderer extends TileInfusionPillarRenderer {
private IModelCustom model;
private static final ResourceLocation PILLAR = new ResourceLocation("thaumcraft", "textures/models/pillar.obj");
@@ -23,8 +26,8 @@ public class TilePillarAlphaRenderer extends TileInfusionPillarRenderer {
}
@SideOnly(Side.CLIENT)
public void renderTileEntityAt(
TileEntityInfusionPillarAlpha tile, double par2, double par4, double par6, float par8) {
public void renderTileEntityAt(TileEntityInfusionPillarAlpha tile, double par2, double par4, double par6,
float par8) {
GL11.glPushMatrix();
GL11.glTranslatef((float) par2 + 0.5F, (float) par4, (float) par6 + 0.5F);
GL11.glRotatef(90.0F, -1.0F, 0.0F, 0.0F);
@@ -2,6 +2,7 @@ package thaumicinsurgence.tileentity;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.common.util.ForgeDirection;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.aspects.IAspectContainer;
@@ -22,8 +23,10 @@ public class TileEntityInfusionFucker extends TileEntity implements IAspectConta
public boolean addedStability;
public boolean stabilityHasBeenAdded;
/* public static final Aspect AIR = new Aspect("aer", 16777086, "e", 1);
public static final Aspect EARTH = new Aspect("terra", 5685248, "2", 1); */
/*
* public static final Aspect AIR = new Aspect("aer", 16777086, "e", 1); public static final Aspect EARTH = new
* Aspect("terra", 5685248, "2", 1);
*/
// the commented lines above show how the essentias are labeled, you use the actual name of the essentia to grab it.
// public Aspect AIR = aspect.getAspect("aer");
@@ -55,8 +58,7 @@ public class TileEntityInfusionFucker extends TileEntity implements IAspectConta
}
/**
* If the matrix needs any aspects, attempt to grab ALL of them
* from the essentiaEntity sequentially in this tick.
* If the matrix needs any aspects, attempt to grab ALL of them from the essentiaEntity sequentially in this tick.
*/
public void matrixFuckery() {
if (matrix.getAspects().size() != 0) {
@@ -97,16 +99,17 @@ public class TileEntityInfusionFucker extends TileEntity implements IAspectConta
stabilityHasBeenAdded = false;
}
/** If an input exists, this method will see if it contains the IEssentiaTransport interface, and if it does, it will
* set the current input to the whatever is trying to input */
/**
* If an input exists, this method will see if it contains the IEssentiaTransport interface, and if it does, it will
* set the current input to the whatever is trying to input
*/
public void setInput() {
try {
TileEntity inputCandidate = worldObj.getTileEntity(this.xCoord, this.yCoord - 1, this.zCoord);
if (inputCandidate instanceof IEssentiaTransport) {
essentiaEntity = (IEssentiaTransport) inputCandidate;
}
} catch (Exception ignored) {
}
} catch (Exception ignored) {}
}
/** this is obvious, but it grabs the infusion matrix that the intercepter is going to screw with. */
@@ -116,8 +119,7 @@ public class TileEntityInfusionFucker extends TileEntity implements IAspectConta
if (matrixCandidate instanceof TileInfusionMatrix) {
matrix = (TileInfusionMatrix) matrixCandidate;
}
} catch (Exception ignored) {
}
} catch (Exception ignored) {}
}
/** this method handles removing essentia from the essentia source, and adds it to myAspects */
@@ -145,9 +147,10 @@ public class TileEntityInfusionFucker extends TileEntity implements IAspectConta
}
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* This point marks the end of my custom methods used for this TE itself.
* Everything after this is based off other author's code.
* So only judge my code based off my own shit methods, I'll fix the rest later. :kekw: */
/*
* This point marks the end of my custom methods used for this TE itself. Everything after this is based off other
* author's code. So only judge my code based off my own shit methods, I'll fix the rest later. :kekw:
*/
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// added directly from the crucible of souls
@@ -271,9 +274,7 @@ public class TileEntityInfusionFucker extends TileEntity implements IAspectConta
// added directly from the crucible of souls
@Override
public Aspect getEssentiaType(ForgeDirection face) {
return this.myAspects.visSize() > 0 && face == ForgeDirection.UNKNOWN
? this.myAspects.getAspects()[0]
: null;
return this.myAspects.visSize() > 0 && face == ForgeDirection.UNKNOWN ? this.myAspects.getAspects()[0] : null;
}
// modified
@@ -1,12 +1,10 @@
package thaumicinsurgence.tileentity;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.enchantment.Enchantment;
import net.minecraft.enchantment.EnchantmentHelper;
@@ -25,6 +23,7 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.*;
import net.minecraft.world.World;
import thaumcraft.api.aspects.Aspect;
import thaumcraft.api.aspects.AspectList;
import thaumcraft.api.aspects.IAspectContainer;
@@ -46,8 +45,12 @@ import thaumcraft.common.tiles.TileInfusionMatrix;
import thaumcraft.common.tiles.TileInfusionPillar;
import thaumcraft.common.tiles.TilePedestal;
import thaumicinsurgence.main.utils.VersionInfo;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements IWandable, IAspectContainer {
private ArrayList<ChunkCoordinates> pedestals = new ArrayList();
private int dangerCount = 0;
public boolean active = false;
@@ -80,7 +83,7 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
public static final String tileEntityName = VersionInfo.ModID + ".matrixAlpha";
// public TileEntityInfusionMatrixAlpha() {}
// public TileEntityInfusionMatrixAlpha() {}
@Override
public void readCustomNBT(NBTTagCompound nbtCompound) {
@@ -201,7 +204,7 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
} else {
if (this.active && this.crafting && this.count % this.countDelay == 0) {
// try {
// try {
if (!startOfCycle) {
pedestalList = new TilePedestal[this.pedestals.size()];
pedestalItems = new ItemStack[this.pedestals.size()];
@@ -211,7 +214,7 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
}
// I am going to have to rewrite this entire portion from scratch.
this.craftCycle();
// } catch (Exception ignored) {}
// } catch (Exception ignored) {}
this.markDirty();
}
@@ -224,13 +227,12 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
List<Entity> targets = this.worldObj.getEntitiesWithinAABB(
EntityLivingBase.class,
AxisAlignedBB.getBoundingBox(
(double) this.xCoord,
(double) this.yCoord,
(double) this.zCoord,
(double) (this.xCoord + 1),
(double) (this.yCoord + 1),
(double) (this.zCoord + 1))
.expand(10.0D, 10.0D, 10.0D));
(double) this.xCoord,
(double) this.yCoord,
(double) this.zCoord,
(double) (this.xCoord + 1),
(double) (this.yCoord + 1),
(double) (this.zCoord + 1)).expand(10.0D, 10.0D, 10.0D));
if (targets != null && targets.size() > 0) {
for (Entity target : targets) {
PacketHandler.INSTANCE.sendToAllAround(
@@ -254,19 +256,19 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
}
}
}
// Directly from the infusion matrix
// TODO: change as needed
private void inEvHarm(boolean all) {
List<EntityLivingBase> targets = this.worldObj.getEntitiesWithinAABB(
EntityLivingBase.class,
AxisAlignedBB.getBoundingBox(
(double) this.xCoord,
(double) this.yCoord,
(double) this.zCoord,
(double) (this.xCoord + 1),
(double) (this.yCoord + 1),
(double) (this.zCoord + 1))
.expand(10.0D, 10.0D, 10.0D));
(double) this.xCoord,
(double) this.yCoord,
(double) this.zCoord,
(double) (this.xCoord + 1),
(double) (this.yCoord + 1),
(double) (this.zCoord + 1)).expand(10.0D, 10.0D, 10.0D));
if (targets != null && targets.size() > 0) {
for (EntityLivingBase target : targets) {
if (this.worldObj.rand.nextBoolean()) {
@@ -283,19 +285,19 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
}
}
}
// Directly from the infusion matrix
// TODO: change as needed
private void inEvWarp() {
List<EntityPlayer> targets = this.worldObj.getEntitiesWithinAABB(
EntityPlayer.class,
AxisAlignedBB.getBoundingBox(
(double) this.xCoord,
(double) this.yCoord,
(double) this.zCoord,
(double) (this.xCoord + 1),
(double) (this.yCoord + 1),
(double) (this.zCoord + 1))
.expand(10.0D, 10.0D, 10.0D));
(double) this.xCoord,
(double) this.yCoord,
(double) this.zCoord,
(double) (this.xCoord + 1),
(double) (this.yCoord + 1),
(double) (this.zCoord + 1)).expand(10.0D, 10.0D, 10.0D));
if (targets != null && targets.size() > 0) {
EntityPlayer target = (EntityPlayer) targets.get(this.worldObj.rand.nextInt(targets.size()));
if (this.worldObj.rand.nextFloat() < 0.25F) {
@@ -305,12 +307,13 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
}
}
}
// Directly from the infusion matrix
// TODO: change as needed
private void inEvEjectItem(int type) {
for (int q = 0; q < 50 && this.pedestals.size() > 0; ++q) {
ChunkCoordinates cc =
(ChunkCoordinates) this.pedestals.get(this.worldObj.rand.nextInt(this.pedestals.size()));
ChunkCoordinates cc = (ChunkCoordinates) this.pedestals
.get(this.worldObj.rand.nextInt(this.pedestals.size()));
TileEntity te = this.worldObj.getTileEntity(cc.posX, cc.posY, cc.posZ);
if (te != null && te instanceof TilePedestal && ((TilePedestal) te).getStackInSlot(0) != null) {
if (type >= 3 && type != 5) {
@@ -333,12 +336,22 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
} else {
this.worldObj.setBlock(cc.posX, cc.posY + 1, cc.posZ, ConfigBlocks.blockFluxGas, 7, 3);
this.worldObj.playSoundEffect(
(double) cc.posX, (double) cc.posY, (double) cc.posZ, "random.fizz", 0.3F, 1.0F);
(double) cc.posX,
(double) cc.posY,
(double) cc.posZ,
"random.fizz",
0.3F,
1.0F);
}
} else {
this.worldObj.setBlock(cc.posX, cc.posY + 1, cc.posZ, ConfigBlocks.blockFluxGoo, 7, 3);
this.worldObj.playSoundEffect(
(double) cc.posX, (double) cc.posY, (double) cc.posZ, "game.neutral.swim", 0.3F, 1.0F);
(double) cc.posX,
(double) cc.posY,
(double) cc.posZ,
"game.neutral.swim",
0.3F,
1.0F);
}
this.worldObj.addBlockEvent(cc.posX, cc.posY, cc.posZ, ConfigBlocks.blockStoneDevice, 11, 0);
@@ -398,8 +411,7 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
int y = this.yCoord - yy;
int z = this.zCoord + zz;
TileEntity te = this.worldObj.getTileEntity(x, y, z);
if (!skip
&& yy > 0
if (!skip && yy > 0
&& Math.abs(xx) <= 8
&& Math.abs(zz) <= 8
&& te != null
@@ -409,9 +421,8 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
} else {
Block bi = this.worldObj.getBlock(x, y, z);
if (bi == Blocks.skull
|| bi instanceof IInfusionStabiliser
&& ((IInfusionStabiliser) bi)
.canStabaliseInfusion(this.getWorldObj(), x, y, z)) {
|| bi instanceof IInfusionStabiliser && ((IInfusionStabiliser) bi)
.canStabaliseInfusion(this.getWorldObj(), x, y, z)) {
stuff.add(new ChunkCoordinates(x, y, z));
}
}
@@ -453,27 +464,22 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
int x = this.xCoord - cc.posX;
int z = this.zCoord - cc.posZ;
Block bi = this.worldObj.getBlock(cc.posX, cc.posY, cc.posZ);
if (bi == Blocks.skull
|| bi instanceof IInfusionStabiliser
&& ((IInfusionStabiliser) bi)
.canStabaliseInfusion(this.getWorldObj(), cc.posX, cc.posY, cc.posZ)) {
if (bi == Blocks.skull || bi instanceof IInfusionStabiliser && ((IInfusionStabiliser) bi)
.canStabaliseInfusion(this.getWorldObj(), cc.posX, cc.posY, cc.posZ)) {
sym += 0.1F;
}
int xx = this.xCoord + x;
int zz = this.zCoord + z;
bi = this.worldObj.getBlock(xx, cc.posY, zz);
if (bi == Blocks.skull
|| bi instanceof IInfusionStabiliser
&& ((IInfusionStabiliser) bi)
.canStabaliseInfusion(this.getWorldObj(), cc.posX, cc.posY, cc.posZ)) {
if (bi == Blocks.skull || bi instanceof IInfusionStabiliser && ((IInfusionStabiliser) bi)
.canStabaliseInfusion(this.getWorldObj(), cc.posX, cc.posY, cc.posZ)) {
sym -= 0.2F;
}
}
this.symmetry = (int) ((float) this.symmetry + sym);
} catch (Exception ignored) {
}
} catch (Exception ignored) {}
}
// Directly from the infusion matrix
@@ -511,14 +517,14 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
}
if (components.size() != 0) {
InfusionRecipe recipe =
ThaumcraftCraftingManager.findMatchingInfusionRecipe(components, this.recipeInput, player);
InfusionRecipe recipe = ThaumcraftCraftingManager
.findMatchingInfusionRecipe(components, this.recipeInput, player);
if (recipe != null) {
this.recipeType = 0;
this.recipeIngredients = new ArrayList();
if (recipe instanceof InfusionRunicAugmentRecipe) {
for (ItemStack ing :
((InfusionRunicAugmentRecipe) recipe).getComponents(this.recipeInput)) {
for (ItemStack ing : ((InfusionRunicAugmentRecipe) recipe)
.getComponents(this.recipeInput)) {
this.recipeIngredients.add(ing.copy());
}
} else {
@@ -536,8 +542,7 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
}
this.recipeInstability = recipe.getInstability(this.recipeInput);
this.recipeEssentia =
recipe.getAspects(this.recipeInput).copy();
this.recipeEssentia = recipe.getAspects(this.recipeInput).copy();
this.recipePlayer = player.getCommandSenderName();
this.instability = this.symmetry + this.recipeInstability;
this.crafting = true;
@@ -551,9 +556,8 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
this.markDirty();
} else {
InfusionEnchantmentRecipe recipe2 =
ThaumcraftCraftingManager.findMatchingInfusionEnchantmentRecipe(
components, this.recipeInput, player);
InfusionEnchantmentRecipe recipe2 = ThaumcraftCraftingManager
.findMatchingInfusionEnchantmentRecipe(components, this.recipeInput, player);
if (recipe2 != null) {
this.recipeType = 1;
this.recipeIngredients = new ArrayList();
@@ -678,13 +682,12 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
List<EntityPlayer> targets = this.worldObj.getEntitiesWithinAABB(
EntityPlayer.class,
AxisAlignedBB.getBoundingBox(
(double) this.xCoord,
(double) this.yCoord,
(double) this.zCoord,
(double) (this.xCoord + 1),
(double) (this.yCoord + 1),
(double) (this.zCoord + 1))
.expand(10.0D, 10.0D, 10.0D));
(double) this.xCoord,
(double) this.yCoord,
(double) this.zCoord,
(double) (this.xCoord + 1),
(double) (this.yCoord + 1),
(double) (this.zCoord + 1)).expand(10.0D, 10.0D, 10.0D));
if (targets != null && targets.size() > 0) {
for (EntityPlayer target : targets) {
if (target.experienceLevel > 0) {
@@ -706,9 +709,16 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
var22.sendToAllAround(
var23,
new NetworkRegistry.TargetPoint(
this.getWorldObj().provider.dimensionId, var24, var25, var26, 32.0D));
this.getWorldObj().provider.dimensionId,
var24,
var25,
var26,
32.0D));
this.worldObj.playSoundAtEntity(
target, "random.fizz", 1.0F, 2.0F + this.worldObj.rand.nextFloat() * 0.4F);
target,
"random.fizz",
1.0F,
2.0F + this.worldObj.rand.nextFloat() * 0.4F);
this.countDelay = 20;
return;
}
@@ -743,37 +753,19 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
// this section is all related to sucking in vis as it comes, I can easily improve this.
// or alternatively, I could straight remove this and use my intercepter as the absolute essentia method.
// TODO: no Alastor, you can't remove this fully, or the matrix will just do the recipe for free!
/* if (this.recipeEssentia.visSize() > 0) {
for (Aspect aspect : this.recipeEssentia.getAspects()) {
if (this.recipeEssentia.getAmount(aspect) > 0) {
if (EssentiaHandler.drainEssentia(this, aspect, ForgeDirection.UNKNOWN, 12)) {
this.recipeEssentia.reduce(aspect, 1);
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
this.markDirty();
return;
}
// the Math.max statement ensures that it doesn't go below 0,
// if the instability would put it below 10, it hard floors
// the chance to add instability at 1/10 per tick or approx
// a 10% chance per tick. or around +2 instability per sec
// originally this caused a massive crash.
if (this.worldObj.rand.nextInt(Math.max(100 - this.recipeInstability * 3, 10)) == 0) {
++this.instability;
}
// this is a reference to instability, was originally 25
if (this.instability > 500) {
this.instability = 500;
}
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
this.markDirty();
}
}
this.checkSurroundings = true;
} */
/*
* if (this.recipeEssentia.visSize() > 0) { for (Aspect aspect : this.recipeEssentia.getAspects()) { if
* (this.recipeEssentia.getAmount(aspect) > 0) { if (EssentiaHandler.drainEssentia(this, aspect,
* ForgeDirection.UNKNOWN, 12)) { this.recipeEssentia.reduce(aspect, 1);
* this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); this.markDirty(); return; } //
* the Math.max statement ensures that it doesn't go below 0, // if the instability would put it below 10,
* it hard floors // the chance to add instability at 1/10 per tick or approx // a 10% chance per tick. or
* around +2 instability per sec // originally this caused a massive crash. if
* (this.worldObj.rand.nextInt(Math.max(100 - this.recipeInstability * 3, 10)) == 0) { ++this.instability; }
* // this is a reference to instability, was originally 25 if (this.instability > 500) { this.instability =
* 500; } this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); this.markDirty(); } }
* this.checkSurroundings = true; }
*/
// this section is related to resetting the matrix if there are no items left in the recipe
// also turns the central item into the desired item.
@@ -793,8 +785,7 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
te = this.worldObj.getTileEntity(cc.posX, cc.posY, cc.posZ);
// if te is a Tile Pedestal, wacky hijinks ensues.
if (te instanceof TilePedestal
&& ((TilePedestal) te).getStackInSlot(0) != null
if (te instanceof TilePedestal && ((TilePedestal) te).getStackInSlot(0) != null
&& InfusionRecipe.areItemStacksEqual(
((TilePedestal) te).getStackInSlot(0),
(ItemStack) this.recipeIngredients.get(a),
@@ -834,21 +825,21 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
else if (this.itemCount-- <= 1) {
pedestalList[numPedestals] = (TilePedestal) te;
ItemStack is = ((TilePedestal) te)
.getStackInSlot(0)
.getItem()
ItemStack is = ((TilePedestal) te).getStackInSlot(0).getItem()
.getContainerItem(((TilePedestal) te).getStackInSlot(0));
pedestalItems[numPedestals] = is;
numPedestals++;
String[] users = MinecraftServer.getServer()
.getConfigurationManager()
String[] users = MinecraftServer.getServer().getConfigurationManager()
.getAllUsernames();
EntityPlayer tempPlayer = MinecraftServer.getServer()
.getEntityWorld()
EntityPlayer tempPlayer = MinecraftServer.getServer().getEntityWorld()
.getPlayerEntityByName(users[0]);
tempPlayer.addChatMessage(new ChatComponentText("we are on item num: " + numPedestals
+ " we have gone through " + pedsGoneThru + " total."));
tempPlayer.addChatMessage(
new ChatComponentText(
"we are on item num: " + numPedestals
+ " we have gone through "
+ pedsGoneThru
+ " total."));
}
return;
@@ -912,7 +903,12 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
this.recipeEssentia = new AspectList();
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
this.worldObj.playSoundEffect(
(double) this.xCoord, (double) this.yCoord, (double) this.zCoord, "thaumcraft:craftfail", 1.0F, 0.6F);
(double) this.xCoord,
(double) this.yCoord,
(double) this.zCoord,
"thaumcraft:craftfail",
1.0F,
0.6F);
this.markDirty();
}
@@ -954,11 +950,10 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
if (this.recipePlayer != null) {
EntityPlayer p = this.worldObj.getPlayerEntityByName(this.recipePlayer);
if (p != null) {
FMLCommonHandler.instance()
.firePlayerCraftingEvent(
p,
((TilePedestal) te).getStackInSlot(0),
new InventoryFake(this.recipeIngredients));
FMLCommonHandler.instance().firePlayerCraftingEvent(
p,
((TilePedestal) te).getStackInSlot(0),
new InventoryFake(this.recipeIngredients));
}
}
@@ -966,16 +961,16 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
this.recipeEssentia = new AspectList();
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
this.markDirty();
this.worldObj.addBlockEvent(
this.xCoord, this.yCoord - 2, this.zCoord, ConfigBlocks.blockStoneDevice, 12, 0);
this.worldObj
.addBlockEvent(this.xCoord, this.yCoord - 2, this.zCoord, ConfigBlocks.blockStoneDevice, 12, 0);
}
}
// Directly from the infusion matrix
// TODO: change as needed
@Override
public int onWandRightClick(
World world, ItemStack wandstack, EntityPlayer player, int x, int y, int z, int side, int md) {
public int onWandRightClick(World world, ItemStack wandstack, EntityPlayer player, int x, int y, int z, int side,
int md) {
if (!world.isRemote && this.active && !this.crafting) {
this.craftingStart(player);
return 0;
@@ -1081,15 +1076,11 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
for (int a = 0; a < Thaumcraft.proxy.particleCount(2); ++a) {
Thaumcraft.proxy.drawInfusionParticles4(
this.worldObj,
player.posX
+ (double)
((this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat())
* player.width),
player.posX + (double) ((this.worldObj.rand.nextFloat()
- this.worldObj.rand.nextFloat()) * player.width),
player.boundingBox.minY + (double) (this.worldObj.rand.nextFloat() * player.height),
player.posZ
+ (double)
((this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat())
* player.width),
player.posZ + (double) ((this.worldObj.rand.nextFloat()
- this.worldObj.rand.nextFloat()) * player.width),
this.xCoord,
this.yCoord,
this.zCoord);
@@ -1135,14 +1126,11 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
for (int a = 0; a < Thaumcraft.proxy.particleCount(2); ++a) {
Thaumcraft.proxy.drawInfusionParticles1(
this.worldObj,
(double) ((float) fx.loc.posX
+ 0.4F
(double) ((float) fx.loc.posX + 0.4F
+ this.worldObj.rand.nextFloat() * 0.2F),
(double) ((float) fx.loc.posY
+ 1.23F
(double) ((float) fx.loc.posY + 1.23F
+ this.worldObj.rand.nextFloat() * 0.2F),
(double) ((float) fx.loc.posZ
+ 0.4F
(double) ((float) fx.loc.posZ + 0.4F
+ this.worldObj.rand.nextFloat() * 0.2F),
this.xCoord,
this.yCoord,
@@ -1171,14 +1159,11 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
(float) this.xCoord + 0.5F,
(float) this.yCoord + 0.5F,
(float) this.zCoord + 0.5F,
(float) this.xCoord
+ 0.5F
(float) this.xCoord + 0.5F
+ (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 2.0F,
(float) this.yCoord
+ 0.5F
(float) this.yCoord + 0.5F
+ (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 2.0F,
(float) this.zCoord
+ 0.5F
(float) this.zCoord + 0.5F
+ (this.worldObj.rand.nextFloat() - this.worldObj.rand.nextFloat()) * 2.0F);
}
}
@@ -1247,6 +1232,7 @@ public class TileEntityInfusionMatrixAlpha extends TileInfusionMatrix implements
// Directly from the infusion matrix
// TODO: change as needed
public class SourceFX {
public ChunkCoordinates loc;
public int ticks;
public int color;
@@ -1,13 +1,15 @@
package thaumicinsurgence.tileentity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import thaumcraft.common.tiles.TileInfusionPillar;
import thaumicinsurgence.main.utils.VersionInfo;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TileEntityInfusionPillarAlpha extends TileInfusionPillar {
public byte orientation = 0;
public static final String tileEntityName = VersionInfo.ModID + ".pillarAlpha";
@@ -1,7 +1,5 @@
package thaumicinsurgence.tileentity;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
@@ -9,12 +7,16 @@ import net.minecraft.nbt.NBTTagList;
import net.minecraft.network.NetworkManager;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import net.minecraft.util.AxisAlignedBB;
import thaumcraft.common.Thaumcraft;
import thaumcraft.common.tiles.TilePedestal;
import thaumicinsurgence.main.utils.VersionInfo;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class TileEntityPedestalAlpha extends TilePedestal {
private static final int[] slots = new int[] {0};
private static final int[] slots = new int[] { 0 };
private ItemStack[] inventory = new ItemStack[1];
private String customName;
public static final String tileEntityName = VersionInfo.ModID + ".marblePedestal";
@@ -160,10 +162,9 @@ public class TileEntityPedestalAlpha extends TilePedestal {
}
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer) {
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) == this
&& par1EntityPlayer.getDistanceSq(
(double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D)
<= 64.0D;
return this.worldObj.getTileEntity(this.xCoord, this.yCoord, this.zCoord) == this && par1EntityPlayer
.getDistanceSq((double) this.xCoord + 0.5D, (double) this.yCoord + 0.5D, (double) this.zCoord + 0.5D)
<= 64.0D;
}
public void openInventory() {}
@@ -190,8 +191,8 @@ public class TileEntityPedestalAlpha extends TilePedestal {
if (i == 11) {
if (this.worldObj.isRemote) {
for (int a = 0; a < Thaumcraft.proxy.particleCount(5); ++a) {
Thaumcraft.proxy.blockSparkle(
this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord, 12583104, 2);
Thaumcraft.proxy
.blockSparkle(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord, 12583104, 2);
}
}
@@ -1,6 +1,7 @@
package thaumicinsurgence.tileentity;
import net.minecraft.world.World;
import thaumcraft.api.crafting.IInfusionStabiliser;
import thaumcraft.common.tiles.TileInfusionMatrix;
import thaumcraft.common.tiles.TileNodeStabilizer;
@@ -16,8 +17,10 @@ public class TileEntityStabilizerTesting extends TileNodeStabilizer implements I
// these two if statements handle setting the TE variables the intercepter deals with.
if (matrix == null) setMatrix();
/* this method handles literally everything this does, I moved it to it's own method so that I could
* make it not do anything if the matrix didn't exist to save idle performance */
/*
* this method handles literally everything this does, I moved it to it's own method so that I could make it not
* do anything if the matrix didn't exist to save idle performance
*/
if (matrix != null) {
matrixFuckery();
}
@@ -27,18 +30,24 @@ public class TileEntityStabilizerTesting extends TileNodeStabilizer implements I
try {
if (worldObj.getTileEntity(this.xCoord + 1, this.yCoord + 3, this.zCoord) instanceof TileInfusionMatrix) {
matrix = (TileInfusionMatrix) worldObj.getTileEntity(this.xCoord + 1, this.yCoord + 3, this.zCoord);
} else if (worldObj.getTileEntity(this.xCoord - 1, this.yCoord + 3, this.zCoord)
instanceof TileInfusionMatrix) {
matrix = (TileInfusionMatrix) worldObj.getTileEntity(this.xCoord - 1, this.yCoord + 3, this.zCoord);
} else if (worldObj.getTileEntity(this.xCoord, this.yCoord + 3, this.zCoord + 1)
instanceof TileInfusionMatrix) {
matrix = (TileInfusionMatrix) worldObj.getTileEntity(this.xCoord, this.yCoord + 3, this.zCoord + 1);
} else if (worldObj.getTileEntity(this.xCoord, this.yCoord + 3, this.zCoord - 1)
instanceof TileInfusionMatrix) {
matrix = (TileInfusionMatrix) worldObj.getTileEntity(this.xCoord, this.yCoord + 3, this.zCoord - 1);
}
} catch (Exception ignored) {
}
} else if (worldObj
.getTileEntity(this.xCoord - 1, this.yCoord + 3, this.zCoord) instanceof TileInfusionMatrix) {
matrix = (TileInfusionMatrix) worldObj
.getTileEntity(this.xCoord - 1, this.yCoord + 3, this.zCoord);
} else
if (worldObj
.getTileEntity(this.xCoord, this.yCoord + 3, this.zCoord + 1) instanceof TileInfusionMatrix) {
matrix = (TileInfusionMatrix) worldObj
.getTileEntity(this.xCoord, this.yCoord + 3, this.zCoord + 1);
} else
if (worldObj.getTileEntity(
this.xCoord,
this.yCoord + 3,
this.zCoord - 1) instanceof TileInfusionMatrix) {
matrix = (TileInfusionMatrix) worldObj
.getTileEntity(this.xCoord, this.yCoord + 3, this.zCoord - 1);
}
} catch (Exception ignored) {}
}
public void matrixFuckery() {}