generated from tilera/1710mod
Compare commits
64 commits
Author | SHA1 | Date | |
---|---|---|---|
Timo Ley | 011786e953 | ||
Timo Ley | f76723b551 | ||
Timo Ley | b89da88a78 | ||
Timo Ley | 18365c9c85 | ||
Timo Ley | d5e9580367 | ||
Timo Ley | 61cd161d8e | ||
Timo Ley | 34a38d2160 | ||
Timo Ley | 3900b28745 | ||
Timo Ley | 725e524497 | ||
Timo Ley | 78636b0f7f | ||
Timo Ley | 0349b88293 | ||
Timo Ley | 4a4798738e | ||
Timo Ley | 3db4a140e3 | ||
Timo Ley | e5587ebd31 | ||
Timo Ley | 3005fdba58 | ||
Timo Ley | 5f9630e891 | ||
Timo Ley | 16fea97234 | ||
Timo Ley | 9db42fb0db | ||
Timo Ley | d9a56272f7 | ||
Timo Ley | 98b73ac9da | ||
Timo Ley | 7b65a2a51a | ||
Timo Ley | 39d0bcd8e0 | ||
Timo Ley | 244ca15f40 | ||
Timo Ley | a367fe8f6c | ||
Timo Ley | ea5df8a3f2 | ||
Timo Ley | da11f55a94 | ||
Timo Ley | b98a39af6e | ||
Timo Ley | eb7c01ad7b | ||
Timo Ley | 6ffec2106c | ||
Timo Ley | c79f7779bb | ||
Timo Ley | 0b2eed4b7c | ||
Timo Ley | 96e611fd13 | ||
Timo Ley | 80bbd9f283 | ||
Timo Ley | 59ec91cf7c | ||
Timo Ley | 49c41c1ef4 | ||
Timo Ley | 0e909e82de | ||
Timo Ley | 881e51ec6c | ||
Timo Ley | 89b713de99 | ||
Timo Ley | bc0b3634b8 | ||
Timo Ley | 2cc0bc5e5c | ||
Timo Ley | ee27c10e77 | ||
Timo Ley | 465e6922b9 | ||
Timo Ley | 09e78be65d | ||
Timo Ley | e8e7cc6e13 | ||
Timo Ley | 6d5559ee02 | ||
Timo Ley | 98e1dad6d9 | ||
Timo Ley | 350663b4cf | ||
Timo Ley | 53326bffc9 | ||
Timo Ley | 0b1915134d | ||
Timo Ley | 911352f2eb | ||
Timo Ley | d50a160532 | ||
Timo Ley | b36c725d26 | ||
Timo Ley | 8a6def104b | ||
Timo Ley | a1e998830f | ||
Timo Ley | 3b5eafbca3 | ||
Timo Ley | 2508e6118d | ||
Timo Ley | 659b498a49 | ||
Timo Ley | 6079bace94 | ||
Timo Ley | bf547b6f2b | ||
Timo Ley | 7c128b580f | ||
Timo Ley | 0c28acea1d | ||
Timo Ley | 22af5cf660 | ||
Timo Ley | 05dfb876ce | ||
Timo Ley | 491360a906 |
7
LICENSE
Normal file
7
LICENSE
Normal file
|
@ -0,0 +1,7 @@
|
|||
Copyright 2023 Timo Ley
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
26
TODO.md
26
TODO.md
|
@ -1,26 +0,0 @@
|
|||
# TODO
|
||||
|
||||
## Aura interaction
|
||||
- Arcane Bore
|
||||
- Mirror (+ Hand Mirror)
|
||||
- Lifter/Levitator
|
||||
|
||||
## Compat
|
||||
- TC4 Aura Nodes <-> Aura interaction
|
||||
|
||||
## Research
|
||||
- Old Research Table
|
||||
- No scanning required
|
||||
- Knowing all aspects from beginning
|
||||
- Crafting API
|
||||
|
||||
## Crafting
|
||||
- Infusion Crafting implementation
|
||||
|
||||
## Crucible
|
||||
- Old Crucible crafting
|
||||
- No Flux goo & gas
|
||||
- No boiling down to primal aspects
|
||||
|
||||
## Config
|
||||
- Config options for many things
|
|
@ -24,7 +24,7 @@ apply from: './gradle/scripts/mixins.gradle'
|
|||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
|
||||
version = "1.1.2"
|
||||
version = "1.10.0-beta-1"
|
||||
group= "dev.tilera"
|
||||
archivesBaseName = "auracore"
|
||||
|
||||
|
@ -37,11 +37,13 @@ minecraft {
|
|||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
maven { url = "https://maven.tilera.xyz" }
|
||||
maven { url = "https://jitpack.io" }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "net.anvilcraft:anvillib-7:0.1.0:deobf"
|
||||
implementation "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:deobf"
|
||||
implementation "com.github.tox1cozZ:mixin-booter-legacy:1.1.2"
|
||||
annotationProcessor "com.github.tox1cozZ:mixin-booter-legacy:1.1.2:processor"
|
||||
|
|
|
@ -6,27 +6,25 @@ import cpw.mods.fml.common.SidedProxy;
|
|||
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.common.event.FMLServerAboutToStartEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import dev.tilera.auracore.api.Aspects;
|
||||
import dev.tilera.auracore.aura.AuraCalculationThread;
|
||||
import dev.tilera.auracore.aura.AuraDeleteThread;
|
||||
import dev.tilera.auracore.aura.AuraManager;
|
||||
import dev.tilera.auracore.aura.AuraUpdateThread;
|
||||
import dev.tilera.auracore.aura.AuraWorldTicker;
|
||||
import dev.tilera.auracore.client.GUITicker;
|
||||
import dev.tilera.auracore.client.RenderEventHandler;
|
||||
import dev.tilera.auracore.network.AuraDeletePacket;
|
||||
import dev.tilera.auracore.network.AuraDeletePacketHandler;
|
||||
import dev.tilera.auracore.network.AuraPacket;
|
||||
import dev.tilera.auracore.network.AuraPacketHandler;
|
||||
import dev.tilera.auracore.network.AuraTransferFXPacket;
|
||||
import dev.tilera.auracore.network.AuraTransferFXPacketHandler;
|
||||
import dev.tilera.auracore.network.NodeZapPacket;
|
||||
import dev.tilera.auracore.network.NodeZapPacketHandler;
|
||||
import dev.tilera.auracore.proxy.CommonProxy;
|
||||
import dev.tilera.auracore.world.WorldGenerator;
|
||||
import net.anvilcraft.anvillib.network.AnvilChannel;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
|
@ -35,10 +33,10 @@ import thaumcraft.api.aspects.AspectList;
|
|||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
|
||||
@Mod(modid = "auracore", name = "AuraCore", version = "{VERSION}", dependencies = "required-after:Thaumcraft")
|
||||
@Mod(modid = "auracore", name = "AuraCore", version = "{VERSION}", dependencies = "required-after:anvillib;required-after:Thaumcraft;after:MagicBees")
|
||||
public class AuraCore {
|
||||
|
||||
public static SimpleNetworkWrapper CHANNEL;
|
||||
public static AnvilChannel CHANNEL;
|
||||
@Mod.Instance("auracore")
|
||||
public static AuraCore INSTANCE;
|
||||
@SidedProxy(modId = "auracore", clientSide = "dev.tilera.auracore.proxy.ClientProxy", serverSide = "dev.tilera.auracore.proxy.CommonProxy")
|
||||
|
@ -46,13 +44,14 @@ public class AuraCore {
|
|||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent e) {
|
||||
Config.load();
|
||||
Aspects.load();
|
||||
CHANNEL = NetworkRegistry.INSTANCE.newSimpleChannel("auracore");
|
||||
int pktID = 0;
|
||||
CHANNEL.registerMessage(AuraPacketHandler.class, AuraPacket.class, pktID++, Side.CLIENT);
|
||||
CHANNEL.registerMessage(AuraDeletePacketHandler.class, AuraDeletePacket.class, pktID++, Side.CLIENT);
|
||||
CHANNEL.registerMessage(AuraTransferFXPacketHandler.class, AuraTransferFXPacket.class, pktID++, Side.CLIENT);
|
||||
CHANNEL.registerMessage(NodeZapPacketHandler.class, NodeZapPacket.class, pktID++, Side.CLIENT);
|
||||
CHANNEL = new AnvilChannel("auracore");
|
||||
AuraCore.CHANNEL.register(AuraPacket.class);
|
||||
AuraCore.CHANNEL.register(AuraDeletePacket.class);
|
||||
AuraCore.CHANNEL.register(AuraTransferFXPacket.class);
|
||||
AuraCore.CHANNEL.register(NodeZapPacket.class);
|
||||
proxy.preInit();
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
MinecraftForge.EVENT_BUS.register(new RenderEventHandler());
|
||||
FMLCommonHandler.instance().bus().register(new AuraWorldTicker());
|
||||
|
@ -71,7 +70,12 @@ public class AuraCore {
|
|||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent ev) {
|
||||
proxy.init();
|
||||
ConfigBlocks.blockCrystal.setTickRandomly(true);
|
||||
Recipes.initRecipes();
|
||||
NetworkRegistry.INSTANCE.registerGuiHandler(this, proxy);
|
||||
thaumcraft.common.config.Config.genStructure = false;
|
||||
thaumcraft.common.config.Config.genAura = false;
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
|
@ -91,4 +95,14 @@ public class AuraCore {
|
|||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCustomOre, 1, 10), new AspectList().add(Aspect.EARTH, 1).add(Aspect.TAINT, 3).add(Aspect.CRYSTAL, 2));
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void onServerLoad(FMLServerAboutToStartEvent event) {
|
||||
AuraManager.invalidate();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void onServerStop(FMLServerStoppedEvent event) {
|
||||
AuraManager.invalidate();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
39
src/main/java/dev/tilera/auracore/Config.java
Normal file
39
src/main/java/dev/tilera/auracore/Config.java
Normal file
|
@ -0,0 +1,39 @@
|
|||
package dev.tilera.auracore;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
|
||||
public class Config {
|
||||
|
||||
private static Configuration config = new Configuration(new File(Loader.instance().getConfigDir(), "AuraCore.cfg"));
|
||||
public static int nodeRarity = 23;
|
||||
public static int specialNodeRarity = 75;
|
||||
public static int newNodeRarity = 20;
|
||||
public static boolean replaceSilverwood = true;
|
||||
public static boolean knowAllAspects = true;
|
||||
public static boolean replaceAspects = true;
|
||||
public static boolean legacyAspects = false;
|
||||
public static boolean generateEldritchRing = true;
|
||||
public static boolean legacyCrucibleMechanics = true;
|
||||
|
||||
public static boolean noScanning() {
|
||||
return knowAllAspects;
|
||||
}
|
||||
|
||||
public static void load() {
|
||||
config.load();
|
||||
nodeRarity = config.get("worldgen", "nodeRarity", nodeRarity).getInt(nodeRarity);
|
||||
specialNodeRarity = config.get("worldgen", "specialNodeRarity", specialNodeRarity).getInt(specialNodeRarity);
|
||||
newNodeRarity = config.getInt("newNodeRarity", "worldgen", newNodeRarity, -1, Integer.MAX_VALUE, "Rarity of TC4 nodes generating instead of TC3 nodes (-1 to disable TC4 nodes)");
|
||||
replaceSilverwood = config.getBoolean("replaceSilverwood", "worldgen", replaceSilverwood, "Replace Silverwood trees with TC3 Silverwood");
|
||||
knowAllAspects = config.getBoolean("knowAllAspects", "research", knowAllAspects, "Know all Aspects from beginning");
|
||||
replaceAspects = config.getBoolean("replaceAspects", "client", replaceAspects, "Replace some aspect textures");
|
||||
legacyAspects = config.getBoolean("legacyAspects", "aspects", legacyAspects, "Use TC3 item aspects");
|
||||
generateEldritchRing = config.getBoolean("generateEldritchRing", "worldgen", generateEldritchRing, "Generate Eldritch Ring structures");
|
||||
legacyCrucibleMechanics = config.getBoolean("legacyCrucibleMechanics", "crucible", legacyCrucibleMechanics, "Use TC3 crucible mechanics");
|
||||
config.save();
|
||||
}
|
||||
|
||||
}
|
|
@ -47,6 +47,17 @@ public class EventHandler {
|
|||
}
|
||||
}
|
||||
nodeNBT.setTag("flux", flux);
|
||||
NBTTagList stasis = new NBTTagList();
|
||||
if (node.stasis.size() > 0) {
|
||||
for (Aspect tag : node.stasis.getAspects()) {
|
||||
if (tag == null) continue;
|
||||
NBTTagCompound f = new NBTTagCompound();
|
||||
f.setString("id", tag.getTag());
|
||||
f.setInteger("amount", node.stasis.getAmount(tag));
|
||||
stasis.appendTag(f);
|
||||
}
|
||||
}
|
||||
nodeNBT.setTag("stasis", stasis);
|
||||
nodelist.appendTag(nodeNBT);
|
||||
}
|
||||
}
|
||||
|
@ -83,6 +94,15 @@ public class EventHandler {
|
|||
if (!flux.hasKey("id") || !flux.hasKey("amount")) continue;
|
||||
node.flux.add(Aspect.getAspect(flux.getString("id")), flux.getInteger("amount"));
|
||||
}
|
||||
node.stasis = new AspectList();
|
||||
if (nodeData.hasKey("stasis")) {
|
||||
NBTTagList stasisTags = nodeData.getTagList("stasis", 10);
|
||||
for (int j = 0; j < stasisTags.tagCount(); ++j) {
|
||||
NBTTagCompound stasis = stasisTags.getCompoundTagAt(j);
|
||||
if (!stasis.hasKey("id") || !stasis.hasKey("amount")) continue;
|
||||
node.stasis.add(Aspect.getAspect(stasis.getString("id")), stasis.getInteger("amount"));
|
||||
}
|
||||
}
|
||||
AuraManager.auraNodes.put(node.key, node);
|
||||
AuraManager.addToAuraUpdateList(node);
|
||||
AuraManager.generateNodeNeighbours(node);
|
||||
|
|
69
src/main/java/dev/tilera/auracore/Recipes.java
Normal file
69
src/main/java/dev/tilera/auracore/Recipes.java
Normal file
|
@ -0,0 +1,69 @@
|
|||
package dev.tilera.auracore;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import dev.tilera.auracore.api.Aspects;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumcraft.common.config.ConfigResearch;
|
||||
|
||||
public class Recipes {
|
||||
|
||||
static Set<String> oldCrucibleRecipes = new HashSet<>();
|
||||
|
||||
public static void initRecipes() {
|
||||
ConfigResearch.recipes.put("Clusters8", shapelessOreDictRecipe(new ItemStack(ConfigBlocks.blockCrystal, 1, 8), new Object[] { new ItemStack(ConfigItems.itemShard, 1, 7), new ItemStack(ConfigItems.itemShard, 1, 7), new ItemStack(ConfigItems.itemShard, 1, 7), new ItemStack(ConfigItems.itemShard, 1, 7), new ItemStack(ConfigItems.itemShard, 1, 7), new ItemStack(ConfigItems.itemShard, 1, 7) }));
|
||||
ConfigResearch.recipes.put("Clusters10", shapelessOreDictRecipe(new ItemStack(ConfigBlocks.blockCrystal, 1, 10), new Object[] { new ItemStack(ConfigItems.itemShard, 1, 9), new ItemStack(ConfigItems.itemShard, 1, 9), new ItemStack(ConfigItems.itemShard, 1, 9), new ItemStack(ConfigItems.itemShard, 1, 9), new ItemStack(ConfigItems.itemShard, 1, 9), new ItemStack(ConfigItems.itemShard, 1, 9) }));
|
||||
ConfigResearch.recipes.put("Clusters9", shapelessOreDictRecipe(new ItemStack(ConfigBlocks.blockCrystal, 1, 9), new Object[] { new ItemStack(ConfigItems.itemShard, 1, 0), new ItemStack(ConfigItems.itemShard, 1, 1), new ItemStack(ConfigItems.itemShard, 1, 2), new ItemStack(ConfigItems.itemShard, 1, 3), new ItemStack(ConfigItems.itemShard, 1, 7) }));
|
||||
if (false) {
|
||||
ThaumcraftApi.addCrucibleRecipe("ALUMENTUM", new ItemStack(ConfigItems.itemResource, 1, 0), 5, new AspectList().merge(Aspect.ENERGY, 6).merge(Aspect.FIRE, 6).merge(Aspects.DESTRUCTION, 3));
|
||||
oldCrucibleRecipes.add("ALUMENTUM");
|
||||
//ThaumcraftApi.addCrucibleRecipe("GUNPOWDER", new ItemStack(Items.gunpowder), 5, new AspectList().merge(Aspect.FIRE, 6).merge(Aspects.DESTRUCTION, 6));
|
||||
ThaumcraftApi.addCrucibleRecipe("NITOR", new ItemStack(ConfigItems.itemResource, 1, 1), 5, new AspectList().merge(Aspect.ENERGY, 4).merge(Aspect.FIRE, 4).merge(Aspect.LIGHT, 6));
|
||||
oldCrucibleRecipes.add("NITOR");
|
||||
ThaumcraftApi.addCrucibleRecipe("THAUMIUM", new ItemStack(ConfigItems.itemResource, 1, 2), 5, new AspectList().merge(Aspect.METAL, 8).merge(Aspect.MAGIC, 4));
|
||||
oldCrucibleRecipes.add("THAUMIUM");
|
||||
ThaumcraftApi.addCrucibleRecipe("TALLOW", new ItemStack(ConfigItems.itemResource, 1, 4), 5, new AspectList().merge(Aspect.FLESH, 4));
|
||||
oldCrucibleRecipes.add("TALLOW");
|
||||
ThaumcraftApi.addCrucibleRecipe("TRANSGOLD", new ItemStack(Items.gold_nugget, 2, 0), 5, new AspectList().merge(Aspect.METAL, 2).merge(Aspects.VALUABLE, 1));
|
||||
oldCrucibleRecipes.add("TRANSGOLD");
|
||||
if (thaumcraft.common.config.Config.foundCopperIngot) {
|
||||
ThaumcraftApi.addCrucibleRecipe("TRANSCOPPER", new ItemStack(ConfigItems.itemNugget, 3, 1), 5, new AspectList().merge(Aspect.METAL, 3).merge(Aspect.LIFE, 1));
|
||||
oldCrucibleRecipes.add("TRANSCOPPER");
|
||||
}
|
||||
if (thaumcraft.common.config.Config.foundTinIngot) {
|
||||
ThaumcraftApi.addCrucibleRecipe("TRANSTIN", new ItemStack(ConfigItems.itemNugget, 3, 2), 5, new AspectList().merge(Aspect.METAL, 3).merge(Aspect.CRYSTAL, 1));
|
||||
oldCrucibleRecipes.add("TRANSTIN");
|
||||
}
|
||||
if (thaumcraft.common.config.Config.foundSilverIngot) {
|
||||
ThaumcraftApi.addCrucibleRecipe("TRANSSILVER", new ItemStack(ConfigItems.itemNugget, 3, 3), 5, new AspectList().merge(Aspect.METAL, 3).merge(Aspect.EXCHANGE, 1));
|
||||
oldCrucibleRecipes.add("TRANSSILVER");
|
||||
}
|
||||
if (thaumcraft.common.config.Config.foundLeadIngot) {
|
||||
ThaumcraftApi.addCrucibleRecipe("TRANSLEAD", new ItemStack(ConfigItems.itemNugget, 3, 4), 5, new AspectList().merge(Aspect.METAL, 3).merge(Aspect.VOID, 1));
|
||||
oldCrucibleRecipes.add("TRANSLEAD");
|
||||
}
|
||||
ThaumcraftApi.addCrucibleRecipe("TRANSIRON", new ItemStack(ConfigItems.itemNugget, 2, 0), 5, new AspectList().merge(Aspect.METAL, 2));
|
||||
oldCrucibleRecipes.add("TRANSIRON");
|
||||
ThaumcraftApi.getCraftingRecipes().removeIf((Object o) -> o instanceof thaumcraft.api.crafting.CrucibleRecipe && oldCrucibleRecipes.contains(((thaumcraft.api.crafting.CrucibleRecipe)o).key));
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked"})
|
||||
static IRecipe shapelessOreDictRecipe(final ItemStack res, final Object[] params) {
|
||||
final IRecipe rec = (IRecipe)new ShapelessOreRecipe(res, params);
|
||||
CraftingManager.getInstance().getRecipeList().add(rec);
|
||||
return rec;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +1,8 @@
|
|||
package dev.tilera.auracore.api;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
import dev.tilera.auracore.Config;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
|
@ -10,16 +13,40 @@ public class Aspects {
|
|||
public static final Aspect FLUX = new Aspect("mutatio", 12061625, new Aspect[] {Aspect.MAGIC, Aspects.EVIL}, new ResourceLocation("auracore", "textures/aspects/mutatio.png"), 1);
|
||||
public static final Aspect SOUND = new Aspect("sonus", 1100224, new Aspect[] {Aspect.SENSES, Aspect.AIR}, new ResourceLocation("auracore", "textures/aspects/sonus.png"), 1);
|
||||
public static final Aspect VISION = new Aspect("visum", 14013676, new Aspect[] {Aspect.SENSES, Aspect.LIGHT}, new ResourceLocation("auracore", "textures/aspects/visum.png"), 1);
|
||||
public static final Aspect TIME = new Aspect("tempus", 9466080, new Aspect[] {Aspect.VOID, Aspect.ORDER}, new ResourceLocation("auracore", "textures/aspects/tempus.png"), 1);
|
||||
public static Aspect TIME;
|
||||
public static final Aspect ROCK = new Aspect("saxum", 6047810, new Aspect[] {Aspect.EARTH, Aspect.EARTH}, new ResourceLocation("auracore", "textures/aspects/saxum.png"), 1);
|
||||
public static final Aspect DESTRUCTION = new Aspect("fractus", 0x506050, new Aspect[] {Aspect.ENTROPY, Aspect.ENTROPY}, new ResourceLocation("auracore", "textures/aspects/fractus.png"), 1);
|
||||
public static final Aspect PURE = new Aspect("purus", 10878973, new Aspect[] {Aspect.CRYSTAL, Aspect.ORDER}, new ResourceLocation("auracore", "textures/aspects/purus.png"), 1);
|
||||
public static final Aspect VALUABLE = new Aspect("carus", 15121988, new Aspect[] {Aspect.GREED, Aspects.PURE}, new ResourceLocation("auracore", "textures/aspects/carus.png"), 1);
|
||||
public static final Aspect CONTROL = new Aspect("imperito", 10000715, new Aspect[] {Aspect.MIND, Aspect.ORDER}, new ResourceLocation("auracore", "textures/aspects/imperito.png"), 1);
|
||||
public static final Aspect SOIL = new Aspect("solum", 7421741, new Aspect[] {Aspect.EARTH, Aspects.ROCK}, new ResourceLocation("auracore", "textures/aspects/solum.png"), 1);
|
||||
public static final Aspect FLOWER = new Aspect("flos", 0xFFFF40, new Aspect[] {Aspect.PLANT, Aspects.SOIL}, new ResourceLocation("auracore", "textures/aspects/flos.png"), 1);
|
||||
public static final Aspect FLOWER = new Aspect("flos", 0xFFFF40, new Aspect[] {Aspect.PLANT, Aspect.EARTH}, new ResourceLocation("auracore", "textures/aspects/flos.png"), 1);
|
||||
public static final Aspect FUNGUS = new Aspect("fungus", 16246215, new Aspect[] {Aspect.PLANT, Aspect.TREE}, new ResourceLocation("auracore", "textures/aspects/fungus.png"), 1);
|
||||
|
||||
public static void load() {}
|
||||
public static final Aspect VIS = new VirtualAspect("vis", 9896128, new ResourceLocation("thaumcraft", "textures/aspects/praecantatio.png"), 1);
|
||||
public static final Aspect OBSCURE = new VirtualAspect("obscurus", 0x282828, new ResourceLocation("auracore", "textures/aspects/obscurus.png"), 1);
|
||||
|
||||
public static void load() {
|
||||
if (Config.replaceAspects) {
|
||||
ReflectionHelper.setPrivateValue(Aspect.class, Aspect.EARTH, 7421741, "color");
|
||||
ReflectionHelper.setPrivateValue(Aspect.class, Aspect.EARTH, new ResourceLocation("auracore", "textures/aspects/solum.png"), "image");
|
||||
ReflectionHelper.setPrivateValue(Aspect.class, Aspect.MIND, 0x8080EE, "color");
|
||||
ReflectionHelper.setPrivateValue(Aspect.class, Aspect.MIND, new ResourceLocation("auracore", "textures/aspects/cognitio.png"), "image");
|
||||
ReflectionHelper.setPrivateValue(Aspect.class, Aspect.AIR, 12632279, "color");
|
||||
ReflectionHelper.setPrivateValue(Aspect.class, Aspect.AIR, new ResourceLocation("auracore", "textures/aspects/aura.png"), "image");
|
||||
ReflectionHelper.setPrivateValue(Aspect.class, Aspect.TREE, 360709, "color");
|
||||
ReflectionHelper.setPrivateValue(Aspect.class, Aspect.TREE, new ResourceLocation("auracore", "textures/aspects/lignum.png"), "image");
|
||||
ReflectionHelper.setPrivateValue(Aspect.class, Aspect.FIRE, new ResourceLocation("auracore", "textures/aspects/ignis.png"), "image");
|
||||
ReflectionHelper.setPrivateValue(Aspect.class, Aspect.WATER, new ResourceLocation("auracore", "textures/aspects/aqua.png"), "image");
|
||||
ReflectionHelper.setPrivateValue(Aspect.class, Aspect.CRYSTAL, new ResourceLocation("auracore", "textures/aspects/vitreus.png"), "image");
|
||||
}
|
||||
if (Loader.isModLoaded("MagicBees")) {
|
||||
TIME = Aspect.getAspect("tempus");
|
||||
ReflectionHelper.setPrivateValue(Aspect.class, TIME, 9466080, "color");
|
||||
ReflectionHelper.setPrivateValue(Aspect.class, TIME, new ResourceLocation("auracore", "textures/aspects/tempus.png"), "image");
|
||||
|
||||
} else {
|
||||
TIME = new Aspect("tempus", 9466080, new Aspect[] {Aspect.VOID, Aspect.ORDER}, new ResourceLocation("auracore", "textures/aspects/tempus.png"), 1);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@ public class AuraNode implements Serializable {
|
|||
public short baseLevel;
|
||||
public short taint;
|
||||
public AspectList flux = new AspectList();
|
||||
public AspectList stasis = new AspectList();
|
||||
public EnumNodeType type;
|
||||
public int dimension;
|
||||
public double xPos;
|
||||
|
|
172
src/main/java/dev/tilera/auracore/api/AuracoreRecipes.java
Normal file
172
src/main/java/dev/tilera/auracore/api/AuracoreRecipes.java
Normal file
|
@ -0,0 +1,172 @@
|
|||
package dev.tilera.auracore.api;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import dev.tilera.auracore.api.crafting.CrucibleRecipe;
|
||||
import dev.tilera.auracore.api.crafting.IInfusionRecipe;
|
||||
import dev.tilera.auracore.api.crafting.ShapedInfusionCraftingRecipe;
|
||||
import dev.tilera.auracore.api.crafting.ShapelessInfusionCraftingRecipe;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.common.tiles.TileCrucible;
|
||||
|
||||
public class AuracoreRecipes {
|
||||
|
||||
private static List<CrucibleRecipe> crucibleRecipes = new ArrayList<CrucibleRecipe>();
|
||||
private static List<IInfusionRecipe> infusionRecipes = new ArrayList<IInfusionRecipe>();
|
||||
|
||||
public static CrucibleRecipe addCrucibleRecipe(String key, ItemStack result, int cost, AspectList tags) {
|
||||
CrucibleRecipe rec = new CrucibleRecipe(key, result, tags, cost);
|
||||
crucibleRecipes.add(rec);
|
||||
return rec;
|
||||
}
|
||||
|
||||
public static CrucibleRecipe addCrucibleRecipe(String key, String recipeKey, ItemStack result, int cost, AspectList tags) {
|
||||
CrucibleRecipe rec = new CrucibleRecipe(key, recipeKey, result, tags, cost);
|
||||
crucibleRecipes.add(rec);
|
||||
return rec;
|
||||
}
|
||||
|
||||
public static List<CrucibleRecipe> getCrucibleRecipes() {
|
||||
return crucibleRecipes;
|
||||
}
|
||||
|
||||
public static CrucibleRecipe getCrucibleRecipe(String key) {
|
||||
for (Object r : crucibleRecipes) {
|
||||
if (!(r instanceof CrucibleRecipe) || !((CrucibleRecipe)r).key.equals(key)) continue;
|
||||
return (CrucibleRecipe)r;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static CrucibleRecipe getCrucibleRecipe(ItemStack stack) {
|
||||
for (Object r : crucibleRecipes) {
|
||||
if (!(r instanceof CrucibleRecipe) || !((CrucibleRecipe)r).recipeOutput.isItemEqual(stack)) continue;
|
||||
return (CrucibleRecipe)r;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static CrucibleRecipe getCrucibleRecipe(AspectList tags, TileCrucible tile) {
|
||||
int highest = 0;
|
||||
int index = -1;
|
||||
for (int a = 0; a < AuracoreRecipes.getCrucibleRecipes().size(); ++a) {
|
||||
int result;
|
||||
CrucibleRecipe recipe;
|
||||
if (!(AuracoreRecipes.getCrucibleRecipes().get(a) instanceof CrucibleRecipe) || !(recipe = (CrucibleRecipe)AuracoreRecipes.getCrucibleRecipes().get(a)).matches(tags) || (result = recipe.aspects.size()) <= highest) continue;
|
||||
highest = result;
|
||||
index = a;
|
||||
}
|
||||
if (index < 0) {
|
||||
return null;
|
||||
} else {
|
||||
return crucibleRecipes.get(index);
|
||||
}
|
||||
}
|
||||
|
||||
public static int getCrucibleOutputCost(TileCrucible tile, CrucibleRecipe recipe) {
|
||||
int output = 0;
|
||||
AspectList tt = new AspectList();
|
||||
tt.aspects.putAll(tile.aspects.aspects);
|
||||
while (recipe.matches(tt)) {
|
||||
tt = recipe.removeMatching(tt);
|
||||
output += recipe.cost;
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
public static ItemStack getCrucibleOutput(AspectList tags, TileCrucible tile, CrucibleRecipe recipe) {
|
||||
ItemStack output = recipe.recipeOutput.copy();
|
||||
int stackInc = output.stackSize;
|
||||
output.stackSize = 0;
|
||||
while (recipe.matches(tags)) {
|
||||
tags = recipe.removeMatching(tags);
|
||||
output.stackSize += stackInc;
|
||||
}
|
||||
if (!tile.getWorldObj().isRemote) {
|
||||
tile.aspects = tags;
|
||||
}
|
||||
return output;
|
||||
}
|
||||
|
||||
public static List<IInfusionRecipe> getInfusionRecipes() {
|
||||
return infusionRecipes;
|
||||
}
|
||||
|
||||
public static IInfusionRecipe addInfusionCraftingRecipe(String key, String research, int cost, AspectList tags, ItemStack result, Object ... ingredients) {
|
||||
int var9;
|
||||
String var3 = "";
|
||||
int var4 = 0;
|
||||
int var5 = 0;
|
||||
int var6 = 0;
|
||||
if (ingredients[var4] instanceof String[]) {
|
||||
String[] var7;
|
||||
String[] var8 = var7 = (String[])ingredients[var4++];
|
||||
var9 = var7.length;
|
||||
for (int var10 = 0; var10 < var9; ++var10) {
|
||||
String var11 = var8[var10];
|
||||
++var6;
|
||||
var5 = var11.length();
|
||||
var3 = var3 + var11;
|
||||
}
|
||||
} else {
|
||||
while (ingredients[var4] instanceof String) {
|
||||
String var13 = (String)ingredients[var4++];
|
||||
++var6;
|
||||
var5 = var13.length();
|
||||
var3 = var3 + var13;
|
||||
}
|
||||
}
|
||||
HashMap<Character, ItemStack> var14 = new HashMap<Character, ItemStack>();
|
||||
while (var4 < ingredients.length) {
|
||||
Character var16 = (Character)ingredients[var4];
|
||||
ItemStack var17 = null;
|
||||
if (ingredients[var4 + 1] instanceof Item) {
|
||||
var17 = new ItemStack((Item)ingredients[var4 + 1]);
|
||||
} else if (ingredients[var4 + 1] instanceof Block) {
|
||||
var17 = new ItemStack((Block)ingredients[var4 + 1], 1, -1);
|
||||
} else if (ingredients[var4 + 1] instanceof ItemStack) {
|
||||
var17 = (ItemStack)ingredients[var4 + 1];
|
||||
}
|
||||
var14.put(var16, var17);
|
||||
var4 += 2;
|
||||
}
|
||||
ItemStack[] var15 = new ItemStack[var5 * var6];
|
||||
for (var9 = 0; var9 < var5 * var6; ++var9) {
|
||||
char var18 = var3.charAt(var9);
|
||||
var15[var9] = var14.containsKey(Character.valueOf(var18)) ? ((ItemStack)var14.get(Character.valueOf(var18))).copy() : null;
|
||||
}
|
||||
IInfusionRecipe rec = new ShapedInfusionCraftingRecipe(key, research, var5, var6, var15, result, cost, tags);
|
||||
infusionRecipes.add(rec);
|
||||
return rec;
|
||||
}
|
||||
|
||||
public static IInfusionRecipe addShapelessInfusionCraftingRecipe(String key, String research, int cost, AspectList tags, ItemStack result, Object ... ingredients) {
|
||||
ArrayList<ItemStack> var3 = new ArrayList<ItemStack>();
|
||||
Object[] var4 = ingredients;
|
||||
int var5 = ingredients.length;
|
||||
for (int var6 = 0; var6 < var5; ++var6) {
|
||||
Object var7 = var4[var6];
|
||||
if (var7 instanceof ItemStack) {
|
||||
var3.add(((ItemStack)var7).copy());
|
||||
continue;
|
||||
}
|
||||
if (var7 instanceof Item) {
|
||||
var3.add(new ItemStack((Item)var7));
|
||||
continue;
|
||||
}
|
||||
if (!(var7 instanceof Block)) {
|
||||
throw new RuntimeException("Invalid shapeless recipe!");
|
||||
}
|
||||
var3.add(new ItemStack((Block)var7));
|
||||
}
|
||||
IInfusionRecipe rec = new ShapelessInfusionCraftingRecipe(key, research, result, var3, cost, tags);
|
||||
infusionRecipes.add(rec);
|
||||
return rec;
|
||||
}
|
||||
|
||||
}
|
|
@ -5,7 +5,7 @@ public class CrystalColors {
|
|||
public static final int[] colors = new int[]{16777215, 16777086, 16727041, 37119, 40960, 15650047, 5592439, 11154172, 0xB0B0BC, 0x800080};
|
||||
|
||||
public static int getColorForShard(int meta) {
|
||||
if (meta > 9 || meta < 0) {
|
||||
if (meta > 9 || meta < 0 || meta == 6) {
|
||||
return 0xFFFFFF;
|
||||
} else if (meta > 6) {
|
||||
return colors[meta];
|
||||
|
@ -24,4 +24,14 @@ public class CrystalColors {
|
|||
}
|
||||
}
|
||||
|
||||
public static int getColorForCrystal(int meta) {
|
||||
if (meta > 10 || meta < 0) {
|
||||
return 0xFFFFFF;
|
||||
} else if (meta > 7) {
|
||||
return colors[meta - 1];
|
||||
} else {
|
||||
return colors[meta + 1];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
32
src/main/java/dev/tilera/auracore/api/ICrystal.java
Normal file
32
src/main/java/dev/tilera/auracore/api/ICrystal.java
Normal file
|
@ -0,0 +1,32 @@
|
|||
package dev.tilera.auracore.api;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
|
||||
public interface ICrystal {
|
||||
|
||||
public static Map<ChunkCoordinates, Integer> crystalCounts = new HashMap<>();
|
||||
|
||||
/**
|
||||
* @return The amount of crystals in this cluster
|
||||
*/
|
||||
int getCrystalCount(int meta);
|
||||
|
||||
/**
|
||||
* Set the amount of crystals in this cluster.
|
||||
* @param count The new amount of crystals
|
||||
* @return true, if the crystal count was changed
|
||||
*/
|
||||
boolean setCrystalCount(int count);
|
||||
|
||||
/**
|
||||
* Harvest a single shard with a specific tool
|
||||
*/
|
||||
void harvestShard(EntityPlayer player);
|
||||
|
||||
boolean canHarvest(EntityPlayer player);
|
||||
|
||||
}
|
25
src/main/java/dev/tilera/auracore/api/IWandableBlock.java
Normal file
25
src/main/java/dev/tilera/auracore/api/IWandableBlock.java
Normal file
|
@ -0,0 +1,25 @@
|
|||
package dev.tilera.auracore.api;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IWandableBlock {
|
||||
|
||||
/**
|
||||
* Called by wands when interacting with the block
|
||||
* @param world The World of the block
|
||||
* @param stack The ItemStack of the wand
|
||||
* @param impl The IWand implementation for the wand
|
||||
* @param player The player
|
||||
* @param x xCoord of the block
|
||||
* @param y yCoord of the block
|
||||
* @param z zCoord of the block
|
||||
* @param side The side, which was activated
|
||||
* @param md The metadata of the block
|
||||
* @return true, if block was successfully wanded
|
||||
*/
|
||||
boolean onWandRightClick(World world, ItemStack stack, IWand impl, EntityPlayer player, int x, int y, int z, ForgeDirection side, int md);
|
||||
|
||||
}
|
13
src/main/java/dev/tilera/auracore/api/VirtualAspect.java
Normal file
13
src/main/java/dev/tilera/auracore/api/VirtualAspect.java
Normal file
|
@ -0,0 +1,13 @@
|
|||
package dev.tilera.auracore.api;
|
||||
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
|
||||
public class VirtualAspect extends Aspect {
|
||||
|
||||
public VirtualAspect(String tag, int color, ResourceLocation image, int blend) {
|
||||
super(tag, color, null, image, blend);
|
||||
Aspect.aspects.remove(tag);
|
||||
}
|
||||
|
||||
}
|
|
@ -22,8 +22,4 @@ public interface IInfusionRecipe {
|
|||
String getKey();
|
||||
|
||||
String getResearch();
|
||||
|
||||
default boolean isSimple() {
|
||||
return getAspects() == null || getRecipeSize() <= 6;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,112 @@
|
|||
package dev.tilera.auracore.api.crafting;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
public class ShapedInfusionCraftingRecipe implements IInfusionRecipe {
|
||||
public int recipeWidth;
|
||||
public int recipeHeight;
|
||||
public String key;
|
||||
public String research;
|
||||
public int cost;
|
||||
public AspectList tags;
|
||||
public ItemStack[] recipeItems;
|
||||
private ItemStack recipeOutput;
|
||||
public final Item recipeOutputItem;
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public ShapedInfusionCraftingRecipe(String key, String research, int par1, int par2, ItemStack[] par3ArrayOfItemStack, ItemStack par4ItemStack, int cost, AspectList tags) {
|
||||
this.recipeOutputItem = par4ItemStack.getItem();
|
||||
this.recipeWidth = par1;
|
||||
this.recipeHeight = par2;
|
||||
this.recipeItems = par3ArrayOfItemStack;
|
||||
this.recipeOutput = par4ItemStack;
|
||||
this.key = key;
|
||||
this.research = research;
|
||||
this.cost = cost;
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return this.recipeOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(IInventory par1InventoryCrafting, World world, EntityPlayer player) {
|
||||
if (this.research.length() > 0 && !ThaumcraftApiHelper.isResearchComplete(player.getDisplayName(), this.research)) {
|
||||
return false;
|
||||
}
|
||||
for (int var2 = 0; var2 <= 3 - this.recipeWidth; ++var2) {
|
||||
for (int var3 = 0; var3 <= 3 - this.recipeHeight; ++var3) {
|
||||
if (this.checkMatch(par1InventoryCrafting, var2, var3, true)) {
|
||||
return true;
|
||||
}
|
||||
if (!this.checkMatch(par1InventoryCrafting, var2, var3, false)) continue;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean checkMatch(IInventory par1InventoryCrafting, int par2, int par3, boolean par4) {
|
||||
for (int var5 = 0; var5 < 3; ++var5) {
|
||||
for (int var6 = 0; var6 < 3; ++var6) {
|
||||
ItemStack var10;
|
||||
int var7 = var5 - par2;
|
||||
int var8 = var6 - par3;
|
||||
ItemStack var9 = null;
|
||||
if (var7 >= 0 && var8 >= 0 && var7 < this.recipeWidth && var8 < this.recipeHeight) {
|
||||
var9 = par4 ? this.recipeItems[this.recipeWidth - var7 - 1 + var8 * this.recipeWidth] : this.recipeItems[var7 + var8 * this.recipeWidth];
|
||||
}
|
||||
if ((var10 = ThaumcraftApiHelper.getStackInRowAndColumn((Object)par1InventoryCrafting, var5, var6)) == null && var9 == null) continue;
|
||||
if (var10 == null && var9 != null || var10 != null && var9 == null) {
|
||||
return false;
|
||||
}
|
||||
if (var9.getItem() != var10.getItem()) {
|
||||
return false;
|
||||
}
|
||||
if (var9.getItemDamage() != 32767 && var9.getItemDamage() != var10.getItemDamage()) {
|
||||
return false;
|
||||
}
|
||||
if (!var9.hasTagCompound()) continue;
|
||||
return ThaumcraftApiHelper.areItemStackTagsEqualForCrafting(var10, var9);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(IInventory par1InventoryCrafting) {
|
||||
return new ItemStack(this.recipeOutput.getItem(), this.recipeOutput.stackSize, this.recipeOutput.getItemDamage());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return this.recipeWidth * this.recipeHeight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCost() {
|
||||
return this.cost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getAspects() {
|
||||
return this.tags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getResearch() {
|
||||
return this.research;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
package dev.tilera.auracore.api.crafting;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
public class ShapelessInfusionCraftingRecipe implements IInfusionRecipe {
|
||||
private final ItemStack recipeOutput;
|
||||
public final List<ItemStack> recipeItems;
|
||||
public String key;
|
||||
public String research;
|
||||
public int cost;
|
||||
public AspectList tags;
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return this.key;
|
||||
}
|
||||
|
||||
public ShapelessInfusionCraftingRecipe(String key, String research, ItemStack par1ItemStack, List<ItemStack> par2List, int cost, AspectList tags) {
|
||||
this.recipeOutput = par1ItemStack;
|
||||
this.recipeItems = par2List;
|
||||
this.key = key;
|
||||
this.research = research;
|
||||
this.cost = cost;
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return this.recipeOutput;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(IInventory par1InventoryCrafting, World world, EntityPlayer player) {
|
||||
if (this.research.length() > 0 && !ThaumcraftApiHelper.isResearchComplete(player.getDisplayName(), this.research)) {
|
||||
return false;
|
||||
}
|
||||
ArrayList<ItemStack> var2 = new ArrayList<>(this.recipeItems);
|
||||
for (int var3 = 0; var3 < 3; ++var3) {
|
||||
for (int var4 = 0; var4 < 3; ++var4) {
|
||||
ItemStack var5 = ThaumcraftApiHelper.getStackInRowAndColumn((Object)par1InventoryCrafting, var4, var3);
|
||||
if (var5 == null) continue;
|
||||
boolean var6 = false;
|
||||
for (ItemStack var8 : var2) {
|
||||
if (var5.getItem() != var8.getItem() || var8.getItemDamage() != 32767 && var5.getItemDamage() != var8.getItemDamage()) continue;
|
||||
boolean matches = true;
|
||||
if (var8.hasTagCompound()) {
|
||||
matches = ThaumcraftApiHelper.areItemStackTagsEqualForCrafting(var5, var8);
|
||||
}
|
||||
if (!matches) continue;
|
||||
var6 = true;
|
||||
var2.remove((Object)var8);
|
||||
break;
|
||||
}
|
||||
if (var6) continue;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return var2.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(IInventory par1InventoryCrafting) {
|
||||
return this.recipeOutput.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return this.recipeItems.size();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCost() {
|
||||
return this.cost;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AspectList getAspects() {
|
||||
return this.tags;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getResearch() {
|
||||
return this.research;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package dev.tilera.auracore.api.research;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* DO NOT IMPLEMENT THIS!
|
||||
* Implemented by TileResearchTable. Can safely be casted to it.
|
||||
*/
|
||||
public interface IResearchTable {
|
||||
|
||||
ResearchTableExtension getInternalExtension();
|
||||
|
||||
World getWorld();
|
||||
|
||||
int getXCoord();
|
||||
|
||||
int getYCoord();
|
||||
|
||||
int getZCoord();
|
||||
|
||||
void openGUI(EntityPlayer player);
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package dev.tilera.auracore.api.research;
|
||||
|
||||
import dev.tilera.auracore.api.crafting.CrucibleRecipe;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
|
||||
public class ResearchPageCrucible extends ResearchPage {
|
||||
|
||||
public ResearchPageCrucible(CrucibleRecipe recipe) {
|
||||
super("auracore.research_title.crucible");
|
||||
this.recipe = recipe;
|
||||
this.recipeOutput = recipe.recipeOutput.copy();
|
||||
}
|
||||
|
||||
public ResearchPageCrucible(CrucibleRecipe[] recipes) {
|
||||
super("auracore.research_title.crucible");
|
||||
this.recipe = recipes;
|
||||
if (recipes.length > 0) {
|
||||
this.recipeOutput = recipes[0].recipeOutput.copy();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package dev.tilera.auracore.api.research;
|
||||
|
||||
import dev.tilera.auracore.api.crafting.IInfusionRecipe;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
|
||||
public class ResearchPageInfusion extends ResearchPage {
|
||||
|
||||
public ResearchPageInfusion(IInfusionRecipe recipe) {
|
||||
super("auracore.research_title.infusion");
|
||||
this.recipe = recipe;
|
||||
this.recipeOutput = recipe.getRecipeOutput().copy();
|
||||
}
|
||||
|
||||
public ResearchPageInfusion(IInfusionRecipe[] recipes) {
|
||||
super("auracore.research_title.infusion");
|
||||
this.recipe = recipes;
|
||||
if (recipes.length > 0) {
|
||||
this.recipeOutput = recipes[0].getRecipeOutput().copy();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package dev.tilera.auracore.api.research;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public abstract class ResearchTableExtension {
|
||||
|
||||
public WeakReference<IResearchTable> researchTable;
|
||||
private Method markDirty;
|
||||
|
||||
public ResearchTableExtension(IResearchTable researchTable) {
|
||||
this.researchTable = new WeakReference<>(researchTable);
|
||||
Class<? extends ResearchTableExtension> impl = this.getClass();
|
||||
try {
|
||||
markDirty = impl.getDeclaredMethod("markDirty", new Class[0]);
|
||||
} catch (Exception e) {
|
||||
markDirty = null;
|
||||
}
|
||||
}
|
||||
|
||||
public World getWorld() {
|
||||
return researchTable.get().getWorld();
|
||||
}
|
||||
|
||||
public int getXCoord() {
|
||||
return researchTable.get().getXCoord();
|
||||
}
|
||||
|
||||
public int getYCoord() {
|
||||
return researchTable.get().getYCoord();
|
||||
}
|
||||
|
||||
public int getZCoord() {
|
||||
return researchTable.get().getZCoord();
|
||||
}
|
||||
|
||||
public IResearchTable getResearchTable() {
|
||||
return researchTable.get();
|
||||
}
|
||||
|
||||
public abstract void writeToNBT(NBTTagCompound nbt);
|
||||
|
||||
public abstract void readFromNBT(NBTTagCompound nbt);
|
||||
|
||||
public abstract void writeToPacket(NBTTagCompound nbt);
|
||||
|
||||
public abstract void readFromPacket(NBTTagCompound nbt);
|
||||
|
||||
public abstract void onTick();
|
||||
|
||||
public void extMarkDirty() {
|
||||
if (this instanceof IInventory) {
|
||||
((IInventory)this).markDirty();
|
||||
} else if (markDirty != null) {
|
||||
try {
|
||||
markDirty.invoke(this);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public abstract boolean openGUI(EntityPlayer player);
|
||||
|
||||
public abstract String getNBTKey();
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package dev.tilera.auracore.api.research;
|
||||
|
||||
import java.lang.reflect.Constructor;
|
||||
|
||||
public class ResearchTableExtensionRegistry {
|
||||
|
||||
private static Class<? extends ResearchTableExtension> extension = null;
|
||||
|
||||
public static boolean registerResearchTableExtension(Class<? extends ResearchTableExtension> ext, boolean force) {
|
||||
if (extension == null || force) {
|
||||
extension = ext;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean hasActiveExtension() {
|
||||
return extension != null;
|
||||
}
|
||||
|
||||
public static ResearchTableExtension createInstance(IResearchTable table) {
|
||||
try {
|
||||
Constructor<?> constr = extension.getConstructor(IResearchTable.class);
|
||||
return (ResearchTableExtension) constr.newInstance(table);
|
||||
} catch (NullPointerException | ReflectiveOperationException | SecurityException | IllegalArgumentException e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -3,8 +3,10 @@ package dev.tilera.auracore.aura;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.LinkedBlockingQueue;
|
||||
|
||||
|
@ -50,6 +52,18 @@ public class AuraManager {
|
|||
public static Object saveLock = new Object();
|
||||
public static NodeIdStorage nodeIdStore = null;
|
||||
|
||||
public static void invalidate() {
|
||||
auraNodes.clear();;
|
||||
auraUpdateList.clear();
|
||||
nodeNeighbours.clear();;
|
||||
nodeChunks.clear();
|
||||
markedForTransmission.clear();;
|
||||
fluxEventList.clear();
|
||||
auraCalcQueue.clear();
|
||||
auraDeleteQueue.clear();
|
||||
auraUpdateQueue.clear();
|
||||
}
|
||||
|
||||
public static int registerAuraNode(World world, short lvl, EnumNodeType type, int dim, int x, int y, int z) {
|
||||
return registerAuraNode(world, lvl, type, dim, x, y, z, false);
|
||||
}
|
||||
|
@ -216,6 +230,39 @@ public class AuraManager {
|
|||
return closest;
|
||||
}
|
||||
|
||||
public static int getClosestAuraWithinRange(World world, double x, double z, double range) {
|
||||
int dim = world.provider.dimensionId;
|
||||
int cx = MathHelper.floor_double((double)x) / 16;
|
||||
int cz = MathHelper.floor_double((double)z) / 16;
|
||||
if (world.isRemote) {
|
||||
return -1;
|
||||
}
|
||||
int size = 5;
|
||||
int closest = -1;
|
||||
double clRange = Double.MAX_VALUE;
|
||||
synchronized (saveLock) {
|
||||
for (int xx = -size; xx <= size; ++xx) {
|
||||
for (int zz = -size; zz <= size; ++zz) {
|
||||
List<Integer> nc = nodeChunks.get(Arrays.asList(dim, cx + xx, cz + zz));
|
||||
if (nc == null || nc.size() <= 0) continue;
|
||||
for (Integer key : nc) {
|
||||
try {
|
||||
double zd;
|
||||
double xd;
|
||||
double distSq;
|
||||
AuraNode node = AuraManager.copyNode(AuraManager.getNode(key));
|
||||
if (node == null || node.locked || !Utils.isChunkLoaded(world, MathHelper.floor_double((double)node.xPos), MathHelper.floor_double((double)node.zPos)) || !(range * range >= (distSq = (xd = node.xPos - x) * xd + (zd = node.zPos - z) * zd)) || !(distSq < clRange)) continue;
|
||||
closest = key;
|
||||
clRange = distSq;
|
||||
}
|
||||
catch (Exception e) {}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return closest;
|
||||
}
|
||||
|
||||
public static ArrayList<Integer> getAurasWithin(World world, double x, double y, double z) {
|
||||
int dim = world.provider.dimensionId;
|
||||
int cx = MathHelper.floor_double((double)x) / 16;
|
||||
|
@ -779,12 +826,17 @@ public class AuraManager {
|
|||
}
|
||||
|
||||
public static void queueNodeChanges(int key, int levelMod, int baseMod, boolean toggleLock, AspectList flx, float x, float y, float z) {
|
||||
NodeChanges nc = new NodeChanges(key, levelMod, baseMod, 0, toggleLock, flx, x, y, z);
|
||||
NodeChanges nc = new NodeChanges(key, levelMod, baseMod, 0, toggleLock, flx, null, x, y, z);
|
||||
auraUpdateQueue.add(nc);
|
||||
}
|
||||
|
||||
public static void queueNodeChanges(int key, int levelMod, int baseMod, int taint, boolean toggleLock, AspectList flx, float x, float y, float z) {
|
||||
NodeChanges nc = new NodeChanges(key, levelMod, baseMod, taint, toggleLock, flx, x, y, z);
|
||||
NodeChanges nc = new NodeChanges(key, levelMod, baseMod, taint, toggleLock, flx, null, x, y, z);
|
||||
auraUpdateQueue.add(nc);
|
||||
}
|
||||
|
||||
public static void queueNodeChanges(int key, int levelMod, int baseMod, int taint, boolean toggleLock, AspectList flx, AspectList stasis, float x, float y, float z) {
|
||||
NodeChanges nc = new NodeChanges(key, levelMod, baseMod, taint, toggleLock, flx, stasis, x, y, z);
|
||||
auraUpdateQueue.add(nc);
|
||||
}
|
||||
|
||||
|
@ -793,7 +845,32 @@ public class AuraManager {
|
|||
if (key < 0) {
|
||||
key = registerAuraNode(world, (short)(world.rand.nextInt(50) + 50), EnumNodeType.DARK, world.provider.dimensionId, x, y, z);
|
||||
}
|
||||
queueNodeChanges(key, 0, 0, taint, false, null, x, y, z);
|
||||
queueNodeChanges(key, 0, 0, taint, false, null, 0, 0, 0);
|
||||
}
|
||||
|
||||
public static void addGoodVibes(World world, int x, int y, int z, int amount) {
|
||||
int key = getClosestAuraWithinRange(world, x, y, z, 64);
|
||||
if (key < 0) return;
|
||||
queueNodeChanges(key, 0, 0, 0, false, null, new AspectList().add(Aspect.MAGIC, amount), 0, 0, 0);
|
||||
}
|
||||
|
||||
public static void addBadVibes(World world, int x, int y, int z, int amount) {
|
||||
int key = getClosestAuraWithinRange(world, x, y, z, 64);
|
||||
if (key < 0) return;
|
||||
queueNodeChanges(key, 0, 0, 0, false, new AspectList().add(Aspect.TAINT, amount), null, 0, 0, 0);
|
||||
}
|
||||
|
||||
public static void addBoost(World world, int x, int y, int z, int amount) {
|
||||
int key = getClosestAuraWithinRange(world, x, y, z, 64);
|
||||
if (key < 0) return;
|
||||
queueNodeChanges(key, 0, 0, 0, false, null, new AspectList().add(Aspects.TIME, amount), 0, 0, 0);
|
||||
}
|
||||
|
||||
public static int getBoost(World world, int x, int y, int z) {
|
||||
int key = getClosestAuraWithinRange(world, x, y, z, 64);
|
||||
if (key < 0) return 0;
|
||||
AuraNode node = getNode(key);
|
||||
return node.stasis.getAmount(Aspects.TIME);
|
||||
}
|
||||
|
||||
public static AuraNode copyNode(AuraNode in) {
|
||||
|
@ -809,6 +886,11 @@ public class AuraManager {
|
|||
outflux.add(tag, in.flux.getAmount(tag));
|
||||
}
|
||||
out.flux = outflux;
|
||||
AspectList outstasis = new AspectList();
|
||||
for (Aspect tag : in.stasis.getAspects()) {
|
||||
outstasis.add(tag, in.stasis.getAmount(tag));
|
||||
}
|
||||
out.stasis = outstasis;
|
||||
out.dimension = in.dimension;
|
||||
out.xPos = in.xPos;
|
||||
out.yPos = in.yPos;
|
||||
|
@ -829,6 +911,7 @@ public class AuraManager {
|
|||
out.taint = in.taint;
|
||||
out.type = in.type;
|
||||
out.flux = in.flux;
|
||||
out.stasis = in.stasis;
|
||||
out.dimension = in.dimension;
|
||||
out.xPos = in.xPos;
|
||||
out.yPos = in.yPos;
|
||||
|
@ -844,17 +927,19 @@ public class AuraManager {
|
|||
int taintMod = 0;
|
||||
boolean lock = false;
|
||||
AspectList flux = null;
|
||||
AspectList stasis = null;
|
||||
float motionX;
|
||||
float motionY;
|
||||
float motionZ;
|
||||
|
||||
NodeChanges(int k, int l, int b, int t, boolean lo, AspectList ot, float x, float y, float z) {
|
||||
NodeChanges(int k, int l, int b, int t, boolean lo, AspectList flux, AspectList stasis, float x, float y, float z) {
|
||||
this.key = k;
|
||||
this.levelMod = l;
|
||||
this.baseMod = b;
|
||||
this.taintMod = t;
|
||||
this.lock = lo;
|
||||
this.flux = ot;
|
||||
this.flux = flux;
|
||||
this.stasis = stasis;
|
||||
this.motionX = x;
|
||||
this.motionY = y;
|
||||
this.motionZ = z;
|
||||
|
|
|
@ -74,6 +74,38 @@ public class AuraUpdateThread
|
|||
}
|
||||
}
|
||||
}
|
||||
if (nc.stasis != null) {
|
||||
for (Aspect tag : nc.stasis.getAspects()) {
|
||||
if (nc.stasis.getAmount(tag) > 0) {
|
||||
node.stasis.add(tag, nc.stasis.getAmount(tag));
|
||||
continue;
|
||||
}
|
||||
node.stasis.reduce(tag, -nc.stasis.getAmount(tag)); // TODO:WTF
|
||||
}
|
||||
}
|
||||
if (node.stasis.size() > 0) {
|
||||
ArrayList<Aspect> dt = new ArrayList<>();
|
||||
ArrayList<Aspect> red = new ArrayList<>();
|
||||
for (Aspect tag : node.stasis.getAspects()) {
|
||||
if (node.stasis.getAmount(tag) <= 0) {
|
||||
dt.add(tag);
|
||||
continue;
|
||||
}
|
||||
if (node.stasis.getAmount(tag) <= 100)
|
||||
continue;
|
||||
red.add(tag);
|
||||
}
|
||||
if (red.size() > 0) {
|
||||
for (Aspect tag : red) {
|
||||
node.stasis.reduce(tag, node.stasis.getAmount(tag) - 100);
|
||||
}
|
||||
}
|
||||
if (dt.size() > 0) {
|
||||
for (Aspect tag : dt) {
|
||||
node.stasis.remove(tag);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nc.motionX != 0.0f || nc.motionY != 0.0f || nc.motionZ != 0.0f) {
|
||||
int cx = MathHelper.floor_double((double) node.xPos) / 16;
|
||||
cz = MathHelper.floor_double((double) node.zPos) / 16;
|
||||
|
|
|
@ -33,6 +33,7 @@ public class AuraManagerClient {
|
|||
public boolean lock;
|
||||
public byte type;
|
||||
public int dimension;
|
||||
public boolean isVirtual;
|
||||
|
||||
public NodeStats(AuraPacket packet, int dimension) {
|
||||
key = packet.key;
|
||||
|
@ -46,6 +47,7 @@ public class AuraManagerClient {
|
|||
lock = packet.lock;
|
||||
type = packet.type;
|
||||
this.dimension = dimension;
|
||||
this.isVirtual = packet.virtual;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ public class RenderEventHandler {
|
|||
Minecraft mc = Minecraft.getMinecraft();
|
||||
if (Minecraft.getMinecraft().renderViewEntity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer)Minecraft.getMinecraft().renderViewEntity;
|
||||
long time = mc.theWorld.getWorldTime();
|
||||
long time = mc.theWorld.getTotalWorldTime();
|
||||
if (Utils.hasGoggles(player)) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDepthMask((boolean)false);
|
||||
|
@ -56,6 +56,7 @@ public class RenderEventHandler {
|
|||
int limit = 0;
|
||||
Collection<NodeStats> col = AuraManagerClient.auraClientList.values();
|
||||
for (NodeStats l : col) {
|
||||
if (l.isVirtual) continue;
|
||||
float px = (float) l.x;
|
||||
float py = (float) l.y;
|
||||
float pz = (float) l.z;
|
||||
|
|
|
@ -27,7 +27,7 @@ public class ContainerWorkbench extends Container {
|
|||
this.tileEntity.eventHandler = this;
|
||||
this.ip = par1InventoryPlayer;
|
||||
this.addSlotToContainer((Slot)new SlotCraftingArcaneWorkbench(par1InventoryPlayer.player, this.tileEntity, this.tileEntity, 9, 124, 29));
|
||||
this.addSlotToContainer(new SlotWorkbenchWand(this.tileEntity, 10, 124, 61));
|
||||
this.addSlotToContainer(new SlotWorkbenchWand(this.tileEntity, 10, 124, 61, par1InventoryPlayer.player));
|
||||
for (var6 = 0; var6 < 3; ++var6) {
|
||||
for (var7 = 0; var7 < 3; ++var7) {
|
||||
this.addSlotToContainer(new Slot(this.tileEntity, var7 + var6 * 3, 30 + var7 * 18, 17 + var6 * 18));
|
||||
|
|
|
@ -22,6 +22,7 @@ public class SlotCraftingArcaneWorkbench extends SlotCrafting {
|
|||
this.craftMatrix = par2IInventory;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"deprecation"})
|
||||
public void onPickupFromSlot(EntityPlayer par1EntityPlayer, ItemStack par1ItemStack) {
|
||||
FMLCommonHandler.instance().firePlayerCraftingEvent(this.thePlayer, par1ItemStack, this.craftMatrix);
|
||||
this.onCrafting(par1ItemStack);
|
||||
|
|
|
@ -1,18 +1,38 @@
|
|||
package dev.tilera.auracore.container;
|
||||
|
||||
import dev.tilera.auracore.api.IWand;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.items.wands.ItemWandCasting;
|
||||
import thaumcraft.common.tiles.TileArcaneWorkbench;
|
||||
|
||||
class SlotWorkbenchWand extends Slot {
|
||||
public SlotWorkbenchWand(IInventory par2IInventory, int par3, int par4, int par5) {
|
||||
TileArcaneWorkbench workbench;
|
||||
EntityPlayer player;
|
||||
|
||||
public SlotWorkbenchWand(TileArcaneWorkbench par2IInventory, int par3, int par4, int par5, EntityPlayer player) {
|
||||
super(par2IInventory, par3, par4, par5);
|
||||
this.workbench = par2IInventory;
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack par1ItemStack) {
|
||||
return par1ItemStack.getItem() instanceof ItemWandCasting || par1ItemStack.getItem() instanceof IWand;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSlotChanged() {
|
||||
super.onSlotChanged();
|
||||
if (
|
||||
!this.workbench.getWorldObj().isRemote &&
|
||||
this.inventory.getStackInSlot(this.getSlotIndex()) != null &&
|
||||
this.inventory.getStackInSlot(this.getSlotIndex()).getItem() instanceof ItemWandCasting) {
|
||||
player.inventory.setItemStack(null);
|
||||
player.openGui(Thaumcraft.instance, 13, this.workbench.getWorldObj(), this.workbench.xCoord, this.workbench.yCoord, this.workbench.zCoord);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,257 @@
|
|||
package dev.tilera.auracore.crafting;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import dev.tilera.auracore.api.AuracoreRecipes;
|
||||
import dev.tilera.auracore.api.crafting.CrucibleRecipe;
|
||||
import dev.tilera.auracore.api.crafting.IInfusionRecipe;
|
||||
import dev.tilera.auracore.api.crafting.ShapedInfusionCraftingRecipe;
|
||||
import dev.tilera.auracore.api.crafting.ShapelessInfusionCraftingRecipe;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.crafting.IArcaneRecipe;
|
||||
import thaumcraft.api.crafting.ShapedArcaneRecipe;
|
||||
import thaumcraft.api.crafting.ShapelessArcaneRecipe;
|
||||
import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager;
|
||||
|
||||
public class AspectCalculation {
|
||||
|
||||
public static AspectList generateTagsFromInfusionRecipes(Item item, int meta, ArrayList<List> history) {
|
||||
AspectList ret = null;
|
||||
int value = 0;
|
||||
List<IInfusionRecipe> recipeList = AuracoreRecipes.getInfusionRecipes();
|
||||
for (int q = 0; q < recipeList.size(); ++q) {
|
||||
int idS;
|
||||
IInfusionRecipe recipe = recipeList.get(q);
|
||||
int idR = recipe.getRecipeOutput().getItemDamage() < 0 ? 0 : recipe.getRecipeOutput().getItemDamage();
|
||||
int n = idS = meta < 0 ? 0 : meta;
|
||||
if (recipe.getRecipeOutput().getItem() != item || idR != idS) continue;
|
||||
HashMap<ItemSignature, ItemStack> ingredients = new HashMap<>();
|
||||
AspectList ph = new AspectList();
|
||||
int cval = 0;
|
||||
try {
|
||||
if (recipe instanceof ShapedInfusionCraftingRecipe) {
|
||||
int width = ((ShapedInfusionCraftingRecipe)recipe).recipeWidth;
|
||||
int height = ((ShapedInfusionCraftingRecipe)recipe).recipeHeight;
|
||||
ItemStack[] items = ((ShapedInfusionCraftingRecipe)recipe).recipeItems;
|
||||
for (int i = 0; i < width && i < 3; ++i) {
|
||||
for (int j = 0; j < height && j < 3; ++j) {
|
||||
if (items[i + j * width] == null) continue;
|
||||
items[i + j * width].stackSize = 1;
|
||||
if (ingredients.containsKey(new ItemSignature(items[i + j * width]))) {
|
||||
ItemStack is = (ItemStack)ingredients.get(new ItemSignature(items[i + j * width]));
|
||||
++is.stackSize;
|
||||
ingredients.put(new ItemSignature(items[i + j * width]), is);
|
||||
continue;
|
||||
}
|
||||
ingredients.put(new ItemSignature(items[i + j * width]), items[i + j * width]);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<ItemStack> items = ((ShapelessInfusionCraftingRecipe)recipe).recipeItems;
|
||||
for (int i = 0; i < items.size() && i < 9; ++i) {
|
||||
if (items.get(i) == null) continue;
|
||||
((ItemStack)items.get((int)i)).stackSize = 1;
|
||||
if (ingredients.containsKey(new ItemSignature(items.get((int)i)))) {
|
||||
ItemStack is = (ItemStack)ingredients.get(new ItemSignature(items.get((int)i)));
|
||||
++is.stackSize;
|
||||
ingredients.put(new ItemSignature(items.get((int)i)), is);
|
||||
continue;
|
||||
}
|
||||
ingredients.put(new ItemSignature(items.get((int)i)), items.get(i));
|
||||
}
|
||||
}
|
||||
Collection<ItemStack> ings = ingredients.values();
|
||||
for (ItemStack is : ings) {
|
||||
AspectList obj = ThaumcraftCraftingManager.generateTags(is.getItem(), is.getItemDamage(), history);
|
||||
AspectList objC = null;
|
||||
if (is.getItem().getContainerItem() != null) {
|
||||
objC = ThaumcraftCraftingManager.generateTags(is.getItem().getContainerItem(), -1, history);
|
||||
}
|
||||
if (obj == null) continue;
|
||||
for (Aspect as : obj.getAspects()) {
|
||||
float amnt;
|
||||
if (objC != null && objC.getAmount(as) > 0 || !((amnt = (float)(obj.getAmount(as) * is.stackSize) / (float)recipe.getRecipeOutput().stackSize) > 0.5f)) continue;
|
||||
float tmod = 0.8f;
|
||||
ph.add(as, Math.max(Math.round(amnt * tmod), 1));
|
||||
cval += Math.max(Math.round(amnt * tmod), 1);
|
||||
}
|
||||
}
|
||||
ph.add(Aspect.MAGIC, Math.round((float)recipe.getCost() / 10.0f / (float)recipe.getRecipeOutput().stackSize));
|
||||
for (Aspect tag : recipe.getAspects().getAspects()) {
|
||||
ph.add(tag, Math.round((float)recipe.getAspects().getAmount(tag) / (float)recipe.getRecipeOutput().stackSize));
|
||||
}
|
||||
if (cval < value) continue;
|
||||
ret = ph;
|
||||
value = cval;
|
||||
continue;
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static AspectList generateTagsFromCrucibleRecipes(Item item, int meta, ArrayList<List> history) {
|
||||
CrucibleRecipe cr = AuracoreRecipes.getCrucibleRecipe(new ItemStack(item, 1, meta));
|
||||
if (cr != null) {
|
||||
AspectList ot = new AspectList();
|
||||
int ss = cr.recipeOutput.stackSize;
|
||||
ot.add(Aspect.MAGIC, Math.round((float)cr.cost / 10.0f));
|
||||
for (Aspect tt : cr.aspects.getAspects()) {
|
||||
int amt = cr.aspects.getAmount(tt) / ss;
|
||||
ot.add(tt, amt);
|
||||
}
|
||||
return ot;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static AspectList generateTagsFromArcaneRecipes(Item item, int meta, ArrayList<List> history) {
|
||||
AspectList ret = null;
|
||||
int value = 0;
|
||||
List recipeList = ThaumcraftApi.getCraftingRecipes();
|
||||
for (int q = 0; q < recipeList.size(); ++q) {
|
||||
int idS;
|
||||
if (!(recipeList.get(q) instanceof IArcaneRecipe)) continue;
|
||||
IArcaneRecipe recipe = (IArcaneRecipe)recipeList.get(q);
|
||||
if (!(recipe instanceof ShapedArcaneRecipe || recipe instanceof ShapelessArcaneRecipe)) continue;
|
||||
int idR = recipe.getRecipeOutput().getItemDamage() < 0 ? 0 : recipe.getRecipeOutput().getItemDamage();
|
||||
int n = idS = meta < 0 ? 0 : meta;
|
||||
if (recipe.getRecipeOutput().getItem() != item || idR != idS) continue;
|
||||
HashMap<ItemSignature, ItemStack> ingredients = new HashMap<>();
|
||||
AspectList ph = new AspectList();
|
||||
int cval = 0;
|
||||
try {
|
||||
if (recipe instanceof ShapedArcaneRecipe) {
|
||||
int width = ((ShapedArcaneRecipe)recipe).width;
|
||||
int height = ((ShapedArcaneRecipe)recipe).width;
|
||||
Object[] items = ((ShapedArcaneRecipe)recipe).input;
|
||||
for (int i = 0; i < width && i < 3; ++i) {
|
||||
for (int j = 0; j < height && j < 3; ++j) {
|
||||
if (items[i + j * width] == null) continue;
|
||||
ItemStack stack = null;
|
||||
if (items[i + j * width] instanceof ItemStack) {
|
||||
stack = (ItemStack) items[i + j * width];
|
||||
|
||||
} else if (items[i + j * width] instanceof ArrayList) {
|
||||
ArrayList<ItemStack> l = (ArrayList<ItemStack>) items[i + j * width];
|
||||
if (l.size() > 0) {
|
||||
stack = l.get(0);
|
||||
}
|
||||
}
|
||||
if (stack != null) {
|
||||
stack.stackSize = 1;
|
||||
if (ingredients.containsKey(new ItemSignature(stack))) {
|
||||
ItemStack is = (ItemStack)ingredients.get(new ItemSignature(stack));
|
||||
++is.stackSize;
|
||||
ingredients.put(new ItemSignature(stack), is);
|
||||
continue;
|
||||
}
|
||||
ingredients.put(new ItemSignature(stack), stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
List<Object> items = ((ShapelessArcaneRecipe)recipe).getInput();
|
||||
for (int i = 0; i < items.size() && i < 9; ++i) {
|
||||
if (items.get(i) == null) continue;
|
||||
ItemStack stack = null;
|
||||
if (items.get(i) instanceof ItemStack) {
|
||||
stack = (ItemStack) items.get(i);
|
||||
} else if (items.get(i) instanceof ArrayList) {
|
||||
ArrayList<ItemStack> l = (ArrayList<ItemStack>) items.get(i);
|
||||
if (l.size() > 0){
|
||||
stack = l.get(0);
|
||||
}
|
||||
}
|
||||
if (stack != null) {
|
||||
stack.stackSize = 1;
|
||||
if (ingredients.containsKey(new ItemSignature(stack))) {
|
||||
ItemStack is = (ItemStack)ingredients.get(new ItemSignature(stack));
|
||||
++is.stackSize;
|
||||
ingredients.put(new ItemSignature(stack), is);
|
||||
continue;
|
||||
}
|
||||
ingredients.put(new ItemSignature(stack), stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
Collection<ItemStack> ings = ingredients.values();
|
||||
for (ItemStack is : ings) {
|
||||
AspectList obj = ThaumcraftCraftingManager.generateTags(is.getItem(), is.getItemDamage(), history);
|
||||
AspectList objC = null;
|
||||
if (is.getItem().getContainerItem() != null) {
|
||||
objC = ThaumcraftCraftingManager.generateTags(is.getItem().getContainerItem(), -1, history);
|
||||
}
|
||||
if (obj == null) continue;
|
||||
for (Aspect as : obj.getAspects()) {
|
||||
float amnt;
|
||||
if (objC != null && objC.getAmount(as) > 0 || !((amnt = (float)(obj.getAmount(as) * is.stackSize) / (float)recipe.getRecipeOutput().stackSize) > 0.5f)) continue;
|
||||
float tmod = 0.8f;
|
||||
ph.add(as, Math.max(Math.round(amnt * tmod), 1));
|
||||
cval += Math.max(Math.round(amnt * tmod), 1);
|
||||
}
|
||||
}
|
||||
ph.add(Aspect.MAGIC, Math.round((float)AuracoreCraftingManager.getArcaneRecipeVisCost(recipe, null) / 10.0f / (float)recipe.getRecipeOutput().stackSize));
|
||||
if (cval < value) continue;
|
||||
ret = ph;
|
||||
value = cval;
|
||||
continue;
|
||||
}
|
||||
catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static class ItemSignature {
|
||||
|
||||
Item item;
|
||||
int metadata;
|
||||
|
||||
public ItemSignature(ItemStack stack) {
|
||||
this.item = stack.getItem();
|
||||
this.metadata = stack.getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + ((item == null) ? 0 : item.hashCode());
|
||||
result = prime * result + metadata;
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj)
|
||||
return true;
|
||||
if (obj == null)
|
||||
return false;
|
||||
if (getClass() != obj.getClass())
|
||||
return false;
|
||||
ItemSignature other = (ItemSignature) obj;
|
||||
if (item == null) {
|
||||
if (other.item != null)
|
||||
return false;
|
||||
} else if (!item.equals(other.item))
|
||||
return false;
|
||||
if (metadata != other.metadata)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,11 +1,19 @@
|
|||
package dev.tilera.auracore.crafting;
|
||||
|
||||
import dev.tilera.auracore.api.AuracoreRecipes;
|
||||
import dev.tilera.auracore.api.crafting.CrucibleRecipe;
|
||||
import dev.tilera.auracore.api.crafting.IInfusionRecipe;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.crafting.IArcaneRecipe;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.lib.research.ResearchManager;
|
||||
import thaumcraft.common.tiles.TileCrucible;
|
||||
import thaumcraft.common.tiles.TileMagicWorkbench;
|
||||
|
||||
public class AuracoreCraftingManager {
|
||||
|
@ -20,10 +28,26 @@ public class AuracoreCraftingManager {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static IInfusionRecipe findMatchingInfusionRecipe(TileMagicWorkbench inv, EntityPlayer pl) {
|
||||
for (IInfusionRecipe recipe : AuracoreRecipes.getInfusionRecipes()) {
|
||||
if (recipe.matches(inv, pl.worldObj, pl)) {
|
||||
return recipe;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getArcaneRecipeVisCost(IArcaneRecipe recipe, TileMagicWorkbench awb) {
|
||||
if (recipe == null) return 0;
|
||||
int sum = 0;
|
||||
AspectList aspects = recipe.getAspects(awb);
|
||||
AspectList aspects = recipe.getAspects();
|
||||
if (awb != null) {
|
||||
aspects = recipe.getAspects(awb);
|
||||
}
|
||||
if (aspects == null) {
|
||||
aspects = new AspectList();
|
||||
}
|
||||
for (Aspect aspect : aspects.getAspects()) {
|
||||
if (aspect != null) sum += aspects.getAmount(aspect);
|
||||
}
|
||||
|
@ -40,4 +64,52 @@ public class AuracoreCraftingManager {
|
|||
return workbenchTile;
|
||||
}
|
||||
|
||||
public static boolean performCrucibleCrafting(EntityPlayer player, TileCrucible tile) {
|
||||
AspectList tags = new AspectList();
|
||||
for (Aspect tag : tile.aspects.getAspects()) {
|
||||
tags.add(tag, tile.aspects.getAmount(tag));
|
||||
}
|
||||
World world = tile.getWorldObj();
|
||||
CrucibleRecipe recipe = AuracoreRecipes.getCrucibleRecipe(tags, tile);
|
||||
ItemStack output = AuracoreRecipes.getCrucibleOutput(tags, tile, recipe);
|
||||
if (output != null && isCrucibleCreationSuccessful(world, output, player) && !world.isRemote) {
|
||||
tile.ejectItem(output);
|
||||
world.addBlockEvent(tile.xCoord, tile.yCoord, tile.zCoord, ConfigBlocks.blockMetalDevice, 1, -1);
|
||||
}
|
||||
if (!world.isRemote) {
|
||||
tile.spillRemnants();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static boolean isCrucibleCreationSuccessful(World world, ItemStack item, EntityPlayer player) {
|
||||
String key = AuracoreRecipes.getCrucibleRecipe((ItemStack)item).key;
|
||||
boolean completed = ResearchManager.isResearchComplete(player.getDisplayName(), key);
|
||||
float chance = 0.0f;
|
||||
if (completed) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
//TODO: research
|
||||
/*if (!ResearchManager.doesPlayerHaveRequisites(player.getDisplayName(), key)) {
|
||||
return false;
|
||||
}
|
||||
ItemStack note = ResearchManager.createResearchNoteForPlayer(world, player, key);
|
||||
if (note == null) {
|
||||
if (!world.isRemote) {
|
||||
player.func_70006_a("Your discover something, but you can't record your findings!");
|
||||
}
|
||||
} else if (ResearchManager.progressExperimentalResearch(world, key, note, Config.resExpChance + (int)Math.sqrt(item.stackSize * 8))) {
|
||||
chance = ResearchManager.getData(note).getTotalProgress();
|
||||
if (chance == 1.0f) {
|
||||
note.setItemDamage(note.getItemDamage() + 64);
|
||||
}
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
if (!world.isRemote) {
|
||||
player.func_70006_a("You've learned something new!");
|
||||
}
|
||||
}
|
||||
return world.rand.nextFloat() < chance;*/
|
||||
}
|
||||
|
||||
}
|
||||
|
|
348
src/main/java/dev/tilera/auracore/helper/LegacyAspects.java
Normal file
348
src/main/java/dev/tilera/auracore/helper/LegacyAspects.java
Normal file
|
@ -0,0 +1,348 @@
|
|||
package dev.tilera.auracore.helper;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import dev.tilera.auracore.api.Aspects;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionHelper;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
|
||||
public class LegacyAspects {
|
||||
|
||||
public static void initAspects() {
|
||||
ThaumcraftApi.registerObjectTag("cobblestone", new AspectList().add(Aspects.ROCK, 1).add(Aspects.DESTRUCTION, 1));
|
||||
ThaumcraftApi.registerObjectTag("stone", new AspectList().add(Aspects.ROCK, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.end_stone), new AspectList().add(Aspect.EARTH, 1).add(Aspects.ROCK, 1).add(Aspect.DARKNESS, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.sand, 1, 32767), new AspectList().add(Aspect.EARTH, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.dirt, 1, 32767), new AspectList().add(Aspect.EARTH, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.grass), new AspectList().add(Aspect.EARTH, 2).add(Aspect.PLANT, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.gravel), new AspectList().add(Aspect.EARTH, 1).add(Aspects.ROCK, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.mycelium), new AspectList().add(Aspect.EARTH, 2).add(Aspects.FUNGUS, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.clay_ball, 1, 32767), new AspectList().add(Aspect.EARTH, 2).add(Aspect.WATER, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.clay, 1, 32767), new AspectList().add(Aspect.EARTH, 6).add(Aspect.WATER, 3));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.gold_nugget), new AspectList().add(Aspect.METAL, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemNugget, 1, 32767), new AspectList().add(Aspect.METAL, 1)); // TODO: ?
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.brick, 1, 32767), new AspectList().add(Aspect.EARTH, 2).add(Aspect.FIRE, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.soul_sand, 1, 32767), new AspectList().add(Aspect.EARTH, 1).add(Aspect.TRAP, 1).add(Aspect.SOUL, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.netherrack, 1, 32767), new AspectList().add(Aspect.EARTH, 1).add(Aspects.ROCK, 1).add(Aspect.FIRE, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.nether_brick), new AspectList().add(Aspects.ROCK, 2).add(Aspect.FIRE, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.glass, 1, 32767), new AspectList().add(Aspect.CRYSTAL, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.snowball, 1, 32767), new AspectList().add(Aspect.COLD, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.tallgrass, 1, 32767), new AspectList().add(Aspect.PLANT, 1).add(Aspect.AIR, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.waterlily, 1, 32767), new AspectList().add(Aspect.PLANT, 2).add(Aspect.WATER, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.deadbush, 1, 32767), new AspectList().add(Aspect.PLANT, 1).add(Aspect.AIR, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.vine, 1, 32767), new AspectList().add(Aspect.PLANT, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.wheat_seeds, 1, 32767), new AspectList().add(Aspect.PLANT, 1).add(Aspect.EXCHANGE, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.melon_seeds, 1, 32767), new AspectList().add(Aspect.PLANT, 1).add(Aspect.EXCHANGE, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.pumpkin_seeds, 1, 32767), new AspectList().add(Aspect.PLANT, 1).add(Aspect.EXCHANGE, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.melon, 1, 32767), new AspectList().add(Aspect.LIFE, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.nether_wart), new AspectList().add(Aspects.FUNGUS, 1).add(Aspects.FLUX, 1).add(Aspect.FIRE, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.dye), new AspectList().add(Aspect.DARKNESS, 1).add(Aspect.FLESH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.dye, 1, 2), new AspectList().add(Aspect.PLANT, 3));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.dye, 1, 3), new AspectList().add(Aspect.PLANT, 1).add(Aspect.ENERGY, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.dye, 1, 4), new AspectList().add(Aspects.VALUABLE, 1).add(Aspects.ROCK, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.cookie), new AspectList().add(Aspect.LIFE, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.potionitem), new AspectList().add(Aspect.WATER, 1).add(Aspect.CRYSTAL, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.torch, 1, 32767), new AspectList().add(Aspect.LIGHT, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.mossy_cobblestone, 1, 32767), new AspectList().add(Aspects.ROCK, 2).add(Aspect.PLANT, 1).add(Aspects.FLUX, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.ice, 1, 32767), new AspectList().add(Aspect.COLD, 2).add(Aspect.CRYSTAL, 1).add(Aspect.WATER, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.red_flower), new AspectList().add(Aspects.FLOWER, 4).add(Aspect.FIRE, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.yellow_flower), new AspectList().add(Aspects.FLOWER, 4).add(Aspect.LIGHT, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.cactus), new AspectList().add(Aspect.PLANT, 4).add(Aspect.WATER, 1).add(Aspect.WEAPON, 1));
|
||||
ThaumcraftApi.registerObjectTag("treeSapling", new AspectList().add(Aspect.PLANT, 2).add(Aspect.TREE, 2));
|
||||
ThaumcraftApi.registerObjectTag("logWood", (new AspectList()).add(Aspect.TREE, 4));
|
||||
ThaumcraftApi.registerObjectTag("plankWood", (new AspectList()).add(Aspect.TREE, 1));
|
||||
ThaumcraftApi.registerObjectTag("slabWood", (new AspectList()).add(Aspect.TREE, 1));
|
||||
ThaumcraftApi.registerObjectTag("stairWood", (new AspectList()).add(Aspect.TREE, 1));
|
||||
ThaumcraftApi.registerObjectTag("stickWood", (new AspectList()).add(Aspect.TREE, 1));
|
||||
ThaumcraftApi.registerObjectTag("treeLeaves", (new AspectList()).add(Aspect.PLANT, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.brown_mushroom), new AspectList().add(Aspects.FUNGUS, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.red_mushroom), new AspectList().add(Aspects.FUNGUS, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.brown_mushroom_block, 1, 32767), new AspectList().add(Aspects.FUNGUS, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.red_mushroom_block, 1, 32767), new AspectList().add(Aspects.FUNGUS, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.reeds), new AspectList().add(Aspect.CROP, 2).add(Aspect.WATER, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.wheat), new AspectList().add(Aspect.CROP, 2).add(Aspect.LIFE, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.apple), new AspectList().add(Aspect.CROP, 2).add(Aspect.LIFE, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.coal_ore), new AspectList().add(Aspects.ROCK, 3).add(Aspect.ENERGY, 1).add(Aspect.FIRE, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.coal), new AspectList().add(Aspects.ROCK, 1).add(Aspect.ENERGY, 2).add(Aspect.FIRE, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.coal, 1, 1), new AspectList().add(Aspect.TREE, 1).add(Aspect.ENERGY, 2).add(Aspect.FIRE, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.redstone_ore), new AspectList().add(Aspect.EARTH, 2).add(Aspect.ENERGY, 1).add(Aspect.MECHANISM, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.redstone), new AspectList().add(Aspect.ENERGY, 2).add(Aspect.MECHANISM, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.glowstone_dust), new AspectList().add(Aspects.VISION, 1).add(Aspect.LIGHT, 3));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.glowstone), new AspectList().add(Aspects.VISION, 3).add(Aspect.LIGHT, 10));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.web), new AspectList().add(Aspect.TRAP, 2).add(Aspects.INSECT, 1).add(Aspect.CLOTH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.flint), new AspectList().add(Aspects.ROCK, 1).add(Aspect.TOOL, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.string), new AspectList().add(Aspects.INSECT, 1).add(Aspect.CLOTH, 1).add(Aspect.TRAP, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.carrot), new AspectList().add(Aspect.CROP, 2).add(Aspects.VISION, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.potato), new AspectList().add(Aspect.CROP, 2).add(Aspect.EARTH, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.baked_potato), new AspectList().add(Aspect.CROP, 2).add(Aspect.LIFE, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.poisonous_potato), new AspectList().add(Aspect.CROP, 2).add(Aspect.POISON, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.slime_ball), new AspectList().add(Aspects.CONTROL, 1).add(Aspect.WATER, 1).add(Aspects.FLUX, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.leather), new AspectList().add(Aspect.FLESH, 1).add(Aspect.CLOTH, 1).add(Aspect.BEAST, 1).add(Aspect.ARMOR, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.rotten_flesh), new AspectList().add(Aspect.DEATH, 1).add(Aspect.FLESH, 3));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.feather), new AspectList().add(Aspect.FLIGHT, 2).add(Aspect.AIR, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.bone), new AspectList().add(Aspect.DEATH, 3).add(Aspect.FLESH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.egg), new AspectList().add(Aspect.EXCHANGE, 2).add(Aspect.FLESH, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.spider_eye), new AspectList().add(Aspects.VISION, 2).add(Aspects.INSECT, 2).add(Aspect.POISON, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.quartz_ore), new AspectList().add(Aspects.ROCK, 2).add(Aspect.CRYSTAL, 1).add(Aspects.TIME, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.quartz), new AspectList().add(Aspects.ROCK, 1).add(Aspect.CRYSTAL, 1).add(Aspects.PURE, 1).add(Aspects.VISION, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.obsidian, 1, 32767), new AspectList().add(Aspects.ROCK, 5).add(Aspect.DARKNESS, 1).add(Aspect.FIRE, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.iron_ore), new AspectList().add(Aspect.METAL, 6).add(Aspects.ROCK, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.iron_ingot), new AspectList().add(Aspect.METAL, 8));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.pumpkin, 1, 32767), new AspectList().add(Aspect.CROP, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.gunpowder), new AspectList().add(Aspect.FIRE, 4).add(Aspects.DESTRUCTION, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.wool), new AspectList().add(Aspect.CLOTH, 4).add(Aspect.BEAST, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.fish), new AspectList().add(Aspect.FLESH, 4).add(Aspect.LIFE, 2).add(Aspect.WATER, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.cooked_fished), new AspectList().add(Aspect.FIRE, 1).add(Aspect.FLESH, 4).add(Aspect.LIFE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.chicken), new AspectList().add(Aspect.FLESH, 4).add(Aspect.LIFE, 2).add(Aspect.BEAST, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.cooked_chicken), new AspectList().add(Aspect.FIRE, 1).add(Aspect.FLESH, 4).add(Aspect.LIFE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.porkchop), new AspectList().add(Aspect.FLESH, 4).add(Aspect.LIFE, 2).add(Aspect.BEAST, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.cooked_porkchop), new AspectList().add(Aspect.FIRE, 1).add(Aspect.FLESH, 4).add(Aspect.LIFE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.beef), new AspectList().add(Aspect.FLESH, 4).add(Aspect.LIFE, 2).add(Aspect.BEAST, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.cooked_beef), new AspectList().add(Aspect.FIRE, 1).add(Aspect.FLESH, 4).add(Aspect.LIFE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.blaze_rod), new AspectList().add(Aspect.FIRE, 6).add(Aspect.MAGIC, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.lapis_ore), new AspectList().add(Aspects.VALUABLE, 4).add(Aspects.ROCK, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.gold_ore), new AspectList().add(Aspect.METAL, 6).add(Aspects.ROCK, 2).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.gold_ingot), new AspectList().add(Aspect.METAL, 8).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.saddle), new AspectList().add(Aspects.CONTROL, 4).add(Aspect.CLOTH, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.ender_pearl), new AspectList().add(Aspect.ELDRITCH, 4).add(Aspect.MAGIC, 4).add(Aspect.CRYSTAL, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.diamond_ore), new AspectList().add(Aspect.CRYSTAL, 10).add(Aspects.ROCK, 4).add(Aspects.VALUABLE, 2).add(Aspects.PURE, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.diamond), new AspectList().add(Aspect.CRYSTAL, 12).add(Aspects.VALUABLE, 4).add(Aspects.PURE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.ghast_tear), new AspectList().add(Aspect.WATER, 4).add(Aspect.DEATH, 4).add(Aspects.EVIL, 4).add(Aspect.SOUL, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.skull, 1, 32767), new AspectList().add(Aspect.DEATH, 8).add(Aspect.SOUL, 4).add(Aspects.EVIL, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.emerald_ore), new AspectList().add(Aspect.CRYSTAL, 9).add(Aspects.ROCK, 4).add(Aspect.EXCHANGE, 3).add(Aspect.MAGIC, 3).add(Aspects.VALUABLE, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.emerald), new AspectList().add(Aspect.CRYSTAL, 10).add(Aspect.EXCHANGE, 4).add(Aspect.MAGIC, 4).add(Aspects.VALUABLE, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.record_11), new AspectList().add(Aspects.SOUND, 12).add(Aspect.FIRE, 4).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.record_13), new AspectList().add(Aspects.SOUND, 12).add(Aspect.WATER, 4).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.record_cat), new AspectList().add(Aspects.SOUND, 12).add(Aspect.BEAST, 4).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.record_chirp), new AspectList().add(Aspects.SOUND, 12).add(Aspect.EARTH, 4).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.record_far), new AspectList().add(Aspects.SOUND, 12).add(Aspect.ELDRITCH, 4).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.record_mall), new AspectList().add(Aspects.SOUND, 12).add(Aspect.EXCHANGE, 4).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.record_mellohi), new AspectList().add(Aspects.SOUND, 12).add(Aspect.MOTION, 4).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.record_stal), new AspectList().add(Aspects.SOUND, 12).add(Aspects.EVIL, 4).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.record_strad), new AspectList().add(Aspects.SOUND, 12).add(Aspects.CONTROL, 4).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.record_ward), new AspectList().add(Aspects.SOUND, 12).add(Aspect.MAGIC, 4).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.record_blocks), new AspectList().add(Aspects.SOUND, 12).add(Aspect.CRAFT, 4).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.record_wait), new AspectList().add(Aspects.SOUND, 12).add(Aspect.TRAP, 4).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.nether_star), new AspectList().add(Aspect.ELDRITCH, 16).add(Aspect.MAGIC, 16).add(Aspects.PURE, 16).add(Aspect.DARKNESS, 16));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.chainmail_chestplate, 1, 32767), new AspectList().add(Aspect.METAL, 30));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.chainmail_chestplate, 1, 32767), new AspectList().add(Aspect.METAL, 50));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.chainmail_leggings, 1, 32767), new AspectList().add(Aspect.METAL, 45));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.chainmail_boots, 1, 32767), new AspectList().add(Aspect.METAL, 25));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.paper), new AspectList().add(Aspect.MIND, 2).add(Aspect.CROP, 2).add(Aspect.WATER, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.book), new AspectList().add(Aspect.MIND, 5).add(Aspect.CROP, 5).add(Aspect.WATER, 5).add(Aspect.BEAST, 2).add(Aspect.FLESH, 2));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.stonebrick), new AspectList());
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.stonebrick, 1, 1), new AspectList(new ItemStack(Blocks.stonebrick)).remove(Aspects.ROCK, 1).add(Aspect.PLANT, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.stonebrick, 1, 2), new AspectList(new ItemStack(Blocks.stonebrick)).remove(Aspects.ROCK, 1).add(Aspects.DESTRUCTION, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.stonebrick, 1, 3), new AspectList(new ItemStack(Blocks.stonebrick)).remove(Aspects.ROCK, 1).add(Aspects.VALUABLE, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.sandstone, 1, 32767), new AspectList().add(Aspects.ROCK, 2).remove(Aspect.EARTH, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.sandstone, 1, 1), new AspectList(new ItemStack(Blocks.sandstone)).remove(Aspect.EARTH, 1).add(Aspect.MAGIC, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.sandstone, 1, 2), new AspectList(new ItemStack(Blocks.sandstone)).remove(Aspect.EARTH, 1).add(Aspects.VALUABLE, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.melon_block, 1, 32767), new AspectList().add(Aspect.CROP, 2).remove(Aspect.LIFE, 4));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.ender_eye), new AspectList().add(Aspects.VISION, 4));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.arrow), new AspectList().add(Aspect.WEAPON, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.glass_bottle), new AspectList().add(Aspect.VOID, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.chest), new AspectList().add(Aspect.VOID, 4));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.golden_apple), new AspectList().add(Aspect.MAGIC, 2).add(Aspect.HEAL, 4));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.golden_apple, 1, 1), new AspectList().add(Aspect.MAGIC, 4).add(Aspect.HEAL, 8));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.bowl), new AspectList().add(Aspect.VOID, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.mushroom_stew), new AspectList().add(Aspect.LIFE, 4));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.minecart), new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 4));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.iron_door), new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.wooden_door), new AspectList().add(Aspect.MECHANISM, 1).add(Aspect.MOTION, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.boat), new AspectList().add(Aspect.WATER, 4).add(Aspect.MOTION, 4));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.flint_and_steel, 1, 32767), new AspectList().add(Aspect.FIRE, 4));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.fishing_rod, 1, 32767), new AspectList().add(Aspect.WATER, 1).add(Aspect.TOOL, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.bucket), new AspectList().add(Aspect.METAL, 13).add(Aspect.VOID, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.water_bucket), new AspectList(new ItemStack(Items.bucket)).add(Aspect.WATER, 4));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.lava_bucket), new AspectList(new ItemStack(Items.bucket)).add(Aspect.FIRE, 6).add(Aspects.ROCK, 2).add(Aspect.WATER, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.milk_bucket), new AspectList(new ItemStack(Items.bucket)).add(Aspect.LIFE, 2).add(Aspect.HEAL, 2).add(Aspect.WATER, 2));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.brewing_stand), new AspectList().add(Aspect.MAGIC, 2).add(Aspect.WATER, 2));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.stone_button), new AspectList().add(Aspect.MECHANISM, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.detector_rail), new AspectList().add(Aspect.MECHANISM, 2).add(Aspects.VISION, 2));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.golden_rail), new AspectList().add(Aspect.MECHANISM, 2));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.fence_gate), new AspectList().add(Aspect.MECHANISM, 1).add(Aspect.MOTION, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.wooden_pressure_plate), new AspectList().add(Aspect.MECHANISM, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.stone_pressure_plate), new AspectList().add(Aspect.MECHANISM, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.lever), new AspectList().add(Aspects.CONTROL, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.redstone_torch), new AspectList().add(Aspect.MECHANISM, 2));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.piston), new AspectList().add(Aspect.MECHANISM, 2).add(Aspect.MOTION, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.sticky_piston), new AspectList(new ItemStack(Blocks.piston)).add(Aspect.EXCHANGE, 3).add(Aspect.WATER, 1).add(Aspect.FLESH, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.jukebox), new AspectList().add(Aspects.SOUND, 8).add(Aspect.MECHANISM, 2));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.noteblock), new AspectList().add(Aspects.SOUND, 4).add(Aspect.MECHANISM, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.trapdoor), new AspectList().add(Aspect.MOTION, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.furnace), new AspectList().add(Aspect.FIRE, 2));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.enchanting_table), new AspectList().add(Aspect.MAGIC, 8));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.crafting_table), new AspectList().add(Aspect.CRAFT, 4).add(Aspect.TREE, 3));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.clock), new AspectList().add(Aspects.TIME, 4));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.repeater, 1, 32767), new AspectList().add(Aspects.TIME, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.written_book, 1, 32767), new AspectList(new ItemStack(Items.book)).add(Aspects.TIME, 1).remove(Aspect.BEAST, 2));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.beacon), new AspectList().add(Aspects.CONTROL, 2).add(Aspect.MAGIC, 2));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.anvil), new AspectList().add(Aspect.CRAFT, 2).add(Aspect.TOOL, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.anvil, 1, 1), new AspectList(new ItemStack(Blocks.anvil)).remove(Aspect.CRAFT, 1).remove(Aspect.METAL, 20));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.anvil, 1, 2), new AspectList(new ItemStack(Blocks.anvil)).remove(Aspect.CRAFT, 1).remove(Aspect.TOOL, 1).remove(Aspect.METAL, 40));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.wooden_button), new AspectList().add(Aspect.MECHANISM, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.carrot_on_a_stick), new AspectList().add(Aspects.CONTROL, 4));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.flower_pot), new AspectList().add(Aspect.VOID, 1).add(Aspect.LIFE, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Items.golden_carrot), new AspectList().add(Aspect.MAGIC, 2));
|
||||
Map lhm = new LinkedHashMap();
|
||||
for(int var4 = 1; var4 <= 32767; ++var4) {
|
||||
List var5 = PotionHelper.getPotionEffects(var4, false);
|
||||
if (var5 != null && !var5.isEmpty()) {
|
||||
lhm.put(var5, var4);
|
||||
}
|
||||
}
|
||||
Iterator var6 = lhm.values().iterator();
|
||||
|
||||
while(var6.hasNext()) {
|
||||
int var7 = (Integer)var6.next();
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.potionitem, 1, var7), new AspectList(new ItemStack(Items.potionitem)));
|
||||
}
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemWispEssence, 1, 0), (new AspectList()).add(Aspect.AURA, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemEssence), new AspectList().add(Aspect.VOID, 1).add(Aspect.CRYSTAL, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemNugget, 1, 31), new AspectList().add(Aspect.METAL, 12).add(Aspects.ROCK, 2).add(Aspects.VALUABLE, 8));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemNugget, 1, 16), new AspectList().add(Aspect.METAL, 12).add(Aspects.ROCK, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCosmeticSolid), new AspectList().add(Aspects.ROCK, 4).add(Aspect.DARKNESS, 2).add(Aspect.FIRE, 2).add(Aspect.ELDRITCH, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockMagicalLog), new AspectList().add(Aspect.TREE, 5).add(Aspect.MAGIC, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockMagicalLog, 1, 1), new AspectList().add(Aspect.TREE, 4).add(Aspect.MAGIC, 2).add(Aspects.PURE, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockMagicalLeaves), new AspectList().add(Aspect.PLANT, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockMagicalLeaves, 1, 1), new AspectList().add(Aspect.PLANT, 1).add(Aspects.PURE, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCustomPlant), new AspectList().add(Aspect.PLANT, 2).add(Aspect.TREE, 2).add(Aspect.MAGIC, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCustomPlant, 1, 1), new AspectList().add(Aspect.PLANT, 2).add(Aspect.TREE, 2).add(Aspect.MAGIC, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCustomPlant, 1, 2), new AspectList().add(Aspects.FLOWER, 2).add(Aspect.EXCHANGE, 2).add(Aspect.MAGIC, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCustomPlant, 1, 3), new AspectList().add(Aspects.FLOWER, 2).add(Aspect.FIRE, 2).add(Aspect.MAGIC, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCustomOre), new AspectList().add(Aspects.ROCK, 2).add(Aspect.METAL, 3).add(Aspects.VISION, 3));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCustomOre, 1, 7), new AspectList().add(Aspects.ROCK, 2).add(Aspect.TRAP, 3).add(Aspect.TREE, 1).add(Aspect.CRYSTAL, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemResource, 1, 3), new AspectList().add(Aspect.MOTION, 1).add(Aspect.METAL, 4).add(Aspect.POISON, 1).add(Aspects.VISION, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemZombieBrain), new AspectList().add(Aspect.FLESH, 2).add(Aspect.MIND, 4).add(Aspects.EVIL, 2).add(Aspect.DEATH, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemResource, 1, 6), new AspectList().add(Aspect.TRAP, 4).add(Aspect.TREE, 2).add(Aspect.CRYSTAL, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemResource, 1, 9), new AspectList().add(Aspect.MIND, 16));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemNuggetBeef, 1, 32767), new AspectList().add(Aspect.FLESH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemNuggetChicken, 1, 32767), new AspectList().add(Aspect.FLESH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemNuggetPork, 1, 32767), new AspectList().add(Aspect.FLESH, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(ConfigItems.itemTripleMeatTreat, 1, 32767), new AspectList().add(Aspect.HEAL, 1).remove(Aspect.CROP, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(ConfigItems.itemThaumometer, 1, 32767), new AspectList().add(Aspect.MAGIC, 4).add(Aspect.MIND, 4).add(Aspects.VISION, 4));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(ConfigItems.itemGoggles, 1, 32767), new AspectList().add(Aspects.VISION, 4));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(ConfigBlocks.blockTable, 1, 32767), new AspectList().add(Aspect.TOOL, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockTable, 1, 15), new AspectList(new ItemStack(ConfigBlocks.blockTable)).add(Aspect.CRAFT, 4).add(Aspect.MAGIC, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockMetalDevice), new AspectList(new ItemStack(Items.cauldron, 1, 32767)).add(Aspect.CRAFT, 4).add(Aspect.MAGIC, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCandle), new AspectList().add(Aspect.LIGHT, 4).add(Aspect.FLESH, 3).add(Aspect.CLOTH, 1).add(Aspect.MAGIC, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemThaumonomicon, 1, 32767), new AspectList(new ItemStack(Blocks.bookshelf)).add(Aspect.MAGIC, 4).merge(Aspect.MIND, 8));
|
||||
// TC4 additions
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.dragon_egg), (new AspectList()).add(Aspect.ELDRITCH, 8).add(Aspect.BEAST, 8).add(Aspect.MAGIC, 8));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.portal, 1, 32767), (new AspectList()).add(Aspect.FIRE, 4).add(Aspect.TRAVEL, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.end_portal, 1, 32767), (new AspectList()).add(Aspect.ELDRITCH, 4).add(Aspect.TRAVEL, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.end_portal_frame, 1, 32767), (new AspectList()).add(Aspect.ELDRITCH, 4).add(Aspect.MECHANISM, 4).add(Aspect.TRAVEL, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Blocks.mob_spawner, 1, 32767), (new AspectList()).add(Aspect.BEAST, 4).add(Aspect.TRAVEL, 4).add(Aspect.UNDEAD, 4).add(Aspect.MAGIC, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(Items.cake, 32767), (new AspectList()).add(Aspect.WATER, 4).add(Aspect.HUNGER, 4).add(Aspect.LIFE, 4));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.light_weighted_pressure_plate, 1, 32767), (new AspectList()).add(Aspect.MECHANISM, 1).add(Aspect.SENSES, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.heavy_weighted_pressure_plate, 1, 32767), (new AspectList()).add(Aspect.MECHANISM, 1).add(Aspect.SENSES, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.ender_chest, 1, 32767), (new AspectList()).merge(Aspect.EXCHANGE, 2).merge(Aspect.TRAVEL, 2).merge(Aspect.VOID, 4));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(Blocks.daylight_detector, 1, 32767), (new AspectList()).merge(Aspects.VISION, 2).merge(Aspect.LIGHT, 3).merge(Aspect.MECHANISM, 3));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockTable, 1, 2), (new AspectList(new ItemStack(ConfigBlocks.blockTable))).add(Aspect.MIND, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockTaint, 1, 0), (new AspectList()).add(Aspect.TREE, 1).add(Aspect.TAINT, 3));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockTaint, 1, 1), (new AspectList()).add(Aspect.EARTH, 1).add(Aspect.TAINT, 3));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockTaintFibres, 1, 0), (new AspectList()).add(Aspect.LIFE, 1).add(Aspect.TAINT, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockTaintFibres, 1, 1), (new AspectList()).add(Aspect.PLANT, 1).add(Aspect.TAINT, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockTaintFibres, 1, 2), (new AspectList()).add(Aspect.PLANT, 1).add(Aspect.TAINT, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockTaintFibres, 1, 3), (new AspectList()).add(Aspect.BEAST, 1).add(Aspect.PLANT, 1).add(Aspect.TAINT, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockTaintFibres, 1, 4), (new AspectList()).add(Aspect.BEAST, 1).add(Aspect.PLANT, 1).add(Aspect.TAINT, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCustomPlant, 1, 5), (new AspectList()).add(Aspects.FUNGUS, 2).add(Aspect.POISON, 1).add(Aspect.MAGIC, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemResource, 1, 11), (new AspectList()).add(Aspect.TAINT, 3).add(Aspect.SLIME, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemResource, 1, 12), (new AspectList()).add(Aspect.TAINT, 2).add(Aspect.GREED, 1).add(Aspect.HUNGER, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemResource, 1, 18), (new AspectList()).add(Aspect.GREED, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemLootbag, 1, 0), (new AspectList()).add(Aspect.GREED, 8));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemLootbag, 1, 1), (new AspectList()).add(Aspect.GREED, 16));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemLootbag, 1, 2), (new AspectList()).add(Aspect.GREED, 32));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemNuggetBeef, 1, 32767), (new AspectList()).add(Aspect.HUNGER, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemNuggetChicken, 1, 32767), (new AspectList()).add(Aspect.HUNGER, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemNuggetPork, 1, 32767), (new AspectList()).add(Aspect.HUNGER, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemNuggetFish, 1, 32767), (new AspectList()).add(Aspect.HUNGER, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemResource, 1, 14), (new AspectList(new ItemStack(ConfigItems.itemShard, 1, 6))).add(Aspect.MAGIC, 2).remove(Aspect.CRYSTAL));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockAiry, 1, 2), (new AspectList()).add(Aspect.LIGHT, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockAiry, 1, 3), (new AspectList()).add(Aspect.LIGHT, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemBaubleBlanks, 1, 3), (new AspectList()).add(Aspect.MAGIC, 5));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemFocusPech), (new AspectList()).add(Aspect.MAGIC, 5).add(Aspect.POISON, 5).add(Aspect.ENTROPY, 5).add(Aspect.ELDRITCH, 5).add(Aspect.WEAPON, 5));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemChestCultistPlate, 1, 32767), (new AspectList()).add(Aspect.METAL, 5).add(Aspect.ELDRITCH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemChestCultistRobe, 1, 32767), (new AspectList()).add(Aspect.METAL, 3).add(Aspect.CLOTH, 2).add(Aspect.ELDRITCH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemChestCultistLeaderPlate, 1, 32767), (new AspectList()).add(Aspect.METAL, 5).add(Aspect.ELDRITCH, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemLegsCultistPlate, 1, 32767), (new AspectList()).add(Aspect.METAL, 5).add(Aspect.ELDRITCH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemLegsCultistLeaderPlate, 1, 32767), (new AspectList()).add(Aspect.METAL, 5).add(Aspect.ELDRITCH, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemLegsCultistRobe, 1, 32767), (new AspectList()).add(Aspect.METAL, 3).add(Aspect.CLOTH, 2).add(Aspect.ELDRITCH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemHelmetCultistPlate, 1, 32767), (new AspectList()).add(Aspect.METAL, 5).add(Aspect.ELDRITCH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemHelmetCultistLeaderPlate, 1, 32767), (new AspectList()).add(Aspect.METAL, 5).add(Aspect.ELDRITCH, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemHelmetCultistRobe, 1, 32767), (new AspectList()).add(Aspect.METAL, 3).add(Aspect.CLOTH, 2).add(Aspect.ELDRITCH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemBootsCultist, 1, 32767), (new AspectList()).add(Aspect.METAL, 4).add(Aspect.ELDRITCH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockWoodenDevice, 1, 8), (new AspectList()).add(Aspect.ELDRITCH, 1).add(Aspect.TREE, 2).add(Aspect.CLOTH, 3));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemEldritchObject, 1, 0), (new AspectList()).add(Aspect.ELDRITCH, 5).add(Aspect.AURA, 3).add(Aspect.MAGIC, 3).add(Aspect.SENSES, 3).add(Aspect.SOUL, 3));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemEldritchObject, 1, 1), (new AspectList()).add(Aspect.MIND, 5).add(Aspect.MAGIC, 3).add(Aspect.ELDRITCH, 3).add(Aspect.SOUL, 3));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemEldritchObject, 1, 2), (new AspectList()).add(Aspect.TRAP, 4).add(Aspect.MIND, 4).add(Aspect.MECHANISM, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigItems.itemEldritchObject, 1, 3), (new AspectList()).add(Aspect.AIR, 16).add(Aspect.EARTH, 16).add(Aspect.FIRE, 16).add(Aspect.WATER, 16).add(Aspect.ORDER, 16).add(Aspect.ENTROPY, 16));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockEldritch, 1, 32767), (new AspectList()).add(Aspect.VOID, 8).add(Aspect.ELDRITCH, 8).add(Aspect.SENSES, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockEldritchPortal), (new AspectList()).add(Aspect.VOID, 8).add(Aspect.ELDRITCH, 8).add(Aspect.TRAVEL, 8));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockEldritch, 1, 3), (new AspectList()).add(Aspect.VOID, 4).add(Aspect.ELDRITCH, 4));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockEldritch, 1, 4), (new AspectList()).add(Aspect.LIGHT, 1).add(Aspect.EARTH, 1).add(Aspect.ELDRITCH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockEldritch, 1, 5), (new AspectList()).add(Aspect.MIND, 2).add(Aspect.EARTH, 1).add(Aspect.ELDRITCH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockEldritch, 1, 6), (new AspectList()).add(Aspect.METAL, 2).add(Aspect.MECHANISM, 2).add(Aspect.ELDRITCH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 11), (new AspectList()).add(Aspect.EARTH, 1).add(Aspect.ELDRITCH, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 12), (new AspectList()).add(Aspect.EARTH, 1).add(Aspect.ELDRITCH, 1));
|
||||
ThaumcraftApi.registerComplexObjectTag(new ItemStack(ConfigItems.itemPrimalArrow), (new AspectList()).add(Aspect.WEAPON, 1));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCustomOre, 1, 1), (new AspectList()).add(Aspect.EARTH, 1).add(Aspect.AIR, 3).add(Aspect.CRYSTAL, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCustomOre, 1, 2), (new AspectList()).add(Aspect.EARTH, 1).add(Aspect.FIRE, 3).add(Aspect.CRYSTAL, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCustomOre, 1, 3), (new AspectList()).add(Aspect.EARTH, 1).add(Aspect.WATER, 3).add(Aspect.CRYSTAL, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCustomOre, 1, 4), (new AspectList()).add(Aspect.EARTH, 1).add(Aspect.EARTH, 3).add(Aspect.CRYSTAL, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCustomOre, 1, 5), (new AspectList()).add(Aspect.EARTH, 1).add(Aspect.ORDER, 3).add(Aspect.CRYSTAL, 2));
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(ConfigBlocks.blockCustomOre, 1, 6), (new AspectList()).add(Aspect.EARTH, 1).add(Aspect.ENTROPY, 3).add(Aspect.CRYSTAL, 2));
|
||||
// Oredict
|
||||
ThaumcraftApi.registerObjectTag("nuggetIron", new AspectList().add(Aspect.METAL, 1));
|
||||
ThaumcraftApi.registerObjectTag("nuggetTin", new AspectList().add(Aspect.METAL, 1));
|
||||
ThaumcraftApi.registerObjectTag("nuggetCopper", new AspectList().add(Aspect.METAL, 1));
|
||||
ThaumcraftApi.registerObjectTag("nuggetSilver", new AspectList().add(Aspect.METAL, 1));
|
||||
ThaumcraftApi.registerObjectTag("nuggetLead", new AspectList().add(Aspect.METAL, 1));
|
||||
|
||||
ThaumcraftApi.registerObjectTag("dustIron", new AspectList().add(Aspect.METAL, 7).add(Aspects.DESTRUCTION, 1));
|
||||
ThaumcraftApi.registerObjectTag("dustGold", new AspectList().add(Aspect.METAL, 7).add(Aspects.VALUABLE, 4).add(Aspects.DESTRUCTION, 1));
|
||||
ThaumcraftApi.registerObjectTag("dustCopper", new AspectList().add(Aspect.METAL, 5).add(Aspect.LIFE, 2).add(Aspects.DESTRUCTION, 1));
|
||||
ThaumcraftApi.registerObjectTag("dustTin", new AspectList().add(Aspect.METAL, 5).add(Aspect.CRYSTAL, 2).add(Aspects.DESTRUCTION, 1));
|
||||
ThaumcraftApi.registerObjectTag("dustSilver", new AspectList().add(Aspect.METAL, 5).add(Aspect.EXCHANGE, 2).add(Aspects.DESTRUCTION, 1));
|
||||
ThaumcraftApi.registerObjectTag("dustBrass", new AspectList().add(Aspect.METAL, 5).add(Aspects.CONTROL, 1).add(Aspect.EXCHANGE, 1).add(Aspects.DESTRUCTION, 1));
|
||||
ThaumcraftApi.registerObjectTag("dustBronze", new AspectList().add(Aspect.METAL, 5).add(Aspects.CONTROL, 1).add(Aspect.EXCHANGE, 1).add(Aspects.DESTRUCTION, 1));
|
||||
ThaumcraftApi.registerObjectTag("dustLead", new AspectList().add(Aspect.METAL, 5).add(Aspect.VOID, 2).add(Aspects.DESTRUCTION, 1));
|
||||
|
||||
ThaumcraftApi.registerObjectTag("ingotCopper", new AspectList().add(Aspect.METAL, 6).add(Aspect.LIFE, 2));
|
||||
ThaumcraftApi.registerObjectTag("ingotTin", new AspectList().add(Aspect.METAL, 6).add(Aspect.CRYSTAL, 2));
|
||||
ThaumcraftApi.registerObjectTag("ingotSilver", new AspectList().add(Aspect.METAL, 6).add(Aspect.EXCHANGE, 2));
|
||||
ThaumcraftApi.registerObjectTag("ingotLead", new AspectList().add(Aspect.METAL, 6).add(Aspect.VOID, 2));
|
||||
ThaumcraftApi.registerObjectTag("ingotBrass", new AspectList().add(Aspect.METAL, 6).add(Aspects.CONTROL, 1).add(Aspect.EXCHANGE, 1));
|
||||
ThaumcraftApi.registerObjectTag("ingotBronze", new AspectList().add(Aspect.METAL, 6).add(Aspects.CONTROL, 1).add(Aspect.EXCHANGE, 1));
|
||||
ThaumcraftApi.registerObjectTag("ingotRefinedIron", new AspectList().add(Aspect.METAL, 7).add(Aspects.PURE, 1));
|
||||
ThaumcraftApi.registerObjectTag("ingotSteel", new AspectList().add(Aspect.METAL, 7).add(Aspect.CRAFT, 1));
|
||||
ThaumcraftApi.registerObjectTag("ingotUranium", new AspectList().add(Aspect.METAL, 6).add(Aspect.POISON, 4).add(Aspect.ENERGY, 6));
|
||||
|
||||
ThaumcraftApi.registerObjectTag("oreUranium", new AspectList().add(Aspect.METAL, 6).add(Aspect.POISON, 4).add(Aspect.ENERGY, 6));
|
||||
ThaumcraftApi.registerObjectTag("oreCopper", new AspectList().add(Aspect.METAL, 5).add(Aspect.EXCHANGE, 1).add(Aspects.ROCK, 2));
|
||||
ThaumcraftApi.registerObjectTag("oreTin", new AspectList().add(Aspect.METAL, 5).add(Aspects.CONTROL, 1).add(Aspects.ROCK, 2));
|
||||
ThaumcraftApi.registerObjectTag("oreSilver", new AspectList().add(Aspect.METAL, 5).add(Aspect.EXCHANGE, 1).add(Aspects.ROCK, 2));
|
||||
|
||||
ThaumcraftApi.registerObjectTag("dustNikolite", new AspectList().add(Aspect.ENERGY, 2).add(Aspect.MECHANISM, 2));
|
||||
ThaumcraftApi.registerObjectTag("dustSulfur", new AspectList().add(Aspect.LIFE, 2).add(Aspect.FIRE, 1));
|
||||
|
||||
ThaumcraftApi.registerObjectTag("gemRuby", new AspectList().add(Aspect.CRYSTAL, 8).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag("gemGreenSapphire", new AspectList().add(Aspect.CRYSTAL, 8).add(Aspects.VALUABLE, 4));
|
||||
ThaumcraftApi.registerObjectTag("gemSapphire", new AspectList().add(Aspect.CRYSTAL, 8).add(Aspects.VALUABLE, 4));
|
||||
|
||||
ThaumcraftApi.registerObjectTag("woodRubber", new AspectList().add(Aspect.TREE, 6).add(Aspect.MOTION, 1).add(Aspect.TOOL, 1));
|
||||
ThaumcraftApi.registerObjectTag("itemRubber", new AspectList().add(Aspect.MOTION, 2).add(Aspects.CONTROL, 2));
|
||||
ThaumcraftApi.registerObjectTag("dropUranium", new AspectList().add(Aspect.METAL, 6).add(Aspect.POISON, 4).add(Aspect.ENERGY, 6));
|
||||
}
|
||||
|
||||
}
|
|
@ -9,19 +9,11 @@ import java.nio.channels.spi.AbstractInterruptibleChannel;
|
|||
|
||||
import dev.tilera.auracore.api.IWand;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockCrops;
|
||||
import net.minecraft.block.BlockDirectional;
|
||||
import net.minecraft.block.BlockMushroom;
|
||||
import net.minecraft.block.BlockSapling;
|
||||
import net.minecraft.block.BlockStem;
|
||||
import net.minecraft.block.IGrowable;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import thaumcraft.api.IGoggles;
|
||||
import thaumcraft.api.IVisDiscountGear;
|
||||
|
||||
|
@ -79,6 +71,7 @@ public class Utils {
|
|||
return world.getBlock(x, y, z + 1) == id || world.getBlock(x, y, z - 1) == id || world.getBlock(x + 1, y, z) == id || world.getBlock(x - 1, y, z) == id || world.getBlock(x, y + 1, z) == id || world.getBlock(x, y - 1, z) == id;
|
||||
}
|
||||
|
||||
@SuppressWarnings({"resource"})
|
||||
public static void copyFile(File sourceFile, File destFile) throws IOException {
|
||||
if (!destFile.exists()) {
|
||||
destFile.createNewFile();
|
||||
|
@ -131,6 +124,7 @@ public class Utils {
|
|||
}
|
||||
|
||||
public static boolean spendCharge(final ItemStack itemstack, final EntityPlayer player, int amount) {
|
||||
if (itemstack == null) return false;
|
||||
final int discount = 100 - Math.min(50, getTotalVisDiscount(player));
|
||||
amount = Math.round(amount * (discount / 100.0f));
|
||||
return ((IWand) itemstack.getItem()).consumeVis(itemstack, amount);
|
||||
|
|
112
src/main/java/dev/tilera/auracore/mixins/MixinBlockCrystal.java
Normal file
112
src/main/java/dev/tilera/auracore/mixins/MixinBlockCrystal.java
Normal file
|
@ -0,0 +1,112 @@
|
|||
package dev.tilera.auracore.mixins;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
import dev.tilera.auracore.api.AuraNode;
|
||||
import dev.tilera.auracore.api.ICrystal;
|
||||
import dev.tilera.auracore.aura.AuraManager;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.common.blocks.BlockCrystal;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumcraft.common.tiles.TileCrystal;
|
||||
import thaumcraft.common.tiles.TileEldritchCrystal;
|
||||
|
||||
@Mixin(BlockCrystal.class)
|
||||
public abstract class MixinBlockCrystal extends BlockContainer {
|
||||
|
||||
protected MixinBlockCrystal(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
* @reason Old crystals
|
||||
*/
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Overwrite
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for(int var4 = 0; var4 <= 6; ++var4) {
|
||||
par3List.add(new ItemStack(par1, 1, var4));
|
||||
}
|
||||
par3List.add(new ItemStack(par1, 1, 8));
|
||||
par3List.add(new ItemStack(par1, 1, 9));
|
||||
par3List.add(new ItemStack(par1, 1, 10));
|
||||
}
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
* @reason Old crystals
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
public TileEntity createTileEntity(World world, int metadata) {
|
||||
if (metadata == 7) {
|
||||
return new TileEldritchCrystal();
|
||||
} else {
|
||||
return new TileCrystal();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
* @reason Drop old crystals
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int md, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<>();
|
||||
Integer count = ICrystal.crystalCounts.get(new ChunkCoordinates(x, y, z));
|
||||
if (md < 6 && count != null) {
|
||||
for(int t = 0; t < count.intValue(); ++t) {
|
||||
ret.add(new ItemStack(ConfigItems.itemShard, 1, md));
|
||||
}
|
||||
} else if ((md == 8 || md == 10) && count != null) {
|
||||
for(int t = 0; t < count.intValue(); ++t) {
|
||||
ret.add(new ItemStack(ConfigItems.itemShard, 1, md - 1));
|
||||
}
|
||||
} else if (md == 6) {
|
||||
for(int t = 0; t < 6; ++t) {
|
||||
ret.add(new ItemStack(ConfigItems.itemShard, 1, t));
|
||||
}
|
||||
} else if (md == 7) {
|
||||
ret.add(new ItemStack(ConfigItems.itemShard, 1, 6));
|
||||
} else if (md == 9) {
|
||||
for(int t = 0; t < 4; ++t) {
|
||||
ret.add(new ItemStack(ConfigItems.itemShard, 1, t));
|
||||
}
|
||||
ret.add(new ItemStack(ConfigItems.itemShard, 1, 7));
|
||||
} else {
|
||||
return super.getDrops(world, x, y, z, md, fortune);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (tile instanceof ICrystal) {
|
||||
ICrystal crystal = (ICrystal) tile;
|
||||
if (rand.nextInt(crystal.getCrystalCount(meta) * 75) == 0) {
|
||||
int nodeKey = AuraManager.getClosestAuraWithinRange(world, x, y, z, 64);
|
||||
if (nodeKey < 0) return;
|
||||
AuraNode node = AuraManager.getNode(nodeKey);
|
||||
if (node.level > node.baseLevel - 10) {
|
||||
int crystals = crystal.getCrystalCount(meta);
|
||||
crystal.setCrystalCount(crystals + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package dev.tilera.auracore.mixins;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.common.blocks.BlockCrystalItem;
|
||||
import thaumcraft.common.tiles.TileCrystal;
|
||||
|
||||
@Mixin(BlockCrystalItem.class)
|
||||
public abstract class MixinBlockCrystalItem extends ItemBlock {
|
||||
|
||||
public MixinBlockCrystalItem(Block p_i45328_1_) {
|
||||
super(p_i45328_1_);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
* @reason Place old crystals
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) {
|
||||
boolean placed = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata);
|
||||
if (placed) {
|
||||
try {
|
||||
TileCrystal ts = (TileCrystal)world.getTileEntity(x, y, z);
|
||||
ts.orientation = (short)side;
|
||||
} catch (Exception var14) {
|
||||
}
|
||||
}
|
||||
|
||||
return placed;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package dev.tilera.auracore.mixins;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import thaumcraft.client.renderers.block.BlockCrystalRenderer;
|
||||
import thaumcraft.client.renderers.block.BlockRenderer;
|
||||
import thaumcraft.common.tiles.TileCrystal;
|
||||
import thaumcraft.common.tiles.TileEldritchCrystal;
|
||||
|
||||
@Mixin(BlockCrystalRenderer.class)
|
||||
public abstract class MixinBlockCrystalRenderer extends BlockRenderer {
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
* @reason Render old crystals
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
|
||||
if (metadata == 7) {
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
TileEntityRendererDispatcher.instance.renderTileEntityAt(new TileEldritchCrystal(), 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
GL11.glEnable(32826);
|
||||
} else {
|
||||
GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
|
||||
TileCrystal tc = new TileCrystal();
|
||||
tc.blockMetadata = metadata;
|
||||
TileEntityRendererDispatcher.instance.renderTileEntityAt(tc, 0.0D, 0.0D, 0.0D, 0.0F);
|
||||
GL11.glEnable(32826);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -37,6 +37,7 @@ public abstract class MixinBlockCustomOre extends Block {
|
|||
* @author tilera
|
||||
* @reason Vis, Tainted and Dull ores
|
||||
*/
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Overwrite
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
|
|
|
@ -5,6 +5,7 @@ import java.util.Random;
|
|||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
import dev.tilera.auracore.Config;
|
||||
import dev.tilera.auracore.api.EnumNodeType;
|
||||
import dev.tilera.auracore.aura.AuraManager;
|
||||
import dev.tilera.auracore.world.WorldGenSilverwoodTreesOld;
|
||||
|
@ -12,6 +13,7 @@ import net.minecraft.block.BlockBush;
|
|||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.common.blocks.BlockCustomPlant;
|
||||
import thaumcraft.common.lib.world.WorldGenSilverwoodTrees;
|
||||
|
||||
@Mixin(BlockCustomPlant.class)
|
||||
public abstract class MixinBlockCustomPlant extends BlockBush {
|
||||
|
@ -22,9 +24,10 @@ public abstract class MixinBlockCustomPlant extends BlockBush {
|
|||
*/
|
||||
@Overwrite(remap = false)
|
||||
public void growSilverTree(World world, int i, int j, int k, Random random) {
|
||||
if (world == null || world.provider == null) {
|
||||
if (world == null || world.provider == null || world.isRemote) {
|
||||
return;
|
||||
}
|
||||
if (Config.replaceSilverwood) {
|
||||
world.setBlock(i, j, k, Blocks.air, 0, 3);
|
||||
WorldGenSilverwoodTreesOld obj = new WorldGenSilverwoodTreesOld(true);
|
||||
int value = random.nextInt(50) + 50;
|
||||
|
@ -40,6 +43,13 @@ public abstract class MixinBlockCustomPlant extends BlockBush {
|
|||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
world.setBlockToAir(i, j, k);
|
||||
WorldGenSilverwoodTrees obj = new WorldGenSilverwoodTrees(true, 7, 5);
|
||||
if (!obj.generate(world, random, i, j, k)) {
|
||||
world.setBlock(i, j, k, this, 1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ import org.spongepowered.asm.mixin.Mixin;
|
|||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
import dev.tilera.auracore.AuraCore;
|
||||
import dev.tilera.auracore.api.research.IResearchTable;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -48,12 +49,12 @@ public abstract class MixinBlockTable extends BlockContainer {
|
|||
return true;
|
||||
} else {
|
||||
if (tileEntity instanceof TileResearchTable) {
|
||||
player.openGui(Thaumcraft.instance, 10, world, x, y, z);
|
||||
((IResearchTable)tileEntity).openGUI(player);
|
||||
} else {
|
||||
for(int a = 2; a < 6; ++a) {
|
||||
TileEntity tile = world.getTileEntity(x + ForgeDirection.getOrientation(a).offsetX, y + ForgeDirection.getOrientation(a).offsetY, z + ForgeDirection.getOrientation(a).offsetZ);
|
||||
if (tile != null && tile instanceof TileResearchTable) {
|
||||
player.openGui(Thaumcraft.instance, 10, world, x + ForgeDirection.getOrientation(a).offsetX, y + ForgeDirection.getOrientation(a).offsetY, z + ForgeDirection.getOrientation(a).offsetZ);
|
||||
if (tile instanceof TileResearchTable) {
|
||||
((IResearchTable)tile).openGUI(player);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,120 @@
|
|||
package dev.tilera.auracore.mixins;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import dev.tilera.auracore.Config;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.client.lib.ClientTickEventsFML;
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager;
|
||||
import thaumcraft.common.lib.research.ScanManager;
|
||||
|
||||
@Mixin(ClientTickEventsFML.class)
|
||||
public abstract class MixinClientTickEventsFML {
|
||||
|
||||
@Shadow(remap = false)
|
||||
protected abstract boolean isMouseOverSlot(Slot par1Slot, int par2, int par3, int par4, int par5);
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
* @reason Show aspects without scanning
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
public void renderAspectsInGui(GuiContainer gui, EntityPlayer player) {
|
||||
Minecraft mc = FMLClientHandler.instance().getClient();
|
||||
ScaledResolution var13 = new ScaledResolution(Minecraft.getMinecraft(), mc.displayWidth, mc.displayHeight);
|
||||
int var14 = var13.getScaledWidth();
|
||||
int var15 = var13.getScaledHeight();
|
||||
int var16 = Mouse.getX() * var14 / mc.displayWidth;
|
||||
int var17 = var15 - Mouse.getY() * var15 / mc.displayHeight - 1;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glPushAttrib(1048575);
|
||||
GL11.glDisable(2896);
|
||||
|
||||
for(int var20 = 0; var20 < gui.inventorySlots.inventorySlots.size(); ++var20) {
|
||||
int xs = UtilsFX.getGuiXSize(gui);
|
||||
int ys = UtilsFX.getGuiYSize(gui);
|
||||
int shift = 0;
|
||||
int shift2 = 0;
|
||||
int shiftx = -8;
|
||||
int shifty = -8;
|
||||
if (Thaumcraft.instance.aspectShift) {
|
||||
shiftx -= 8;
|
||||
shifty -= 8;
|
||||
}
|
||||
|
||||
Slot var23 = (Slot)gui.inventorySlots.inventorySlots.get(var20);
|
||||
int guiLeft = shift + (gui.width - xs - shift2) / 2;
|
||||
int guiTop = (gui.height - ys) / 2;
|
||||
if (this.isMouseOverSlot(var23, var16, var17, guiLeft, guiTop) && var23.getStack() != null) {
|
||||
int h = ScanManager.generateItemHash(var23.getStack().getItem(), var23.getStack().getItemDamage());
|
||||
List<String> list = Thaumcraft.proxy.getScannedObjects().get(player.getCommandSenderName());
|
||||
if (Config.noScanning() || (list != null && (list.contains("@" + h) || list.contains("#" + h)))) {
|
||||
AspectList tags = ThaumcraftCraftingManager.getObjectTags(var23.getStack());
|
||||
tags = ThaumcraftCraftingManager.getBonusTags(var23.getStack(), tags);
|
||||
if (tags != null) {
|
||||
int x = var16 + 17;
|
||||
int y = var17 + 7 - 33;
|
||||
GL11.glDisable(2929);
|
||||
int index = 0;
|
||||
if (tags.size() > 0) {
|
||||
Aspect[] arr$ = tags.getAspectsSortedAmount();
|
||||
int len$ = arr$.length;
|
||||
|
||||
for(int i$ = 0; i$ < len$; ++i$) {
|
||||
Aspect tag = arr$[i$];
|
||||
if (tag != null) {
|
||||
x = var16 + 17 + index * 18;
|
||||
y = var17 + 7 - 33;
|
||||
UtilsFX.bindTexture("textures/aspects/_back.png");
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
GL11.glTranslated((double)(x + shiftx - 2), (double)(y + shifty - 2), 0.0D);
|
||||
GL11.glScaled(1.25D, 1.25D, 0.0D);
|
||||
UtilsFX.drawTexturedQuadFull(0, 0, (double)UtilsFX.getGuiZLevel(gui));
|
||||
GL11.glDisable(3042);
|
||||
GL11.glPopMatrix();
|
||||
if (Thaumcraft.proxy.playerKnowledge.hasDiscoveredAspect(player.getCommandSenderName(), tag)) {
|
||||
UtilsFX.drawTag(x + shiftx, y + shifty, tag, (float)tags.getAmount(tag), 0, (double)UtilsFX.getGuiZLevel(gui));
|
||||
} else {
|
||||
UtilsFX.bindTexture("textures/aspects/_unknown.png");
|
||||
GL11.glPushMatrix();
|
||||
GL11.glEnable(3042);
|
||||
GL11.glBlendFunc(770, 771);
|
||||
GL11.glTranslated((double)(x + shiftx), (double)(y + shifty), 0.0D);
|
||||
UtilsFX.drawTexturedQuadFull(0, 0, (double)UtilsFX.getGuiZLevel(gui));
|
||||
GL11.glDisable(3042);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
++index;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glEnable(2929);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glPopAttrib();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package dev.tilera.auracore.mixins;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import dev.tilera.auracore.Config;
|
||||
import dev.tilera.auracore.helper.LegacyAspects;
|
||||
import thaumcraft.common.config.ConfigAspects;
|
||||
|
||||
@Mixin(ConfigAspects.class)
|
||||
public class MixinConfigAspects {
|
||||
|
||||
@Shadow(remap = false)
|
||||
private static void registerEntityAspects() {}
|
||||
@Shadow(remap = false)
|
||||
private static void registerItemAspects() {}
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
* @reason Legacy aspects
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
public static void init() {
|
||||
if (Config.legacyAspects) {
|
||||
LegacyAspects.initAspects();
|
||||
} else {
|
||||
registerItemAspects();
|
||||
}
|
||||
registerEntityAspects();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,411 @@
|
|||
package dev.tilera.auracore.mixins;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import dev.tilera.auracore.api.Aspects;
|
||||
import dev.tilera.auracore.api.crafting.CrucibleRecipe;
|
||||
import dev.tilera.auracore.api.crafting.IInfusionRecipe;
|
||||
import dev.tilera.auracore.api.crafting.ShapedInfusionCraftingRecipe;
|
||||
import dev.tilera.auracore.api.crafting.ShapelessInfusionCraftingRecipe;
|
||||
import dev.tilera.auracore.api.research.ResearchPageCrucible;
|
||||
import dev.tilera.auracore.api.research.ResearchPageInfusion;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.research.ResearchItem;
|
||||
import thaumcraft.api.research.ResearchPage;
|
||||
import thaumcraft.api.research.ResearchPage.PageType;
|
||||
import thaumcraft.client.gui.GuiResearchRecipe;
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
import thaumcraft.common.lib.utils.InventoryUtils;
|
||||
|
||||
@Mixin(GuiResearchRecipe.class)
|
||||
public abstract class MixinGuiResearchRecipe extends GuiScreen {
|
||||
|
||||
@Shadow(remap = false)
|
||||
private ResearchItem research;
|
||||
@Shadow(remap = false)
|
||||
String tex2;
|
||||
@Shadow(remap = false)
|
||||
private int cycle;
|
||||
@Shadow(remap = false)
|
||||
ArrayList<List> reference;
|
||||
@Shadow(remap = false)
|
||||
private int page;
|
||||
@Shadow(remap = false)
|
||||
private long lastCycle;
|
||||
@Shadow(remap = false)
|
||||
protected static RenderItem itemRenderer;
|
||||
@Shadow(remap = false)
|
||||
public abstract void drawCustomTooltip(GuiScreen gui, RenderItem itemRenderer, FontRenderer fr, List var4, int par2, int par3, int subTipColor);
|
||||
@Shadow(remap = false)
|
||||
public abstract Object[] findRecipeReference(ItemStack item);
|
||||
@Shadow(remap = false)
|
||||
protected abstract void drawAspectPage(int side, int x, int y, int mx, int my, AspectList aspects);
|
||||
@Shadow(remap = false)
|
||||
protected abstract void drawCompoundCraftingPage(int side, int x, int y, int mx, int my, ResearchPage page);
|
||||
@Shadow(remap = false)
|
||||
protected abstract void drawCruciblePage(int side, int x, int y, int mx, int my, ResearchPage pageParm);
|
||||
@Shadow(remap = false)
|
||||
protected abstract void drawCraftingPage(int side, int x, int y, int mx, int my, ResearchPage pageParm);
|
||||
@Shadow(remap = false)
|
||||
protected abstract void drawArcaneCraftingPage(int side, int x, int y, int mx, int my, ResearchPage pageParm);
|
||||
@Shadow(remap = false)
|
||||
protected abstract void drawInfusionPage(int side, int x, int y, int mx, int my, ResearchPage pageParm);
|
||||
@Shadow(remap = false)
|
||||
protected abstract void drawInfusionEnchantingPage(int side, int x, int y, int mx, int my, ResearchPage pageParm);
|
||||
@Shadow(remap = false)
|
||||
protected abstract void drawSmeltingPage(int side, int x, int y, int mx, int my, ResearchPage pageParm);
|
||||
@Shadow(remap = false)
|
||||
protected abstract void drawTextPage(int side, int x, int y, String text);
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
* @reason Custom pages
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
private void drawPage(ResearchPage pageParm, int side, int x, int y, int mx, int my) {
|
||||
GL11.glPushAttrib(1048575);
|
||||
if (this.lastCycle < System.currentTimeMillis()) {
|
||||
++this.cycle;
|
||||
this.lastCycle = System.currentTimeMillis() + 1000L;
|
||||
}
|
||||
|
||||
if (this.page == 0 && side == 0) {
|
||||
this.drawTexturedModalRect(x + 4, y - 13, 24, 184, 96, 4);
|
||||
this.drawTexturedModalRect(x + 4, y + 4, 24, 184, 96, 4);
|
||||
int offset = super.fontRendererObj.getStringWidth(this.research.getName());
|
||||
if (offset <= 130) {
|
||||
super.fontRendererObj.drawString(this.research.getName(), x + 52 - offset / 2, y - 6, 3158064);
|
||||
} else {
|
||||
float vv = 130.0F / (float)offset;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float)(x + 52) - (float)(offset / 2) * vv, (float)y - 6.0F * vv, 0.0F);
|
||||
GL11.glScalef(vv, vv, vv);
|
||||
super.fontRendererObj.drawString(this.research.getName(), 0, 0, 3158064);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
y += 25;
|
||||
}
|
||||
|
||||
GL11.glAlphaFunc(516, 0.003921569F);
|
||||
if (pageParm instanceof ResearchPageInfusion) {
|
||||
this.drawInfusionCraftingPage(side, x, y, mx, my, pageParm);
|
||||
} else if (pageParm instanceof ResearchPageCrucible) {
|
||||
this.drawLegacyCruciblePage(side, x, y, mx, my, pageParm);
|
||||
} else if (pageParm.type != PageType.TEXT && pageParm.type != PageType.TEXT_CONCEALED) {
|
||||
if (pageParm.type == PageType.ASPECTS) {
|
||||
this.drawAspectPage(side, x - 8, y - 8, mx, my, pageParm.aspects);
|
||||
} else if (pageParm.type == PageType.CRUCIBLE_CRAFTING) {
|
||||
this.drawCruciblePage(side, x - 4, y - 8, mx, my, pageParm);
|
||||
} else if (pageParm.type == PageType.NORMAL_CRAFTING) {
|
||||
this.drawCraftingPage(side, x - 4, y - 8, mx, my, pageParm);
|
||||
} else if (pageParm.type == PageType.ARCANE_CRAFTING) {
|
||||
this.drawArcaneCraftingPage(side, x - 4, y - 8, mx, my, pageParm);
|
||||
} else if (pageParm.type == PageType.COMPOUND_CRAFTING) {
|
||||
this.drawCompoundCraftingPage(side, x - 4, y - 8, mx, my, pageParm);
|
||||
} else if (pageParm.type == PageType.INFUSION_CRAFTING) {
|
||||
this.drawInfusionPage(side, x - 4, y - 8, mx, my, pageParm);
|
||||
} else if (pageParm.type == PageType.INFUSION_ENCHANTMENT) {
|
||||
this.drawInfusionEnchantingPage(side, x - 4, y - 8, mx, my, pageParm);
|
||||
} else if (pageParm.type == PageType.SMELTING) {
|
||||
this.drawSmeltingPage(side, x - 4, y - 8, mx, my, pageParm);
|
||||
}
|
||||
} else {
|
||||
this.drawTextPage(side, x, y - 10, pageParm.getTranslatedText());
|
||||
}
|
||||
|
||||
GL11.glAlphaFunc(516, 0.1F);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
private void drawInfusionCraftingPage(int side, int x, int y, int mx, int my, ResearchPage pageParm) {
|
||||
IInfusionRecipe recipe = null;
|
||||
Object tr = null;
|
||||
if (pageParm.recipe instanceof Object[]) {
|
||||
try {
|
||||
tr = ((Object[])((Object[])pageParm.recipe))[this.cycle];
|
||||
} catch (Exception var22) {
|
||||
this.cycle = 0;
|
||||
tr = ((Object[])((Object[])pageParm.recipe))[this.cycle];
|
||||
}
|
||||
} else {
|
||||
tr = pageParm.recipe;
|
||||
}
|
||||
|
||||
if (tr instanceof ShapedInfusionCraftingRecipe) {
|
||||
recipe = (ShapedInfusionCraftingRecipe)tr;
|
||||
} else if (tr instanceof ShapelessInfusionCraftingRecipe) {
|
||||
recipe = (ShapelessInfusionCraftingRecipe)tr;
|
||||
}
|
||||
|
||||
if (recipe != null) {
|
||||
GL11.glPushMatrix();
|
||||
int start = side * 152;
|
||||
UtilsFX.bindTexture(this.tex2);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glTranslatef((float)(x + start), (float)y, 0.0F);
|
||||
GL11.glScalef(2.0F, 2.0F, 1.0F);
|
||||
this.drawTexturedModalRect(2, 27, 112, 15, 52, 52);
|
||||
this.drawTexturedModalRect(20, 7, 20, 3, 16, 16);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.4F);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glTranslatef((float)(x + start), (float)(y + 164), 0.0F);
|
||||
GL11.glScalef(2.0F, 2.0F, 1.0F);
|
||||
this.drawTexturedModalRect(0, 0, 68, 76, 12, 12);
|
||||
GL11.glPopMatrix();
|
||||
int mposx = mx;
|
||||
int mposy = my;
|
||||
AspectList tags = ((IInfusionRecipe)recipe).getAspects();
|
||||
int rw;
|
||||
int i;
|
||||
int j;
|
||||
if (tags != null && tags.size() > 0) {
|
||||
int count = 0;
|
||||
Aspect[] aspects = tags.getAspectsSortedAmount();
|
||||
rw = aspects.length;
|
||||
|
||||
Aspect tag;
|
||||
for(int k = 0; k < rw; ++k) {
|
||||
tag = aspects[k];
|
||||
i = x + start + 14 + 18 * count + (5 - tags.size()) * 8;
|
||||
j = y + 172;
|
||||
UtilsFX.drawTag(x + start + 14 + 18 * count + (5 - tags.size()) * 8, y + 172, tag, (float)tags.getAmount(tag), 0, 0.0D, 771, 1.0F);
|
||||
if (mposx >= i && mposy >= j && mposx < i + 16 && mposy < j + 16) {
|
||||
this.drawCustomTooltip(this, itemRenderer, super.fontRendererObj, Arrays.asList(tag.getName(), tag.getLocalizedDescription()), mx, my - 8, 11);
|
||||
}
|
||||
++count;
|
||||
}
|
||||
|
||||
}
|
||||
UtilsFX.drawTag(x + 48 + start + 32, y + 22, Aspects.VIS, recipe.getCost(), 0, 0.0D, 771, 1.0F);
|
||||
if (mposx >= x + 48 + start + 32 && mposy >= y + 27 && mposx < x + 48 + start + 48 && mposy < y + 27 + 16) {
|
||||
this.drawCustomTooltip(this, itemRenderer, super.fontRendererObj, Arrays.asList(Aspects.VIS.getName(), Aspects.VIS.getLocalizedDescription()), mx, my - 8, 11);
|
||||
}
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glTranslated(0.0D, 0.0D, 100.0D);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glEnable(2884);
|
||||
itemRenderer.renderItemAndEffectIntoGUI(super.mc.fontRenderer, super.mc.renderEngine, InventoryUtils.cycleItemStack(((IInfusionRecipe)recipe).getRecipeOutput()), x + 48 + start, y + 22);
|
||||
itemRenderer.renderItemOverlayIntoGUI(super.mc.fontRenderer, super.mc.renderEngine, InventoryUtils.cycleItemStack(((IInfusionRecipe)recipe).getRecipeOutput()), x + 48 + start, y + 22);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glEnable(2896);
|
||||
GL11.glPopMatrix();
|
||||
if (mposx >= x + 48 + start && mposy >= y + 27 && mposx < x + 48 + start + 16 && mposy < y + 27 + 16) {
|
||||
this.drawCustomTooltip(this, itemRenderer, super.fontRendererObj, InventoryUtils.cycleItemStack(((IInfusionRecipe)recipe).getRecipeOutput()).getTooltip(super.mc.thePlayer, super.mc.gameSettings.advancedItemTooltips), mx, my, 11);
|
||||
}
|
||||
|
||||
String text = StatCollector.translateToLocal("auracore.research_title.infusion");
|
||||
int offset = super.fontRendererObj.getStringWidth(text);
|
||||
super.fontRendererObj.drawString(text, x + start + 56 - offset / 2, y, 5263440);
|
||||
if (recipe != null && recipe instanceof ShapedInfusionCraftingRecipe) {
|
||||
rw = ((ShapedInfusionCraftingRecipe)recipe).recipeWidth;
|
||||
int h = ((ShapedInfusionCraftingRecipe)recipe).recipeHeight;
|
||||
Object[] items = ((ShapedInfusionCraftingRecipe)recipe).recipeItems;
|
||||
|
||||
for(i = 0; i < rw && i < 3; ++i) {
|
||||
for(j = 0; j < h && j < 3; ++j) {
|
||||
if (items[i + j * rw] != null) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.0D, 0.0D, 100.0D);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glEnable(2884);
|
||||
itemRenderer.renderItemAndEffectIntoGUI(super.mc.fontRenderer, super.mc.renderEngine, InventoryUtils.cycleItemStack(items[i + j * rw]), x + start + 16 + i * 32, y + 66 + j * 32);
|
||||
itemRenderer.renderItemOverlayIntoGUI(super.mc.fontRenderer, super.mc.renderEngine, InventoryUtils.cycleItemStack(items[i + j * rw]).copy().splitStack(1), x + start + 16 + i * 32, y + 66 + j * 32);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glEnable(2896);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(i = 0; i < rw && i < 3; ++i) {
|
||||
for(j = 0; j < h && j < 3; ++j) {
|
||||
if (items[i + j * rw] != null && mposx >= x + 16 + start + i * 32 && mposy >= y + 66 + j * 32 && mposx < x + 16 + start + i * 32 + 16 && mposy < y + 66 + j * 32 + 16) {
|
||||
List addtext = InventoryUtils.cycleItemStack(items[i + j * rw]).getTooltip(super.mc.thePlayer, super.mc.gameSettings.advancedItemTooltips);
|
||||
Object[] ref = this.findRecipeReference(InventoryUtils.cycleItemStack(items[i + j * rw]));
|
||||
if (ref != null && !((String)ref[0]).equals(this.research.key)) {
|
||||
addtext.add("\u00a78\u00a7o" + StatCollector.translateToLocal("recipe.clickthrough"));
|
||||
this.reference.add(Arrays.asList(mx, my, (String)ref[0], (Integer)ref[1]));
|
||||
}
|
||||
|
||||
this.drawCustomTooltip(this, itemRenderer, super.fontRendererObj, addtext, mx, my, 11);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (recipe != null && recipe instanceof ShapelessInfusionCraftingRecipe) {
|
||||
List<ItemStack> items = ((ShapelessInfusionCraftingRecipe)recipe).recipeItems;
|
||||
|
||||
for(i = 0; i < items.size() && i < 9; ++i) {
|
||||
if (items.get(i) != null) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.0D, 0.0D, 100.0D);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glEnable(2884);
|
||||
itemRenderer.renderItemAndEffectIntoGUI(super.mc.fontRenderer, super.mc.renderEngine, InventoryUtils.cycleItemStack(items.get(i)), x + start + 16 + i % 3 * 32, y + 66 + i / 3 * 32);
|
||||
itemRenderer.renderItemOverlayIntoGUI(super.mc.fontRenderer, super.mc.renderEngine, InventoryUtils.cycleItemStack(items.get(i)), x + start + 16 + i % 3 * 32, y + 66 + i / 3 * 32);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glEnable(2896);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
for(i = 0; i < items.size() && i < 9; ++i) {
|
||||
if (items.get(i) != null && mposx >= x + 16 + start + i % 3 * 32 && mposy >= y + 66 + i / 3 * 32 && mposx < x + 16 + start + i % 3 * 32 + 16 && mposy < y + 66 + i / 3 * 32 + 16) {
|
||||
List addtext = InventoryUtils.cycleItemStack(items.get(i)).getTooltip(super.mc.thePlayer, super.mc.gameSettings.advancedItemTooltips);
|
||||
Object[] ref = this.findRecipeReference(InventoryUtils.cycleItemStack(items.get(i)));
|
||||
if (ref != null && !((String)ref[0]).equals(this.research.key)) {
|
||||
addtext.add("\u00a78\u00a7o" + StatCollector.translateToLocal("recipe.clickthrough"));
|
||||
this.reference.add(Arrays.asList(mx, my, (String)ref[0], (Integer)ref[1]));
|
||||
}
|
||||
|
||||
this.drawCustomTooltip(this, itemRenderer, super.fontRendererObj, addtext, mx, my, 11);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
private void drawLegacyCruciblePage(int side, int x, int y, int mx, int my, ResearchPage pageParm) {
|
||||
CrucibleRecipe rc = null;
|
||||
Object tr = null;
|
||||
if (pageParm.recipe instanceof Object[]) {
|
||||
try {
|
||||
tr = ((Object[])((Object[])pageParm.recipe))[this.cycle];
|
||||
} catch (Exception var26) {
|
||||
this.cycle = 0;
|
||||
tr = ((Object[])((Object[])pageParm.recipe))[this.cycle];
|
||||
}
|
||||
} else {
|
||||
tr = pageParm.recipe;
|
||||
}
|
||||
|
||||
if (tr instanceof CrucibleRecipe) {
|
||||
rc = (CrucibleRecipe)tr;
|
||||
}
|
||||
|
||||
if (rc != null) {
|
||||
GL11.glPushMatrix();
|
||||
int start = side * 152;
|
||||
String text = StatCollector.translateToLocal("recipe.type.crucible");
|
||||
int offset = super.fontRendererObj.getStringWidth(text);
|
||||
super.fontRendererObj.drawString(text, x + start + 56 - offset / 2, y, 5263440);
|
||||
UtilsFX.bindTexture(this.tex2);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glEnable(3042);
|
||||
GL11.glTranslatef((float)(x + start), (float)(y + 28), 0.0F);
|
||||
GL11.glScalef(2.0F, 2.0F, 1.0F);
|
||||
this.drawTexturedModalRect(0, 0, 0, 3, 56, 17);
|
||||
GL11.glTranslatef(0.0F, 32.0F, 0.0F);
|
||||
this.drawTexturedModalRect(0, 0, 0, 20, 56, 48);
|
||||
GL11.glTranslatef(21.0F, -8.0F, 0.0F);
|
||||
this.drawTexturedModalRect(0, 0, 100, 84, 11, 13);
|
||||
GL11.glPopMatrix();
|
||||
int mposx = mx;
|
||||
int mposy = my;
|
||||
int total = 0;
|
||||
int rows = (rc.aspects.size() - 1) / 3;
|
||||
int shift = (3 - rc.aspects.size() % 3) * 10;
|
||||
int sx = x + start + 28;
|
||||
int sy = y + 96 + 32 - 10 * rows;
|
||||
Aspect[] arr$ = rc.aspects.getAspectsSorted();
|
||||
int len$ = arr$.length;
|
||||
|
||||
int i$;
|
||||
Aspect tag;
|
||||
byte m;
|
||||
int vx;
|
||||
int vy;
|
||||
for(i$ = 0; i$ < len$; ++i$) {
|
||||
tag = arr$[i$];
|
||||
m = 0;
|
||||
if (total / 3 >= rows && (rows > 1 || rc.aspects.size() < 3)) {
|
||||
m = 1;
|
||||
}
|
||||
|
||||
vx = sx + total % 3 * 20 + shift * m;
|
||||
vy = sy + total / 3 * 20;
|
||||
UtilsFX.drawTag(vx, vy, tag, (float)rc.aspects.getAmount(tag), 0, (double)super.zLevel);
|
||||
++total;
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.0D, 0.0D, 100.0D);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glEnable(2884);
|
||||
itemRenderer.renderItemAndEffectIntoGUI(super.mc.fontRenderer, super.mc.renderEngine, rc.recipeOutput, x + 48 + start, y + 36);
|
||||
itemRenderer.renderItemOverlayIntoGUI(super.mc.fontRenderer, super.mc.renderEngine, rc.recipeOutput, x + 48 + start, y + 36);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glEnable(2896);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0.0D, 0.0D, 100.0D);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
GL11.glEnable(2884);
|
||||
UtilsFX.drawTag(x + 26 + start, y + 72, Aspects.VIS, rc.cost, 0, (double)super.zLevel);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glEnable(2896);
|
||||
GL11.glPopMatrix();
|
||||
if (mx >= x + 48 + start && my >= y + 36 && mx < x + 48 + start + 16 && my < y + 36 + 16) {
|
||||
this.drawCustomTooltip(this, itemRenderer, super.fontRendererObj, rc.recipeOutput.getTooltip(super.mc.thePlayer, super.mc.gameSettings.advancedItemTooltips), mx, my, 11);
|
||||
}
|
||||
|
||||
if (mx >= x + 26 + start && my >= y + 72 && mx < x + 26 + start + 16 && my < y + 72 + 16) {
|
||||
List addtext = Arrays.asList(Aspects.VIS.getName(), Aspects.VIS.getLocalizedDescription());
|
||||
|
||||
this.drawCustomTooltip(this, itemRenderer, super.fontRendererObj, addtext, mx, my, 11);
|
||||
}
|
||||
|
||||
total = 0;
|
||||
arr$ = rc.aspects.getAspectsSorted();
|
||||
len$ = arr$.length;
|
||||
|
||||
for(i$ = 0; i$ < len$; ++i$) {
|
||||
tag = arr$[i$];
|
||||
m = 0;
|
||||
if (total / 3 >= rows && (rows > 1 || rc.aspects.size() < 3)) {
|
||||
m = 1;
|
||||
}
|
||||
|
||||
vx = sx + total % 3 * 20 + shift * m;
|
||||
vy = sy + total / 3 * 20;
|
||||
if (mposx >= vx && mposy >= vy && mposx < vx + 16 && mposy < vy + 16) {
|
||||
this.drawCustomTooltip(this, itemRenderer, super.fontRendererObj, Arrays.asList(tag.getName(), tag.getLocalizedDescription()), mx, my, 11);
|
||||
}
|
||||
|
||||
++total;
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -30,6 +30,7 @@ public abstract class MixinItemShard extends Item {
|
|||
* @author tilera
|
||||
* @reason Vis, Tainted and Dull shards
|
||||
*/
|
||||
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||
@Overwrite
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
package dev.tilera.auracore.mixins;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import dev.tilera.auracore.Config;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.common.lib.research.PlayerKnowledge;
|
||||
|
||||
@Mixin(PlayerKnowledge.class)
|
||||
public abstract class MixinPlayerKnowledge {
|
||||
|
||||
@Shadow(remap = false)
|
||||
public Map<String, AspectList> aspectsDiscovered;
|
||||
|
||||
@Inject(method = "getAspectsDiscovered", at = @At("HEAD"), remap = false)
|
||||
public void onGetPlayerKnowledge(String player, CallbackInfoReturnable<AspectList> ci) {
|
||||
AspectList known = (AspectList)this.aspectsDiscovered.get(player);
|
||||
if (Config.knowAllAspects && (known == null || known.size() < Aspect.aspects.size())) {
|
||||
addAllAspects(player);
|
||||
}
|
||||
}
|
||||
|
||||
public void addAllAspects(String player) {
|
||||
AspectList known = (AspectList)this.aspectsDiscovered.get(player);
|
||||
if (known == null) {
|
||||
known = new AspectList();
|
||||
}
|
||||
for (Aspect a : Aspect.aspects.values()) {
|
||||
if (!known.aspects.containsKey(a)) {
|
||||
known.add(a, 0);
|
||||
}
|
||||
}
|
||||
aspectsDiscovered.put(player, known);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package dev.tilera.auracore.mixins;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.gen.Invoker;
|
||||
|
||||
import dev.tilera.auracore.api.Aspects;
|
||||
import dev.tilera.auracore.crafting.AspectCalculation;
|
||||
import net.minecraft.item.Item;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager;
|
||||
|
||||
@Mixin(ThaumcraftCraftingManager.class)
|
||||
public abstract class MixinThaumcraftCraftingManager {
|
||||
|
||||
@Invoker(value = "generateTagsFromCrucibleRecipes", remap = false)
|
||||
public static AspectList invokeGenerateTagsFromCrucibleRecipes(Item item, int meta, ArrayList<List> history) {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
|
||||
@Invoker(value = "generateTagsFromArcaneRecipes", remap = false)
|
||||
public static AspectList invokeGenerateTagsFromArcaneRecipes(Item item, int meta, ArrayList<List> history) {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
|
||||
@Invoker(value = "generateTagsFromInfusionRecipes", remap = false)
|
||||
public static AspectList invokeGenerateTagsFromInfusionRecipes(Item item, int meta, ArrayList<List> history) {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
|
||||
@Invoker(value = "generateTagsFromCraftingRecipes", remap = false)
|
||||
public static AspectList invokeGenerateTagsFromCraftingRecipes(Item item, int meta, ArrayList<List> history) {
|
||||
throw new RuntimeException();
|
||||
}
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
* @reason recipe tag generation
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
private static AspectList generateTagsFromRecipes(Item item, int meta, ArrayList<List> history) {
|
||||
AspectList ret = null;
|
||||
ret = AspectCalculation.generateTagsFromCrucibleRecipes(item, meta, history);
|
||||
if (ret != null) {
|
||||
return ret;
|
||||
}
|
||||
ret = invokeGenerateTagsFromCrucibleRecipes(item, meta, history);
|
||||
if (ret != null) {
|
||||
removeVis(ret);
|
||||
return ret;
|
||||
}
|
||||
ret = AspectCalculation.generateTagsFromArcaneRecipes(item, meta, history);
|
||||
if (ret != null) {
|
||||
return ret;
|
||||
}
|
||||
ret = invokeGenerateTagsFromArcaneRecipes(item, meta, history);
|
||||
if (ret != null) {
|
||||
removeVis(ret);
|
||||
return ret;
|
||||
}
|
||||
ret = AspectCalculation.generateTagsFromInfusionRecipes(item, meta, history);
|
||||
if (ret != null) {
|
||||
return ret;
|
||||
}
|
||||
ret = invokeGenerateTagsFromInfusionRecipes(item, meta, history);
|
||||
if (ret != null) {
|
||||
removeVis(ret);
|
||||
return ret;
|
||||
}
|
||||
ret = invokeGenerateTagsFromCraftingRecipes(item, meta, history);
|
||||
|
||||
if (ret != null) {
|
||||
removeVis(ret);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
private static void removeVis(AspectList aspects) {
|
||||
int vis = aspects.getAmount(Aspects.VIS);
|
||||
if (vis > 0) {
|
||||
aspects.remove(Aspects.VIS);
|
||||
int magic = Math.round((float)vis / 10.0f);
|
||||
aspects.add(Aspect.MAGIC, magic);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -19,6 +19,7 @@ import thaumcraft.api.aspects.Aspect;
|
|||
import thaumcraft.common.config.Config;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.lib.world.ThaumcraftWorldGenerator;
|
||||
import thaumcraft.common.lib.world.WorldGenSilverwoodTrees;
|
||||
import thaumcraft.common.lib.world.biomes.BiomeHandler;
|
||||
|
||||
@Mixin(ThaumcraftWorldGenerator.class)
|
||||
|
@ -34,9 +35,9 @@ public abstract class MixinThaumcraftWorldGenerator {
|
|||
int z = chunkZ * 16 + random.nextInt(16);
|
||||
int y = world.getHeightValue(x, z);
|
||||
BiomeGenBase bio = world.getBiomeGenForCoords(x, z);
|
||||
if (bio.equals(ThaumcraftWorldGenerator.biomeMagicalForest) || bio.equals(ThaumcraftWorldGenerator.biomeTaint) || !BiomeDictionary.isBiomeOfType(bio, Type.MAGICAL) && bio.biomeID != BiomeGenBase.forestHills.biomeID && bio.biomeID != BiomeGenBase.birchForestHills.biomeID) {
|
||||
if (bio.equals(ThaumcraftWorldGenerator.biomeMagicalForest) || bio.equals(ThaumcraftWorldGenerator.biomeTaint) || !BiomeDictionary.isBiomeOfType(bio, Type.MAGICAL) && BiomeDictionary.isBiomeOfType(bio, Type.FOREST)) {
|
||||
return false;
|
||||
} else {
|
||||
} else if (dev.tilera.auracore.Config.replaceSilverwood) {
|
||||
boolean t = (new WorldGenSilverwoodTreesOld(false)).generate(world, random, x, y, z);
|
||||
if (t) {
|
||||
int value = random.nextInt(200) + 200;
|
||||
|
@ -44,6 +45,8 @@ public abstract class MixinThaumcraftWorldGenerator {
|
|||
ThaumcraftWorldGenerator.generateFlowers(world, random, x, y, z, 2);
|
||||
}
|
||||
return t;
|
||||
} else {
|
||||
return (new WorldGenSilverwoodTrees(false, 7, 4)).generate(world, random, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -4,8 +4,11 @@ import org.spongepowered.asm.mixin.Mixin;
|
|||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import dev.tilera.auracore.Config;
|
||||
import dev.tilera.auracore.api.IAlembic;
|
||||
import dev.tilera.auracore.aura.AuraManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
|
@ -25,6 +28,23 @@ public abstract class MixinTileCrucible extends TileThaumcraft implements IAspec
|
|||
public AspectList aspects;
|
||||
@Shadow(remap = false)
|
||||
public FluidTank tank;
|
||||
@Shadow(remap = false)
|
||||
int bellows;
|
||||
@Shadow(remap = false)
|
||||
private long counter;
|
||||
|
||||
@Shadow(remap = false)
|
||||
public abstract AspectList takeRandomFromSource();
|
||||
@Shadow(remap = false)
|
||||
public abstract void getBellows();
|
||||
@Shadow(remap = false)
|
||||
public abstract int tagAmount();
|
||||
@Shadow(remap = false)
|
||||
public abstract void spill();
|
||||
@Shadow(remap = false)
|
||||
abstract void drawEffects();
|
||||
|
||||
boolean spillNextTick = false;
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
|
@ -74,8 +94,13 @@ public abstract class MixinTileCrucible extends TileThaumcraft implements IAspec
|
|||
}
|
||||
}
|
||||
}
|
||||
AuraManager.addFluxToClosest(this.worldObj, (float) this.xCoord + 0.5f, (float) this.yCoord + 0.5f,
|
||||
(float) this.zCoord + 0.5f, this.aspects);
|
||||
if (Config.legacyCrucibleMechanics) {
|
||||
AuraManager.addFluxToClosest(this.worldObj, (float) this.xCoord + 0.5f, (float) this.yCoord + 0.5f, (float) this.zCoord + 0.5f, this.aspects);
|
||||
} else {
|
||||
for(int a = 0; a < this.aspects.visSize() / 2; ++a) {
|
||||
this.spill();
|
||||
}
|
||||
}
|
||||
|
||||
this.aspects = new AspectList();
|
||||
this.markDirty();
|
||||
|
@ -85,6 +110,97 @@ public abstract class MixinTileCrucible extends TileThaumcraft implements IAspec
|
|||
|
||||
}
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
* @reason Flux to aura & no aspect boiling down
|
||||
*/
|
||||
@Overwrite
|
||||
public void updateEntity() {
|
||||
++this.counter;
|
||||
int prevheat = this.heat;
|
||||
if (!super.worldObj.isRemote) {
|
||||
if (this.bellows < 0) {
|
||||
this.getBellows();
|
||||
}
|
||||
if (this.spillNextTick) {
|
||||
this.spillRemnants();
|
||||
this.spillNextTick = false;
|
||||
this.getBellows();
|
||||
}
|
||||
if (this.tank.getFluidAmount() <= 0) {
|
||||
if (this.heat > 0) {
|
||||
--this.heat;
|
||||
}
|
||||
} else {
|
||||
Material mat = super.worldObj.getBlock(super.xCoord, super.yCoord - 1, super.zCoord).getMaterial();
|
||||
Block bi = super.worldObj.getBlock(super.xCoord, super.yCoord - 1, super.zCoord);
|
||||
int md = super.worldObj.getBlockMetadata(super.xCoord, super.yCoord - 1, super.zCoord);
|
||||
if (mat != Material.lava && mat != Material.fire && (bi != ConfigBlocks.blockAiry || md != 1)) {
|
||||
if (this.heat > 0) {
|
||||
--this.heat;
|
||||
if (this.heat == 149) {
|
||||
this.markDirty();
|
||||
super.worldObj.markBlockForUpdate(super.xCoord, super.yCoord, super.zCoord);
|
||||
}
|
||||
}
|
||||
} else if (this.heat < 200) {
|
||||
this.heat = (short)(this.heat + 1 + this.bellows * 2);
|
||||
if (prevheat < 151 && this.heat >= 151) {
|
||||
this.markDirty();
|
||||
super.worldObj.markBlockForUpdate(super.xCoord, super.yCoord, super.zCoord);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (Config.legacyCrucibleMechanics) {
|
||||
if (this.tagAmount() > 500 && this.counter % 5L == 0L) {
|
||||
AspectList tt = this.takeRandomFromSource();
|
||||
AuraManager.addFluxToClosest(this.worldObj, this.xCoord, this.yCoord, this.zCoord, tt);
|
||||
if (this.tagAmount() <= 500) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (this.tagAmount() > 100 && this.counter % 5L == 0L) {
|
||||
this.takeRandomFromSource();
|
||||
this.spill();
|
||||
}
|
||||
|
||||
if (this.counter > 100L && this.heat > 150) {
|
||||
this.counter = 0L;
|
||||
if (this.tagAmount() > 0) {
|
||||
int s = this.aspects.getAspects().length;
|
||||
Aspect a = this.aspects.getAspects()[super.worldObj.rand.nextInt(s)];
|
||||
if (a.isPrimal()) {
|
||||
a = this.aspects.getAspects()[super.worldObj.rand.nextInt(s)];
|
||||
}
|
||||
|
||||
this.tank.drain(2, true);
|
||||
this.aspects.remove(a, 1);
|
||||
if (!a.isPrimal()) {
|
||||
if (super.worldObj.rand.nextBoolean()) {
|
||||
this.aspects.add(a.getComponents()[0], 1);
|
||||
} else {
|
||||
this.aspects.add(a.getComponents()[1], 1);
|
||||
}
|
||||
} else {
|
||||
this.spill();
|
||||
}
|
||||
}
|
||||
|
||||
this.markDirty();
|
||||
super.worldObj.markBlockForUpdate(super.xCoord, super.yCoord, super.zCoord);
|
||||
}
|
||||
}
|
||||
} else if (this.tank.getFluidAmount() > 0) {
|
||||
this.drawEffects();
|
||||
}
|
||||
|
||||
if (super.worldObj.isRemote && prevheat < 151 && this.heat >= 151) {
|
||||
++this.heat;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
* @reason Implement aspect container properly
|
||||
|
@ -93,7 +209,7 @@ public abstract class MixinTileCrucible extends TileThaumcraft implements IAspec
|
|||
public boolean takeFromContainer(Aspect tag, int amount) {
|
||||
if (this.aspects.getAmount(tag) >= amount) {
|
||||
this.aspects.reduce(tag, amount);
|
||||
//this.spillNextTick = true;
|
||||
this.spillNextTick = true;
|
||||
this.markDirty();
|
||||
super.worldObj.markBlockForUpdate(super.xCoord, super.yCoord, super.zCoord);
|
||||
return true;
|
||||
|
@ -110,7 +226,7 @@ public abstract class MixinTileCrucible extends TileThaumcraft implements IAspec
|
|||
if (this.doesContainerContain(ot)) {
|
||||
for (Aspect tag : ot.getAspects()) {
|
||||
this.aspects.reduce(tag, ot.getAmount(tag));
|
||||
//this.spillNextTick = true;
|
||||
this.spillNextTick = true;
|
||||
this.markDirty();
|
||||
super.worldObj.markBlockForUpdate(super.xCoord, super.yCoord, super.zCoord);
|
||||
}
|
||||
|
|
|
@ -3,15 +3,29 @@ package dev.tilera.auracore.mixins;
|
|||
import java.util.Random;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import dev.tilera.auracore.api.ICrystal;
|
||||
import dev.tilera.auracore.aura.AuraManager;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import thaumcraft.api.TileThaumcraft;
|
||||
import thaumcraft.common.config.ConfigItems;
|
||||
import thaumcraft.common.tiles.TileCrystal;
|
||||
|
||||
@Mixin(TileCrystal.class)
|
||||
public abstract class MixinTileCrystal extends TileThaumcraft {
|
||||
public abstract class MixinTileCrystal extends TileThaumcraft implements ICrystal {
|
||||
|
||||
private long count = System.currentTimeMillis() + (long)new Random().nextInt(300000);
|
||||
@Shadow(remap = false)
|
||||
public short orientation;
|
||||
public int crystals = 6;
|
||||
public int ticks = 0;
|
||||
public boolean isLoaded = false;
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
|
@ -24,8 +38,18 @@ public abstract class MixinTileCrystal extends TileThaumcraft {
|
|||
if (this.worldObj.isRemote) {
|
||||
return;
|
||||
}
|
||||
if (!isLoaded) {
|
||||
isLoaded = true;
|
||||
ICrystal.crystalCounts.put(new ChunkCoordinates(xCoord, yCoord, zCoord), crystals);
|
||||
}
|
||||
ticks++;
|
||||
int md = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
|
||||
if (md == 7) {
|
||||
if (md == 6) {
|
||||
crystals = 6;
|
||||
} else if (md == 9) {
|
||||
crystals = 5;
|
||||
}
|
||||
if (md == 7 || md == 10 || crystals < 6) {
|
||||
return;
|
||||
}
|
||||
if (this.count <= System.currentTimeMillis()) {
|
||||
|
@ -39,4 +63,66 @@ public abstract class MixinTileCrystal extends TileThaumcraft {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
* @reason Crystal count
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
public void readCustomNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readCustomNBT(nbttagcompound);
|
||||
this.orientation = nbttagcompound.getShort("orientation");
|
||||
if (nbttagcompound.hasKey("crystals"));
|
||||
this.crystals = nbttagcompound.getInteger("crystals");
|
||||
ICrystal.crystalCounts.put(new ChunkCoordinates(xCoord, yCoord, zCoord), crystals);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
* @reason Crystal count
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
public void writeCustomNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeCustomNBT(nbttagcompound);
|
||||
nbttagcompound.setShort("orientation", this.orientation);
|
||||
nbttagcompound.setInteger("crystals", this.crystals);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCrystalCount(int meta) {
|
||||
if (meta == 6) return 6;
|
||||
if (meta == 9) return 5;
|
||||
return crystals;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean setCrystalCount(int count) {
|
||||
int md = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
|
||||
if(md == 6 || md == 9 || count > 6 || count < 1) return false;
|
||||
crystals = count;
|
||||
worldObj.markBlockForUpdate(xCoord, yCoord, zCoord);
|
||||
ICrystal.crystalCounts.put(new ChunkCoordinates(xCoord, yCoord, zCoord), crystals);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void harvestShard(EntityPlayer player) {
|
||||
if(worldObj.isRemote || !setCrystalCount(crystals - 1)) return;
|
||||
int meta = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
|
||||
if (meta > 7) {
|
||||
meta--;
|
||||
}
|
||||
ItemStack stack = new ItemStack(ConfigItems.itemShard, 1, meta);
|
||||
EntityItem entity = new EntityItem(worldObj, xCoord, yCoord, zCoord, stack);
|
||||
entity.motionX = (player.posX - entity.posX) * 0.1;
|
||||
entity.motionY = (player.posY - entity.posY) * 0.1;
|
||||
entity.motionZ = (player.posZ - entity.posZ) * 0.1;
|
||||
worldObj.spawnEntityInWorld(entity);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canHarvest(EntityPlayer player) {
|
||||
int md = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord);
|
||||
return md != 6 && md != 9 && crystals > 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
package dev.tilera.auracore.mixins;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import dev.tilera.auracore.api.CrystalColors;
|
||||
import dev.tilera.auracore.api.ICrystal;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import thaumcraft.client.lib.UtilsFX;
|
||||
import thaumcraft.client.renderers.tile.TileCrystalRenderer;
|
||||
import thaumcraft.common.tiles.TileCrystal;
|
||||
|
||||
@Mixin(TileCrystalRenderer.class)
|
||||
public abstract class MixinTileCrystalRenderer extends TileEntitySpecialRenderer {
|
||||
|
||||
@Shadow(remap = false)
|
||||
abstract void drawCrystal(int ori, float x, float y, float z, float a1, float a2, Random rand, int color, float size);
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
* @reason Old crystals
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
|
||||
GL11.glPushMatrix();
|
||||
TileCrystal tco = (TileCrystal)te;
|
||||
int md = tco.getBlockMetadata();
|
||||
int color = CrystalColors.colors[5];
|
||||
if (md != 6) {
|
||||
color = CrystalColors.getColorForCrystal(md);
|
||||
}
|
||||
if (md == 9) {
|
||||
color = CrystalColors.colors[7];
|
||||
}
|
||||
|
||||
UtilsFX.bindTexture("textures/models/crystal.png");
|
||||
Random rand = new Random((long)(tco.getBlockMetadata() + tco.xCoord + tco.yCoord * tco.zCoord));
|
||||
this.drawCrystal(tco.orientation, (float)x, (float)y, (float)z, (rand.nextFloat() - rand.nextFloat()) * 5.0F, (rand.nextFloat() - rand.nextFloat()) * 5.0F, rand, color, 1.1F);
|
||||
|
||||
ICrystal ic = (ICrystal) tco;
|
||||
for(int a = 1; a < ic.getCrystalCount(md); ++a) {
|
||||
if (md == 6 || md == 9) {
|
||||
color = CrystalColors.colors[a == 5 ? 6 : a];
|
||||
}
|
||||
|
||||
int angle1 = rand.nextInt(36) + 72 * a;
|
||||
int angle2 = 15 + rand.nextInt(15);
|
||||
this.drawCrystal(tco.orientation, (float)x, (float)y, (float)z, (float)angle1, (float)angle2, rand, color, 1.0F);
|
||||
}
|
||||
|
||||
GL11.glPopMatrix();
|
||||
GL11.glDisable(3042);
|
||||
}
|
||||
|
||||
}
|
65
src/main/java/dev/tilera/auracore/mixins/MixinTileNode.java
Normal file
65
src/main/java/dev/tilera/auracore/mixins/MixinTileNode.java
Normal file
|
@ -0,0 +1,65 @@
|
|||
package dev.tilera.auracore.mixins;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
|
||||
import dev.tilera.auracore.api.EnumNodeType;
|
||||
import dev.tilera.auracore.aura.AuraManager;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import thaumcraft.api.TileThaumcraft;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
import thaumcraft.api.nodes.NodeType;
|
||||
import thaumcraft.common.tiles.TileNode;
|
||||
|
||||
@Mixin(TileNode.class)
|
||||
public abstract class MixinTileNode extends TileThaumcraft {
|
||||
|
||||
@Shadow(remap = false)
|
||||
private NodeType nodeType;
|
||||
@Shadow(remap = false)
|
||||
AspectList aspectsBase;
|
||||
int virtualNodeID = -1;
|
||||
|
||||
@Inject(method = "writeCustomNBT", at = @At("HEAD"), remap = false)
|
||||
public void onNBTWrite(NBTTagCompound nbt, CallbackInfo ci) {
|
||||
nbt.setInteger("virtualNodeID", this.virtualNodeID);
|
||||
}
|
||||
|
||||
@Inject(method = "readCustomNBT", at = @At("HEAD"), remap = false)
|
||||
public void onNBTRead(NBTTagCompound nbt, CallbackInfo ci) {
|
||||
if (nbt.hasKey("virtualNodeID")) {
|
||||
this.virtualNodeID = nbt.getInteger("virtualNodeID");
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "updateEntity", at = @At("HEAD"))
|
||||
public void onTick(CallbackInfo ci) {
|
||||
if (virtualNodeID == -1) {
|
||||
this.createVirtualNode();
|
||||
}
|
||||
}
|
||||
|
||||
private void createVirtualNode() {
|
||||
EnumNodeType type = convertNodeType(nodeType);
|
||||
virtualNodeID = AuraManager.registerAuraNode(this.worldObj, (short)aspectsBase.visSize(), type, this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord, true);
|
||||
}
|
||||
|
||||
private static EnumNodeType convertNodeType(NodeType type) {
|
||||
switch (type) {
|
||||
case TAINTED:
|
||||
case DARK:
|
||||
return EnumNodeType.DARK;
|
||||
case PURE:
|
||||
return EnumNodeType.PURE;
|
||||
case HUNGRY:
|
||||
case UNSTABLE:
|
||||
return EnumNodeType.UNSTABLE;
|
||||
default:
|
||||
return EnumNodeType.NORMAL;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,187 @@
|
|||
package dev.tilera.auracore.mixins;
|
||||
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
|
||||
import dev.tilera.auracore.api.research.IResearchTable;
|
||||
import dev.tilera.auracore.api.research.ResearchTableExtension;
|
||||
import dev.tilera.auracore.api.research.ResearchTableExtensionRegistry;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.api.TileThaumcraft;
|
||||
import thaumcraft.common.Thaumcraft;
|
||||
import thaumcraft.common.tiles.TileResearchTable;
|
||||
|
||||
@Mixin(TileResearchTable.class)
|
||||
public abstract class MixinTileResearchTable extends TileThaumcraft implements IResearchTable {
|
||||
|
||||
private ResearchTableExtension extension = null;
|
||||
|
||||
@Inject(method = "<init>()V", at = @At("TAIL"), remap = false)
|
||||
public void constructorHead(CallbackInfo ci) {
|
||||
if (ResearchTableExtensionRegistry.hasActiveExtension()) {
|
||||
extension = ResearchTableExtensionRegistry.createInstance(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResearchTableExtension getInternalExtension() {
|
||||
return extension;
|
||||
}
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return this.worldObj;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getXCoord() {
|
||||
return this.xCoord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getYCoord() {
|
||||
return this.yCoord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getZCoord() {
|
||||
return this.zCoord;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openGUI(EntityPlayer player) {
|
||||
if (extension != null) {
|
||||
if (extension.openGUI(player)) return;
|
||||
}
|
||||
player.openGui(Thaumcraft.instance, 10, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
@Inject(method = "markDirty", at = @At("TAIL"))
|
||||
public void onMarkDirty(CallbackInfo ci) {
|
||||
if (extension != null) {
|
||||
extension.extMarkDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "updateEntity", at = @At("TAIL"))
|
||||
public void onUpdateEntity(CallbackInfo ci) {
|
||||
if (extension != null) {
|
||||
extension.onTick();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
if (extension != null) {
|
||||
String key = extension.getNBTKey();
|
||||
if (!nbttagcompound.hasKey(key)) return;
|
||||
NBTTagCompound nbt = nbttagcompound.getCompoundTag(key);
|
||||
extension.readFromNBT(nbt);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
if (extension != null) {
|
||||
String key = extension.getNBTKey();
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
extension.writeToNBT(nbt);
|
||||
nbttagcompound.setTag(key, nbt);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
||||
this.writeCustomNBT(nbttagcompound);
|
||||
if (extension != null) {
|
||||
String key = extension.getNBTKey();
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
extension.writeToPacket(nbt);
|
||||
nbttagcompound.setTag(key, nbt);
|
||||
}
|
||||
return new S35PacketUpdateTileEntity(super.xCoord, super.yCoord, super.zCoord, -999, nbttagcompound);
|
||||
}
|
||||
|
||||
/**
|
||||
* @author tilera
|
||||
* @reason ResearchTable extensions
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
super.onDataPacket(net, pkt);
|
||||
if (super.worldObj != null && super.worldObj.isRemote) {
|
||||
super.worldObj.markBlockForUpdate(super.xCoord, super.yCoord, super.zCoord);
|
||||
}
|
||||
if (extension != null) {
|
||||
NBTTagCompound nbttagcompound = pkt.func_148857_g();
|
||||
String key = extension.getNBTKey();
|
||||
if (!nbttagcompound.hasKey(key)) return;
|
||||
NBTTagCompound nbt = nbttagcompound.getCompoundTag(key);
|
||||
extension.readFromNBT(nbt);
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "getSizeInventory", at = @At("HEAD"), cancellable = true)
|
||||
public void onGetInventorySize(CallbackInfoReturnable<Integer> ci) {
|
||||
if (extension instanceof IInventory) {
|
||||
IInventory ext = (IInventory) extension;
|
||||
ci.setReturnValue(2 + ext.getSizeInventory());
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "getStackInSlot", at = @At("HEAD"), cancellable = true)
|
||||
public void onGetStackInSlot(int slot, CallbackInfoReturnable<ItemStack> ci) {
|
||||
if (extension instanceof IInventory && slot >= 2) {
|
||||
IInventory ext = (IInventory) extension;
|
||||
ci.setReturnValue(ext.getStackInSlot(slot - 2));
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "getStackInSlotOnClosing", at = @At("HEAD"), cancellable = true)
|
||||
public void onGetStackInSlotOnClosing(int slot, CallbackInfoReturnable<ItemStack> ci) {
|
||||
if (extension instanceof IInventory && slot >= 2) {
|
||||
IInventory ext = (IInventory) extension;
|
||||
ci.setReturnValue(ext.getStackInSlotOnClosing(slot - 2));
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "decrStackSize", at = @At("HEAD"), cancellable = true)
|
||||
public void onDecrStackSize(int slot, int amt, CallbackInfoReturnable<ItemStack> ci) {
|
||||
if (extension instanceof IInventory && slot >= 2) {
|
||||
IInventory ext = (IInventory) extension;
|
||||
ci.setReturnValue(ext.decrStackSize(slot - 2, amt));
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "setInventorySlotContents", at = @At("HEAD"), cancellable = true)
|
||||
public void onSetSlotContents(int slot, ItemStack stack, CallbackInfo ci) {
|
||||
if (extension instanceof IInventory && slot >= 2) {
|
||||
IInventory ext = (IInventory) extension;
|
||||
ext.setInventorySlotContents(slot - 2, stack);
|
||||
ci.cancel();
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "isItemValidForSlot", at = @At("HEAD"), cancellable = true)
|
||||
public void onIsItemValid(int slot, ItemStack stack, CallbackInfoReturnable<Boolean> ci) {
|
||||
if (extension instanceof IInventory) {
|
||||
IInventory ext = (IInventory) extension;
|
||||
ci.setReturnValue(ext.isItemValidForSlot(slot - 2, stack));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -1,10 +1,16 @@
|
|||
package dev.tilera.auracore.network;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import dev.tilera.auracore.api.AuraNode;
|
||||
import dev.tilera.auracore.client.AuraManagerClient;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.anvilcraft.anvillib.network.AnvilPacket;
|
||||
import net.anvilcraft.anvillib.network.IAnvilPacket;
|
||||
|
||||
public class AuraDeletePacket implements IMessage {
|
||||
@AnvilPacket(Side.CLIENT)
|
||||
public class AuraDeletePacket implements IAnvilPacket {
|
||||
|
||||
int key;
|
||||
|
||||
|
@ -23,5 +29,12 @@ public class AuraDeletePacket implements IMessage {
|
|||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeInt(key);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void handle(MessageContext ctx) {
|
||||
AuraManagerClient.auraClientList.remove(this.key);
|
||||
AuraManagerClient.auraClientHistory.remove(this.key);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
package dev.tilera.auracore.network;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import dev.tilera.auracore.client.AuraManagerClient;
|
||||
|
||||
public class AuraDeletePacketHandler implements IMessageHandler<AuraDeletePacket, IMessage> {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(AuraDeletePacket message, MessageContext ctx) {
|
||||
AuraManagerClient.auraClientList.remove(message.key);
|
||||
AuraManagerClient.auraClientHistory.remove(message.key);
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,10 +1,20 @@
|
|||
package dev.tilera.auracore.network;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import dev.tilera.auracore.api.AuraNode;
|
||||
import dev.tilera.auracore.client.AuraManagerClient;
|
||||
import dev.tilera.auracore.client.AuraManagerClient.NodeHistoryStats;
|
||||
import dev.tilera.auracore.client.AuraManagerClient.NodeStats;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.anvilcraft.anvillib.network.AnvilPacket;
|
||||
import net.anvilcraft.anvillib.network.IAnvilPacket;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class AuraPacket implements IMessage {
|
||||
@AnvilPacket(Side.CLIENT)
|
||||
public class AuraPacket implements IAnvilPacket {
|
||||
|
||||
public int key;
|
||||
public double x;
|
||||
|
@ -16,6 +26,7 @@ public class AuraPacket implements IMessage {
|
|||
public int flux;
|
||||
public boolean lock;
|
||||
public byte type;
|
||||
public boolean virtual;
|
||||
|
||||
public AuraPacket() {}
|
||||
|
||||
|
@ -30,6 +41,7 @@ public class AuraPacket implements IMessage {
|
|||
this.flux = node.flux.visSize();
|
||||
this.lock = node.locked;
|
||||
this.type = (byte) node.type.ordinal();
|
||||
this.virtual = node.isVirtual;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -44,6 +56,7 @@ public class AuraPacket implements IMessage {
|
|||
this.flux = buf.readInt();
|
||||
this.lock = buf.readBoolean();
|
||||
this.type = buf.readByte();
|
||||
this.virtual = buf.readBoolean();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -58,6 +71,20 @@ public class AuraPacket implements IMessage {
|
|||
buf.writeInt(flux);
|
||||
buf.writeBoolean(lock);
|
||||
buf.writeByte(type);
|
||||
buf.writeBoolean(virtual);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void handle(MessageContext ctx) {
|
||||
World world = FMLClientHandler.instance().getWorldClient();
|
||||
if (AuraManagerClient.auraClientHistory.get(this.key) != null) {
|
||||
AuraManagerClient.auraClientHistory.put(this.key, new NodeHistoryStats(AuraManagerClient.auraClientList.get(this.key)));
|
||||
}
|
||||
AuraManagerClient.auraClientList.put(this.key, new NodeStats(this, world.provider.dimensionId));
|
||||
if (AuraManagerClient.auraClientHistory.get(this.key) == null) {
|
||||
AuraManagerClient.auraClientHistory.put(this.key, new NodeHistoryStats(this.level, this.flux, this.taint));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
package dev.tilera.auracore.network;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import dev.tilera.auracore.client.AuraManagerClient;
|
||||
import dev.tilera.auracore.client.AuraManagerClient.NodeHistoryStats;
|
||||
import dev.tilera.auracore.client.AuraManagerClient.NodeStats;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class AuraPacketHandler implements IMessageHandler<AuraPacket, IMessage> {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(AuraPacket message, MessageContext ctx) {
|
||||
World world = FMLClientHandler.instance().getWorldClient();
|
||||
if (AuraManagerClient.auraClientHistory.get(message.key) != null) {
|
||||
AuraManagerClient.auraClientHistory.put(message.key, new NodeHistoryStats(AuraManagerClient.auraClientList.get(message.key)));
|
||||
}
|
||||
AuraManagerClient.auraClientList.put(message.key, new NodeStats(message, world.provider.dimensionId));
|
||||
if (AuraManagerClient.auraClientHistory.get(message.key) == null) {
|
||||
AuraManagerClient.auraClientHistory.put(message.key, new NodeHistoryStats(message.level, message.flux, message.taint));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,10 +1,20 @@
|
|||
package dev.tilera.auracore.network;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import dev.tilera.auracore.api.AuraNode;
|
||||
import dev.tilera.auracore.client.FXSparkle;
|
||||
import dev.tilera.auracore.helper.Utils;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.anvilcraft.anvillib.network.AnvilPacket;
|
||||
import net.anvilcraft.anvillib.network.IAnvilPacket;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class AuraTransferFXPacket implements IMessage {
|
||||
@AnvilPacket(Side.CLIENT)
|
||||
public class AuraTransferFXPacket implements IAnvilPacket {
|
||||
|
||||
double x;
|
||||
double y;
|
||||
|
@ -43,5 +53,23 @@ public class AuraTransferFXPacket implements IMessage {
|
|||
buf.writeDouble(targetY);
|
||||
buf.writeDouble(targetZ);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void handle(MessageContext ctx) {
|
||||
EntityPlayer player = FMLClientHandler.instance().getClientPlayerEntity();
|
||||
if (Utils.hasGoggles(player)) {
|
||||
double var7 = this.x - this.targetX;
|
||||
double var9 = this.y - this.targetY;
|
||||
double var11 = this.z - this.targetZ;
|
||||
int distance = (int)MathHelper.sqrt_double((double)(var7 * var7 + var9 * var9 + var11 * var11));
|
||||
FXSparkle fx = new FXSparkle(player.worldObj, this.x, this.y, this.z, this.targetX, this.targetY, this.targetZ, 2.5f, 0, distance / 2);
|
||||
fx.slowdown = false;
|
||||
fx.noClip = true;
|
||||
fx.leyLineEffect = true;
|
||||
fx.shrink = false;
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(fx);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
package dev.tilera.auracore.network;
|
||||
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import dev.tilera.auracore.client.FXSparkle;
|
||||
import dev.tilera.auracore.helper.Utils;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.MathHelper;
|
||||
|
||||
public class AuraTransferFXPacketHandler implements IMessageHandler<AuraTransferFXPacket, IMessage> {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(AuraTransferFXPacket message, MessageContext ctx) {
|
||||
EntityPlayer player = FMLClientHandler.instance().getClientPlayerEntity();
|
||||
if (Utils.hasGoggles(player)) {
|
||||
double var7 = message.x - message.targetX;
|
||||
double var9 = message.y - message.targetY;
|
||||
double var11 = message.z - message.targetZ;
|
||||
int distance = (int)MathHelper.sqrt_double((double)(var7 * var7 + var9 * var9 + var11 * var11));
|
||||
FXSparkle fx = new FXSparkle(player.worldObj, message.x, message.y, message.z, message.targetX, message.targetY, message.targetZ, 2.5f, 0, distance / 2);
|
||||
fx.slowdown = false;
|
||||
fx.noClip = true;
|
||||
fx.leyLineEffect = true;
|
||||
fx.shrink = false;
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(fx);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,10 +1,18 @@
|
|||
package dev.tilera.auracore.network;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.anvilcraft.anvillib.network.AnvilPacket;
|
||||
import net.anvilcraft.anvillib.network.IAnvilPacket;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.client.fx.bolt.FXLightningBolt;
|
||||
|
||||
public class NodeZapPacket implements IMessage {
|
||||
@AnvilPacket(Side.CLIENT)
|
||||
public class NodeZapPacket implements IAnvilPacket {
|
||||
|
||||
public double x;
|
||||
public double y;
|
||||
|
@ -35,5 +43,18 @@ public class NodeZapPacket implements IMessage {
|
|||
buf.writeDouble(z);
|
||||
buf.writeInt(entityID);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void handle(MessageContext ctx) {
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
Entity targetedEntity = world.getEntityByID(this.entityID);
|
||||
if (targetedEntity != null) {
|
||||
FXLightningBolt bolt = new FXLightningBolt(world, this.x, this.y, this.z, targetedEntity.posX, targetedEntity.posY, targetedEntity.posZ, world.rand.nextLong(), 10, 2.0f, 5);
|
||||
bolt.defaultFractal();
|
||||
bolt.setType(3);
|
||||
bolt.finalizeBolt();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
package dev.tilera.auracore.network;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.client.fx.bolt.FXLightningBolt;
|
||||
|
||||
public class NodeZapPacketHandler implements IMessageHandler<NodeZapPacket, IMessage> {
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(NodeZapPacket message, MessageContext ctx) {
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
Entity targetedEntity = world.getEntityByID(message.entityID);
|
||||
if (targetedEntity != null) {
|
||||
FXLightningBolt bolt = new FXLightningBolt(world, message.x, message.y, message.z, targetedEntity.posX, targetedEntity.posY, targetedEntity.posZ, world.rand.nextLong(), 10, 2.0f, 5);
|
||||
bolt.defaultFractal();
|
||||
bolt.setType(3);
|
||||
bolt.finalizeBolt();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,6 +1,7 @@
|
|||
package dev.tilera.auracore.proxy;
|
||||
|
||||
import dev.tilera.auracore.client.gui.GuiArcaneWorkbench;
|
||||
import dev.tilera.capes.Capes;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.common.tiles.TileArcaneWorkbench;
|
||||
|
@ -15,4 +16,9 @@ public class ClientProxy extends CommonProxy {
|
|||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
Capes.initCapes();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,6 +8,10 @@ import thaumcraft.common.tiles.TileArcaneWorkbench;
|
|||
|
||||
public class CommonProxy implements IGuiHandler {
|
||||
|
||||
public void preInit() {}
|
||||
|
||||
public void init() {}
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) {
|
||||
if (id == 0) {
|
||||
|
|
|
@ -4,6 +4,7 @@ import java.util.HashMap;
|
|||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
import dev.tilera.auracore.Config;
|
||||
import dev.tilera.auracore.api.EnumNodeType;
|
||||
import dev.tilera.auracore.aura.AuraManager;
|
||||
import dev.tilera.auracore.aura.NodeIdStorage;
|
||||
|
@ -17,8 +18,11 @@ import net.minecraft.world.chunk.Chunk;
|
|||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.structure.MapGenScatteredFeature;
|
||||
import thaumcraft.common.config.ConfigBlocks;
|
||||
import thaumcraft.common.lib.world.ThaumcraftWorldGenerator;
|
||||
import thaumcraft.common.lib.world.WorldGenEldritchRing;
|
||||
import thaumcraft.common.lib.world.WorldGenHilltopStones;
|
||||
import thaumcraft.common.lib.world.WorldGenMound;
|
||||
import thaumcraft.common.lib.world.dim.MazeThread;
|
||||
|
||||
public class WorldGenerator implements IWorldGenerator {
|
||||
|
||||
|
@ -64,6 +68,21 @@ public class WorldGenerator implements IWorldGenerator {
|
|||
int value = random.nextInt(200) + 400;
|
||||
AuraManager.registerAuraNode(world, (short)value, EnumNodeType.DARK, world.provider.dimensionId, randPosX2 + 9, randPosY + 8, randPosZ2 + 9);
|
||||
}
|
||||
} else if (Config.generateEldritchRing && random.nextInt(66) == 0) {
|
||||
WorldGenEldritchRing stonering = new WorldGenEldritchRing();
|
||||
randPosY += 8;
|
||||
int w = 11 + random.nextInt(6) * 2;
|
||||
int h = 11 + random.nextInt(6) * 2;
|
||||
stonering.chunkX = chunkX;
|
||||
stonering.chunkZ = chunkZ;
|
||||
stonering.width = w;
|
||||
stonering.height = h;
|
||||
if (stonering.generate(world, random, randPosX2, randPosY, randPosZ2)) {
|
||||
auraGen = true;
|
||||
ThaumcraftWorldGenerator.createRandomNodeAt(world, randPosX2, randPosY + 2, randPosZ2, random, false, true, false);
|
||||
Thread t = new Thread(new MazeThread(chunkX, chunkZ, w, h, random.nextLong()));
|
||||
t.start();
|
||||
}
|
||||
} else {
|
||||
WorldGenHilltopStones hilltopStones = new WorldGenHilltopStones();
|
||||
if (random.nextInt(3) == 0 && !AuraManager.specificAuraTypeNearby(world.provider.dimensionId, randPosX2, randPosY += 9, randPosZ2, EnumNodeType.UNSTABLE, 250) && hilltopStones.generate(world, random, randPosX2, randPosY, randPosZ2)) {
|
||||
|
@ -78,8 +97,12 @@ public class WorldGenerator implements IWorldGenerator {
|
|||
if (var7 != null && !this.structureNode.containsKey(var7.hashCode())) {
|
||||
auraGen = true;
|
||||
this.structureNode.put(var7.hashCode(), true);
|
||||
int value = random.nextInt(200) + 800;
|
||||
AuraManager.registerAuraNode(world, (short)value, EnumNodeType.NORMAL, world.provider.dimensionId, var7.chunkPosX, world.getHeightValue(var7.chunkPosX, var7.chunkPosZ) + 3, var7.chunkPosZ);
|
||||
int yPos = world.getHeightValue(var7.chunkPosX, var7.chunkPosZ) + 3;
|
||||
int nearKey = AuraManager.getClosestAuraWithinRange(world, var7.chunkPosX, var7.chunkPosZ, 10);
|
||||
if (nearKey < 0 && yPos > 5) {
|
||||
int value = random.nextInt(200) + 800;
|
||||
AuraManager.registerAuraNode(world, (short)value, EnumNodeType.NORMAL, world.provider.dimensionId, var7.chunkPosX, yPos, var7.chunkPosZ);
|
||||
}
|
||||
}
|
||||
auraGen = this.generateAura(world, random, chunkX, chunkZ, auraGen, newGen);
|
||||
}
|
||||
|
@ -91,8 +114,9 @@ public class WorldGenerator implements IWorldGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unused"})
|
||||
private boolean generateAura(World world, Random random, int chunkX, int chunkZ, boolean auraGen, boolean newGen) {
|
||||
if (random.nextInt(/*Config.nodeRarity*/23) == 0 && !auraGen) {
|
||||
if (random.nextInt(Config.nodeRarity) == 0 && !auraGen) {
|
||||
int y;
|
||||
int p;
|
||||
int z;
|
||||
|
@ -117,7 +141,7 @@ public class WorldGenerator implements IWorldGenerator {
|
|||
boolean bbase = false;
|
||||
int value = random.nextInt(/*BiomeHandler.getBiomeAura(bg)*/400 / 2) + /*BiomeHandler.getBiomeAura(bg)*/400 / 2;
|
||||
EnumNodeType type = EnumNodeType.NORMAL;
|
||||
if (random.nextInt(/*Config.specialNodeRarity*/75) == 0) {
|
||||
if (random.nextInt(Config.specialNodeRarity) == 0) {
|
||||
switch (random.nextInt(3)) {
|
||||
case 0: {
|
||||
type = EnumNodeType.PURE;
|
||||
|
@ -156,7 +180,11 @@ public class WorldGenerator implements IWorldGenerator {
|
|||
}
|
||||
}
|
||||
}
|
||||
AuraManager.registerAuraNode(world, (short)value, type, world.provider.dimensionId, x, y, z);
|
||||
if (Config.newNodeRarity > 0 && random.nextInt(Config.newNodeRarity) == 0) {
|
||||
ThaumcraftWorldGenerator.createRandomNodeAt(world, x, y, z, random, false, false, false);
|
||||
} else {
|
||||
AuraManager.registerAuraNode(world, (short)value, type, world.provider.dimensionId, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -4,6 +4,9 @@ item.ItemShard.9.name=Tainted Shard
|
|||
tile.blockCustomOre.8.name=Vis Infused Ore
|
||||
tile.blockCustomOre.9.name=Dull Ore
|
||||
tile.blockCustomOre.10.name=Tainted Ore
|
||||
tile.blockCrystal.8.name=Vis Crystal Cluster
|
||||
tile.blockCrystal.9.name=Mixed Crystal Cluster
|
||||
tile.blockCrystal.10.name=Tainted Crystal Cluster
|
||||
|
||||
tc.aspect.bestiola=Spider, Web, Insects
|
||||
tc.aspect.malum=Evil, The Nether, Malice
|
||||
|
@ -18,4 +21,9 @@ tc.aspect.carus=Expensive, Precious, Valuable
|
|||
tc.aspect.imperito=Control, Command, Dominate
|
||||
tc.aspect.solum=Soil, Ground, Foundation
|
||||
tc.aspect.flos=Flower, Bloom, Blossom
|
||||
tc.aspect.fungus=Mushroom, Toadstool, Fungi
|
||||
tc.aspect.fungus=Mushroom, Toadstool, Fungi
|
||||
tc.aspect.vis=Vis
|
||||
tc.aspect.obscurus=Unknown
|
||||
|
||||
auracore.research_title.infusion=Infusion Altar
|
||||
auracore.research_title.crucible=Crucible
|
Before Width: | Height: | Size: 980 B After Width: | Height: | Size: 980 B |
|
@ -6,20 +6,31 @@
|
|||
"mixins": [
|
||||
"MixinItemShard",
|
||||
"MixinItemEssence",
|
||||
"MixinBlockCrystalItem",
|
||||
"MixinTileCrystal",
|
||||
"MixinTileCrucible",
|
||||
"MixinTileArcaneFurnace",
|
||||
"MixinTileJarFillable",
|
||||
"MixinTileAlembic",
|
||||
"MixinTileResearchTable",
|
||||
"MixinTileNode",
|
||||
"MixinBlockCustomPlant",
|
||||
"MixinBlockCustomOre",
|
||||
"MixinBlockTable",
|
||||
"MixinBlockCrystal",
|
||||
"MixinEventHandlerEntity",
|
||||
"MixinThaumcraftWorldGenerator"
|
||||
"MixinThaumcraftWorldGenerator",
|
||||
"MixinPlayerKnowledge",
|
||||
"MixinConfigAspects",
|
||||
"MixinThaumcraftCraftingManager"
|
||||
],
|
||||
"client": [
|
||||
"MixinBlockCustomOreRenderer",
|
||||
"MixinTileArcaneWorkbenchRenderer"
|
||||
"MixinTileArcaneWorkbenchRenderer",
|
||||
"MixinTileCrystalRenderer",
|
||||
"MixinBlockCrystalRenderer",
|
||||
"MixinClientTickEventsFML",
|
||||
"MixinGuiResearchRecipe"
|
||||
],
|
||||
"injectors": {
|
||||
"defaultRequire": 1
|
||||
|
|
Loading…
Reference in a new issue