diff --git a/src/main/java/makeo/gadomancy/api/AuraEffect.java b/src/main/java/makeo/gadomancy/api/AuraEffect.java index a6fbf2a..3d0482d 100644 --- a/src/main/java/makeo/gadomancy/api/AuraEffect.java +++ b/src/main/java/makeo/gadomancy/api/AuraEffect.java @@ -1,16 +1,16 @@ package makeo.gadomancy.api; import java.util.Random; + import net.minecraft.entity.Entity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 17.11.2015 14:36 */ @@ -19,11 +19,11 @@ public abstract class AuraEffect { /** * Return the EffectType you want to use here. * - * EffectType.ENTITY_EFFECT selects entities within {@link AuraEffect#getRange()} - * range and fires the Entity-related methods + * EffectType.ENTITY_EFFECT selects entities within {@link AuraEffect#getRange()} range and fires the Entity-related + * methods * - * EffectType.BLOCK_EFFECT selects random locations within {@link #getRange()} - * range and fires {@link #doBlockEffect(net.minecraft.util.ChunkCoordinates, net.minecraft.util.ChunkCoordinates, net.minecraft.world.World)} + * EffectType.BLOCK_EFFECT selects random locations within {@link #getRange()} range and fires + * {@link #doBlockEffect(net.minecraft.util.ChunkCoordinates, net.minecraft.util.ChunkCoordinates, net.minecraft.world.World)} * * Returning null will cause BOTH effects to happen and thus, both should be implemented. */ @@ -33,7 +33,8 @@ public abstract class AuraEffect { * Only fired when {@link #getEffectType()} returns {@link makeo.gadomancy.api.AuraEffect.EffectType#ENTITY_EFFECT} * * @param e an entity to check if it should be handled. - * @return if the entity should be handled with {@link #doEntityEffect(net.minecraft.util.ChunkCoordinates, net.minecraft.entity.Entity)} + * @return if the entity should be handled with + * {@link #doEntityEffect(net.minecraft.util.ChunkCoordinates, net.minecraft.entity.Entity)} */ public abstract boolean isEntityApplicable(Entity e); @@ -42,7 +43,7 @@ public abstract class AuraEffect { * Do the actual effect on the Entity here. * * @param originTile where the master tile of the aura pylon is. - * @param e an entity where {@link #isEntityApplicable(net.minecraft.entity.Entity)} returned true + * @param e an entity where {@link #isEntityApplicable(net.minecraft.entity.Entity)} returned true */ public abstract void doEntityEffect(ChunkCoordinates originTile, Entity e); @@ -58,9 +59,9 @@ public abstract class AuraEffect { * Only fired when {@link #getEffectType()} returns {@link makeo.gadomancy.api.AuraEffect.EffectType#BLOCK_EFFECT} * Do the actual effect on a block here. * - * @param originTile where the master tile of the aura pylon is. + * @param originTile where the master tile of the aura pylon is. * @param selectedBlock a selected block - * @param world world of the tile and the block + * @param world world of the tile and the block */ public abstract void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world); @@ -74,10 +75,8 @@ public abstract class AuraEffect { /** * Get the range of the aura pylon's effect * - * Defines - * - the range where entities are collected around the pylon. - * - the range where blocks are collected around the pylon. - * - how close the player has to be to get the aura's research + * Defines - the range where entities are collected around the pylon. - the range where blocks are collected around + * the pylon. - how close the player has to be to get the aura's research */ public double getRange() { return 8; diff --git a/src/main/java/makeo/gadomancy/api/ClickBehavior.java b/src/main/java/makeo/gadomancy/api/ClickBehavior.java index 7f22d9b..e8bd666 100644 --- a/src/main/java/makeo/gadomancy/api/ClickBehavior.java +++ b/src/main/java/makeo/gadomancy/api/ClickBehavior.java @@ -4,14 +4,13 @@ import net.minecraft.block.Block; import net.minecraft.world.World; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 11.10.2015 12:09 */ public abstract class ClickBehavior { + protected World world; protected Block block; protected int x, y, z, metadata; diff --git a/src/main/java/makeo/gadomancy/api/GadomancyApi.java b/src/main/java/makeo/gadomancy/api/GadomancyApi.java index df088df..7c61e0e 100644 --- a/src/main/java/makeo/gadomancy/api/GadomancyApi.java +++ b/src/main/java/makeo/gadomancy/api/GadomancyApi.java @@ -1,23 +1,25 @@ package makeo.gadomancy.api; import java.util.List; + import makeo.gadomancy.api.golems.AdditionalGolemType; import makeo.gadomancy.api.golems.cores.AdditionalGolemCore; import makeo.gadomancy.api.internal.IApiHandler; + import net.minecraft.item.ItemStack; + import thaumcraft.api.aspects.Aspect; import thaumcraft.common.entities.golems.EntityGolemBase; import thaumcraft.common.entities.golems.EnumGolemType; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 26.07.2015 19:00 */ public abstract class GadomancyApi { + private static IApiHandler handler; public static void setInstance(IApiHandler handler) { diff --git a/src/main/java/makeo/gadomancy/api/golems/AdditionalGolemType.java b/src/main/java/makeo/gadomancy/api/golems/AdditionalGolemType.java index 266d369..a784c37 100644 --- a/src/main/java/makeo/gadomancy/api/golems/AdditionalGolemType.java +++ b/src/main/java/makeo/gadomancy/api/golems/AdditionalGolemType.java @@ -5,17 +5,17 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; + import thaumcraft.common.entities.golems.EnumGolemType; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 26.07.2015 20:55 */ public abstract class AdditionalGolemType { + private EnumGolemType enumEntry; private Item placerItem; private String modId; @@ -29,15 +29,8 @@ public abstract class AdditionalGolemType { public final int regenDelay; public final int strength; - public AdditionalGolemType( - int maxHealth, - int armor, - float movementSpeed, - boolean fireResist, - int upgradeAmount, - int carryLimit, - int regenDelay, - int strength) { + public AdditionalGolemType(int maxHealth, int armor, float movementSpeed, boolean fireResist, int upgradeAmount, + int carryLimit, int regenDelay, int strength) { this.maxHealth = maxHealth; this.armor = armor; this.movementSpeed = movementSpeed; diff --git a/src/main/java/makeo/gadomancy/api/golems/cores/AdditionalGolemCore.java b/src/main/java/makeo/gadomancy/api/golems/cores/AdditionalGolemCore.java index d94d44e..c7580a4 100644 --- a/src/main/java/makeo/gadomancy/api/golems/cores/AdditionalGolemCore.java +++ b/src/main/java/makeo/gadomancy/api/golems/cores/AdditionalGolemCore.java @@ -2,27 +2,28 @@ package makeo.gadomancy.api.golems.cores; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; + import thaumcraft.common.entities.golems.EntityGolemBase; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 11.08.2015 14:10 */ public abstract class AdditionalGolemCore { + private String name; /** * Init your AI stuff here + * * @param golem the golem entity */ public abstract void setupGolem(EntityGolemBase golem); /** - * @return If the golem has a gui + * @return If the golem has a gui */ public abstract boolean hasGui(); @@ -34,10 +35,10 @@ public abstract class AdditionalGolemCore { } /** - * Open custom a gui here - * Only called if hasGui is true + * Open custom a gui here Only called if hasGui is true + * * @param player player entity - * @param golem golem entity + * @param golem golem entity * @return false -> open default gui true -> no gui */ public boolean openGui(EntityPlayer player, EntityGolemBase golem) { diff --git a/src/main/java/makeo/gadomancy/api/golems/events/GolemDropPlacerEvent.java b/src/main/java/makeo/gadomancy/api/golems/events/GolemDropPlacerEvent.java index 322c30c..e496649 100644 --- a/src/main/java/makeo/gadomancy/api/golems/events/GolemDropPlacerEvent.java +++ b/src/main/java/makeo/gadomancy/api/golems/events/GolemDropPlacerEvent.java @@ -1,19 +1,19 @@ package makeo.gadomancy.api.golems.events; -import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; + import thaumcraft.common.entities.golems.EntityGolemBase; +import cpw.mods.fml.common.eventhandler.Event; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 14.10.2015 14:09 */ public class GolemDropPlacerEvent extends Event { + public final EntityPlayer player; public final EntityItem placer; public final EntityGolemBase golem; diff --git a/src/main/java/makeo/gadomancy/api/golems/events/PlacerCreateGolemEvent.java b/src/main/java/makeo/gadomancy/api/golems/events/PlacerCreateGolemEvent.java index f3d4777..7dc9010 100644 --- a/src/main/java/makeo/gadomancy/api/golems/events/PlacerCreateGolemEvent.java +++ b/src/main/java/makeo/gadomancy/api/golems/events/PlacerCreateGolemEvent.java @@ -1,19 +1,19 @@ package makeo.gadomancy.api.golems.events; -import cpw.mods.fml.common.eventhandler.Event; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; + import thaumcraft.common.entities.golems.EntityGolemBase; +import cpw.mods.fml.common.eventhandler.Event; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 14.10.2015 14:09 */ public class PlacerCreateGolemEvent extends Event { + public final EntityPlayer player; public final ItemStack placer; public final EntityGolemBase golem; diff --git a/src/main/java/makeo/gadomancy/api/internal/IApiHandler.java b/src/main/java/makeo/gadomancy/api/internal/IApiHandler.java index 4eaeb85..e8cb6be 100644 --- a/src/main/java/makeo/gadomancy/api/internal/IApiHandler.java +++ b/src/main/java/makeo/gadomancy/api/internal/IApiHandler.java @@ -1,23 +1,25 @@ package makeo.gadomancy.api.internal; import java.util.List; + import makeo.gadomancy.api.AuraEffect; import makeo.gadomancy.api.ClickBehavior; import makeo.gadomancy.api.golems.AdditionalGolemType; import makeo.gadomancy.api.golems.cores.AdditionalGolemCore; + import net.minecraft.item.ItemStack; + import thaumcraft.api.aspects.Aspect; import thaumcraft.common.entities.golems.EntityGolemBase; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 14.10.2015 14:28 */ public interface IApiHandler { + boolean registerAdditionalGolemType(String name, String modId, AdditionalGolemType newType); AdditionalGolemType getAdditionalGolemType(String name); diff --git a/src/main/java/makeo/gadomancy/client/ClientProxy.java b/src/main/java/makeo/gadomancy/client/ClientProxy.java index 515dd31..4fdcfc5 100644 --- a/src/main/java/makeo/gadomancy/client/ClientProxy.java +++ b/src/main/java/makeo/gadomancy/client/ClientProxy.java @@ -1,13 +1,9 @@ package makeo.gadomancy.client; -import cpw.mods.fml.client.registry.ClientRegistry; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.FMLLog; import java.util.ArrayDeque; import java.util.List; import java.util.Queue; + import makeo.gadomancy.client.effect.EffectHandler; import makeo.gadomancy.client.events.ClientHandler; import makeo.gadomancy.client.events.RenderEventHandler; @@ -29,6 +25,7 @@ import makeo.gadomancy.common.entities.EntityPermNoClipItem; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.utils.Injector; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.resources.IResourceManager; @@ -41,6 +38,7 @@ import net.minecraft.world.World; import net.minecraftforge.client.MinecraftForgeClient; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.client.gui.GuiGolem; import thaumcraft.client.renderers.entity.RenderGolemBase; import thaumcraft.client.renderers.entity.RenderSpecialItem; @@ -50,16 +48,20 @@ import thaumcraft.common.entities.golems.EntityGolemBase; import thaumcraft.common.tiles.TileEldritchAltar; import thaumcraft.common.tiles.TileEldritchCap; import thaumcraft.common.tiles.TileEldritchObelisk; +import cpw.mods.fml.client.registry.ClientRegistry; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.FMLLog; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 29.11.2014 14:15 */ public class ClientProxy extends CommonProxy { + @Override public void preInitalize() { super.preInitalize(); @@ -95,14 +97,16 @@ public class ClientProxy extends CommonProxy { RenderTileManipulationFocus renderTileManipulationFocus = new RenderTileManipulationFocus(); ClientRegistry.bindTileEntitySpecialRenderer(TileManipulationFocus.class, renderTileManipulationFocus); - ClientRegistry.bindTileEntitySpecialRenderer( - TileAdditionalEldritchPortal.class, new TileEldritchPortalRenderer()); + ClientRegistry + .bindTileEntitySpecialRenderer(TileAdditionalEldritchPortal.class, new TileEldritchPortalRenderer()); ClientRegistry.bindTileEntitySpecialRenderer(TileEldritchObelisk.class, new RenderTileObelisk()); ClientRegistry.bindTileEntitySpecialRenderer( - TileEldritchAltar.class, new RenderTileCapEldritch("textures/models/obelisk_cap_altar.png")); + TileEldritchAltar.class, + new RenderTileCapEldritch("textures/models/obelisk_cap_altar.png")); ClientRegistry.bindTileEntitySpecialRenderer( - TileEldritchCap.class, new RenderTileCapEldritch("textures/models/obelisk_cap.png")); + TileEldritchCap.class, + new RenderTileCapEldritch("textures/models/obelisk_cap.png")); RenderTileEssentiaCompressor renderTileEssentiaCompressor = new RenderTileEssentiaCompressor(); ClientRegistry.bindTileEntitySpecialRenderer(TileEssentiaCompressor.class, renderTileEssentiaCompressor); @@ -135,27 +139,31 @@ public class ClientProxy extends CommonProxy { MinecraftForgeClient.registerItemRenderer( Item.getItemFromBlock(RegisteredBlocks.blockEssentiaCompressor), new ItemRenderTileEntity( - renderTileEssentiaCompressor, new TileEssentiaCompressor())); + renderTileEssentiaCompressor, + new TileEssentiaCompressor())); + + MinecraftForgeClient + .registerItemRenderer(Item.getItemFromBlock(ConfigBlocks.blockAiry), new ItemExNodeRenderer()); MinecraftForgeClient.registerItemRenderer( - Item.getItemFromBlock(ConfigBlocks.blockAiry), new ItemExNodeRenderer()); - - MinecraftForgeClient.registerItemRenderer( - Item.getItemFromBlock(RegisteredBlocks.blockKnowledgeBook), new ItemRenderTEKnowledgeBook(bookRender)); + Item.getItemFromBlock(RegisteredBlocks.blockKnowledgeBook), + new ItemRenderTEKnowledgeBook(bookRender)); ItemRenderTileEntityMulti multi = new ItemRenderTileEntityMulti( new ItemRenderTileEntityMulti.RenderSet(renderTileAuraPylon, new TileAuraPylon(), 0), new ItemRenderTileEntityMulti.RenderSet(renderTileAuraPylon, new TileAuraPylonTop(), 1)); MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(RegisteredBlocks.blockAuraPylon), multi); + MinecraftForgeClient + .registerItemRenderer(RegisteredItems.itemExtendedNodeJar, new ItemJarExtendedNodeRenderer()); MinecraftForgeClient.registerItemRenderer( - RegisteredItems.itemExtendedNodeJar, new ItemJarExtendedNodeRenderer()); - MinecraftForgeClient.registerItemRenderer( - Item.getItemFromBlock(RegisteredBlocks.blockRemoteJar), new ItemRenderRemoteJar(renderTileRemoteJar)); + Item.getItemFromBlock(RegisteredBlocks.blockRemoteJar), + new ItemRenderRemoteJar(renderTileRemoteJar)); ItemRenderStoneMachine itemRenderStoneMachine = new ItemRenderStoneMachine(); MinecraftForgeClient.registerItemRenderer( - Item.getItemFromBlock(RegisteredBlocks.blockStoneMachine), itemRenderStoneMachine); + Item.getItemFromBlock(RegisteredBlocks.blockStoneMachine), + itemRenderStoneMachine); itemRenderStoneMachine.registerRenderer(0, new TileManipulationFocus(), renderTileManipulationFocus); TileManipulationFocus tileManipulationFocus = new TileManipulationFocus(); tileManipulationFocus.blockMetadata = 3; @@ -204,7 +212,12 @@ public class ClientProxy extends CommonProxy { @Override public void spawnBubbles(World world, float posX, float posY, float posZ, float rangeAroundItem) { MultiTickEffectDispatcher.BubbleFXInfo bubbles = new MultiTickEffectDispatcher.BubbleFXInfo( - Minecraft.getMinecraft().theWorld.provider.dimensionId, posX, posY, posZ, 10, rangeAroundItem); + Minecraft.getMinecraft().theWorld.provider.dimensionId, + posX, + posY, + posZ, + 10, + rangeAroundItem); MultiTickEffectDispatcher.registerBubbles(bubbles); } @@ -213,7 +226,7 @@ public class ClientProxy extends CommonProxy { switch (ID) { case 0: return new GuiGolem(player, (EntityGolemBase) world.getEntityByID(x)); - // return new AdditionalGolemGui(player, (EntityGolemBase)world.getEntityByID(x)); + // return new AdditionalGolemGui(player, (EntityGolemBase)world.getEntityByID(x)); case 1: return new InfusionClawGui(player.inventory, (IInventory) world.getTileEntity(x, y, z)); case 2: diff --git a/src/main/java/makeo/gadomancy/client/effect/CheckpointingSet.java b/src/main/java/makeo/gadomancy/client/effect/CheckpointingSet.java index 4231b72..e8d11ae 100644 --- a/src/main/java/makeo/gadomancy/client/effect/CheckpointingSet.java +++ b/src/main/java/makeo/gadomancy/client/effect/CheckpointingSet.java @@ -6,6 +6,7 @@ import java.util.Iterator; import java.util.Set; class CheckpointingSet implements Iterable { + private final Set main = new HashSet<>(); private final Set toAdd = Collections.synchronizedSet(new HashSet<>()); private final Set toRemove = Collections.synchronizedSet(new HashSet<>()); @@ -42,6 +43,7 @@ class CheckpointingSet implements Iterable { @Override public Iterator iterator() { return new Iterator() { + private final Iterator backing = main.iterator(); private boolean initialized = false; private E cur = null; diff --git a/src/main/java/makeo/gadomancy/client/effect/EffectHandler.java b/src/main/java/makeo/gadomancy/client/effect/EffectHandler.java index 34d4196..43e28b8 100644 --- a/src/main/java/makeo/gadomancy/client/effect/EffectHandler.java +++ b/src/main/java/makeo/gadomancy/client/effect/EffectHandler.java @@ -1,19 +1,19 @@ package makeo.gadomancy.client.effect; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import makeo.gadomancy.client.effect.fx.FXFlow; import makeo.gadomancy.client.effect.fx.FXVortex; import makeo.gadomancy.client.effect.fx.Orbital; import makeo.gadomancy.common.utils.Vector3; + import net.minecraft.client.renderer.Tessellator; import net.minecraft.world.World; import net.minecraftforge.client.event.RenderWorldLastEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 17.11.2015 18:39 */ diff --git a/src/main/java/makeo/gadomancy/client/effect/fx/EntityFXFlowPolicy.java b/src/main/java/makeo/gadomancy/client/effect/fx/EntityFXFlowPolicy.java index 8c7e43a..9f2aa42 100644 --- a/src/main/java/makeo/gadomancy/client/effect/fx/EntityFXFlowPolicy.java +++ b/src/main/java/makeo/gadomancy/client/effect/fx/EntityFXFlowPolicy.java @@ -2,31 +2,25 @@ package makeo.gadomancy.client.effect.fx; import java.awt.*; import java.util.Random; + import makeo.gadomancy.common.utils.Vector3; + import net.minecraft.client.Minecraft; import net.minecraft.world.World; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 17.11.2015 18:42 */ public abstract class EntityFXFlowPolicy { - public abstract void doSubParticles( - FXFlow fxFlow, - int policyCounter, - double posX, - double posY, - double posZ, - double lastPosX, - double lastPosY, - double lastPosZ); + public abstract void doSubParticles(FXFlow fxFlow, int policyCounter, double posX, double posY, double posZ, + double lastPosX, double lastPosY, double lastPosZ); public enum Policies { + NO_OP(null), CIRCLE_MIX(new CircularMixPolicy()), CIRCLE(new CircularPolicy()), @@ -46,25 +40,16 @@ public abstract class EntityFXFlowPolicy { static class DefaultPolicy extends EntityFXFlowPolicy { @Override - public void doSubParticles( - FXFlow fxFlow, - int policyCounter, - double posX, - double posY, - double posZ, - double lastPosX, - double lastPosY, - double lastPosZ) { - this.doParticles( - fxFlow, policyCounter, posX, posY, posZ, fxFlow.getRand().nextInt(3) + 1); + public void doSubParticles(FXFlow fxFlow, int policyCounter, double posX, double posY, double posZ, + double lastPosX, double lastPosY, double lastPosZ) { + this.doParticles(fxFlow, policyCounter, posX, posY, posZ, fxFlow.getRand().nextInt(3) + 1); } public void doParticles(FXFlow fxFlow, int policyCounter, double posX, double posY, double posZ, int count) { Random rand = fxFlow.getOriginWorld().rand; for (int i = 0; i < count; i++) { Vector3 subOffset = this.genSubOffset(rand, fxFlow.getSurroundingDistance()); - Color c = (fxFlow.getFadingColor() != null && rand.nextBoolean()) - ? fxFlow.getFadingColor() + Color c = (fxFlow.getFadingColor() != null && rand.nextBoolean()) ? fxFlow.getFadingColor() : fxFlow.getColor(); FXFlow.FXFlowBase flow = new FXFlow.FXFlowBase( fxFlow.getOriginWorld(), @@ -92,24 +77,17 @@ public abstract class EntityFXFlowPolicy { public static final int TICKS_PER_FULL_TURN = 40; @Override - public void doSubParticles( - FXFlow fxFlow, - int policyCounter, - double posX, - double posY, - double posZ, - double lastPosX, - double lastPosY, - double lastPosZ) { + public void doSubParticles(FXFlow fxFlow, int policyCounter, double posX, double posY, double posZ, + double lastPosX, double lastPosY, double lastPosZ) { Vector3 rotationAxis = fxFlow.getMovementVector(); - Vector3 perpendicular = - rotationAxis.clone().perpendicular().normalize().multiply(fxFlow.getSurroundingDistance()); + Vector3 perpendicular = rotationAxis.clone().perpendicular().normalize() + .multiply(fxFlow.getSurroundingDistance()); Vector3 counterSide = perpendicular.clone().rotate(Math.toRadians(180), rotationAxis); int currentDividedPolicyTick = policyCounter % CircularPolicy.TICKS_PER_FULL_TURN; - float currentDegree = - 360F * (((float) currentDividedPolicyTick) / ((float) CircularPolicy.TICKS_PER_FULL_TURN)); + float currentDegree = 360F + * (((float) currentDividedPolicyTick) / ((float) CircularPolicy.TICKS_PER_FULL_TURN)); double currentRad = Math.toRadians(currentDegree); perpendicular = perpendicular.rotate(currentRad, rotationAxis); @@ -143,25 +121,12 @@ public abstract class EntityFXFlowPolicy { static class CircularMixPolicy extends CircularPolicy { @Override - public void doSubParticles( - FXFlow fxFlow, - int policyCounter, - double posX, - double posY, - double posZ, - double lastPosX, - double lastPosY, - double lastPosZ) { + public void doSubParticles(FXFlow fxFlow, int policyCounter, double posX, double posY, double posZ, + double lastPosX, double lastPosY, double lastPosZ) { super.doSubParticles(fxFlow, policyCounter, posX, posY, posZ, lastPosX, lastPosY, lastPosZ); ((DefaultPolicy) Policies.DEFAULT.getPolicy()) - .doParticles( - fxFlow, - policyCounter, - posX, - posY, - posZ, - fxFlow.getRand().nextInt(2)); + .doParticles(fxFlow, policyCounter, posX, posY, posZ, fxFlow.getRand().nextInt(2)); } } } diff --git a/src/main/java/makeo/gadomancy/client/effect/fx/FXFlow.java b/src/main/java/makeo/gadomancy/client/effect/fx/FXFlow.java index 4f40988..63ad8ea 100644 --- a/src/main/java/makeo/gadomancy/client/effect/fx/FXFlow.java +++ b/src/main/java/makeo/gadomancy/client/effect/fx/FXFlow.java @@ -4,23 +4,24 @@ import java.awt.*; import java.util.ArrayDeque; import java.util.Queue; import java.util.Random; + import makeo.gadomancy.client.effect.EffectHandler; import makeo.gadomancy.common.data.config.ModConfig; import makeo.gadomancy.common.utils.MiscUtils; import makeo.gadomancy.common.utils.SimpleResourceLocation; import makeo.gadomancy.common.utils.Vector3; + import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; + import org.lwjgl.opengl.GL11; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 17.11.2015 18:45 */ @@ -166,19 +167,39 @@ public class FXFlow { return; } - FXFlowBase flow = - new FXFlowBase(this.origin, this.posX, this.posY, this.posZ, this.color, this.mainParticleSize, 9, 240); + FXFlowBase flow = new FXFlowBase( + this.origin, + this.posX, + this.posY, + this.posZ, + this.color, + this.mainParticleSize, + 9, + 240); Minecraft.getMinecraft().effectRenderer.addEffect(flow); // Initial position. double lastPosX = this.posX - (this.posX - this.lastTickPosX) / 2.0D; double lastPosY = this.posY - (this.posY - this.lastTickPosY) / 2.0D; double lastPosZ = this.posZ - (this.posZ - this.lastTickPosZ) / 2.0D; FXFlowBase flow2 = new FXFlowBase( - this.origin, lastPosX, lastPosY, lastPosZ, this.color, (float) (this.mainParticleSize * 0.8), 8, 240); + this.origin, + lastPosX, + lastPosY, + lastPosZ, + this.color, + (float) (this.mainParticleSize * 0.8), + 8, + 240); Minecraft.getMinecraft().effectRenderer.addEffect(flow2); // Consistency to last position - if (this.policy != null) - this.policy.doSubParticles( - this, this.policyCounter, this.posX, this.posY, this.posZ, lastPosX, lastPosY, lastPosZ); + if (this.policy != null) this.policy.doSubParticles( + this, + this.policyCounter, + this.posX, + this.posY, + this.posZ, + lastPosX, + lastPosY, + lastPosZ); } public Color getColor() { @@ -346,8 +367,8 @@ public class FXFlow { private ResourceLocation texture = new SimpleResourceLocation("fx/flow_large.png"); private float buffHalfLife, buffParticleScale; - public FXFlowBase( - World world, double x, double y, double z, Color color, float size, int multiplier, int brightness) { + public FXFlowBase(World world, double x, double y, double z, Color color, float size, int multiplier, + int brightness) { super(world, x, y, z); if (color != null) { this.partBlue = color.getBlue() / 255F; @@ -439,17 +460,11 @@ public class FXFlow { } @Override - public void renderParticle( - Tessellator tessellator, - float partialTicks, - float par3, - float par4, - float par5, - float par6, - float par7) { + public void renderParticle(Tessellator tessellator, float partialTicks, float par3, float par4, float par5, + float par6, float par7) { if (MiscUtils.getPositionVector(Minecraft.getMinecraft().renderViewEntity) - .distance(new Vector3(this.posX, this.posY, this.posZ)) - > ModConfig.renderParticleDistance) return; + .distance(new Vector3(this.posX, this.posY, this.posZ)) > ModConfig.renderParticleDistance) + return; this.partialTicks = partialTicks; this.rendArg1 = par3; diff --git a/src/main/java/makeo/gadomancy/client/effect/fx/FXVortex.java b/src/main/java/makeo/gadomancy/client/effect/fx/FXVortex.java index 45a722a..d62bb7f 100644 --- a/src/main/java/makeo/gadomancy/client/effect/fx/FXVortex.java +++ b/src/main/java/makeo/gadomancy/client/effect/fx/FXVortex.java @@ -1,31 +1,33 @@ package makeo.gadomancy.client.effect.fx; import java.util.Random; + import makeo.gadomancy.client.effect.EffectHandler; import makeo.gadomancy.client.events.ClientHandler; import makeo.gadomancy.common.blocks.tiles.TileEssentiaCompressor; import makeo.gadomancy.common.utils.MiscUtils; import makeo.gadomancy.common.utils.Vector3; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ActiveRenderInfo; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Vec3; + import org.lwjgl.opengl.GL11; + import thaumcraft.client.lib.QuadHelper; import thaumcraft.client.lib.UtilsFX; /** - * HellFirePvP@Admin - * Date: 24.04.2016 / 00:45 - * on Gadomancy - * FXVortex + * HellFirePvP@Admin Date: 24.04.2016 / 00:45 on Gadomancy FXVortex */ public class FXVortex { private static final Random RAND = new Random(); - public static final ResourceLocation TC_VORTEX_TEXTURE = - new ResourceLocation("thaumcraft", "textures/misc/vortex.png"); + public static final ResourceLocation TC_VORTEX_TEXTURE = new ResourceLocation( + "thaumcraft", + "textures/misc/vortex.png"); private static final float RAD = (float) (Math.PI * 2); private TileEssentiaCompressor parent; diff --git a/src/main/java/makeo/gadomancy/client/effect/fx/Orbital.java b/src/main/java/makeo/gadomancy/client/effect/fx/Orbital.java index a47bb9e..2df7819 100644 --- a/src/main/java/makeo/gadomancy/client/effect/fx/Orbital.java +++ b/src/main/java/makeo/gadomancy/client/effect/fx/Orbital.java @@ -4,18 +4,18 @@ import java.awt.*; import java.util.ArrayList; import java.util.List; import java.util.Random; + import makeo.gadomancy.client.effect.EffectHandler; import makeo.gadomancy.common.data.config.ModConfig; import makeo.gadomancy.common.utils.MiscUtils; import makeo.gadomancy.common.utils.Vector3; + import net.minecraft.client.Minecraft; import net.minecraft.world.World; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 17.11.2015 18:41 */ @@ -54,9 +54,9 @@ public final class Orbital { } public void doRender(float partialTicks) { - if (MiscUtils.getPositionVector(Minecraft.getMinecraft().renderViewEntity) - .distance(this.center) - > ModConfig.renderParticleDistance) return; + if (MiscUtils.getPositionVector(Minecraft.getMinecraft().renderViewEntity).distance(this.center) + > ModConfig.renderParticleDistance) + return; if (Minecraft.getMinecraft().isGamePaused()) return; for (OrbitalRenderProperties orbitalNode : this.orbitals) { @@ -64,17 +64,12 @@ public final class Orbital { int counterOffset = orbitalNode.getOffsetTicks() % orbitalNode.getTicksForFullCircle(); int currentDividedPolicyTick = (this.orbitalCounter + counterOffset) % orbitalNode.getTicksForFullCircle(); - float currentDegree = - 360F * (((float) currentDividedPolicyTick) / ((float) orbitalNode.getTicksForFullCircle())); + float currentDegree = 360F + * (((float) currentDividedPolicyTick) / ((float) orbitalNode.getTicksForFullCircle())); double currentRad = Math.toRadians(currentDegree); - Vector3 point = axis.getAxis() - .clone() - .perpendicular() - .normalize() - .multiply(orbitalNode.getOffset()) - .rotate(currentRad, axis.getAxis()) - .add(this.center); + Vector3 point = axis.getAxis().clone().perpendicular().normalize().multiply(orbitalNode.getOffset()) + .rotate(currentRad, axis.getAxis()).add(this.center); if (orbitalNode.getRunnable() != null) { orbitalNode.getRunnable().onRender(this.world, point, orbitalNode, this.orbitalCounter, partialTicks); @@ -138,17 +133,12 @@ public final class Orbital { int counterOffset = property.getOffsetTicks() % property.getTicksForFullCircle(); int currentDividedPolicyTick = (this.orbitalCounter + counterOffset) % property.getTicksForFullCircle(); - float currentDegree = - 360F * (((float) currentDividedPolicyTick) / ((float) property.getTicksForFullCircle())); + float currentDegree = 360F + * (((float) currentDividedPolicyTick) / ((float) property.getTicksForFullCircle())); double currentRad = Math.toRadians(currentDegree); - arr[i] = axis.getAxis() - .clone() - .perpendicular() - .normalize() - .multiply(property.getOffset()) - .rotate(currentRad, axis.getAxis()) - .add(this.center); + arr[i] = axis.getAxis().clone().perpendicular().normalize().multiply(property.getOffset()) + .rotate(currentRad, axis.getAxis()).add(this.center); } return arr; } @@ -173,6 +163,7 @@ public final class Orbital { public static class OrbitalRenderProperties { private static final OrbitalSubSizeRunnable subSizeRunnableStatic = new OrbitalSubSizeRunnable() { + @Override public float getSubParticleSize(Random rand, int orbitalExisted) { return 0.1F + (rand.nextBoolean() ? 0.0F : 0.1F); @@ -295,16 +286,14 @@ public final class Orbital { } public abstract static class OrbitalSubSizeRunnable { + public abstract float getSubParticleSize(Random rand, int orbitalExisted); } public abstract static class OrbitalRenderRunnable { - public abstract void onRender( - World world, - Vector3 selectedPosition, - OrbitalRenderProperties properties, - int orbitalExisted, - float partialTicks); + + public abstract void onRender(World world, Vector3 selectedPosition, OrbitalRenderProperties properties, + int orbitalExisted, float partialTicks); } public static class Axis { diff --git a/src/main/java/makeo/gadomancy/client/events/ClientHandler.java b/src/main/java/makeo/gadomancy/client/events/ClientHandler.java index b146381..3d8e510 100644 --- a/src/main/java/makeo/gadomancy/client/events/ClientHandler.java +++ b/src/main/java/makeo/gadomancy/client/events/ClientHandler.java @@ -1,21 +1,22 @@ package makeo.gadomancy.client.events; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; -import cpw.mods.fml.common.network.FMLNetworkEvent; import java.util.Queue; + import makeo.gadomancy.client.ClientProxy; import makeo.gadomancy.client.effect.EffectHandler; import makeo.gadomancy.client.renderers.tile.RenderTileEssentiaCompressor; import makeo.gadomancy.client.util.FamiliarHandlerClient; import makeo.gadomancy.common.Gadomancy; + import net.minecraft.client.Minecraft; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; +import cpw.mods.fml.common.network.FMLNetworkEvent; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 01.11.2015 10:41 */ diff --git a/src/main/java/makeo/gadomancy/client/events/FakeArchitectItem.java b/src/main/java/makeo/gadomancy/client/events/FakeArchitectItem.java index 712e288..87d009b 100644 --- a/src/main/java/makeo/gadomancy/client/events/FakeArchitectItem.java +++ b/src/main/java/makeo/gadomancy/client/events/FakeArchitectItem.java @@ -1,22 +1,23 @@ package makeo.gadomancy.client.events; import java.util.ArrayList; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.api.BlockCoordinates; import thaumcraft.api.IArchitect; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 13.10.2015 20:34 */ public class FakeArchitectItem extends Item implements IArchitect { + private ArrayList coords; public void setCoords(ArrayList coords) { @@ -24,17 +25,13 @@ public class FakeArchitectItem extends Item implements IArchitect { } @Override - public ArrayList getArchitectBlocks( - ItemStack stack, World world, int x, int y, int z, int side, EntityPlayer player) { + public ArrayList getArchitectBlocks(ItemStack stack, World world, int x, int y, int z, int side, + EntityPlayer player) { return this.coords; } @Override - public boolean showAxis( - ItemStack paramItemStack, - World paramWorld, - EntityPlayer paramEntityPlayer, - int paramInt, + public boolean showAxis(ItemStack paramItemStack, World paramWorld, EntityPlayer paramEntityPlayer, int paramInt, EnumAxis paramEnumAxis) { return false; } diff --git a/src/main/java/makeo/gadomancy/client/events/RenderEventHandler.java b/src/main/java/makeo/gadomancy/client/events/RenderEventHandler.java index 8a2c7ef..bbab23c 100644 --- a/src/main/java/makeo/gadomancy/client/events/RenderEventHandler.java +++ b/src/main/java/makeo/gadomancy/client/events/RenderEventHandler.java @@ -1,10 +1,9 @@ package makeo.gadomancy.client.events; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.zip.GZIPInputStream; + import makeo.gadomancy.api.GadomancyApi; import makeo.gadomancy.api.golems.cores.AdditionalGolemCore; import makeo.gadomancy.client.gui.GuiResearchRecipeAuraEffects; @@ -22,6 +21,7 @@ import makeo.gadomancy.common.utils.Injector; import makeo.gadomancy.common.utils.MiscUtils; import makeo.gadomancy.common.utils.NBTHelper; import makeo.gadomancy.common.utils.Vector3; + import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GLAllocation; @@ -37,7 +37,9 @@ import net.minecraftforge.client.event.*; import net.minecraftforge.client.model.IModelCustom; import net.minecraftforge.client.model.obj.WavefrontObject; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.BlockCoordinates; import thaumcraft.api.IArchitect; import thaumcraft.api.research.ResearchItem; @@ -48,16 +50,17 @@ import thaumcraft.client.lib.REHWandHandler; import thaumcraft.common.entities.golems.EntityGolemBase; import thaumcraft.common.items.relics.ItemThaumometer; import thaumcraft.common.items.wands.ItemWandCasting; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 13.10.2015 16:11 */ public class RenderEventHandler { + private static final REHWandHandler WAND_HANDLER = new REHWandHandler(); private static final FakeArchitectItem ARCHITECT_ITEM = new FakeArchitectItem(); @@ -75,8 +78,8 @@ public class RenderEventHandler { this.blurbId = core.getBaseCore(); String key = "golemblurb." + this.blurbId + ".text"; this.oldGolemblurb = ResourceReloadListener.languageList.get(key); - ResourceReloadListener.languageList.put( - key, StatCollector.translateToLocal(core.getUnlocalizedGuiText())); + ResourceReloadListener.languageList + .put(key, StatCollector.translateToLocal(core.getUnlocalizedGuiText())); } } } @@ -106,23 +109,28 @@ public class RenderEventHandler { for (int x = -1; x < 2; x++) { for (int y = -1; y < 2; y++) { for (int z = -1; z < 2; z++) { - coords.add(new BlockCoordinates( - e.target.blockX + 2 * dir.offsetX + x, - e.target.blockY + 2 * dir.offsetY + y, - e.target.blockZ + 2 * dir.offsetZ + z)); + coords.add( + new BlockCoordinates( + e.target.blockX + 2 * dir.offsetX + x, + e.target.blockY + 2 * dir.offsetY + y, + e.target.blockZ + 2 * dir.offsetZ + z)); } } } - coords.add(new BlockCoordinates( - e.target.blockX + dir.offsetX, - e.target.blockY + dir.offsetY, - e.target.blockZ + dir.offsetZ)); + coords.add( + new BlockCoordinates( + e.target.blockX + dir.offsetX, + e.target.blockY + dir.offsetY, + e.target.blockZ + dir.offsetZ)); RenderEventHandler.ARCHITECT_ITEM.setCoords(coords); GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); RenderEventHandler.WAND_HANDLER.handleArchitectOverlay( - new ItemStack(RenderEventHandler.ARCHITECT_ITEM), e, e.player.ticksExisted, e.target); + new ItemStack(RenderEventHandler.ARCHITECT_ITEM), + e, + e.player.ticksExisted, + e.target); GL11.glPopAttrib(); } } @@ -136,13 +144,13 @@ public class RenderEventHandler { if (tile instanceof TileExtendedNode) { TileExtendedNode node = (TileExtendedNode) tile; if (node.getExtendedNodeType() == null) return; - ExtendedTypeDisplayManager.notifyDisplayTick( - node.getId(), node.getNodeType(), node.getExtendedNodeType()); + ExtendedTypeDisplayManager + .notifyDisplayTick(node.getId(), node.getNodeType(), node.getExtendedNodeType()); } else if (tile instanceof TileExtendedNodeJar) { TileExtendedNodeJar nodeJar = (TileExtendedNodeJar) tile; if (nodeJar.getExtendedNodeType() == null) return; - ExtendedTypeDisplayManager.notifyDisplayTick( - nodeJar.getId(), nodeJar.getNodeType(), nodeJar.getExtendedNodeType()); + ExtendedTypeDisplayManager + .notifyDisplayTick(nodeJar.getId(), nodeJar.getNodeType(), nodeJar.getExtendedNodeType()); } } } @@ -230,21 +238,17 @@ public class RenderEventHandler { } static { - ResourceLocation mod = new ResourceLocation(Gadomancy.MODID.toLowerCase() - + new String( - new byte[] { - 58, 116, 101, 120, 116, 117, 114, 101, 115, 47, 109, 111, 100, 101, 108, 115, 47, 109, 111, - 100, 101, 108, 65, 115, 115, 101, 99, 46, 111, 98, 106 - }, + ResourceLocation mod = new ResourceLocation( + Gadomancy.MODID.toLowerCase() + new String( + new byte[] { 58, 116, 101, 120, 116, 117, 114, 101, 115, 47, 109, 111, 100, 101, 108, 115, 47, + 109, 111, 100, 101, 108, 65, 115, 115, 101, 99, 46, 111, 98, 106 }, StandardCharsets.UTF_8)); IModelCustom buf; try { buf = new WavefrontObject( "gadomancy:wRender", - new GZIPInputStream(Minecraft.getMinecraft() - .getResourceManager() - .getResource(mod) - .getInputStream())); + new GZIPInputStream( + Minecraft.getMinecraft().getResourceManager().getResource(mod).getInputStream())); } catch (Exception exc) { // shush. buf = null; @@ -253,12 +257,11 @@ public class RenderEventHandler { } private static final IModelCustom obj; - private static final ResourceLocation tex = new ResourceLocation(new String( - new byte[] { - 103, 97, 100, 111, 109, 97, 110, 99, 121, 58, 116, 101, 120, 116, 117, 114, 101, 115, 47, 109, 105, 115, - 99, 47, 116, 101, 120, 87, 46, 112, 110, 103 - }, - StandardCharsets.UTF_8)); + private static final ResourceLocation tex = new ResourceLocation( + new String( + new byte[] { 103, 97, 100, 111, 109, 97, 110, 99, 121, 58, 116, 101, 120, 116, 117, 114, 101, 115, + 47, 109, 105, 115, 99, 47, 116, 101, 120, 87, 46, 112, 110, 103 }, + StandardCharsets.UTF_8)); private static int dList = -1; @SubscribeEvent @@ -274,14 +277,8 @@ public class RenderEventHandler { Minecraft.getMinecraft().renderEngine.bindTexture(RenderEventHandler.tex); boolean f = event.entityPlayer.capabilities.isFlying; double ma = f ? 15 : 5; - double r = (ma * (Math.abs((ClientHandler.ticks % 80) - 40) / 40D)) - + ((65 - ma) - * Math.max( - 0, - Math.min( - 1, - new Vector3(event.entityPlayer.motionX, 0, event.entityPlayer.motionZ) - .length()))); + double r = (ma * (Math.abs((ClientHandler.ticks % 80) - 40) / 40D)) + ((65 - ma) * Math + .max(0, Math.min(1, new Vector3(event.entityPlayer.motionX, 0, event.entityPlayer.motionZ).length()))); GL11.glScaled(0.07, 0.07, 0.07); GL11.glRotatef(180, 0, 0, 1); GL11.glTranslated(0, -12.7, 0.7 - (((float) (r / ma)) * (f ? 0.5D : 0.2D))); diff --git a/src/main/java/makeo/gadomancy/client/events/ResourceReloadListener.java b/src/main/java/makeo/gadomancy/client/events/ResourceReloadListener.java index fc1cc30..1b4bd7d 100644 --- a/src/main/java/makeo/gadomancy/client/events/ResourceReloadListener.java +++ b/src/main/java/makeo/gadomancy/client/events/ResourceReloadListener.java @@ -1,11 +1,13 @@ package makeo.gadomancy.client.events; import java.util.Map; + import makeo.gadomancy.api.GadomancyApi; import makeo.gadomancy.api.golems.AdditionalGolemType; import makeo.gadomancy.client.textures.GolemGuiTexture; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.utils.Injector; + import net.minecraft.client.Minecraft; import net.minecraft.client.resources.IResourceManager; import net.minecraft.client.resources.IResourceManagerReloadListener; @@ -14,10 +16,8 @@ import net.minecraft.util.StatCollector; import net.minecraft.util.StringTranslate; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 03.10.2015 12:09 */ @@ -47,6 +47,7 @@ public class ResourceReloadListener implements IResourceManagerReloadListener { this.manipulateLanguageFile(); Gadomancy.proxy.runDelayedClientSide(new Runnable() { + @Override public void run() { ResourceReloadListener.this.registerTextureOverride(); @@ -64,14 +65,13 @@ public class ResourceReloadListener implements IResourceManagerReloadListener { } } - private static final ResourceLocation TC_GOLEM_GUI_TEXTURE = - new ResourceLocation("thaumcraft", "textures/gui/guigolem.png"); + private static final ResourceLocation TC_GOLEM_GUI_TEXTURE = new ResourceLocation( + "thaumcraft", + "textures/gui/guigolem.png"); private void registerTextureOverride() { - Minecraft.getMinecraft() - .renderEngine - .loadTexture( - ResourceReloadListener.TC_GOLEM_GUI_TEXTURE, - new GolemGuiTexture(ResourceReloadListener.TC_GOLEM_GUI_TEXTURE)); + Minecraft.getMinecraft().renderEngine.loadTexture( + ResourceReloadListener.TC_GOLEM_GUI_TEXTURE, + new GolemGuiTexture(ResourceReloadListener.TC_GOLEM_GUI_TEXTURE)); } } diff --git a/src/main/java/makeo/gadomancy/client/gui/ArcanePackagerGui.java b/src/main/java/makeo/gadomancy/client/gui/ArcanePackagerGui.java index 53d8f8c..6539f9a 100644 --- a/src/main/java/makeo/gadomancy/client/gui/ArcanePackagerGui.java +++ b/src/main/java/makeo/gadomancy/client/gui/ArcanePackagerGui.java @@ -1,27 +1,29 @@ package makeo.gadomancy.client.gui; import java.awt.*; + import makeo.gadomancy.common.blocks.tiles.TileArcanePackager; import makeo.gadomancy.common.containers.ContainerArcanePackager; import makeo.gadomancy.common.utils.ColorHelper; import makeo.gadomancy.common.utils.SimpleResourceLocation; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; + import org.lwjgl.opengl.GL11; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 14.11.2015 01:17 */ public class ArcanePackagerGui extends GuiContainer { + private static final ResourceLocation TEXTURE = new SimpleResourceLocation("gui/gui_packager.png"); private final TileArcanePackager tile; @@ -78,10 +80,16 @@ public class ArcanePackagerGui extends GuiContainer { this.drawTexturedModalRect(var5, var6, 0, 0, this.xSize, this.ySize); this.drawString( - 100, 98, "gadomancy.info.ArcanePackager.useEssentia", this.tile.useEssentia ? Color.WHITE : Color.GRAY); + 100, + 98, + "gadomancy.info.ArcanePackager.useEssentia", + this.tile.useEssentia ? Color.WHITE : Color.GRAY); this.drawString( - 100, 111, "gadomancy.info.ArcanePackager.autoStart", this.tile.autoStart ? Color.WHITE : Color.GRAY); + 100, + 111, + "gadomancy.info.ArcanePackager.autoStart", + this.tile.autoStart ? Color.WHITE : Color.GRAY); this.drawString( 100, diff --git a/src/main/java/makeo/gadomancy/client/gui/GuiResearchRecipeAuraEffects.java b/src/main/java/makeo/gadomancy/client/gui/GuiResearchRecipeAuraEffects.java index a029288..2049f70 100644 --- a/src/main/java/makeo/gadomancy/client/gui/GuiResearchRecipeAuraEffects.java +++ b/src/main/java/makeo/gadomancy/client/gui/GuiResearchRecipeAuraEffects.java @@ -4,16 +4,20 @@ import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.aura.AuraResearchManager; import makeo.gadomancy.common.aura.ResearchPageAuraAspects; import makeo.gadomancy.common.utils.Injector; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; import net.minecraft.util.StatCollector; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchItem; @@ -26,10 +30,8 @@ import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager; import thaumcraft.common.lib.utils.InventoryUtils; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 30.11.2015 12:24 */ @@ -42,8 +44,8 @@ public class GuiResearchRecipeAuraEffects extends GuiResearchRecipe { Injector inj = new Injector(this, GuiResearchRecipe.class); - ResearchPage[] additionalPages = - ResearchPageAuraAspects.createAllAuraPagesFor(Minecraft.getMinecraft().thePlayer); + ResearchPage[] additionalPages = ResearchPageAuraAspects + .createAllAuraPagesFor(Minecraft.getMinecraft().thePlayer); ResearchPage[] pages = inj.getField("pages"); ResearchPage[] newPages = new ResearchPage[pages.length + additionalPages.length]; System.arraycopy(pages, 0, newPages, 0, pages.length); @@ -51,8 +53,7 @@ public class GuiResearchRecipeAuraEffects extends GuiResearchRecipe { inj.setField("pages", newPages); inj.setField("maxPages", newPages.length); - List list = Thaumcraft.proxy - .getScannedObjects() + List list = Thaumcraft.proxy.getScannedObjects() .get(Minecraft.getMinecraft().thePlayer.getCommandSenderName()); if ((list != null) && (list.size() > 0)) { for (String s : list) { @@ -75,8 +76,7 @@ public class GuiResearchRecipeAuraEffects extends GuiResearchRecipe { } } } - } catch (NumberFormatException e) { - } + } catch (NumberFormatException e) {} } } } @@ -216,7 +216,12 @@ public class GuiResearchRecipeAuraEffects extends GuiResearchRecipe { } GL11.glScalef(2.0F, 2.0F, 2.0F); UtilsFX.drawTag( - (x + start) / 2, (y + count * 50) / 2, aspect, aspects.getAmount(aspect), 0, this.zLevel); + (x + start) / 2, + (y + count * 50) / 2, + aspect, + aspects.getAmount(aspect), + 0, + this.zLevel); GL11.glPopMatrix(); String text = aspect.getName(); int offset = fr.getStringWidth(text) / 2; diff --git a/src/main/java/makeo/gadomancy/client/gui/InfusionClawGui.java b/src/main/java/makeo/gadomancy/client/gui/InfusionClawGui.java index cb5537f..48d95d0 100644 --- a/src/main/java/makeo/gadomancy/client/gui/InfusionClawGui.java +++ b/src/main/java/makeo/gadomancy/client/gui/InfusionClawGui.java @@ -1,12 +1,12 @@ package makeo.gadomancy.client.gui; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.awt.*; + import makeo.gadomancy.common.blocks.tiles.TileInfusionClaw; import makeo.gadomancy.common.containers.ContainerInfusionClaw; import makeo.gadomancy.common.utils.ColorHelper; import makeo.gadomancy.common.utils.SimpleResourceLocation; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.entity.player.InventoryPlayer; @@ -14,18 +14,21 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; + import org.lwjgl.opengl.GL11; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 09.10.2015 20:21 */ @SideOnly(Side.CLIENT) public class InfusionClawGui extends GuiContainer { + private static final ResourceLocation BACKGROUND = new SimpleResourceLocation("/gui/gui_infusion_claw.png"); private ContainerInfusionClaw container; @@ -43,10 +46,8 @@ public class InfusionClawGui extends GuiContainer { } ItemStack cursorStack = this.container.playerInv.getItemStack(); - if (((TileInfusionClaw) this.container.clawInv).isRunning() - || (cursorStack != null - && cursorStack.stackSize > 0 - && !this.container.clawInv.isItemValidForSlot(0, cursorStack))) { + if (((TileInfusionClaw) this.container.clawInv).isRunning() || (cursorStack != null && cursorStack.stackSize > 0 + && !this.container.clawInv.isItemValidForSlot(0, cursorStack))) { GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); GL11.glEnable(GL11.GL_BLEND); diff --git a/src/main/java/makeo/gadomancy/client/models/ModelArcaneDropper.java b/src/main/java/makeo/gadomancy/client/models/ModelArcaneDropper.java index c0ecab6..e64c66d 100644 --- a/src/main/java/makeo/gadomancy/client/models/ModelArcaneDropper.java +++ b/src/main/java/makeo/gadomancy/client/models/ModelArcaneDropper.java @@ -5,15 +5,14 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * - * Created by makeo @ 30.09.2015 17:04 - * using Techne: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-tools/1261123 + * Created by makeo @ 30.09.2015 17:04 using Techne: + * http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-tools/1261123 */ public class ModelArcaneDropper extends ModelBase { + // fields ModelRenderer shape1; ModelRenderer shape2; diff --git a/src/main/java/makeo/gadomancy/client/models/ModelArcanePackager.java b/src/main/java/makeo/gadomancy/client/models/ModelArcanePackager.java index 43d4564..0a22eb3 100644 --- a/src/main/java/makeo/gadomancy/client/models/ModelArcanePackager.java +++ b/src/main/java/makeo/gadomancy/client/models/ModelArcanePackager.java @@ -5,14 +5,13 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 28.11.2015 19:04 */ public class ModelArcanePackager extends ModelBase { + ModelRenderer shape1; ModelRenderer shape2; ModelRenderer shape3; diff --git a/src/main/java/makeo/gadomancy/client/models/ModelAuraPylon.java b/src/main/java/makeo/gadomancy/client/models/ModelAuraPylon.java index 0ebe327..3ba42e3 100644 --- a/src/main/java/makeo/gadomancy/client/models/ModelAuraPylon.java +++ b/src/main/java/makeo/gadomancy/client/models/ModelAuraPylon.java @@ -5,6 +5,7 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelAuraPylon extends ModelBase { + // fields ModelRenderer outerpylon; ModelRenderer lowerconduit; diff --git a/src/main/java/makeo/gadomancy/client/models/ModelAuraPylonBottom.java b/src/main/java/makeo/gadomancy/client/models/ModelAuraPylonBottom.java index f6d4ea9..f43da0e 100644 --- a/src/main/java/makeo/gadomancy/client/models/ModelAuraPylonBottom.java +++ b/src/main/java/makeo/gadomancy/client/models/ModelAuraPylonBottom.java @@ -5,6 +5,7 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelAuraPylonBottom extends ModelBase { + // fields ModelRenderer outerpylon; ModelRenderer lowerconduit; diff --git a/src/main/java/makeo/gadomancy/client/models/ModelAuraPylonTop.java b/src/main/java/makeo/gadomancy/client/models/ModelAuraPylonTop.java index bfb4c57..7f3b905 100644 --- a/src/main/java/makeo/gadomancy/client/models/ModelAuraPylonTop.java +++ b/src/main/java/makeo/gadomancy/client/models/ModelAuraPylonTop.java @@ -5,6 +5,7 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; public class ModelAuraPylonTop extends ModelBase { + // fields ModelRenderer outerpylon; ModelRenderer lowerconduit; diff --git a/src/main/java/makeo/gadomancy/client/models/ModelBlockProtector.java b/src/main/java/makeo/gadomancy/client/models/ModelBlockProtector.java index 87806de..b5aec1f 100644 --- a/src/main/java/makeo/gadomancy/client/models/ModelBlockProtector.java +++ b/src/main/java/makeo/gadomancy/client/models/ModelBlockProtector.java @@ -5,14 +5,13 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 11.11.2015 17:15 */ public class ModelBlockProtector extends ModelBase { + // fields ModelRenderer Shape1; ModelRenderer Shape2; diff --git a/src/main/java/makeo/gadomancy/client/models/ModelEssentiaCompressor.java b/src/main/java/makeo/gadomancy/client/models/ModelEssentiaCompressor.java index 0aae1af..88cb29a 100644 --- a/src/main/java/makeo/gadomancy/client/models/ModelEssentiaCompressor.java +++ b/src/main/java/makeo/gadomancy/client/models/ModelEssentiaCompressor.java @@ -5,10 +5,7 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; /** - * HellFirePvP@Admin - * Date: 22.04.2016 / 21:36 - * on Gadomancy - * ModelEssentiaCompressor + * HellFirePvP@Admin Date: 22.04.2016 / 21:36 on Gadomancy ModelEssentiaCompressor */ public class ModelEssentiaCompressor extends ModelBase { diff --git a/src/main/java/makeo/gadomancy/client/models/ModelFocusPortalPart.java b/src/main/java/makeo/gadomancy/client/models/ModelFocusPortalPart.java index b9b9bf0..808c6c4 100644 --- a/src/main/java/makeo/gadomancy/client/models/ModelFocusPortalPart.java +++ b/src/main/java/makeo/gadomancy/client/models/ModelFocusPortalPart.java @@ -5,14 +5,13 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 09.11.2015 23:08 */ public class ModelFocusPortalPart extends ModelBase { + // fields ModelRenderer shape1; ModelRenderer shape2; diff --git a/src/main/java/makeo/gadomancy/client/models/ModelInfusionClawPart.java b/src/main/java/makeo/gadomancy/client/models/ModelInfusionClawPart.java index c8052bc..9227327 100644 --- a/src/main/java/makeo/gadomancy/client/models/ModelInfusionClawPart.java +++ b/src/main/java/makeo/gadomancy/client/models/ModelInfusionClawPart.java @@ -5,14 +5,13 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 08.10.2015 16:14 */ public class ModelInfusionClawPart extends ModelBase { + // fields ModelRenderer shape1; diff --git a/src/main/java/makeo/gadomancy/client/models/ModelJarPot.java b/src/main/java/makeo/gadomancy/client/models/ModelJarPot.java index b194139..2f5a0e2 100644 --- a/src/main/java/makeo/gadomancy/client/models/ModelJarPot.java +++ b/src/main/java/makeo/gadomancy/client/models/ModelJarPot.java @@ -5,14 +5,13 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 23.10.2015 23:13 */ public class ModelJarPot extends ModelBase { + // fields ModelRenderer shape1; ModelRenderer shape2; diff --git a/src/main/java/makeo/gadomancy/client/models/ModelManipulatorPart.java b/src/main/java/makeo/gadomancy/client/models/ModelManipulatorPart.java index ae14684..5d93829 100644 --- a/src/main/java/makeo/gadomancy/client/models/ModelManipulatorPart.java +++ b/src/main/java/makeo/gadomancy/client/models/ModelManipulatorPart.java @@ -5,14 +5,13 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 28.10.2015 12:31 */ public class ModelManipulatorPart extends ModelBase { + // fields ModelRenderer shape2; ModelRenderer shape3; diff --git a/src/main/java/makeo/gadomancy/client/models/ModelPackagerPiston.java b/src/main/java/makeo/gadomancy/client/models/ModelPackagerPiston.java index b9c0e9c..6d5c975 100644 --- a/src/main/java/makeo/gadomancy/client/models/ModelPackagerPiston.java +++ b/src/main/java/makeo/gadomancy/client/models/ModelPackagerPiston.java @@ -5,14 +5,13 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 29.11.2015 12:36 */ public class ModelPackagerPiston extends ModelBase { + ModelRenderer shape1; ModelRenderer shape2; diff --git a/src/main/java/makeo/gadomancy/client/models/ModelPackedCompressorBlock.java b/src/main/java/makeo/gadomancy/client/models/ModelPackedCompressorBlock.java index 394c63e..02c2cdf 100644 --- a/src/main/java/makeo/gadomancy/client/models/ModelPackedCompressorBlock.java +++ b/src/main/java/makeo/gadomancy/client/models/ModelPackedCompressorBlock.java @@ -5,10 +5,7 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; /** - * HellFirePvP@Admin - * Date: 22.04.2016 / 22:59 - * on Gadomancy - * ModelPackedCompressorBlock + * HellFirePvP@Admin Date: 22.04.2016 / 22:59 on Gadomancy ModelPackedCompressorBlock */ public class ModelPackedCompressorBlock extends ModelBase { diff --git a/src/main/java/makeo/gadomancy/client/models/ModelSmallCube.java b/src/main/java/makeo/gadomancy/client/models/ModelSmallCube.java index add5de6..756c4da 100644 --- a/src/main/java/makeo/gadomancy/client/models/ModelSmallCube.java +++ b/src/main/java/makeo/gadomancy/client/models/ModelSmallCube.java @@ -5,14 +5,13 @@ import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 27.10.2015 23:40 */ public class ModelSmallCube extends ModelBase { + // fields ModelRenderer shape1; diff --git a/src/main/java/makeo/gadomancy/client/models/ModelWandPart.java b/src/main/java/makeo/gadomancy/client/models/ModelWandPart.java index 46eb54c..ea316e9 100644 --- a/src/main/java/makeo/gadomancy/client/models/ModelWandPart.java +++ b/src/main/java/makeo/gadomancy/client/models/ModelWandPart.java @@ -1,6 +1,7 @@ package makeo.gadomancy.client.models; import java.awt.*; + import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.ItemRenderer; @@ -14,7 +15,9 @@ import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; + import org.lwjgl.opengl.GL11; + import thaumcraft.client.lib.UtilsFX; import thaumcraft.client.renderers.block.BlockRenderer; import thaumcraft.client.renderers.models.gear.ModelWand; @@ -22,14 +25,14 @@ import thaumcraft.common.Thaumcraft; import thaumcraft.common.items.wands.ItemWandCasting; /** - * This class is NOT part of the Gadomancy Mod - * This file is copied from Azanors thaumcraft.client.renderers.models.gear.ModelWand.java and contains small modifications - * Thaumcraft: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1292130 + * This class is NOT part of the Gadomancy Mod This file is copied from Azanors + * thaumcraft.client.renderers.models.gear.ModelWand.java and contains small modifications Thaumcraft: + * http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1292130 * - * Created by Azanor - * Modified by makeo @ 10.10.2015 17:28 + * Created by Azanor Modified by makeo @ 10.10.2015 17:28 */ public class ModelWandPart extends ModelWand { + ModelRenderer Rod; ModelRenderer Focus; ModelRenderer Cap; @@ -157,15 +160,15 @@ public class ModelWandPart extends ModelWand { GL11.glPushMatrix(); GL11.glTranslatef(-0.25F, -0.1F, 0.0275F); GL11.glScaled(0.5D, 0.5D, 0.5D); - ItemRenderer.renderItemIn2D( - tessellator, f1, f2, f3, f4, icon.getIconWidth(), icon.getIconHeight(), 0.1F); + ItemRenderer + .renderItemIn2D(tessellator, f1, f2, f3, f4, icon.getIconWidth(), icon.getIconHeight(), 0.1F); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); GL11.glTranslatef(-0.25F, -0.1F, 0.0275F); GL11.glScaled(0.5D, 0.5D, 0.5D); - ItemRenderer.renderItemIn2D( - tessellator, f1, f2, f3, f4, icon.getIconWidth(), icon.getIconHeight(), 0.1F); + ItemRenderer + .renderItemIn2D(tessellator, f1, f2, f3, f4, icon.getIconWidth(), icon.getIconHeight(), 0.1F); GL11.glPopMatrix(); GL11.glPopMatrix(); } @@ -182,7 +185,10 @@ public class ModelWandPart extends ModelWand { Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); this.renderBlocks.setRenderBoundsFromBlock(Blocks.stone); BlockRenderer.drawFaces( - this.renderBlocks, null, wand.getFocus(wandStack).getFocusDepthLayerIcon(focusStack), false); + this.renderBlocks, + null, + wand.getFocus(wandStack).getFocusDepthLayerIcon(focusStack), + false); GL11.glPopMatrix(); alpha = 0.6F; } diff --git a/src/main/java/makeo/gadomancy/client/renderers/block/BlockExtendedNodeJarRenderer.java b/src/main/java/makeo/gadomancy/client/renderers/block/BlockExtendedNodeJarRenderer.java index 22d6039..12ed58b 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/block/BlockExtendedNodeJarRenderer.java +++ b/src/main/java/makeo/gadomancy/client/renderers/block/BlockExtendedNodeJarRenderer.java @@ -1,7 +1,7 @@ package makeo.gadomancy.client.renderers.block; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import makeo.gadomancy.common.registration.RegisteredBlocks; + import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.EntityRenderer; @@ -10,19 +10,19 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; + import org.lwjgl.opengl.GL11; + import thaumcraft.common.blocks.BlockJar; import thaumcraft.common.config.ConfigBlocks; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; /** - * This class is NOT part of the Gadomancy Mod - * This file is copied from Azanors thaumcraft.client.renderers.block.BlockRenderer.java and - * thaumcraft.client.renderers.block.BlockJarRenderer.java + * This class is NOT part of the Gadomancy Mod This file is copied from Azanors + * thaumcraft.client.renderers.block.BlockRenderer.java and thaumcraft.client.renderers.block.BlockJarRenderer.java * Thaumcraft: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1292130 * - * Created by Azanor - * Modified to create compatibility with ExtendedNodes - * Modified by HellFirePvP @ 26.10.2015 00:29 + * Created by Azanor Modified to create compatibility with ExtendedNodes Modified by HellFirePvP @ 26.10.2015 00:29 */ public class BlockExtendedNodeJarRenderer implements ISimpleBlockRenderingHandler { @@ -58,8 +58,8 @@ public class BlockExtendedNodeJarRenderer implements ISimpleBlockRenderingHandle BlockExtendedNodeJarRenderer.W12, BlockExtendedNodeJarRenderer.W13); renderer.setRenderBoundsFromBlock(block); - BlockExtendedNodeJarRenderer.drawFaces( - renderer, block, ((BlockJar) ConfigBlocks.blockJar).iconJarBottom, i1, i2, i2, i2, i2, true); + BlockExtendedNodeJarRenderer + .drawFaces(renderer, block, ((BlockJar) ConfigBlocks.blockJar).iconJarBottom, i1, i2, i2, i2, i2, true); block.setBlockBounds( BlockExtendedNodeJarRenderer.W5, BlockExtendedNodeJarRenderer.W12, @@ -68,14 +68,14 @@ public class BlockExtendedNodeJarRenderer implements ISimpleBlockRenderingHandle BlockExtendedNodeJarRenderer.W14, BlockExtendedNodeJarRenderer.W11); renderer.setRenderBoundsFromBlock(block); - BlockExtendedNodeJarRenderer.drawFaces( - renderer, block, ((BlockJar) ConfigBlocks.blockJar).iconJarBottom, i1, i2, i2, i2, i2, true); + BlockExtendedNodeJarRenderer + .drawFaces(renderer, block, ((BlockJar) ConfigBlocks.blockJar).iconJarBottom, i1, i2, i2, i2, i2, true); GL11.glPopMatrix(); } @Override - public boolean renderWorldBlock( - IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { int bb = this.setBrightness(world, x, y, z, block); int metadata = world.getBlockMetadata(x, y, z); block.setBlockBounds( @@ -103,16 +103,8 @@ public class BlockExtendedNodeJarRenderer implements ISimpleBlockRenderingHandle return true; } - public static void drawFaces( - RenderBlocks renderblocks, - Block block, - IIcon i1, - IIcon i2, - IIcon i3, - IIcon i4, - IIcon i5, - IIcon i6, - boolean solidtop) { + public static void drawFaces(RenderBlocks renderblocks, Block block, IIcon i1, IIcon i2, IIcon i3, IIcon i4, + IIcon i5, IIcon i6, boolean solidtop) { Tessellator tessellator = Tessellator.instance; GL11.glTranslatef(-0.5F, -0.5F, -0.5F); tessellator.startDrawingQuads(); diff --git a/src/main/java/makeo/gadomancy/client/renderers/block/BlockRenderingHandler.java b/src/main/java/makeo/gadomancy/client/renderers/block/BlockRenderingHandler.java index 98c99ce..521ee45 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/block/BlockRenderingHandler.java +++ b/src/main/java/makeo/gadomancy/client/renderers/block/BlockRenderingHandler.java @@ -1,20 +1,20 @@ package makeo.gadomancy.client.renderers.block; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.util.IIcon; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 29.09.2015 21:18 */ public abstract class BlockRenderingHandler implements ISimpleBlockRenderingHandler { + protected void renderAllFaces(RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon) { renderer.renderFaceYNeg(block, x, y, z, icon); renderer.renderFaceYPos(block, x, y, z, icon); @@ -47,18 +47,15 @@ public abstract class BlockRenderingHandler implements ISimpleBlockRenderingHand } } - protected void renderFace( - ForgeDirection side, RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon) { + protected void renderFace(ForgeDirection side, RenderBlocks renderer, Block block, int x, int y, int z, + IIcon icon) { this.renderFace(side.ordinal(), renderer, block, x, y, z, icon); } - /*protected void renderFaceHollow(int side, RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon, - int startX, int startY, int startZ, int endX, int endY, int endZ) { - - } - - protected void renderFacePartially(int side, RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon, - int startX, int startY, int startZ, int endX, int endY, int endZ) { - - }*/ + /* + * protected void renderFaceHollow(int side, RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon, + * int startX, int startY, int startZ, int endX, int endY, int endZ) { } protected void renderFacePartially(int + * side, RenderBlocks renderer, Block block, int x, int y, int z, IIcon icon, int startX, int startY, int startZ, + * int endX, int endY, int endZ) { } + */ } diff --git a/src/main/java/makeo/gadomancy/client/renderers/block/RenderBlockStoneMachine.java b/src/main/java/makeo/gadomancy/client/renderers/block/RenderBlockStoneMachine.java index 5feaa36..551f2d0 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/block/RenderBlockStoneMachine.java +++ b/src/main/java/makeo/gadomancy/client/renderers/block/RenderBlockStoneMachine.java @@ -1,23 +1,24 @@ package makeo.gadomancy.client.renderers.block; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import makeo.gadomancy.common.blocks.BlockStoneMachine; import makeo.gadomancy.common.registration.RegisteredBlocks; + import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.world.IBlockAccess; + import thaumcraft.client.renderers.block.BlockStoneDeviceRenderer; import thaumcraft.common.blocks.BlockStoneDevice; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 03.11.2015 22:09 */ public class RenderBlockStoneMachine implements ISimpleBlockRenderingHandler { + private static final BlockStoneDeviceRenderer DEVICE_RENDERER = new BlockStoneDeviceRenderer(); private static final BlockStoneDevice DEVICE_BLOCK = new BlockStoneDevice(); @@ -27,14 +28,14 @@ public class RenderBlockStoneMachine implements ISimpleBlockRenderingHandler { BlockStoneMachine blockStoneMachine = (BlockStoneMachine) block; RenderBlockStoneMachine.DEVICE_BLOCK.iconPedestal[0] = blockStoneMachine.pedestalSideIcon; RenderBlockStoneMachine.DEVICE_BLOCK.iconPedestal[1] = blockStoneMachine.pedestalTopIcon; - RenderBlockStoneMachine.DEVICE_RENDERER.renderInventoryBlock( - RenderBlockStoneMachine.DEVICE_BLOCK, 1, modelId, renderer); + RenderBlockStoneMachine.DEVICE_RENDERER + .renderInventoryBlock(RenderBlockStoneMachine.DEVICE_BLOCK, 1, modelId, renderer); } } @Override - public boolean renderWorldBlock( - IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { int metadata = world.getBlockMetadata(x, y, z); if (metadata == 1) { RenderBlockStoneMachine.DEVICE_RENDERER.renderWorldBlock(world, x, y, z, block, modelId, renderer); diff --git a/src/main/java/makeo/gadomancy/client/renderers/block/RenderBlockTransparent.java b/src/main/java/makeo/gadomancy/client/renderers/block/RenderBlockTransparent.java index 5e9f6fe..7769ba1 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/block/RenderBlockTransparent.java +++ b/src/main/java/makeo/gadomancy/client/renderers/block/RenderBlockTransparent.java @@ -2,25 +2,25 @@ package makeo.gadomancy.client.renderers.block; import makeo.gadomancy.common.blocks.IBlockTransparent; import makeo.gadomancy.common.registration.RegisteredBlocks; + import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.world.IBlockAccess; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 29.09.2015 20:53 */ public class RenderBlockTransparent extends BlockRenderingHandler { + @Override public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {} @Override - public boolean renderWorldBlock( - IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { if (block instanceof IBlockTransparent) { this.renderAllFaces(renderer, block, x, y, z, ((IBlockTransparent) block).getTransparentIcon()); } diff --git a/src/main/java/makeo/gadomancy/client/renderers/entity/PlayerCameraRenderer.java b/src/main/java/makeo/gadomancy/client/renderers/entity/PlayerCameraRenderer.java index 9862635..e6906ba 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/entity/PlayerCameraRenderer.java +++ b/src/main/java/makeo/gadomancy/client/renderers/entity/PlayerCameraRenderer.java @@ -5,14 +5,13 @@ import net.minecraft.client.renderer.EntityRenderer; import net.minecraft.entity.player.EntityPlayer; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 09.07.2015 02:34 */ public class PlayerCameraRenderer extends EntityRenderer { + private final Minecraft minecraft; private boolean isMarkedForRemoval; @@ -49,8 +48,7 @@ public class PlayerCameraRenderer extends EntityRenderer { } private boolean canChangeView() { - return !this.isMarkedForRemoval - && this.minecraft.thePlayer != null + return !this.isMarkedForRemoval && this.minecraft.thePlayer != null && !this.minecraft.thePlayer.isRiding() && !this.minecraft.thePlayer.isPlayerSleeping(); } diff --git a/src/main/java/makeo/gadomancy/client/renderers/entity/RenderAdditionalGolemBase.java b/src/main/java/makeo/gadomancy/client/renderers/entity/RenderAdditionalGolemBase.java index 4478ebb..aef7355 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/entity/RenderAdditionalGolemBase.java +++ b/src/main/java/makeo/gadomancy/client/renderers/entity/RenderAdditionalGolemBase.java @@ -3,23 +3,24 @@ package makeo.gadomancy.client.renderers.entity; import makeo.gadomancy.api.GadomancyApi; import makeo.gadomancy.api.golems.AdditionalGolemType; import makeo.gadomancy.api.golems.cores.AdditionalGolemCore; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; + import thaumcraft.client.renderers.entity.RenderGolemBase; import thaumcraft.client.renderers.models.entities.ModelGolem; import thaumcraft.common.entities.golems.EntityGolemBase; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 12.03.2015 15:57 */ public class RenderAdditionalGolemBase extends RenderGolemBase { + private ItemStack toolItem; public RenderAdditionalGolemBase() { diff --git a/src/main/java/makeo/gadomancy/client/renderers/entity/RenderEffectHelper.java b/src/main/java/makeo/gadomancy/client/renderers/entity/RenderEffectHelper.java index ec2dd68..8ea001d 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/entity/RenderEffectHelper.java +++ b/src/main/java/makeo/gadomancy/client/renderers/entity/RenderEffectHelper.java @@ -1,3 +1,4 @@ package makeo.gadomancy.client.renderers.entity; -public class RenderEffectHelper {} +public class RenderEffectHelper { +} diff --git a/src/main/java/makeo/gadomancy/client/renderers/entity/RenderEntityAuraCore.java b/src/main/java/makeo/gadomancy/client/renderers/entity/RenderEntityAuraCore.java index e583403..34b3688 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/entity/RenderEntityAuraCore.java +++ b/src/main/java/makeo/gadomancy/client/renderers/entity/RenderEntityAuraCore.java @@ -2,13 +2,12 @@ package makeo.gadomancy.client.renderers.entity; import makeo.gadomancy.common.entities.EntityAuraCore; import makeo.gadomancy.common.utils.MiscUtils; + import net.minecraft.entity.Entity; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 01.12.2015 13:55 */ diff --git a/src/main/java/makeo/gadomancy/client/renderers/entity/RenderEntityItem.java b/src/main/java/makeo/gadomancy/client/renderers/entity/RenderEntityItem.java index 3b9b94e..9819b3f 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/entity/RenderEntityItem.java +++ b/src/main/java/makeo/gadomancy/client/renderers/entity/RenderEntityItem.java @@ -9,10 +9,8 @@ import net.minecraft.entity.item.EntityItem; import net.minecraft.util.ResourceLocation; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 29.11.2015 19:13 */ diff --git a/src/main/java/makeo/gadomancy/client/renderers/entity/RenderGolemHelper.java b/src/main/java/makeo/gadomancy/client/renderers/entity/RenderGolemHelper.java index c2e6c0c..e8f2453 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/entity/RenderGolemHelper.java +++ b/src/main/java/makeo/gadomancy/client/renderers/entity/RenderGolemHelper.java @@ -1,7 +1,9 @@ package makeo.gadomancy.client.renderers.entity; import java.awt.*; + import makeo.gadomancy.api.golems.cores.AdditionalGolemCore; + import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBase; @@ -15,19 +17,20 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; + import org.lwjgl.opengl.GL11; + import thaumcraft.client.renderers.models.entities.ModelGolem; import thaumcraft.common.entities.golems.EntityGolemBase; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 07.10.2015 13:18 */ public class RenderGolemHelper { + private RenderGolemHelper() {} public static void renderCore(EntityGolemBase golem, AdditionalGolemCore core) { @@ -45,8 +48,8 @@ public class RenderGolemHelper { float f3 = icon.getMinU(); float f4 = icon.getMaxV(); Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationItemsTexture); - ItemRenderer.renderItemIn2D( - Tessellator.instance, f1, f2, f3, f4, icon.getIconWidth(), icon.getIconHeight(), 0.2F); + ItemRenderer + .renderItemIn2D(Tessellator.instance, f1, f2, f3, f4, icon.getIconWidth(), icon.getIconHeight(), 0.2F); GL11.glPopMatrix(); } @@ -92,8 +95,8 @@ public class RenderGolemHelper { GL11.glPopMatrix(); } - public static void renderToolItem( - EntityGolemBase golem, ItemStack itemstack, ModelBase mainModel, RenderManager renderManager) { + public static void renderToolItem(EntityGolemBase golem, ItemStack itemstack, ModelBase mainModel, + RenderManager renderManager) { GL11.glPushMatrix(); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); @@ -109,22 +112,18 @@ public class RenderGolemHelper { float fs = 0.66F; GL11.glScalef(fs, fs, fs); - net.minecraftforge.client.IItemRenderer customRenderer = - net.minecraftforge.client.MinecraftForgeClient.getItemRenderer( - itemstack, net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED); - boolean is3D = (customRenderer != null - && customRenderer.shouldUseRenderHelper( - net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED, - itemstack, - net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D)); + net.minecraftforge.client.IItemRenderer customRenderer = net.minecraftforge.client.MinecraftForgeClient + .getItemRenderer(itemstack, net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED); + boolean is3D = (customRenderer != null && customRenderer.shouldUseRenderHelper( + net.minecraftforge.client.IItemRenderer.ItemRenderType.EQUIPPED, + itemstack, + net.minecraftforge.client.IItemRenderer.ItemRendererHelper.BLOCK_3D)); Item item = itemstack.getItem(); float f1; if (item instanceof ItemBlock - && (is3D - || RenderBlocks.renderItemIn3d( - Block.getBlockFromItem(item).getRenderType()))) { + && (is3D || RenderBlocks.renderItemIn3d(Block.getBlockFromItem(item).getRenderType()))) { f1 = 0.5F; GL11.glTranslatef(0.0F, 0.1875F, -0.3125F); f1 *= 0.75F; diff --git a/src/main/java/makeo/gadomancy/client/renderers/item/ItemCreativeNodeRenderer.java b/src/main/java/makeo/gadomancy/client/renderers/item/ItemCreativeNodeRenderer.java index 01475a9..ac32797 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/item/ItemCreativeNodeRenderer.java +++ b/src/main/java/makeo/gadomancy/client/renderers/item/ItemCreativeNodeRenderer.java @@ -1,25 +1,23 @@ package makeo.gadomancy.client.renderers.item; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.item.ItemStack; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.nodes.NodeType; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 04.11.2015 20:41 */ public class ItemCreativeNodeRenderer extends ItemExNodeRenderer { - private static final AspectList ASPECTS = new AspectList() - .add(Aspect.AIR, 50) - .add(Aspect.FIRE, 50) - .add(Aspect.EARTH, 50) - .add(Aspect.WATER, 50); + + private static final AspectList ASPECTS = new AspectList().add(Aspect.AIR, 50).add(Aspect.FIRE, 50) + .add(Aspect.EARTH, 50).add(Aspect.WATER, 50); @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { @@ -29,6 +27,11 @@ public class ItemCreativeNodeRenderer extends ItemExNodeRenderer { @Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { makeo.gadomancy.client.renderers.item.ItemNodeRenderer.renderNodeItem( - type, item, ItemCreativeNodeRenderer.ASPECTS, NodeType.values()[item.getItemDamage()], null, data); + type, + item, + ItemCreativeNodeRenderer.ASPECTS, + NodeType.values()[item.getItemDamage()], + null, + data); } } diff --git a/src/main/java/makeo/gadomancy/client/renderers/item/ItemExNodeRenderer.java b/src/main/java/makeo/gadomancy/client/renderers/item/ItemExNodeRenderer.java index ee6384e..5cfa558 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/item/ItemExNodeRenderer.java +++ b/src/main/java/makeo/gadomancy/client/renderers/item/ItemExNodeRenderer.java @@ -1,15 +1,15 @@ package makeo.gadomancy.client.renderers.item; import makeo.gadomancy.common.registration.RegisteredBlocks; + import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import thaumcraft.client.renderers.tile.ItemNodeRenderer; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 22.10.2015 20:11 */ @@ -17,8 +17,7 @@ public class ItemExNodeRenderer extends ItemNodeRenderer { @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { - return (item != null) - && (item.getItem() == Item.getItemFromBlock(RegisteredBlocks.blockNode)) + return (item != null) && (item.getItem() == Item.getItemFromBlock(RegisteredBlocks.blockNode)) && ((item.getItemDamage() == 0) || item.getItemDamage() == 5); } diff --git a/src/main/java/makeo/gadomancy/client/renderers/item/ItemJarExtendedNodeRenderer.java b/src/main/java/makeo/gadomancy/client/renderers/item/ItemJarExtendedNodeRenderer.java index b752efe..44bd4e7 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/item/ItemJarExtendedNodeRenderer.java +++ b/src/main/java/makeo/gadomancy/client/renderers/item/ItemJarExtendedNodeRenderer.java @@ -3,6 +3,7 @@ package makeo.gadomancy.client.renderers.item; import makeo.gadomancy.common.items.ItemExtendedNodeJar; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.texture.TextureMap; @@ -10,19 +11,20 @@ import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.aspects.AspectList; import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.tiles.TileJar; import thaumcraft.common.tiles.TileJarNode; /** - * This class is NOT part of the Gadomancy Mod - * This file is copied from Azanors thaumcraft.client.renderers.tile.ItemJarNodeRenderer.java and contains small modifications - * Thaumcraft: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1292130 + * This class is NOT part of the Gadomancy Mod This file is copied from Azanors + * thaumcraft.client.renderers.tile.ItemJarNodeRenderer.java and contains small modifications Thaumcraft: + * http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1292130 * - * Created by Azanor - * Modified by HellFirePvP @ 26.10.2015 00:06 + * Created by Azanor Modified by HellFirePvP @ 26.10.2015 00:06 */ public class ItemJarExtendedNodeRenderer implements IItemRenderer { @@ -32,8 +34,8 @@ public class ItemJarExtendedNodeRenderer implements IItemRenderer { return (item != null) && (item.getItem() == RegisteredItems.itemExtendedNodeJar); } - public boolean shouldUseRenderHelper( - IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) { + public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item, + IItemRenderer.ItemRendererHelper helper) { return helper != ItemRendererHelper.EQUIPPED_BLOCK; } diff --git a/src/main/java/makeo/gadomancy/client/renderers/item/ItemNodeRenderer.java b/src/main/java/makeo/gadomancy/client/renderers/item/ItemNodeRenderer.java index 6ceb38c..44d6af3 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/item/ItemNodeRenderer.java +++ b/src/main/java/makeo/gadomancy/client/renderers/item/ItemNodeRenderer.java @@ -7,7 +7,9 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.nodes.INode; @@ -19,23 +21,21 @@ import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.tiles.TileNode; /** - * This class is NOT part of the Gadomancy Mod - * This file is copied from Azanors thaumcraft.client.renderers.tile.ItemNodeRenderer.java and contains small modifications - * Thaumcraft: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1292130 + * This class is NOT part of the Gadomancy Mod This file is copied from Azanors + * thaumcraft.client.renderers.tile.ItemNodeRenderer.java and contains small modifications Thaumcraft: + * http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1292130 * - * Created by Azanor - * Modified by HellFirePvP @ 24.10.2015 17:19 + * Created by Azanor Modified by HellFirePvP @ 24.10.2015 17:19 */ public class ItemNodeRenderer implements IItemRenderer { public boolean handleRenderType(ItemStack item, IItemRenderer.ItemRenderType type) { - return (item != null) - && (item.getItem() == Item.getItemFromBlock(ConfigBlocks.blockAiry)) + return (item != null) && (item.getItem() == Item.getItemFromBlock(ConfigBlocks.blockAiry)) && ((item.getItemDamage() == 0) || (item.getItemDamage() == 5)); } - public boolean shouldUseRenderHelper( - IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) { + public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item, + IItemRenderer.ItemRendererHelper helper) { return helper != ItemRendererHelper.EQUIPPED_BLOCK; } @@ -46,13 +46,8 @@ public class ItemNodeRenderer implements IItemRenderer { } // Gadomancy: Renamed to access it static from another class and added aspects, nodeType and nodeModifier as params - public static void renderNodeItem( - IItemRenderer.ItemRenderType type, - ItemStack item, - AspectList aspects, - NodeType nodeType, - NodeModifier nodeModifier, - Object... data) { + public static void renderNodeItem(IItemRenderer.ItemRenderType type, ItemStack item, AspectList aspects, + NodeType nodeType, NodeModifier nodeModifier, Object... data) { if (type == IItemRenderer.ItemRenderType.ENTITY) { GL11.glTranslatef(-0.5F, -0.25F, -0.5F); } else if ((type == IItemRenderer.ItemRenderType.EQUIPPED) && ((data[1] instanceof EntityPlayer))) { @@ -79,10 +74,7 @@ public class ItemNodeRenderer implements IItemRenderer { ItemNodeRenderer.renderNodeItem(type, item, ItemNodeRenderer.aspects, NodeType.NORMAL, null, data); } - private static AspectList aspects = new AspectList() - .add(Aspect.AIR, 40) - .add(Aspect.FIRE, 40) - .add(Aspect.EARTH, 40) + private static AspectList aspects = new AspectList().add(Aspect.AIR, 40).add(Aspect.FIRE, 40).add(Aspect.EARTH, 40) .add(Aspect.WATER, 40); public static void renderItemNode(INode node) { @@ -131,7 +123,13 @@ public class ItemNodeRenderer implements IItemRenderer { scale = MathHelper.sin(viewer.ticksExisted / (14.0F - count)) * bscale + bscale * 2.0F; scale = 0.2F + scale * (node.getAspects().getAmount(aspect) / 50.0F); UtilsFX.renderAnimatedQuadStrip( - scale, alpha / node.getAspects().size(), frames, 0, i, 0.0F, aspect.getColor()); + scale, + alpha / node.getAspects().size(), + frames, + 0, + i, + 0.0F, + aspect.getColor()); GL11.glDisable(3042); GL11.glPopMatrix(); count++; diff --git a/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderFamiliar.java b/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderFamiliar.java index bf8c207..ea86263 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderFamiliar.java +++ b/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderFamiliar.java @@ -2,10 +2,12 @@ package makeo.gadomancy.client.renderers.item; import java.awt.*; import java.util.Random; + import makeo.gadomancy.client.util.FamiliarHandlerClient; import makeo.gadomancy.common.items.baubles.ItemEtherealFamiliar; import makeo.gadomancy.common.utils.MiscUtils; import makeo.gadomancy.common.utils.world.fake.FakeWorld; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ActiveRenderInfo; import net.minecraft.client.renderer.Tessellator; @@ -14,7 +16,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.aspects.Aspect; import thaumcraft.client.fx.ParticleEngine; import thaumcraft.client.lib.UtilsFX; @@ -22,10 +26,8 @@ import thaumcraft.common.Thaumcraft; import thaumcraft.common.entities.monster.EntityWisp; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 01.11.2015 12:55 */ @@ -62,10 +64,8 @@ public class ItemRenderFamiliar implements IItemRenderer { if (ItemEtherealFamiliar.hasFamiliarAspect(item)) { if (ItemRenderFamiliar.ENTITY_WISP == null) ItemRenderFamiliar.ENTITY_WISP = new EntityWisp(new FakeWorld()); - ItemRenderFamiliar.ENTITY_WISP.ticksExisted = - FamiliarHandlerClient.PartialEntityFamiliar.DUMMY_FAMILIAR.ticksExisted; - ItemRenderFamiliar.ENTITY_WISP.setType( - ItemEtherealFamiliar.getFamiliarAspect(item).getTag()); + ItemRenderFamiliar.ENTITY_WISP.ticksExisted = FamiliarHandlerClient.PartialEntityFamiliar.DUMMY_FAMILIAR.ticksExisted; + ItemRenderFamiliar.ENTITY_WISP.setType(ItemEtherealFamiliar.getFamiliarAspect(item).getTag()); ItemRenderFamiliar.renderEntityWispFor(null, ItemRenderFamiliar.ENTITY_WISP, 0, 0, 0, 0, 0); } } finally { @@ -122,8 +122,8 @@ public class ItemRenderFamiliar implements IItemRenderer { private static int size1; - public static void renderEntityWispFor( - EntityPlayer owner, EntityWisp wisp, double x, double y, double z, float fq, float pticks) { + public static void renderEntityWispFor(EntityPlayer owner, EntityWisp wisp, double x, double y, double z, float fq, + float pticks) { if (ItemRenderFamiliar.size1 == 0) { ItemRenderFamiliar.size1 = UtilsFX.getTextureSize("textures/misc/wisp.png", 64); } diff --git a/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderRemoteJar.java b/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderRemoteJar.java index 37a6ace..2c0eb2e 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderRemoteJar.java +++ b/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderRemoteJar.java @@ -1,27 +1,29 @@ package makeo.gadomancy.client.renderers.item; -import cpw.mods.fml.client.registry.RenderingRegistry; import makeo.gadomancy.client.renderers.tile.RenderTileRemoteJar; import makeo.gadomancy.common.blocks.tiles.TileRemoteJar; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.item.ItemStack; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.aspects.AspectList; import thaumcraft.common.blocks.ItemJarFilled; import thaumcraft.common.config.ConfigItems; +import cpw.mods.fml.client.registry.RenderingRegistry; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 17.10.2015 01:44 */ public class ItemRenderRemoteJar extends ItemRenderTileEntity { + public ItemRenderRemoteJar(RenderTileRemoteJar render) { super(render, new TileRemoteJar()); } @@ -48,12 +50,11 @@ public class ItemRenderRemoteJar extends ItemRenderTileEntity { GL11.glPushMatrix(); GL11.glTranslatef(0.5f, 0.5f, 0.5f); - RenderingRegistry.instance() - .renderInventoryBlock( - RenderBlocks.getInstance(), - RegisteredBlocks.blockRemoteJar, - 0, - RegisteredBlocks.blockRemoteJar.getRenderType()); + RenderingRegistry.instance().renderInventoryBlock( + RenderBlocks.getInstance(), + RegisteredBlocks.blockRemoteJar, + 0, + RegisteredBlocks.blockRemoteJar.getRenderType()); GL11.glPopMatrix(); } } diff --git a/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderStoneMachine.java b/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderStoneMachine.java index 8f37eb1..e48e861 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderStoneMachine.java +++ b/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderStoneMachine.java @@ -2,25 +2,27 @@ package makeo.gadomancy.client.renderers.item; import java.util.HashMap; import java.util.Map; + import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; + import org.lwjgl.opengl.GL11; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 28.10.2015 23:27 */ public class ItemRenderStoneMachine extends ItemRenderTileEntity { + private final Map renderers = new HashMap(); public ItemRenderStoneMachine() {} private static class RenderInfo { + private TileEntity tile; private TileEntitySpecialRenderer renderer; } diff --git a/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderTEKnowledgeBook.java b/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderTEKnowledgeBook.java index 1033124..5309653 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderTEKnowledgeBook.java +++ b/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderTEKnowledgeBook.java @@ -2,14 +2,13 @@ package makeo.gadomancy.client.renderers.item; import makeo.gadomancy.client.renderers.tile.RenderTileKnowledgeBook; import makeo.gadomancy.common.blocks.tiles.TileKnowledgeBook; + import net.minecraft.item.ItemStack; + import org.lwjgl.opengl.GL11; /** - * HellFirePvP@Admin - * Date: 19.04.2016 / 16:02 - * on Gadomancy - * ItemRenderTEKnowledgeBook + * HellFirePvP@Admin Date: 19.04.2016 / 16:02 on Gadomancy ItemRenderTEKnowledgeBook */ public class ItemRenderTEKnowledgeBook extends ItemRenderTileEntity { diff --git a/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderTileEntity.java b/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderTileEntity.java index 9b137bc..6f86654 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderTileEntity.java +++ b/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderTileEntity.java @@ -2,22 +2,23 @@ package makeo.gadomancy.client.renderers.item; import makeo.gadomancy.common.blocks.tiles.TileManipulationFocus; import makeo.gadomancy.common.utils.world.fake.FakeWorld; + import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 29.09.2015 18:29 */ public class ItemRenderTileEntity implements IItemRenderer { + protected static final World FAKE_WORLD = new FakeWorld(); protected TileEntitySpecialRenderer renderer; diff --git a/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderTileEntityMulti.java b/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderTileEntityMulti.java index 2f25cb7..604dc0a 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderTileEntityMulti.java +++ b/src/main/java/makeo/gadomancy/client/renderers/item/ItemRenderTileEntityMulti.java @@ -2,17 +2,17 @@ package makeo.gadomancy.client.renderers.item; import java.util.HashMap; import java.util.Map; + import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 13.11.2015 00:33 */ diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileAIShutdown.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileAIShutdown.java index 5888ff5..57c281a 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileAIShutdown.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileAIShutdown.java @@ -1,21 +1,22 @@ package makeo.gadomancy.client.renderers.tile; import java.util.Random; + import makeo.gadomancy.client.effect.EffectHandler; import makeo.gadomancy.client.effect.fx.Orbital; import makeo.gadomancy.common.blocks.tiles.TileAIShutdown; import makeo.gadomancy.common.utils.Vector3; + import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import thaumcraft.client.fx.ParticleEngine; import thaumcraft.client.fx.particles.FXWisp; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 09.06.2016 / 12:56 */ @@ -60,13 +61,10 @@ public class RenderTileAIShutdown extends TileEntitySpecialRenderer { prop.setTicksForFullCircle(50).setOffsetTicks(0); prop.setParticleSize(0F); prop.setRenderRunnable(new Orbital.OrbitalRenderRunnable() { + @Override - public void onRender( - World world, - Vector3 pos, - Orbital.OrbitalRenderProperties properties, - int orbitalExisted, - float partialTicks) { + public void onRender(World world, Vector3 pos, Orbital.OrbitalRenderProperties properties, + int orbitalExisted, float partialTicks) { if (RenderTileAIShutdown.rand.nextInt(3) == 0) { FXWisp ef = new FXWisp( world, @@ -86,13 +84,10 @@ public class RenderTileAIShutdown extends TileEntitySpecialRenderer { prop.setTicksForFullCircle(50).setOffsetTicks(25); prop.setParticleSize(0F); prop.setRenderRunnable(new Orbital.OrbitalRenderRunnable() { + @Override - public void onRender( - World world, - Vector3 pos, - Orbital.OrbitalRenderProperties properties, - int orbitalExisted, - float partialTicks) { + public void onRender(World world, Vector3 pos, Orbital.OrbitalRenderProperties properties, + int orbitalExisted, float partialTicks) { if (RenderTileAIShutdown.rand.nextInt(3) == 0) { FXWisp ef = new FXWisp( world, @@ -112,13 +107,10 @@ public class RenderTileAIShutdown extends TileEntitySpecialRenderer { prop.setTicksForFullCircle(90).setOffsetTicks(0); prop.setParticleSize(0F); prop.setRenderRunnable(new Orbital.OrbitalRenderRunnable() { + @Override - public void onRender( - World world, - Vector3 pos, - Orbital.OrbitalRenderProperties properties, - int orbitalExisted, - float partialTicks) { + public void onRender(World world, Vector3 pos, Orbital.OrbitalRenderProperties properties, + int orbitalExisted, float partialTicks) { if (RenderTileAIShutdown.rand.nextBoolean()) { FXWisp ef = new FXWisp( world, @@ -138,13 +130,10 @@ public class RenderTileAIShutdown extends TileEntitySpecialRenderer { prop.setTicksForFullCircle(90).setOffsetTicks(30); prop.setParticleSize(0F); prop.setRenderRunnable(new Orbital.OrbitalRenderRunnable() { + @Override - public void onRender( - World world, - Vector3 pos, - Orbital.OrbitalRenderProperties properties, - int orbitalExisted, - float partialTicks) { + public void onRender(World world, Vector3 pos, Orbital.OrbitalRenderProperties properties, + int orbitalExisted, float partialTicks) { if (RenderTileAIShutdown.rand.nextBoolean()) { FXWisp ef = new FXWisp( world, @@ -164,13 +153,10 @@ public class RenderTileAIShutdown extends TileEntitySpecialRenderer { prop.setTicksForFullCircle(90).setOffsetTicks(60); prop.setParticleSize(0F); prop.setRenderRunnable(new Orbital.OrbitalRenderRunnable() { + @Override - public void onRender( - World world, - Vector3 pos, - Orbital.OrbitalRenderProperties properties, - int orbitalExisted, - float partialTicks) { + public void onRender(World world, Vector3 pos, Orbital.OrbitalRenderProperties properties, + int orbitalExisted, float partialTicks) { if (RenderTileAIShutdown.rand.nextBoolean()) { FXWisp ef = new FXWisp( world, diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileArcaneDropper.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileArcaneDropper.java index aa86522..bdcf579 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileArcaneDropper.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileArcaneDropper.java @@ -2,24 +2,26 @@ package makeo.gadomancy.client.renderers.tile; import makeo.gadomancy.client.models.ModelArcaneDropper; import makeo.gadomancy.common.utils.SimpleResourceLocation; + import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; + import thaumcraft.client.renderers.tile.TileBellowsRenderer; import thaumcraft.common.tiles.TileBellows; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 28.09.2015 20:00 */ public class RenderTileArcaneDropper extends TileEntitySpecialRenderer { + private static final ResourceLocation RESOURCE = new SimpleResourceLocation("models/arcane_dropper.png"); private static final ModelBase MODEL = new ModelArcaneDropper(); diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileArcanePackager.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileArcanePackager.java index b784d81..b841d73 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileArcanePackager.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileArcanePackager.java @@ -4,21 +4,23 @@ import makeo.gadomancy.client.models.ModelArcanePackager; import makeo.gadomancy.client.models.ModelPackagerPiston; import makeo.gadomancy.common.blocks.tiles.TileArcanePackager; import makeo.gadomancy.common.utils.SimpleResourceLocation; + import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; + import thaumcraft.common.tiles.TileJarFillable; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 28.11.2015 19:08 */ public class RenderTileArcanePackager extends TileEntitySpecialRenderer { + private static final ResourceLocation TEXTURE = new SimpleResourceLocation("/models/arcane_packager.png"); private static final ModelArcanePackager MODEL = new ModelArcanePackager(); diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileAuraPylon.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileAuraPylon.java index ad888f6..fffe180 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileAuraPylon.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileAuraPylon.java @@ -2,6 +2,7 @@ package makeo.gadomancy.client.renderers.tile; import java.awt.*; import java.util.Random; + import makeo.gadomancy.client.effect.EffectHandler; import makeo.gadomancy.client.effect.fx.Orbital; import makeo.gadomancy.client.models.ModelAuraPylon; @@ -11,21 +12,22 @@ import makeo.gadomancy.common.blocks.tiles.TileAuraPylon; import makeo.gadomancy.common.blocks.tiles.TileAuraPylonTop; import makeo.gadomancy.common.utils.SimpleResourceLocation; import makeo.gadomancy.common.utils.Vector3; + import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.aspects.Aspect; import thaumcraft.client.fx.ParticleEngine; import thaumcraft.client.fx.particles.FXWisp; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 12.11.2015 21:33 */ @@ -34,11 +36,11 @@ public class RenderTileAuraPylon extends TileEntitySpecialRenderer { public static final ModelBase MODEL_AURA_PYLON = new ModelAuraPylon(); public static final ModelBase MODEL_AURA_PYLON_TOP = new ModelAuraPylonTop(); public static final ModelBase MODEL_AURA_PYLON_BOTTOM = new ModelAuraPylonBottom(); - public static final SimpleResourceLocation PYLON_TEXTURE_TOP = - new SimpleResourceLocation("models/aura_pylon_peak.png"); + public static final SimpleResourceLocation PYLON_TEXTURE_TOP = new SimpleResourceLocation( + "models/aura_pylon_peak.png"); public static final SimpleResourceLocation PYLON_TEXTURE = new SimpleResourceLocation("models/aura_pylon.png"); - public static final SimpleResourceLocation PYLON_TEXTURE_BOTTOM = - new SimpleResourceLocation("models/aura_pylon_base.png"); + public static final SimpleResourceLocation PYLON_TEXTURE_BOTTOM = new SimpleResourceLocation( + "models/aura_pylon_base.png"); public void renderTileEntity(TileEntity tile, double x, double y, double z, float partTicks) { GL11.glPushMatrix(); @@ -85,7 +87,8 @@ public class RenderTileAuraPylon extends TileEntitySpecialRenderer { TileAuraPylonTop ta = (TileAuraPylonTop) tile; if (ta.orbital == null && tile.getWorldObj() != null) { ta.orbital = new Orbital( - new Vector3(tile.xCoord + 0.5, tile.yCoord + 0.7, tile.zCoord + 0.5), tile.getWorldObj()); + new Vector3(tile.xCoord + 0.5, tile.yCoord + 0.7, tile.zCoord + 0.5), + tile.getWorldObj()); } if (ta.orbital != null && !ta.orbital.registered) { @@ -137,8 +140,9 @@ public class RenderTileAuraPylon extends TileEntitySpecialRenderer { } private void addNewOrbitalPoint(Orbital orbital, Random rand, Color color) { - Orbital.OrbitalRenderProperties properties = - new Orbital.OrbitalRenderProperties(Orbital.Axis.persisentRandomAxis(), rand.nextDouble() + 2D); + Orbital.OrbitalRenderProperties properties = new Orbital.OrbitalRenderProperties( + Orbital.Axis.persisentRandomAxis(), + rand.nextDouble() + 2D); properties.setColor(color).setTicksForFullCircle(60 + rand.nextInt(40)).setOffsetTicks(rand.nextInt(80)); properties.setSubParticleColor(color.brighter().brighter()); orbital.addOrbitalPoint(properties); diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileBlockProtector.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileBlockProtector.java index d34f359..c5fbdc7 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileBlockProtector.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileBlockProtector.java @@ -3,21 +3,23 @@ package makeo.gadomancy.client.renderers.tile; import makeo.gadomancy.client.models.ModelBlockProtector; import makeo.gadomancy.common.blocks.tiles.TileBlockProtector; import makeo.gadomancy.common.utils.SimpleResourceLocation; + import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; + import thaumcraft.client.renderers.models.ModelJar; import thaumcraft.client.renderers.tile.TileJarRenderer; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 11.11.2015 16:28 */ public class RenderTileBlockProtector extends TileJarRenderer { + private static final ResourceLocation TEXTURE_OFF = new SimpleResourceLocation("models/block_protector_off.png"); private static final ResourceLocation TEXTURE_ON = new SimpleResourceLocation("models/block_protector_on.png"); diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileCapEldritch.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileCapEldritch.java index 21a094b..bcc97c3 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileCapEldritch.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileCapEldritch.java @@ -1,15 +1,15 @@ package makeo.gadomancy.client.renderers.tile; import makeo.gadomancy.common.data.config.ModConfig; + import net.minecraft.tileentity.TileEntity; + import thaumcraft.client.renderers.tile.TileEldritchCapRenderer; import thaumcraft.common.config.Config; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 10.11.2015 22:20 */ diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileEssentiaCompressor.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileEssentiaCompressor.java index b6b7b0e..19bd155 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileEssentiaCompressor.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileEssentiaCompressor.java @@ -2,6 +2,7 @@ package makeo.gadomancy.client.renderers.tile; import java.util.HashMap; import java.util.Map; + import makeo.gadomancy.client.effect.EffectHandler; import makeo.gadomancy.client.effect.fx.FXVortex; import makeo.gadomancy.client.models.ModelEssentiaCompressor; @@ -9,26 +10,25 @@ import makeo.gadomancy.client.models.ModelPackedCompressorBlock; import makeo.gadomancy.common.blocks.tiles.TileEssentiaCompressor; import makeo.gadomancy.common.utils.SimpleResourceLocation; import makeo.gadomancy.common.utils.world.fake.FakeWorld; + import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; + import org.lwjgl.opengl.GL11; /** - * HellFirePvP@Admin - * Date: 22.04.2016 / 21:39 - * on Gadomancy - * RenderTileEssentiaCompressor + * HellFirePvP@Admin Date: 22.04.2016 / 21:39 on Gadomancy RenderTileEssentiaCompressor */ public class RenderTileEssentiaCompressor extends TileEntitySpecialRenderer { public static final ModelBase MODEL_ESSENTIA_COMPRESSOR = new ModelEssentiaCompressor(); public static final ModelBase MODEL_PACKED_COMPRESSOR = new ModelPackedCompressorBlock(); - public static final SimpleResourceLocation COMPRESSOR_TEXTURE = - new SimpleResourceLocation("models/essentia_compressor.png"); - public static final SimpleResourceLocation PACKED_COMPRESSOR_TEXTURE = - new SimpleResourceLocation("blocks/block_packed_compressor.png"); + public static final SimpleResourceLocation COMPRESSOR_TEXTURE = new SimpleResourceLocation( + "models/essentia_compressor.png"); + public static final SimpleResourceLocation PACKED_COMPRESSOR_TEXTURE = new SimpleResourceLocation( + "blocks/block_packed_compressor.png"); @Override public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float partialTicks) { @@ -57,8 +57,7 @@ public class RenderTileEssentiaCompressor extends TileEntitySpecialRenderer { tileEntity.xCoord + 0.5, tileEntity.yCoord + 0.5, tileEntity.zCoord + 0.5, - (TileEssentiaCompressor) tileEntity - .getWorldObj() + (TileEssentiaCompressor) tileEntity.getWorldObj() .getTileEntity(tileEntity.xCoord, tileEntity.yCoord - 1, tileEntity.zCoord)); } GL11.glPopMatrix(); diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileExtendedNode.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileExtendedNode.java index aa4c3d2..f8b60ba 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileExtendedNode.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileExtendedNode.java @@ -2,14 +2,13 @@ package makeo.gadomancy.client.renderers.tile; import makeo.gadomancy.common.blocks.tiles.TileExtendedNode; import makeo.gadomancy.common.node.ExtendedNodeType; + import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 22.10.2015 19:44 */ diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileExtendedNodeJar.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileExtendedNodeJar.java index daabccc..06cb7ee 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileExtendedNodeJar.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileExtendedNodeJar.java @@ -3,11 +3,10 @@ package makeo.gadomancy.client.renderers.tile; import thaumcraft.client.renderers.tile.TileJarRenderer; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 26.10.2015 00:00 */ -public class RenderTileExtendedNodeJar extends TileJarRenderer {} +public class RenderTileExtendedNodeJar extends TileJarRenderer { +} diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileInfusionClaw.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileInfusionClaw.java index 95fd916..d642789 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileInfusionClaw.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileInfusionClaw.java @@ -1,11 +1,13 @@ package makeo.gadomancy.client.renderers.tile; import java.util.Random; + import makeo.gadomancy.client.models.ModelInfusionClawPart; import makeo.gadomancy.client.models.ModelWandPart; import makeo.gadomancy.common.blocks.tiles.TileInfusionClaw; import makeo.gadomancy.common.utils.Injector; import makeo.gadomancy.common.utils.SimpleResourceLocation; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; @@ -16,7 +18,9 @@ import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; import net.minecraftforge.client.IItemRenderer; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; + import thaumcraft.client.renderers.entity.RenderPrimalOrb; import thaumcraft.client.renderers.item.ItemWandRenderer; import thaumcraft.common.Thaumcraft; @@ -25,14 +29,13 @@ import thaumcraft.common.entities.projectile.EntityPrimalOrb; import thaumcraft.common.items.wands.ItemWandCasting; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 05.10.2015 21:39 */ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer { + private static final ResourceLocation RESOURCE = new SimpleResourceLocation("models/infusion_claw.png"); private static final ModelInfusionClawPart[] MODELS; private static final Random RANDOM = new Random(); @@ -212,8 +215,8 @@ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer { } } - private void createZap( - TileEntity tile, float startX, float startY, float startZ, float endX, float endY, float endZ) { + private void createZap(TileEntity tile, float startX, float startY, float startZ, float endX, float endY, + float endZ) { Thaumcraft.proxy.nodeBolt( Thaumcraft.proxy.getClientWorld(), tile.xCoord + startX, @@ -225,16 +228,14 @@ public class RenderTileInfusionClaw extends TileEntitySpecialRenderer { } private void playZapSound(float x, float y, float z) { - Thaumcraft.proxy - .getClientWorld() - .playSound( - x, - y, - z, - "thaumcraft:zap", - 0.1F, - 1.0F + Thaumcraft.proxy.getClientWorld().rand.nextFloat() * 0.2F, - false); + Thaumcraft.proxy.getClientWorld().playSound( + x, + y, + z, + "thaumcraft:zap", + 0.1F, + 1.0F + Thaumcraft.proxy.getClientWorld().rand.nextFloat() * 0.2F, + false); } private void renderSides(TileInfusionClaw tile, World world, int x, int y, int z, float elapsed) { diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileKnowledgeBook.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileKnowledgeBook.java index 0aa4bfe..b34930e 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileKnowledgeBook.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileKnowledgeBook.java @@ -1,23 +1,23 @@ package makeo.gadomancy.client.renderers.tile; import makeo.gadomancy.common.blocks.tiles.TileKnowledgeBook; + import net.minecraft.client.model.ModelBook; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.MathHelper; import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; /** - * HellFirePvP@Admin - * Date: 19.04.2016 / 14:57 - * on Gadomancy - * RenderTileKnowledgeBook + * HellFirePvP@Admin Date: 19.04.2016 / 14:57 on Gadomancy RenderTileKnowledgeBook */ public class RenderTileKnowledgeBook extends TileEntitySpecialRenderer { - private static final ResourceLocation bookTexture = - new ResourceLocation("minecraft", "textures/entity/enchanting_table_book.png"); + private static final ResourceLocation bookTexture = new ResourceLocation( + "minecraft", + "textures/entity/enchanting_table_book.png"); private static final ModelBook modelBook = new ModelBook(); @Override @@ -36,9 +36,8 @@ public class RenderTileKnowledgeBook extends TileEntitySpecialRenderer { GL11.glTranslatef(0.0F, 0.1F + MathHelper.sin(f1 * 0.1F) * 0.03F, 0.0F); float f2; - for (f2 = attributes.field_145928_o - attributes.field_145925_p; - f2 >= (float) Math.PI; - f2 -= ((float) Math.PI * 2F)) {} + for (f2 = attributes.field_145928_o - attributes.field_145925_p; f2 + >= (float) Math.PI; f2 -= ((float) Math.PI * 2F)) {} while (f2 < -(float) Math.PI) { f2 += ((float) Math.PI * 2F); @@ -48,11 +47,9 @@ public class RenderTileKnowledgeBook extends TileEntitySpecialRenderer { GL11.glRotatef(-f3 * 180.0F / (float) Math.PI, 0.0F, 1.0F, 0.0F); GL11.glRotatef(80.0F, 0.0F, 0.0F, 1.0F); this.bindTexture(RenderTileKnowledgeBook.bookTexture); - float f4 = attributes.field_145931_j - + (attributes.field_145933_i - attributes.field_145931_j) * partialTicks + float f4 = attributes.field_145931_j + (attributes.field_145933_i - attributes.field_145931_j) * partialTicks + 0.25F; - float f5 = attributes.field_145931_j - + (attributes.field_145933_i - attributes.field_145931_j) * partialTicks + float f5 = attributes.field_145931_j + (attributes.field_145933_i - attributes.field_145931_j) * partialTicks + 0.75F; f4 = (f4 - (float) MathHelper.truncateDoubleToInt(f4)) * 1.6F - 0.3F; f5 = (f5 - (float) MathHelper.truncateDoubleToInt(f5)) * 1.6F - 0.3F; diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileManipulationFocus.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileManipulationFocus.java index 973728f..be0054f 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileManipulationFocus.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileManipulationFocus.java @@ -4,19 +4,20 @@ import makeo.gadomancy.client.models.ModelFocusPortalPart; import makeo.gadomancy.client.models.ModelManipulatorPart; import makeo.gadomancy.common.blocks.tiles.TileManipulationFocus; import makeo.gadomancy.common.utils.SimpleResourceLocation; + import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; + import org.lwjgl.opengl.GL11; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 28.10.2015 18:00 */ public class RenderTileManipulationFocus extends TileEntitySpecialRenderer { + private static final ModelManipulatorPart RANDOM_FOCUS = new ModelManipulatorPart(); private static final ModelFocusPortalPart PORTAL_FOCUS = new ModelFocusPortalPart(); diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileManipulatorPillar.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileManipulatorPillar.java index a6c0cb8..0e24f2f 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileManipulatorPillar.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileManipulatorPillar.java @@ -1,33 +1,35 @@ package makeo.gadomancy.client.renderers.tile; import java.util.Map; + import makeo.gadomancy.common.utils.Injector; import makeo.gadomancy.common.utils.SimpleResourceLocation; + import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; + import thaumcraft.client.lib.UtilsFX; import thaumcraft.client.renderers.tile.TileInfusionPillarRenderer; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 27.10.2015 13:23 */ public class RenderTileManipulatorPillar extends TileInfusionPillarRenderer { + private static final String TC_TEXTURE = "textures/models/pillar.png"; private static final ResourceLocation TEXTURE = new SimpleResourceLocation("models/manipulator_pillar.png"); - private static final Map BOUND_TEXTURES = - new Injector(UtilsFX.class).getField("boundTextures"); + private static final Map BOUND_TEXTURES = new Injector(UtilsFX.class) + .getField("boundTextures"); @Override public void renderTileEntityAt(TileEntity par1TileEntity, double par2, double par4, double par6, float par8) { - ResourceLocation originalTexture = - RenderTileManipulatorPillar.BOUND_TEXTURES.get(RenderTileManipulatorPillar.TC_TEXTURE); - RenderTileManipulatorPillar.BOUND_TEXTURES.put( - RenderTileManipulatorPillar.TC_TEXTURE, RenderTileManipulatorPillar.TEXTURE); + ResourceLocation originalTexture = RenderTileManipulatorPillar.BOUND_TEXTURES + .get(RenderTileManipulatorPillar.TC_TEXTURE); + RenderTileManipulatorPillar.BOUND_TEXTURES + .put(RenderTileManipulatorPillar.TC_TEXTURE, RenderTileManipulatorPillar.TEXTURE); super.renderTileEntityAt(par1TileEntity, par2, par4, par6, par8); if (originalTexture != null) { diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileNodeBasic.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileNodeBasic.java index fe589a9..1001726 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileNodeBasic.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileNodeBasic.java @@ -1,6 +1,7 @@ package makeo.gadomancy.client.renderers.tile; import makeo.gadomancy.common.events.EventHandlerRedirect; + import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -10,7 +11,9 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.ResourceLocation; import net.minecraft.util.Vec3; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.nodes.INode; @@ -23,41 +26,26 @@ import thaumcraft.common.tiles.TileJarNode; import thaumcraft.common.tiles.TileNode; /** - * This class is NOT part of the Gadomancy Mod - * This file is copied from Azanors thaumcraft.client.renderers.tile.TileNodeRenderer.java and contains small modifications - * Thaumcraft: http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1292130 + * This class is NOT part of the Gadomancy Mod This file is copied from Azanors + * thaumcraft.client.renderers.tile.TileNodeRenderer.java and contains small modifications Thaumcraft: + * http://www.minecraftforum.net/forums/mapping-and-modding/minecraft-mods/1292130 * - * Created by Azanor - * Modified by HellFirePvP @ 23.10.2015 20:04 + * Created by Azanor Modified by HellFirePvP @ 23.10.2015 20:04 */ public class RenderTileNodeBasic { /* - Changes overview: - (Note: Changes are visible by "Gadomancy START" to "Gadomancy END" or by a comment in the end of the line!) - - - Where a node is rendered is now defined of the parameters of renderTileEntityAt() and no longer of the node-tile itself - - Node rendering takes doubles as params and no longer int values. - - Redirected renderTileEntityAt to a renderTileEntityAt where a size of the node can be specified - - Changes made by HellFirePvP + * Changes overview: (Note: Changes are visible by "Gadomancy START" to "Gadomancy END" or by a comment in the end + * of the line!) - Where a node is rendered is now defined of the parameters of renderTileEntityAt() and no longer + * of the node-tile itself - Node rendering takes doubles as params and no longer int values. - Redirected + * renderTileEntityAt to a renderTileEntityAt where a size of the node can be specified Changes made by HellFirePvP */ public static final ResourceLocation nodetex = new ResourceLocation("thaumcraft", "textures/misc/nodes.png"); // Gadomancy: changed params x, y, z from int to double - public static void renderNode( - EntityLivingBase viewer, - double viewDistance, - boolean visible, - boolean depthIgnore, - float size, - double x, - double y, - double z, - float partialTicks, - AspectList aspects, - NodeType type, + public static void renderNode(EntityLivingBase viewer, double viewDistance, boolean visible, boolean depthIgnore, + float size, double x, double y, double z, float partialTicks, AspectList aspects, NodeType type, NodeModifier mod) { long nt = System.nanoTime(); @@ -208,8 +196,8 @@ public class RenderTileNodeBasic { // Gadomancy END // Gadomancy: Added dynamic size - public static void renderTileEntityAt( - TileEntity tile, double x, double y, double z, float partialTicks, float size) { + public static void renderTileEntityAt(TileEntity tile, double x, double y, double z, float partialTicks, + float size) { // Gadomancy Added event hook EventHandlerRedirect.preNodeRender(tile); @@ -226,27 +214,25 @@ public class RenderTileNodeBasic { if ((viewer instanceof EntityPlayer)) { if ((tile != null) && ((tile instanceof TileJarNode))) { condition = true; - size = (float) ((size * 7D) - / 10D); // Gadomancy: Node size is 70% of the default size in standart TC. calculating the same + size = (float) ((size * 7D) / 10D); // Gadomancy: Node size is 70% of the default size in standart TC. + // calculating the same // here. } else if ((((EntityPlayer) viewer).inventory.armorItemInSlot(3) != null) && ((((EntityPlayer) viewer).inventory.armorItemInSlot(3).getItem() instanceof IRevealer)) - && (((IRevealer) ((EntityPlayer) viewer) - .inventory - .armorItemInSlot(3) - .getItem()) + && (((IRevealer) ((EntityPlayer) viewer).inventory.armorItemInSlot(3).getItem()) .showNodes(((EntityPlayer) viewer).inventory.armorItemInSlot(3), viewer))) { - condition = true; - depthIgnore = true; - } else if ((((EntityPlayer) viewer).inventory.getCurrentItem() != null) - && ((((EntityPlayer) viewer).inventory.getCurrentItem().getItem() instanceof ItemThaumometer))) { - // Gadomancy: Changed from tile.xCoord, ... to x, y, z to make it dependent from params - if (UtilsFX.isVisibleTo(0.44F, viewer, x, y, z)) { - condition = true; - depthIgnore = true; - viewDistance = 48.0D; - } - } + condition = true; + depthIgnore = true; + } else + if ((((EntityPlayer) viewer).inventory.getCurrentItem() != null) && ((((EntityPlayer) viewer).inventory + .getCurrentItem().getItem() instanceof ItemThaumometer))) { + // Gadomancy: Changed from tile.xCoord, ... to x, y, z to make it dependent from params + if (UtilsFX.isVisibleTo(0.44F, viewer, x, y, z)) { + condition = true; + depthIgnore = true; + viewDistance = 48.0D; + } + } } // Gadomancy: Changed from tile.xCoord, ... to x, y, z to make it dependent from params RenderTileNodeBasic.renderNode( @@ -262,8 +248,7 @@ public class RenderTileNodeBasic { ((INode) tile).getAspects(), ((INode) tile).getNodeType(), ((INode) tile).getNodeModifier()); - if (((tile instanceof TileNode)) - && (((TileNode) tile).drainEntity != null) + if (((tile instanceof TileNode)) && (((TileNode) tile).drainEntity != null) && (((TileNode) tile).drainCollision != null)) { Entity drainEntity = ((TileNode) tile).drainEntity; if (((drainEntity instanceof EntityPlayer)) && (!((EntityPlayer) drainEntity).isUsingItem())) { @@ -283,14 +268,14 @@ public class RenderTileNodeBasic { f10 = MathHelper.sin(iiud / 10.0F) * 10.0F; } Vec3 vec3 = Vec3.createVectorHelper(-0.1D, -0.1D, 0.5D); - vec3.rotateAroundX(-(drainEntity.prevRotationPitch - + (drainEntity.rotationPitch - drainEntity.prevRotationPitch) * partialTicks) - * 3.141593F - / 180.0F); - vec3.rotateAroundY(-(drainEntity.prevRotationYaw - + (drainEntity.rotationYaw - drainEntity.prevRotationYaw) * partialTicks) - * 3.141593F - / 180.0F); + vec3.rotateAroundX( + -(drainEntity.prevRotationPitch + + (drainEntity.rotationPitch - drainEntity.prevRotationPitch) * partialTicks) * 3.141593F + / 180.0F); + vec3.rotateAroundY( + -(drainEntity.prevRotationYaw + + (drainEntity.rotationYaw - drainEntity.prevRotationYaw) * partialTicks) * 3.141593F + / 180.0F); vec3.rotateAroundY(-f10 * 0.01F); vec3.rotateAroundX(-f10 * 0.015F); double d3 = drainEntity.prevPosX + (drainEntity.posX - drainEntity.prevPosX) * partialTicks + vec3.xCoord; diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileNodeManipulator.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileNodeManipulator.java index 709d2f7..0d90f95 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileNodeManipulator.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileNodeManipulator.java @@ -2,21 +2,23 @@ package makeo.gadomancy.client.renderers.tile; import makeo.gadomancy.client.models.ModelSmallCube; import makeo.gadomancy.common.utils.SimpleResourceLocation; + import net.minecraft.client.Minecraft; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; + import thaumcraft.client.renderers.tile.TileWandPedestalRenderer; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 27.10.2015 15:19 */ public class RenderTileNodeManipulator extends TileWandPedestalRenderer { + private static final ModelSmallCube MODEL = new ModelSmallCube(); private static final SimpleResourceLocation TEXTURE = new SimpleResourceLocation("models/small_cube.png"); diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileObelisk.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileObelisk.java index d38ec8d..f7b698e 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileObelisk.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileObelisk.java @@ -1,19 +1,20 @@ package makeo.gadomancy.client.renderers.tile; import makeo.gadomancy.common.data.config.ModConfig; + import net.minecraft.tileentity.TileEntity; + import thaumcraft.client.renderers.tile.TileEldritchObeliskRenderer; import thaumcraft.common.config.Config; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 10.11.2015 21:59 */ public class RenderTileObelisk extends TileEldritchObeliskRenderer { + @Override public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) { if (te.getWorldObj().provider.dimensionId == ModConfig.dimOuterId) { diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileRemoteJar.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileRemoteJar.java index 2822725..d8e348f 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileRemoteJar.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileRemoteJar.java @@ -4,24 +4,26 @@ import makeo.gadomancy.client.models.ModelJarPot; import makeo.gadomancy.common.blocks.BlockRemoteJar; import makeo.gadomancy.common.utils.SimpleResourceLocation; import makeo.gadomancy.common.utils.world.fake.FakeWorld; + import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; + import org.lwjgl.opengl.GL11; + import thaumcraft.client.renderers.tile.TileJarRenderer; import thaumcraft.client.renderers.tile.TileMirrorRenderer; import thaumcraft.common.tiles.TileMirrorEssentia; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 14.10.2015 16:01 */ public class RenderTileRemoteJar extends TileJarRenderer { + private static final ModelJarPot MODEL_JAR_POT = new ModelJarPot(); private static final ResourceLocation OVERLAY_TEXTURE = new SimpleResourceLocation("models/jar_pot.png"); diff --git a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileStickyJar.java b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileStickyJar.java index 6ae9663..2e8411c 100644 --- a/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileStickyJar.java +++ b/src/main/java/makeo/gadomancy/client/renderers/tile/RenderTileStickyJar.java @@ -1,6 +1,7 @@ package makeo.gadomancy.client.renderers.tile; import makeo.gadomancy.common.blocks.tiles.TileStickyJar; + import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; @@ -10,18 +11,19 @@ import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; + import thaumcraft.common.tiles.TileJarFillable; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 14.07.2015 21:05 */ public class RenderTileStickyJar extends TileEntitySpecialRenderer { + private static final RenderBlocks RENDER_BLOCKS = new RenderBlocks(); @Override @@ -63,7 +65,9 @@ public class RenderTileStickyJar extends TileEntitySpecialRenderer { tess.startDrawingQuads(); tess.setNormal( - 0, -stickyJar.placedOn.offsetY, -Math.abs(stickyJar.placedOn.offsetZ + stickyJar.placedOn.offsetX)); + 0, + -stickyJar.placedOn.offsetY, + -Math.abs(stickyJar.placedOn.offsetZ + stickyJar.placedOn.offsetX)); tess.setTranslation(-tile.xCoord, -tile.yCoord, -tile.zCoord); diff --git a/src/main/java/makeo/gadomancy/client/textures/BaseTexture.java b/src/main/java/makeo/gadomancy/client/textures/BaseTexture.java index a0a4eb0..8958dc8 100644 --- a/src/main/java/makeo/gadomancy/client/textures/BaseTexture.java +++ b/src/main/java/makeo/gadomancy/client/textures/BaseTexture.java @@ -3,21 +3,22 @@ package makeo.gadomancy.client.textures; import java.awt.image.BufferedImage; import java.io.IOException; import java.io.InputStream; + import javax.imageio.ImageIO; + import net.minecraft.client.renderer.texture.SimpleTexture; import net.minecraft.client.resources.IResource; import net.minecraft.client.resources.IResourceManager; import net.minecraft.util.ResourceLocation; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 04.10.2015 17:56 */ public abstract class BaseTexture extends SimpleTexture { + public BaseTexture(ResourceLocation resourceLocation) { super(resourceLocation); } diff --git a/src/main/java/makeo/gadomancy/client/textures/GolemGuiTexture.java b/src/main/java/makeo/gadomancy/client/textures/GolemGuiTexture.java index 0a062eb..d5020c8 100644 --- a/src/main/java/makeo/gadomancy/client/textures/GolemGuiTexture.java +++ b/src/main/java/makeo/gadomancy/client/textures/GolemGuiTexture.java @@ -5,27 +5,31 @@ import java.awt.image.BufferedImage; import java.io.IOException; import java.io.InputStream; import java.util.List; + import javax.imageio.ImageIO; + import makeo.gadomancy.api.GadomancyApi; import makeo.gadomancy.api.golems.AdditionalGolemType; + import net.minecraft.client.renderer.texture.TextureUtil; import net.minecraft.client.resources.IResource; import net.minecraft.client.resources.IResourceManager; import net.minecraft.client.resources.data.TextureMetadataSection; import net.minecraft.util.ResourceLocation; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; + import thaumcraft.common.entities.golems.EnumGolemType; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 07.09.2015 18:11 */ public class GolemGuiTexture extends BaseTexture { + private static final Logger LOGGER = LogManager.getLogger(); @Override @@ -52,16 +56,16 @@ public class GolemGuiTexture extends BaseTexture { if (iresource.hasMetadata()) { try { - TextureMetadataSection texturemetadatasection = - (TextureMetadataSection) iresource.getMetadata("texture"); + TextureMetadataSection texturemetadatasection = (TextureMetadataSection) iresource + .getMetadata("texture"); if (texturemetadatasection != null) { flag = texturemetadatasection.getTextureBlur(); flag1 = texturemetadatasection.getTextureClamp(); } } catch (RuntimeException runtimeexception) { - GolemGuiTexture.LOGGER.warn( - "Failed reading metadata of: " + this.textureLocation, runtimeexception); + GolemGuiTexture.LOGGER + .warn("Failed reading metadata of: " + this.textureLocation, runtimeexception); } } @@ -80,7 +84,9 @@ public class GolemGuiTexture extends BaseTexture { int newHeight = (24 * scale) * (this.getMaxOrdinal() + 1); BufferedImage newImg = new BufferedImage( - image.getWidth(), newHeight < image.getHeight() ? image.getHeight() : newHeight, image.getType()); + image.getWidth(), + newHeight < image.getHeight() ? image.getHeight() : newHeight, + image.getType()); for (int x = 0; x < image.getWidth(); x++) { for (int y = 0; y < image.getHeight(); y++) { diff --git a/src/main/java/makeo/gadomancy/client/transformation/FakeEntityGolemBase.java b/src/main/java/makeo/gadomancy/client/transformation/FakeEntityGolemBase.java index 95c2bc6..02f5547 100644 --- a/src/main/java/makeo/gadomancy/client/transformation/FakeEntityGolemBase.java +++ b/src/main/java/makeo/gadomancy/client/transformation/FakeEntityGolemBase.java @@ -2,18 +2,18 @@ package makeo.gadomancy.client.transformation; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; + import thaumcraft.common.entities.golems.EntityGolemBase; import thaumcraft.common.entities.golems.EnumGolemType; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 05.07.2015 15:47 */ public class FakeEntityGolemBase extends EntityGolemBase { + private EntityGolemBase golem; private EntityPlayer player; diff --git a/src/main/java/makeo/gadomancy/client/transformation/TransformationHelper.java b/src/main/java/makeo/gadomancy/client/transformation/TransformationHelper.java index 12704dc..3ef8ca8 100644 --- a/src/main/java/makeo/gadomancy/client/transformation/TransformationHelper.java +++ b/src/main/java/makeo/gadomancy/client/transformation/TransformationHelper.java @@ -1,34 +1,37 @@ package makeo.gadomancy.client.transformation; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.HashMap; import java.util.List; import java.util.Map; + import makeo.gadomancy.client.renderers.entity.PlayerCameraRenderer; import makeo.gadomancy.common.network.PacketHandler; import makeo.gadomancy.common.network.packets.PacketAbortTransform; import makeo.gadomancy.common.registration.RegisteredIntegrations; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.EntityRenderer; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; + import thaumcraft.common.entities.golems.EntityGolemBase; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 04.07.2015 02:38 */ @SideOnly(Side.CLIENT) public class TransformationHelper { + private static final FakeEntityGolemBase DEFAULT_GOLEM; static { EntityGolemBase golem = new EntityGolemBase(null) { + @Override public byte getCore() { return (byte) 4; @@ -47,16 +50,14 @@ public class TransformationHelper { public static boolean isTransformable() { Minecraft mc = Minecraft.getMinecraft(); - return mc.thePlayer.equals(mc.renderViewEntity) - && !RegisteredIntegrations.morph.isMorphed() + return mc.thePlayer.equals(mc.renderViewEntity) && !RegisteredIntegrations.morph.isMorphed() && mc.entityRenderer.getClass().equals(EntityRenderer.class) && (TransformationHelper.renderer == null || TransformationHelper.renderer.isRemoved()); } public static boolean isForeignTransformed() { Minecraft mc = Minecraft.getMinecraft(); - return !mc.renderViewEntity.equals(mc.thePlayer) - || RegisteredIntegrations.morph.isMorphed() + return !mc.renderViewEntity.equals(mc.thePlayer) || RegisteredIntegrations.morph.isMorphed() || (!mc.entityRenderer.getClass().equals(EntityRenderer.class) && !(mc.entityRenderer instanceof PlayerCameraRenderer)); } @@ -116,8 +117,7 @@ public class TransformationHelper { public static void cancelTransformation(PacketAbortTransform.AbortReason reason) { if (TransformationHelper.isTransformed()) { PacketHandler.INSTANCE.sendToServer(new PacketAbortTransform(reason)); - TransformationHelper.onAbortTransformation( - Minecraft.getMinecraft().thePlayer.getEntityId()); + TransformationHelper.onAbortTransformation(Minecraft.getMinecraft().thePlayer.getEntityId()); } } diff --git a/src/main/java/makeo/gadomancy/client/util/ExtendedTypeDisplayManager.java b/src/main/java/makeo/gadomancy/client/util/ExtendedTypeDisplayManager.java index bfae71b..2798404 100644 --- a/src/main/java/makeo/gadomancy/client/util/ExtendedTypeDisplayManager.java +++ b/src/main/java/makeo/gadomancy/client/util/ExtendedTypeDisplayManager.java @@ -2,14 +2,14 @@ package makeo.gadomancy.client.util; import makeo.gadomancy.client.events.ResourceReloadListener; import makeo.gadomancy.common.node.ExtendedNodeType; + import net.minecraft.util.StatCollector; + import thaumcraft.api.nodes.NodeType; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 23.10.2015 22:53 */ @@ -35,8 +35,8 @@ public class ExtendedTypeDisplayManager { private static void resetLanguageFile() { ExtendedTypeDisplayManager.currentNodeId = null; - ResourceReloadListener.languageList.put( - ExtendedTypeDisplayManager.changedEntry, ExtendedTypeDisplayManager.oldName); + ResourceReloadListener.languageList + .put(ExtendedTypeDisplayManager.changedEntry, ExtendedTypeDisplayManager.oldName); ExtendedTypeDisplayManager.changedLanguageFile = false; } diff --git a/src/main/java/makeo/gadomancy/client/util/FamiliarHandlerClient.java b/src/main/java/makeo/gadomancy/client/util/FamiliarHandlerClient.java index d56ce75..3e55248 100644 --- a/src/main/java/makeo/gadomancy/client/util/FamiliarHandlerClient.java +++ b/src/main/java/makeo/gadomancy/client/util/FamiliarHandlerClient.java @@ -1,15 +1,15 @@ package makeo.gadomancy.client.util; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.lang.ref.WeakReference; import java.util.HashMap; import java.util.List; import java.util.Map; + import makeo.gadomancy.client.renderers.item.ItemRenderFamiliar; import makeo.gadomancy.common.data.DataFamiliar; import makeo.gadomancy.common.network.packets.PacketFamiliarBolt; import makeo.gadomancy.common.utils.world.fake.FakeWorld; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; @@ -17,17 +17,19 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.aspects.Aspect; import thaumcraft.client.fx.bolt.FXLightningBolt; import thaumcraft.client.renderers.entity.RenderWisp; import thaumcraft.common.entities.monster.EntityWisp; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 31.10.2015 12:13 */ @@ -103,7 +105,13 @@ public class FamiliarHandlerClient { } ItemRenderFamiliar.renderEntityWispFor( - fam.owner.get(), FamiliarHandlerClient.ENTITY_WISP, diffX, diffY, diffZ, 0, partialTicks); + fam.owner.get(), + FamiliarHandlerClient.ENTITY_WISP, + diffX, + diffY, + diffZ, + 0, + partialTicks); GL11.glPopMatrix(); } @@ -124,7 +132,8 @@ public class FamiliarHandlerClient { public static void handleAdditions(List toAdd) { for (DataFamiliar.FamiliarData data : toAdd) { PartialEntityFamiliar familiar = new PartialEntityFamiliar( - Minecraft.getMinecraft().theWorld.getPlayerEntityByName(data.owner), data.owner); + Minecraft.getMinecraft().theWorld.getPlayerEntityByName(data.owner), + data.owner); ExFamiliarData exData = new ExFamiliarData(data, familiar); FamiliarHandlerClient.clientFamiliars.put(data.owner, exData); } @@ -208,8 +217,8 @@ public class FamiliarHandlerClient { if (this.owner.get() == null) { if (this.potentialOwnerName != null) { - EntityPlayer player = - Minecraft.getMinecraft().theWorld.getPlayerEntityByName(this.potentialOwnerName); + EntityPlayer player = Minecraft.getMinecraft().theWorld + .getPlayerEntityByName(this.potentialOwnerName); if (player != null) { this.owner = new WeakReference(player); } else { diff --git a/src/main/java/makeo/gadomancy/client/util/MultiTickEffectDispatcher.java b/src/main/java/makeo/gadomancy/client/util/MultiTickEffectDispatcher.java index 729e892..f75d319 100644 --- a/src/main/java/makeo/gadomancy/client/util/MultiTickEffectDispatcher.java +++ b/src/main/java/makeo/gadomancy/client/util/MultiTickEffectDispatcher.java @@ -4,20 +4,20 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.concurrent.locks.ReentrantLock; + import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; import net.minecraft.world.World; + import thaumcraft.client.fx.ParticleEngine; import thaumcraft.client.fx.particles.FXBubble; import thaumcraft.client.lib.UtilsFX; import thaumcraft.common.Thaumcraft; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 25.10.2015 18:54 */ @@ -167,16 +167,8 @@ public class MultiTickEffectDispatcher { private int colorAsInt; private int randomOffset = -1; - public FloatyLineInfo( - int dimId, - double pedestalX, - double pedestalY, - double pedestalZ, - double originX, - double originY, - double originZ, - int tickCap, - int colorAsInt) { + public FloatyLineInfo(int dimId, double pedestalX, double pedestalY, double pedestalZ, double originX, + double originY, double originZ, int tickCap, int colorAsInt) { this.dimId = dimId; this.pedestalX = pedestalX; this.pedestalY = pedestalY; @@ -216,16 +208,7 @@ public class MultiTickEffectDispatcher { private int renderTicks; private int tickCap; - public VortexDigInfo( - int dimId, - int oX, - int oY, - int oZ, - int tX, - int tY, - int tZ, - Block blockInstance, - int meta, + public VortexDigInfo(int dimId, int oX, int oY, int oZ, int tX, int tY, int tZ, Block blockInstance, int meta, int tickDuration) { this.dimId = dimId; this.oX = oX; diff --git a/src/main/java/makeo/gadomancy/client/util/UtilsFX.java b/src/main/java/makeo/gadomancy/client/util/UtilsFX.java index d977740..f7e6260 100644 --- a/src/main/java/makeo/gadomancy/client/util/UtilsFX.java +++ b/src/main/java/makeo/gadomancy/client/util/UtilsFX.java @@ -2,37 +2,30 @@ package makeo.gadomancy.client.util; import java.awt.*; import java.util.Random; + import makeo.gadomancy.common.utils.MiscUtils; + import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntitySmokeFX; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; + import thaumcraft.common.Thaumcraft; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 30.10.2015 20:08 */ public class UtilsFX { - private static final Color[] RUNE_COLORS_RED = { - new Color(0xB60707), - new Color(0xEE3782), - new Color(0xF37B20), - new Color(0xFF6722), - new Color(0xFF6D30), - new Color(0xFF0000) - }; - private static final Color[] RUNE_COLORS_GREEN = { - new Color(0x015629), new Color(0x0E9C00), new Color(0x010000), new Color(0x01FF00), new Color(0x014C3E) - }; - private static final Color[] RUNE_COLORS_BLUE = { - new Color(0x060956), new Color(0x012578), new Color(0x0C1556), new Color(0x0100FF), new Color(0x01018C) - }; + private static final Color[] RUNE_COLORS_RED = { new Color(0xB60707), new Color(0xEE3782), new Color(0xF37B20), + new Color(0xFF6722), new Color(0xFF6D30), new Color(0xFF0000) }; + private static final Color[] RUNE_COLORS_GREEN = { new Color(0x015629), new Color(0x0E9C00), new Color(0x010000), + new Color(0x01FF00), new Color(0x014C3E) }; + private static final Color[] RUNE_COLORS_BLUE = { new Color(0x060956), new Color(0x012578), new Color(0x0C1556), + new Color(0x0100FF), new Color(0x01018C) }; public static void doRuneEffects(World world, int x, int y, int z, int colorFlag) { if (world.isRemote) { @@ -81,9 +74,8 @@ public class UtilsFX { public static void doSmokeEffects(World world, int x, int y, int z, float size) { int count = world.rand.nextInt(6) + 2; for (int i = 0; i < count; i++) { - Minecraft.getMinecraft() - .effectRenderer - .addEffect(new EntitySmokeFX( + Minecraft.getMinecraft().effectRenderer.addEffect( + new EntitySmokeFX( world, x + 0.5 + UtilsFX.randEffectOffset(world.rand), y + 0.5 + UtilsFX.randEffectOffset(world.rand), diff --git a/src/main/java/makeo/gadomancy/common/CommonProxy.java b/src/main/java/makeo/gadomancy/common/CommonProxy.java index 7e076eb..fbf0c4e 100644 --- a/src/main/java/makeo/gadomancy/common/CommonProxy.java +++ b/src/main/java/makeo/gadomancy/common/CommonProxy.java @@ -1,12 +1,9 @@ package makeo.gadomancy.common; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.network.IGuiHandler; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.relauncher.Side; import java.util.Arrays; import java.util.HashMap; import java.util.List; + import makeo.gadomancy.client.ClientProxy; import makeo.gadomancy.common.aura.AuraEffects; import makeo.gadomancy.common.containers.ContainerArcanePackager; @@ -22,21 +19,25 @@ import makeo.gadomancy.common.network.packets.PacketStartAnimation; import makeo.gadomancy.common.registration.*; import makeo.gadomancy.common.utils.Injector; import makeo.gadomancy.common.utils.world.WorldProviderTCEldrich; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.world.World; import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.MinecraftForge; + import thaumcraft.api.wands.WandTriggerRegistry; import thaumcraft.common.entities.golems.ContainerGolem; import thaumcraft.common.entities.golems.EntityGolemBase; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.network.IGuiHandler; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.relauncher.Side; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 29.11.2014 14:18 */ @@ -113,7 +114,8 @@ public class CommonProxy implements IGuiHandler { Float.floatToIntBits(posZ), Float.floatToIntBits(rangeAroundItem)); PacketHandler.INSTANCE.sendToAllAround( - pkt, new NetworkRegistry.TargetPoint(world.provider.dimensionId, posX, posY, posZ, 32)); + pkt, + new NetworkRegistry.TargetPoint(world.provider.dimensionId, posX, posY, posZ, 32)); } @Override diff --git a/src/main/java/makeo/gadomancy/common/Gadomancy.java b/src/main/java/makeo/gadomancy/common/Gadomancy.java index 9c7a7a2..6d3d304 100644 --- a/src/main/java/makeo/gadomancy/common/Gadomancy.java +++ b/src/main/java/makeo/gadomancy/common/Gadomancy.java @@ -1,21 +1,21 @@ package makeo.gadomancy.common; -import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.SidedProxy; -import cpw.mods.fml.common.event.*; import makeo.gadomancy.api.GadomancyApi; import makeo.gadomancy.common.api.DefaultApiHandler; import makeo.gadomancy.common.data.config.ModConfig; import makeo.gadomancy.common.data.config.ModData; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; + import thaumcraft.common.Thaumcraft; +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.*; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 29.11.2014 14:07 */ @@ -25,6 +25,7 @@ import thaumcraft.common.Thaumcraft; version = Gadomancy.VERSION, dependencies = "required-after:Thaumcraft@[4.1.1.11,);after:Waila;after:Automagy") public class Gadomancy { + public static final String MODID = "gadomancy"; public static final String NAME = "Gadomancy"; diff --git a/src/main/java/makeo/gadomancy/common/api/DefaultApiHandler.java b/src/main/java/makeo/gadomancy/common/api/DefaultApiHandler.java index 1f306e8..5760fda 100644 --- a/src/main/java/makeo/gadomancy/common/api/DefaultApiHandler.java +++ b/src/main/java/makeo/gadomancy/common/api/DefaultApiHandler.java @@ -1,10 +1,10 @@ package makeo.gadomancy.common.api; -import cpw.mods.fml.common.registry.GameRegistry; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import makeo.gadomancy.api.AuraEffect; import makeo.gadomancy.api.ClickBehavior; import makeo.gadomancy.api.golems.AdditionalGolemType; @@ -19,18 +19,20 @@ import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.utils.GolemEnumHelper; import makeo.gadomancy.common.utils.NBTHelper; import makeo.gadomancy.common.utils.StringHelper; + import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; + import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; + import thaumcraft.api.aspects.Aspect; import thaumcraft.common.entities.golems.EntityGolemBase; +import cpw.mods.fml.common.registry.GameRegistry; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 14.10.2015 14:38 */ @@ -47,8 +49,8 @@ public class DefaultApiHandler implements IApiHandler { GolemEnumHelper.addGolemType(uniqueName, newType); ItemAdditionalGolemPlacer placerItem = new ItemAdditionalGolemPlacer(newType); - GameRegistry.registerItem( - placerItem, "item" + StringHelper.firstToUpper(name.toLowerCase()) + "GolemPlacer"); + GameRegistry + .registerItem(placerItem, "item" + StringHelper.firstToUpper(name.toLowerCase()) + "GolemPlacer"); newType.setModId(modId); newType.setPlacerItem(placerItem); diff --git a/src/main/java/makeo/gadomancy/common/aura/AuraEffectHandler.java b/src/main/java/makeo/gadomancy/common/aura/AuraEffectHandler.java index 06cb570..6e60fae 100644 --- a/src/main/java/makeo/gadomancy/common/aura/AuraEffectHandler.java +++ b/src/main/java/makeo/gadomancy/common/aura/AuraEffectHandler.java @@ -1,19 +1,20 @@ package makeo.gadomancy.common.aura; import java.util.*; + import makeo.gadomancy.api.AuraEffect; + import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 17.11.2015 14:06 */ @@ -22,9 +23,9 @@ public class AuraEffectHandler { public static Map registeredEffects = new HashMap(); public static void distributeEffects(Aspect aspect, World worldObj, double x, double y, double z, int tick) { - if (!AuraEffectHandler.registeredEffects.containsKey(aspect) - || worldObj.isRemote - || AuraResearchManager.isBlacklisted(aspect)) return; + if (!AuraEffectHandler.registeredEffects.containsKey(aspect) || worldObj.isRemote + || AuraResearchManager.isBlacklisted(aspect)) + return; AuraEffect effect = AuraEffectHandler.registeredEffects.get(aspect); if ((tick % effect.getTickInterval()) != 0) return; diff --git a/src/main/java/makeo/gadomancy/common/aura/AuraEffects.java b/src/main/java/makeo/gadomancy/common/aura/AuraEffects.java index 7a2597c..dbba419 100644 --- a/src/main/java/makeo/gadomancy/common/aura/AuraEffects.java +++ b/src/main/java/makeo/gadomancy/common/aura/AuraEffects.java @@ -4,12 +4,14 @@ import static makeo.gadomancy.common.utils.MiscUtils.ticksForMinutes; import static makeo.gadomancy.common.utils.MiscUtils.ticksForSeconds; import java.util.Random; + import makeo.gadomancy.api.AuraEffect; import makeo.gadomancy.common.events.EventHandlerEntity; import makeo.gadomancy.common.integration.IntegrationThaumicTinkerer; import makeo.gadomancy.common.registration.RegisteredIntegrations; import makeo.gadomancy.common.registration.RegisteredPotions; import makeo.gadomancy.common.utils.MiscUtils; + import net.minecraft.block.Block; import net.minecraft.entity.*; import net.minecraft.entity.effect.EntityLightningBolt; @@ -32,6 +34,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.EnumDifficulty; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.Thaumcraft; @@ -47,88 +50,115 @@ import thaumcraft.common.lib.utils.Utils; import thaumcraft.common.lib.world.ThaumcraftWorldGenerator; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 29.11.2015 19:09 */ public class AuraEffects { + private static final ItemStack[][] ITEMS_SOUL = { - { - new ItemStack(Items.bow), - new ItemStack(Items.wooden_sword), - new ItemStack(Items.stone_sword), - new ItemStack(Items.iron_sword), - new ItemStack(Items.stone_axe), - new ItemStack(Items.iron_axe) - }, - {new ItemStack(Items.leather_boots), new ItemStack(Items.chainmail_boots), new ItemStack(Items.iron_boots)}, - { - new ItemStack(Items.leather_leggings), - new ItemStack(Items.chainmail_leggings), - new ItemStack(Items.iron_leggings) - }, - { - new ItemStack(Items.leather_chestplate), - new ItemStack(Items.chainmail_chestplate), - new ItemStack(Items.iron_chestplate) - }, - {new ItemStack(Blocks.lit_pumpkin), new ItemStack(Blocks.pumpkin)} - }; + { new ItemStack(Items.bow), new ItemStack(Items.wooden_sword), new ItemStack(Items.stone_sword), + new ItemStack(Items.iron_sword), new ItemStack(Items.stone_axe), new ItemStack(Items.iron_axe) }, + { new ItemStack(Items.leather_boots), new ItemStack(Items.chainmail_boots), + new ItemStack(Items.iron_boots) }, + { new ItemStack(Items.leather_leggings), new ItemStack(Items.chainmail_leggings), + new ItemStack(Items.iron_leggings) }, + { new ItemStack(Items.leather_chestplate), new ItemStack(Items.chainmail_chestplate), + new ItemStack(Items.iron_chestplate) }, + { new ItemStack(Blocks.lit_pumpkin), new ItemStack(Blocks.pumpkin) } }; // Potion amplifiers start with 0 == lvl 1! // Std. potion effects - public static final AuraEffect AER = - new PotionDistributionEffect(Potion.moveSpeed, 4, 6, ticksForMinutes(6), 1).register(Aspect.AIR); - public static final AuraEffect AQUA = - new PotionDistributionEffect(Potion.waterBreathing, 4, 10, ticksForMinutes(10), 0).register(Aspect.WATER); - public static final AuraEffect TERRA = - new PotionDistributionEffect(Potion.resistance, 4, 8, ticksForMinutes(5), 0).register(Aspect.EARTH); - public static final AuraEffect ORDO = - new PotionDistributionEffect(Potion.regeneration, 4, 6, ticksForMinutes(3), 0).register(Aspect.ORDER); - public static final AuraEffect PERDITIO = - new PotionDistributionEffect(Potion.weakness, 4, 8, ticksForMinutes(3), 0).register(Aspect.ENTROPY); - public static final AuraEffect TELUM = - new PotionDistributionEffect(Potion.damageBoost, 4, 6, ticksForMinutes(6), 2).register(Aspect.WEAPON); - public static final AuraEffect TUTAMEN = - new PotionDistributionEffect(Potion.resistance, 4, 6, ticksForMinutes(6), 1).register(Aspect.ARMOR); + public static final AuraEffect AER = new PotionDistributionEffect(Potion.moveSpeed, 4, 6, ticksForMinutes(6), 1) + .register(Aspect.AIR); + public static final AuraEffect AQUA = new PotionDistributionEffect( + Potion.waterBreathing, + 4, + 10, + ticksForMinutes(10), + 0).register(Aspect.WATER); + public static final AuraEffect TERRA = new PotionDistributionEffect(Potion.resistance, 4, 8, ticksForMinutes(5), 0) + .register(Aspect.EARTH); + public static final AuraEffect ORDO = new PotionDistributionEffect(Potion.regeneration, 4, 6, ticksForMinutes(3), 0) + .register(Aspect.ORDER); + public static final AuraEffect PERDITIO = new PotionDistributionEffect(Potion.weakness, 4, 8, ticksForMinutes(3), 0) + .register(Aspect.ENTROPY); + public static final AuraEffect TELUM = new PotionDistributionEffect(Potion.damageBoost, 4, 6, ticksForMinutes(6), 2) + .register(Aspect.WEAPON); + public static final AuraEffect TUTAMEN = new PotionDistributionEffect( + Potion.resistance, + 4, + 6, + ticksForMinutes(6), + 1).register(Aspect.ARMOR); public static final AuraEffect MOTUS = new PotionDistributionEffect(Potion.moveSpeed, 4, 6, ticksForMinutes(2), 2) .register(Aspect.MOTION); // Fast speed for short duration, long charge time public static final AuraEffect ITER = new PotionDistributionEffect(Potion.moveSpeed, 2, 10, ticksForMinutes(15), 0) .register(Aspect.TRAVEL); // Slower speed for long duration, fast charge time - public static final AuraEffect FAMES = - new PotionDistributionEffect(Potion.hunger, 4, 6, ticksForMinutes(2), 0).register(Aspect.HUNGER); - public static final AuraEffect SENSUS = - new PotionDistributionEffect(Potion.nightVision, 2, 8, ticksForMinutes(8), 0).register(Aspect.SENSES); - public static final AuraEffect VOLATUS = - new PotionDistributionEffect(Potion.jump, 2, 5, ticksForMinutes(4), 0).register(Aspect.FLIGHT); - public static final AuraEffect POTENTIA = - new PotionDistributionEffect(Potion.damageBoost, 4, 6, ticksForMinutes(4), 0).register(Aspect.ENERGY); - public static final AuraEffect TENEBRAE = - new PotionDistributionEffect(Potion.blindness, 4, 6, ticksForMinutes(1), 0).register(Aspect.DARKNESS); - public static final AuraEffect SANO = - new PotionDistributionEffect(Potion.regeneration, 8, 10, ticksForMinutes(5), 1).register(Aspect.HEAL); - public static final AuraEffect MORTUUS = - new PotionDistributionEffect(Potion.wither, 4, 6, ticksForMinutes(3), 1).register(Aspect.DEATH); - public static final AuraEffect HUMANUS = - new PotionDistributionEffect(Potion.field_76434_w, 2, 5, ticksForMinutes(4), 1).register(Aspect.MAN); - public static final AuraEffect INSTRUMENTUM = - new PotionDistributionEffect(Potion.digSpeed, 2, 7, ticksForMinutes(6), 0).register(Aspect.TOOL); - public static final AuraEffect PERFODIO = - new PotionDistributionEffect(Potion.digSpeed, 2, 7, ticksForMinutes(5), 2).register(Aspect.MINE); - public static final AuraEffect VENENUM = - new PotionDistributionEffect(Potion.poison, 2, 6, ticksForMinutes(1), 0).register(Aspect.POISON); - public static final AuraEffect VINCULUM = - new PotionDistributionEffect(Potion.moveSlowdown, 4, 6, ticksForMinutes(3), 0).register(Aspect.TRAP); + public static final AuraEffect FAMES = new PotionDistributionEffect(Potion.hunger, 4, 6, ticksForMinutes(2), 0) + .register(Aspect.HUNGER); + public static final AuraEffect SENSUS = new PotionDistributionEffect( + Potion.nightVision, + 2, + 8, + ticksForMinutes(8), + 0).register(Aspect.SENSES); + public static final AuraEffect VOLATUS = new PotionDistributionEffect(Potion.jump, 2, 5, ticksForMinutes(4), 0) + .register(Aspect.FLIGHT); + public static final AuraEffect POTENTIA = new PotionDistributionEffect( + Potion.damageBoost, + 4, + 6, + ticksForMinutes(4), + 0).register(Aspect.ENERGY); + public static final AuraEffect TENEBRAE = new PotionDistributionEffect( + Potion.blindness, + 4, + 6, + ticksForMinutes(1), + 0).register(Aspect.DARKNESS); + public static final AuraEffect SANO = new PotionDistributionEffect( + Potion.regeneration, + 8, + 10, + ticksForMinutes(5), + 1).register(Aspect.HEAL); + public static final AuraEffect MORTUUS = new PotionDistributionEffect(Potion.wither, 4, 6, ticksForMinutes(3), 1) + .register(Aspect.DEATH); + public static final AuraEffect HUMANUS = new PotionDistributionEffect( + Potion.field_76434_w, + 2, + 5, + ticksForMinutes(4), + 1).register(Aspect.MAN); + public static final AuraEffect INSTRUMENTUM = new PotionDistributionEffect( + Potion.digSpeed, + 2, + 7, + ticksForMinutes(6), + 0).register(Aspect.TOOL); + public static final AuraEffect PERFODIO = new PotionDistributionEffect(Potion.digSpeed, 2, 7, ticksForMinutes(5), 2) + .register(Aspect.MINE); + public static final AuraEffect VENENUM = new PotionDistributionEffect(Potion.poison, 2, 6, ticksForMinutes(1), 0) + .register(Aspect.POISON); + public static final AuraEffect VINCULUM = new PotionDistributionEffect( + Potion.moveSlowdown, + 4, + 6, + ticksForMinutes(3), + 0).register(Aspect.TRAP); // Special effects.. public static final AuraEffect LUCRUM = new PotionDistributionEffect( - RegisteredPotions.POTION_LUCK, 4, 6, ticksForMinutes(5), 1) - .register(Aspect.GREED); // Mining luck (Adding fortune) + RegisteredPotions.POTION_LUCK, + 4, + 6, + ticksForMinutes(5), + 1).register(Aspect.GREED); // Mining luck (Adding fortune) public static final AuraEffect VICTUS = new AuraEffect.EntityAuraEffect() { + @Override public boolean isEntityApplicable(Entity e) { return e instanceof EntityAgeable && ((EntityAgeable) e).getGrowingAge() < 0; @@ -142,6 +172,7 @@ public class AuraEffects { } }.register(Aspect.LIFE); public static final AuraEffect PANNUS = new AuraEffect.EntityAuraEffect() { + @Override public boolean isEntityApplicable(Entity e) { return e instanceof EntitySheep && ((EntitySheep) e).getSheared(); @@ -159,6 +190,7 @@ public class AuraEffects { } }.register(Aspect.CLOTH); public static final AuraEffect LUX = new AuraEffect.EntityAuraEffect() { + @Override public boolean isEntityApplicable(Entity e) { return true; @@ -181,6 +213,7 @@ public class AuraEffects { } }.register(Aspect.LIGHT); public static final AuraEffect TEMPESTAS = new AuraEffect.BlockAuraEffect() { + @Override public int getBlockCount(Random random) { return random.nextInt(10) == 0 ? 1 : 0; @@ -189,12 +222,16 @@ public class AuraEffects { @Override public void doBlockEffect(ChunkCoordinates originTile, ChunkCoordinates selectedBlock, World world) { int highestY = world.getTopSolidOrLiquidBlock(selectedBlock.posX, selectedBlock.posZ); - EntityLightningBolt entityLightning = - new EntityLightningBolt(world, selectedBlock.posX + 0.5, highestY, selectedBlock.posZ + 0.5); + EntityLightningBolt entityLightning = new EntityLightningBolt( + world, + selectedBlock.posX + 0.5, + highestY, + selectedBlock.posZ + 0.5); world.addWeatherEffect(entityLightning); } }.register(Aspect.WEATHER); public static final AuraEffect VITIUM = new AuraEffect() { + @Override public EffectType getEffectType() { return null; @@ -238,6 +275,7 @@ public class AuraEffects { } }.register(Aspect.TAINT); public static final AuraEffect GELUM = new AuraEffect() { + @Override public EffectType getEffectType() { return null; @@ -283,6 +321,7 @@ public class AuraEffects { } }.register(Aspect.COLD); public static final AuraEffect EXAMINIS = new AuraEffect() { + @Override public EffectType getEffectType() { return null; @@ -296,11 +335,21 @@ public class AuraEffects { @Override public void doEntityEffect(ChunkCoordinates originTile, Entity e) { AuraEffects.addOrExtendPotionEffect( - Potion.damageBoost, (EntityLivingBase) e, ticksForMinutes(3), 30, 1, false); + Potion.damageBoost, + (EntityLivingBase) e, + ticksForMinutes(3), + 30, + 1, + false); + AuraEffects + .addOrExtendPotionEffect(Potion.moveSpeed, (EntityLivingBase) e, ticksForMinutes(3), 30, 0, false); AuraEffects.addOrExtendPotionEffect( - Potion.moveSpeed, (EntityLivingBase) e, ticksForMinutes(3), 30, 0, false); - AuraEffects.addOrExtendPotionEffect( - Potion.regeneration, (EntityLivingBase) e, ticksForMinutes(3), 30, 0, false); + Potion.regeneration, + (EntityLivingBase) e, + ticksForMinutes(3), + 30, + 0, + false); } @Override @@ -332,6 +381,7 @@ public class AuraEffects { } }.register(Aspect.UNDEAD); public static final AuraEffect AURAM = new AuraEffect.EntityAuraEffect() { + @Override public boolean isEntityApplicable(Entity e) { return e instanceof EntityPlayer; @@ -341,8 +391,7 @@ public class AuraEffects { public void doEntityEffect(ChunkCoordinates originTile, Entity e) { EntityPlayer player = (EntityPlayer) e; - if (player.getHeldItem() != null - && player.getHeldItem().getItem() != null + if (player.getHeldItem() != null && player.getHeldItem().getItem() != null && player.getHeldItem().getItem() instanceof ItemWandCasting) { ItemStack wand = player.getHeldItem(); ItemWandCasting wandCasting = (ItemWandCasting) wand.getItem(); @@ -359,6 +408,7 @@ public class AuraEffects { } }.register(Aspect.AURA); public static final AuraEffect COGNITIO = new AuraEffect.EntityAuraEffect() { + @Override public boolean isEntityApplicable(Entity e) { return e instanceof EntityPlayer; @@ -385,6 +435,7 @@ public class AuraEffects { } }.register(Aspect.MIND); public static final AuraEffect FABRICO = new AuraEffect() { + @Override public EffectType getEffectType() { return null; @@ -413,6 +464,7 @@ public class AuraEffects { } }.register(Aspect.CRAFT); public static final AuraEffect HERBA = new AuraEffect.BlockAuraEffect() { + @Override public int getBlockCount(Random random) { return 180; @@ -429,6 +481,7 @@ public class AuraEffects { } }.register(Aspect.PLANT); public static final AuraEffect ARBOR = new AuraEffect.BlockAuraEffect() { + @Override public int getBlockCount(Random random) { return 120; @@ -445,6 +498,7 @@ public class AuraEffects { } }.register(Aspect.TREE); public static final AuraEffect IGNIS = new AuraEffect.EntityAuraEffect() { + @Override public boolean isEntityApplicable(Entity e) { return e instanceof EntityLivingBase; @@ -458,14 +512,13 @@ public class AuraEffects { } }.register(Aspect.FIRE); public static final AuraEffect ELDRITCH = new AuraEffect.EntityAuraEffect() { + @Override public boolean isEntityApplicable(Entity e) { if (e instanceof EntityMob) { EntityMob mob = (EntityMob) e; if (mob.getEntityAttribute(EntityUtils.CHAMPION_MOD).getAttributeValue() < 0 - && mob.getEntityAttribute(SharedMonsterAttributes.maxHealth) - .getBaseValue() - >= 10.0D) { + && mob.getEntityAttribute(SharedMonsterAttributes.maxHealth).getBaseValue() >= 10.0D) { boolean whitelisted = false; for (Class clazz : ConfigEntities.championModWhitelist.keySet()) { if (clazz.isAssignableFrom(e.getClass())) { @@ -493,15 +546,17 @@ public class AuraEffects { EntityUtils.makeChampion(mob, false); mob.removePotionEffect(RegisteredPotions.ELDRITCH.getId()); } else { - mob.addPotionEffect(new PotionEffect( - RegisteredPotions.ELDRITCH.getId(), - MiscUtils.ticksForMinutes(1), - effect == null ? 1 : effect.getAmplifier() + 1)); + mob.addPotionEffect( + new PotionEffect( + RegisteredPotions.ELDRITCH.getId(), + MiscUtils.ticksForMinutes(1), + effect == null ? 1 : effect.getAmplifier() + 1)); } } } }.register(Aspect.ELDRITCH); public static final AuraEffect SOUL = new AuraEffect.BlockAuraEffect() { + @Override public int getBlockCount(Random random) { return random.nextInt(60) == 0 ? 1 : 0; @@ -524,8 +579,7 @@ public class AuraEffects { int timeout = 40; int totalCount = (world.rand.nextInt(3) == 0 ? 1 : 0) + 2; do { - int slot = mob.getEquipmentInSlot(0) == null - ? 0 + int slot = mob.getEquipmentInSlot(0) == null ? 0 : (mob.getEquipmentInSlot(4) == null ? 4 : (world.rand.nextInt(3) + 1)); if (mob.getEquipmentInSlot(slot) == null) { ItemStack[] items = AuraEffects.ITEMS_SOUL[slot]; @@ -540,8 +594,12 @@ public class AuraEffects { } while (totalCount > 0 && timeout > 0); if (timeout > 0) { - mob.addPotionEffect(new PotionEffect( - Potion.invisibility.getId(), MiscUtils.ticksForMinutes(60 * 24 * 365), 1, true)); + mob.addPotionEffect( + new PotionEffect( + Potion.invisibility.getId(), + MiscUtils.ticksForMinutes(60 * 24 * 365), + 1, + true)); ChunkCoordinates pos = new ChunkCoordinates((int) mob.posX, (int) mob.posY, (int) mob.posZ); pos = AuraEffects.iterateDown(pos, world); @@ -552,9 +610,13 @@ public class AuraEffects { } }.register(Aspect.SOUL); public static final AuraEffect PRAECANTATIO = new PotionDistributionEffect( - RegisteredPotions.VIS_DISCOUNT, 4, 6, ticksForMinutes(5), 1) - .register(Aspect.MAGIC); + RegisteredPotions.VIS_DISCOUNT, + 4, + 6, + ticksForMinutes(5), + 1).register(Aspect.MAGIC); public static final AuraEffect LIMUS = new AuraEffect.BlockAuraEffect() { + @Override public int getBlockCount(Random random) { return random.nextInt(40) == 0 ? 1 : 0; @@ -584,8 +646,8 @@ public class AuraEffects { }.register(Aspect.SLIME); public static final AuraEffect BESTIA = new AuraEffect.BlockAuraEffect() { - private final Class[] animalClasses = {EntitySheep.class, EntityCow.class, EntityChicken.class, EntityPig.class - }; + private final Class[] animalClasses = { EntitySheep.class, EntityCow.class, EntityChicken.class, + EntityPig.class }; @Override public int getBlockCount(Random random) { @@ -597,8 +659,7 @@ public class AuraEffects { Class animalClass = this.animalClasses[world.rand.nextInt(this.animalClasses.length)]; EntityLivingBase animal; try { - animal = (EntityLivingBase) - animalClass.getConstructor(World.class).newInstance(world); + animal = (EntityLivingBase) animalClass.getConstructor(World.class).newInstance(world); } catch (Exception e) { return; } @@ -617,21 +678,26 @@ public class AuraEffects { } }.register(Aspect.BEAST); - public static final AuraEffect VITREUS = - new PotionDistributionEffect(RegisteredPotions.ACHROMATIC, 4, 6, ticksForMinutes(5), 0) { - @Override - public boolean isEntityApplicable(Entity e) { - return e instanceof EntityPlayer; - } - }.register(Aspect.CRYSTAL); + public static final AuraEffect VITREUS = new PotionDistributionEffect( + RegisteredPotions.ACHROMATIC, + 4, + 6, + ticksForMinutes(5), + 0) { + + @Override + public boolean isEntityApplicable(Entity e) { + return e instanceof EntityPlayer; + } + }.register(Aspect.CRYSTAL); public static class PotionDistributionEffect extends AuraEffect.EntityAuraEffect { private Potion potion; private int tickInterval, addedDuration, durationCap, amplifier; - public PotionDistributionEffect( - Potion potion, int tickInterval, int addedDuration, int durationCap, int amplifier) { + public PotionDistributionEffect(Potion potion, int tickInterval, int addedDuration, int durationCap, + int amplifier) { this.potion = potion; this.tickInterval = tickInterval; this.addedDuration = addedDuration; @@ -649,8 +715,8 @@ public class AuraEffects { if (e == null || !(e instanceof EntityLivingBase)) return; EntityLivingBase living = (EntityLivingBase) e; - AuraEffects.addOrExtendPotionEffect( - this.potion, living, this.durationCap, this.addedDuration, this.amplifier); + AuraEffects + .addOrExtendPotionEffect(this.potion, living, this.durationCap, this.addedDuration, this.amplifier); } @Override @@ -663,7 +729,11 @@ public class AuraEffects { Block block = world.getBlock(coordinates.posX, coordinates.posY, coordinates.posZ); if (block.getTickRandomly()) { world.scheduleBlockUpdate( - coordinates.posX, coordinates.posY, coordinates.posZ, block, world.rand.nextInt(8) + 2); + coordinates.posX, + coordinates.posY, + coordinates.posZ, + block, + world.rand.nextInt(8) + 2); } if (IntegrationThaumicTinkerer.isCropBlock(block)) { TileEntity te = world.getTileEntity(coordinates.posX, coordinates.posY, coordinates.posZ); @@ -675,8 +745,8 @@ public class AuraEffects { } } - private static void addOrExtendPotionEffect( - Potion potion, EntityLivingBase entityLiving, int cap, int durToAdd, int amplifier, boolean ambient) { + private static void addOrExtendPotionEffect(Potion potion, EntityLivingBase entityLiving, int cap, int durToAdd, + int amplifier, boolean ambient) { int activeDuration = 0; if (entityLiving.isPotionActive(potion)) { PotionEffect effect = entityLiving.getActivePotionEffect(potion); @@ -685,13 +755,13 @@ public class AuraEffects { boolean canAdd = (cap - activeDuration) >= durToAdd; if (canAdd) { - entityLiving.addPotionEffect( - new PotionEffect(potion.getId(), activeDuration + durToAdd, amplifier, ambient)); + entityLiving + .addPotionEffect(new PotionEffect(potion.getId(), activeDuration + durToAdd, amplifier, ambient)); } } - private static void addOrExtendPotionEffect( - Potion potion, EntityLivingBase entityLiving, int cap, int durToAdd, int amplifier) { + private static void addOrExtendPotionEffect(Potion potion, EntityLivingBase entityLiving, int cap, int durToAdd, + int amplifier) { AuraEffects.addOrExtendPotionEffect(potion, entityLiving, cap, durToAdd, amplifier, true); } @@ -707,8 +777,8 @@ public class AuraEffects { // the entity there. // Call with mayVary == true to search in 1 block radius, call with mayVary == false for only checking the current // block. - private static boolean setAndCheckPosition( - EntityLivingBase entity, ChunkCoordinates cc, World world, boolean mayVary) { + private static boolean setAndCheckPosition(EntityLivingBase entity, ChunkCoordinates cc, World world, + boolean mayVary) { if (!world.isAirBlock(cc.posX, cc.posY, cc.posZ)) { if (!mayVary) return false; ChunkCoordinates up = new ChunkCoordinates(cc.posX, cc.posY + 1, cc.posZ); diff --git a/src/main/java/makeo/gadomancy/common/aura/AuraResearchManager.java b/src/main/java/makeo/gadomancy/common/aura/AuraResearchManager.java index 69d51c0..f3948b1 100644 --- a/src/main/java/makeo/gadomancy/common/aura/AuraResearchManager.java +++ b/src/main/java/makeo/gadomancy/common/aura/AuraResearchManager.java @@ -2,23 +2,24 @@ package makeo.gadomancy.common.aura; import java.util.ArrayList; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.data.config.ModConfig; import makeo.gadomancy.common.network.PacketHandler; import makeo.gadomancy.common.network.packets.PacketTCNotificationText; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.StatCollector; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.research.ResearchItem; import thaumcraft.common.Thaumcraft; import thaumcraft.common.lib.research.ResearchManager; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 29.11.2015 18:14 */ @@ -30,8 +31,9 @@ public class AuraResearchManager { if (!AuraEffectHandler.registeredEffects.containsKey(aspect)) return; if (AuraResearchManager.isBlacklisted(aspect)) return; - if (!ResearchManager.isResearchComplete( - player.getCommandSenderName(), Gadomancy.MODID.toUpperCase() + ".AURA_EFFECTS")) return; + if (!ResearchManager + .isResearchComplete(player.getCommandSenderName(), Gadomancy.MODID.toUpperCase() + ".AURA_EFFECTS")) + return; if (!Thaumcraft.proxy.getPlayerKnowledge().hasDiscoveredAspect(player.getCommandSenderName(), aspect)) return; String res = String.format(AuraResearchManager.TC_AURA_RESEARCH_STR, aspect.getTag()); diff --git a/src/main/java/makeo/gadomancy/common/aura/ResearchPageAuraAspects.java b/src/main/java/makeo/gadomancy/common/aura/ResearchPageAuraAspects.java index 97fa52e..dc83d43 100644 --- a/src/main/java/makeo/gadomancy/common/aura/ResearchPageAuraAspects.java +++ b/src/main/java/makeo/gadomancy/common/aura/ResearchPageAuraAspects.java @@ -3,19 +3,20 @@ package makeo.gadomancy.common.aura; import java.util.ArrayList; import java.util.Collections; import java.util.List; + import makeo.gadomancy.common.utils.SimpleResourceLocation; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchPage; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 29.11.2015 23:57 */ @@ -50,9 +51,9 @@ public class ResearchPageAuraAspects extends ResearchPage { if (knowledge.size() <= 0) return new ArrayList(); Collections.sort(knowledge); int startIndex = pageIndex << 2; - if (knowledge.size() <= startIndex) - return new ArrayList< - String>(); // Should not happen, because getAdditionalPages should only return indexes within range + if (knowledge.size() <= startIndex) return new ArrayList(); // Should not happen, because + // getAdditionalPages should only return + // indexes within range return knowledge.subList(startIndex, (startIndex + 4 > knowledge.size()) ? knowledge.size() : startIndex + 4); } @@ -70,8 +71,13 @@ public class ResearchPageAuraAspects extends ResearchPage { if (original == null) return null; String fakeTemp = "GADOMANCY_TEMP_" + tag; - Aspect fake = - new FakeAspect(fakeTemp, original.getColor(), null, original.getImage(), original.getBlend(), true); + Aspect fake = new FakeAspect( + fakeTemp, + original.getColor(), + null, + original.getImage(), + original.getBlend(), + true); fake.setTag(original.getTag()); return fake; } @@ -80,8 +86,8 @@ public class ResearchPageAuraAspects extends ResearchPage { private boolean headAspect; - public FakeAspect( - String tag, int color, Aspect[] components, ResourceLocation image, int blend, boolean isHead) { + public FakeAspect(String tag, int color, Aspect[] components, ResourceLocation image, int blend, + boolean isHead) { super(tag, color, components, image, blend); Aspect.aspects.remove(tag); this.headAspect = isHead; diff --git a/src/main/java/makeo/gadomancy/common/blocks/BlockAdditionalEldritchPortal.java b/src/main/java/makeo/gadomancy/common/blocks/BlockAdditionalEldritchPortal.java index fe042d2..2bdcf15 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/BlockAdditionalEldritchPortal.java +++ b/src/main/java/makeo/gadomancy/common/blocks/BlockAdditionalEldritchPortal.java @@ -2,17 +2,17 @@ package makeo.gadomancy.common.blocks; import makeo.gadomancy.common.blocks.tiles.TileAdditionalEldritchPortal; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import thaumcraft.common.blocks.BlockEldritchPortal; import thaumcraft.common.config.ConfigBlocks; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 06.11.2015 23:23 */ diff --git a/src/main/java/makeo/gadomancy/common/blocks/BlockArcaneDropper.java b/src/main/java/makeo/gadomancy/common/blocks/BlockArcaneDropper.java index 3aa7fa7..d96ed45 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/BlockArcaneDropper.java +++ b/src/main/java/makeo/gadomancy/common/blocks/BlockArcaneDropper.java @@ -1,8 +1,10 @@ package makeo.gadomancy.common.blocks; import java.util.List; + import makeo.gadomancy.common.blocks.tiles.TileArcaneDropper; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.block.material.Material; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -16,14 +18,13 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 28.09.2015 20:15 */ public class BlockArcaneDropper extends BlockTransparent { + public BlockArcaneDropper() { super(Material.rock); this.setHardness(3.5f); @@ -63,16 +64,15 @@ public class BlockArcaneDropper extends BlockTransparent { } ForgeDirection rotated = direction.getRotation( - flipped - ? ForgeDirection.getOrientation((direction.ordinal() + 4) % 6) + flipped ? ForgeDirection.getOrientation((direction.ordinal() + 4) % 6) : ForgeDirection.getOrientation((direction.ordinal() + 2) % 6)); return direction != side && rotated != side && rotated.getOpposite() != side; } @Override - public int onBlockPlaced( - World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) { + public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, + int metadata) { return side; } @@ -85,17 +85,16 @@ public class BlockArcaneDropper extends BlockTransparent { super.maxZ = box.maxZ; } - private static final AxisAlignedBB[] COLLISION_BOXES = { - AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 0.3125f, 1), // down - AxisAlignedBB.getBoundingBox(0, 0.6875f, 0, 1, 1, 1), // up - AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 1, 0.3125f), // north - AxisAlignedBB.getBoundingBox(0, 0, 0.6875f, 1, 1, 1), // south - AxisAlignedBB.getBoundingBox(0, 0, 0, 0.3125f, 1, 1), // west - AxisAlignedBB.getBoundingBox(0.6875f, 0, 0, 1, 1, 1), // east + private static final AxisAlignedBB[] COLLISION_BOXES = { AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 0.3125f, 1), // down + AxisAlignedBB.getBoundingBox(0, 0.6875f, 0, 1, 1, 1), // up + AxisAlignedBB.getBoundingBox(0, 0, 0, 1, 1, 0.3125f), // north + AxisAlignedBB.getBoundingBox(0, 0, 0.6875f, 1, 1, 1), // south + AxisAlignedBB.getBoundingBox(0, 0, 0, 0.3125f, 1, 1), // west + AxisAlignedBB.getBoundingBox(0.6875f, 0, 0, 1, 1, 1), // east }; - public void addCollisionBoxesToList( - World world, int x, int y, int z, AxisAlignedBB boundingBox, List list, Entity entity) { + public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB boundingBox, List list, + Entity entity) { ForgeDirection side = ForgeDirection.getOrientation(world.getBlockMetadata(x, y, z) & 7); for (int i = 0; i < BlockArcaneDropper.COLLISION_BOXES.length; i++) { @@ -109,7 +108,12 @@ public class BlockArcaneDropper extends BlockTransparent { this.setBlockBounds(side.offsetX * -0.125f, side.offsetY * -0.125f, side.offsetZ * -0.125f, 1f, 1f, 1f); } else { this.setBlockBounds( - 0f, 0f, 0f, 1 - side.offsetX * 0.125f, 1 - side.offsetY * 0.125f, 1 - side.offsetZ * 0.125f); + 0f, + 0f, + 0f, + 1 - side.offsetX * 0.125f, + 1 - side.offsetY * 0.125f, + 1 - side.offsetZ * 0.125f); } super.addCollisionBoxesToList(world, x, y, z, boundingBox, list, entity); diff --git a/src/main/java/makeo/gadomancy/common/blocks/BlockAuraPylon.java b/src/main/java/makeo/gadomancy/common/blocks/BlockAuraPylon.java index 6874422..b80a2eb 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/BlockAuraPylon.java +++ b/src/main/java/makeo/gadomancy/common/blocks/BlockAuraPylon.java @@ -1,7 +1,7 @@ package makeo.gadomancy.common.blocks; -import cpw.mods.fml.common.network.NetworkRegistry; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.blocks.tiles.TileAuraPylon; import makeo.gadomancy.common.blocks.tiles.TileAuraPylonTop; @@ -12,6 +12,7 @@ import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.registration.RegisteredMultiblocks; import makeo.gadomancy.common.registration.RegisteredRecipes; import makeo.gadomancy.common.utils.MultiblockHelper; + import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -24,15 +25,15 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.common.items.wands.ItemWandCasting; import thaumcraft.common.lib.research.ResearchManager; +import cpw.mods.fml.common.network.NetworkRegistry; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 12.11.2015 22:26 */ @@ -83,10 +84,8 @@ public class BlockAuraPylon extends BlockContainer implements IBlockTransparent @Override public boolean canReplace(World world, int x, int y, int z, int side, ItemStack stack) { int damage = stack.getItemDamage(); - if (damage == 1 - && (y < 1 - || world.getBlock(x, y - 1, z) != RegisteredBlocks.blockAuraPylon - || world.getBlockMetadata(x, y - 1, z) != 0)) { + if (damage == 1 && (y < 1 || world.getBlock(x, y - 1, z) != RegisteredBlocks.blockAuraPylon + || world.getBlockMetadata(x, y - 1, z) != 0)) { return false; } return super.canReplace(world, x, y, z, side, stack); @@ -102,19 +101,19 @@ public class BlockAuraPylon extends BlockContainer implements IBlockTransparent } @Override - public boolean onBlockActivated( - World world, int x, int y, int z, EntityPlayer player, int side, float par7, float par8, float par9) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float par7, + float par8, float par9) { if (world.getBlockMetadata(x, y, z) != 1) { Block up = world.getBlock(x, y + 1, z); return up instanceof BlockAuraPylon && up.onBlockActivated(world, x, y + 1, z, player, side, par7, par8, par9); } ItemStack heldItem = player.getHeldItem(); - if (!world.isRemote - && heldItem != null + if (!world.isRemote && heldItem != null && heldItem.getItem() instanceof ItemWandCasting && ResearchManager.isResearchComplete( - player.getCommandSenderName(), Gadomancy.MODID.toUpperCase() + ".AURA_PYLON")) { + player.getCommandSenderName(), + Gadomancy.MODID.toUpperCase() + ".AURA_PYLON")) { TileAuraPylon tileAuraPylon = (TileAuraPylon) world.getTileEntity(x, y - 1, z); if (MultiblockHelper.isMultiblockPresent(world, x, y, z, RegisteredMultiblocks.auraPylonPattern) && !tileAuraPylon.isPartOfMultiblock() @@ -124,8 +123,12 @@ public class BlockAuraPylon extends BlockContainer implements IBlockTransparent RegisteredRecipes.costsAuraPylonMultiblock, true)) { PacketStartAnimation pkt = new PacketStartAnimation(PacketStartAnimation.ID_SPARKLE_SPREAD, x, y, z); - NetworkRegistry.TargetPoint point = - new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32); + NetworkRegistry.TargetPoint point = new NetworkRegistry.TargetPoint( + world.provider.dimensionId, + x, + y, + z, + 32); PacketHandler.INSTANCE.sendToAllAround(pkt, point); TileAuraPylon ta = (TileAuraPylon) world.getTileEntity(x, y - 1, z); ta.setTileInformation(true, false); diff --git a/src/main/java/makeo/gadomancy/common/blocks/BlockEssentiaCompressor.java b/src/main/java/makeo/gadomancy/common/blocks/BlockEssentiaCompressor.java index 97a26c6..d9726bf 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/BlockEssentiaCompressor.java +++ b/src/main/java/makeo/gadomancy/common/blocks/BlockEssentiaCompressor.java @@ -1,6 +1,5 @@ package makeo.gadomancy.common.blocks; -import cpw.mods.fml.common.network.NetworkRegistry; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.blocks.tiles.TileEssentiaCompressor; import makeo.gadomancy.common.network.PacketHandler; @@ -10,6 +9,7 @@ import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.registration.RegisteredRecipes; import makeo.gadomancy.common.research.SimpleResearchItem; import makeo.gadomancy.common.utils.ExplosionHelper; + import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -21,16 +21,15 @@ import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.items.wands.ItemWandCasting; import thaumcraft.common.lib.research.ResearchManager; +import cpw.mods.fml.common.network.NetworkRegistry; /** - * HellFirePvP@Admin - * Date: 22.04.2016 / 21:42 - * on Gadomancy - * BlockEssentiaCompressor + * HellFirePvP@Admin Date: 22.04.2016 / 21:42 on Gadomancy BlockEssentiaCompressor */ public class BlockEssentiaCompressor extends BlockContainer implements IBlockTransparent { @@ -118,63 +117,75 @@ public class BlockEssentiaCompressor extends BlockContainer implements IBlockTra } @Override - public boolean onBlockActivated( - World world, - int x, - int y, - int z, - EntityPlayer player, - int these, - float are, - float some, - float variables) { // LUL side, hitx, hity, hitz + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int these, float are, + float some, float variables) { // LUL side, hitx, hity, hitz if (world.isRemote) return false; TileEntity te = world.getTileEntity(x, y, z); if (te == null || !(te instanceof TileEssentiaCompressor)) return false; if (((TileEssentiaCompressor) te).isMultiblockFormed()) { if (!((TileEssentiaCompressor) te).isMasterTile()) { int yOffset = ((TileEssentiaCompressor) te).getMultiblockYIndex(); - return RegisteredBlocks.blockEssentiaCompressor.onBlockActivated( - world, x, y - yOffset, z, player, these, are, some, variables); + return RegisteredBlocks.blockEssentiaCompressor + .onBlockActivated(world, x, y - yOffset, z, player, these, are, some, variables); } } else { ItemStack heldItem = player.getHeldItem(); - if (heldItem != null - && heldItem.getItem() instanceof ItemWandCasting + if (heldItem != null && heldItem.getItem() instanceof ItemWandCasting && ResearchManager.isResearchComplete( - player.getCommandSenderName(), SimpleResearchItem.getFullName("ESSENTIA_COMPRESSOR"))) { + player.getCommandSenderName(), + SimpleResearchItem.getFullName("ESSENTIA_COMPRESSOR"))) { ChunkCoordinates lowest = this.findLowestCompressorBlock(world, x, y, z); boolean canForm = lowest != null && this.isMuliblockPossible(world, lowest); - if (canForm - && ThaumcraftApiHelper.consumeVisFromWandCrafting( - player.getCurrentEquippedItem(), - player, - RegisteredRecipes.costsCompressorMultiblock, - true)) { + if (canForm && ThaumcraftApiHelper.consumeVisFromWandCrafting( + player.getCurrentEquippedItem(), + player, + RegisteredRecipes.costsCompressorMultiblock, + true)) { int multiblockID = TileEssentiaCompressor.getAndIncrementNewMultiblockId(); - TileEssentiaCompressor compressor = - (TileEssentiaCompressor) world.getTileEntity(lowest.posX, lowest.posY, lowest.posZ); + TileEssentiaCompressor compressor = (TileEssentiaCompressor) world + .getTileEntity(lowest.posX, lowest.posY, lowest.posZ); compressor.setInMultiblock(true, 0, multiblockID); PacketStartAnimation pkt = new PacketStartAnimation( - PacketStartAnimation.ID_SPARKLE_SPREAD, lowest.posX, lowest.posY, lowest.posZ); + PacketStartAnimation.ID_SPARKLE_SPREAD, + lowest.posX, + lowest.posY, + lowest.posZ); NetworkRegistry.TargetPoint point = new NetworkRegistry.TargetPoint( - world.provider.dimensionId, lowest.posX, lowest.posY, lowest.posZ, 32); + world.provider.dimensionId, + lowest.posX, + lowest.posY, + lowest.posZ, + 32); PacketHandler.INSTANCE.sendToAllAround(pkt, point); - compressor = - (TileEssentiaCompressor) world.getTileEntity(lowest.posX, lowest.posY + 1, lowest.posZ); + compressor = (TileEssentiaCompressor) world + .getTileEntity(lowest.posX, lowest.posY + 1, lowest.posZ); compressor.setInMultiblock(false, 1, multiblockID); pkt = new PacketStartAnimation( - PacketStartAnimation.ID_SPARKLE_SPREAD, lowest.posX, lowest.posY + 1, lowest.posZ); + PacketStartAnimation.ID_SPARKLE_SPREAD, + lowest.posX, + lowest.posY + 1, + lowest.posZ); point = new NetworkRegistry.TargetPoint( - world.provider.dimensionId, lowest.posX, lowest.posY + 1, lowest.posZ, 32); + world.provider.dimensionId, + lowest.posX, + lowest.posY + 1, + lowest.posZ, + 32); PacketHandler.INSTANCE.sendToAllAround(pkt, point); - compressor = - (TileEssentiaCompressor) world.getTileEntity(lowest.posX, lowest.posY + 2, lowest.posZ); + compressor = (TileEssentiaCompressor) world + .getTileEntity(lowest.posX, lowest.posY + 2, lowest.posZ); compressor.setInMultiblock(false, 2, multiblockID); pkt = new PacketStartAnimation( - PacketStartAnimation.ID_SPARKLE_SPREAD, lowest.posX, lowest.posY + 2, lowest.posZ); + PacketStartAnimation.ID_SPARKLE_SPREAD, + lowest.posX, + lowest.posY + 2, + lowest.posZ); point = new NetworkRegistry.TargetPoint( - world.provider.dimensionId, lowest.posX, lowest.posY + 2, lowest.posZ, 32); + world.provider.dimensionId, + lowest.posX, + lowest.posY + 2, + lowest.posZ, + 32); PacketHandler.INSTANCE.sendToAllAround(pkt, point); } } @@ -183,8 +194,7 @@ public class BlockEssentiaCompressor extends BlockContainer implements IBlockTra } private boolean isMuliblockPossible(World world, ChunkCoordinates lowest) { - return lowest != null - && this.isMultiblockable(world, lowest.posX, lowest.posY, lowest.posZ) + return lowest != null && this.isMultiblockable(world, lowest.posX, lowest.posY, lowest.posZ) && this.isMultiblockable(world, lowest.posX, lowest.posY + 1, lowest.posZ) && this.isMultiblockable(world, lowest.posX, lowest.posY + 2, lowest.posZ); } diff --git a/src/main/java/makeo/gadomancy/common/blocks/BlockExtendedNodeJar.java b/src/main/java/makeo/gadomancy/common/blocks/BlockExtendedNodeJar.java index 9f0ec82..74c6aab 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/BlockExtendedNodeJar.java +++ b/src/main/java/makeo/gadomancy/common/blocks/BlockExtendedNodeJar.java @@ -1,13 +1,13 @@ package makeo.gadomancy.common.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; + import makeo.gadomancy.common.blocks.tiles.TileExtendedNodeJar; import makeo.gadomancy.common.items.ItemExtendedNodeJar; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.client.particle.EffectRenderer; @@ -20,19 +20,19 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import thaumcraft.common.blocks.BlockJar; import thaumcraft.common.blocks.CustomStepSound; import thaumcraft.common.config.ConfigBlocks; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * - * Original created by Azanor@Thaumcraft: thaumcraft.common.blocks.BlockJar - * Modified to create compatibility with ExtendedNodes - * Created by HellFirePvP @ 25.10.2015 22:02 + * Original created by Azanor@Thaumcraft: thaumcraft.common.blocks.BlockJar Modified to create compatibility with + * ExtendedNodes Created by HellFirePvP @ 25.10.2015 22:02 */ public class BlockExtendedNodeJar extends BlockContainer { @@ -75,8 +75,8 @@ public class BlockExtendedNodeJar extends BlockContainer { return RegisteredBlocks.rendererExtendedNodeJarBlock; } - public void onBlockHarvested( - World par1World, int par2, int par3, int par4, int par5, EntityPlayer par6EntityPlayer) { + public void onBlockHarvested(World par1World, int par2, int par3, int par4, int par5, + EntityPlayer par6EntityPlayer) { this.dropBlockAsItem(par1World, par2, par3, par4, par5, 0); super.onBlockHarvested(par1World, par2, par3, par4, par5, par6EntityPlayer); } @@ -84,20 +84,17 @@ public class BlockExtendedNodeJar extends BlockContainer { public ArrayList getDrops(World world, int x, int y, int z, int metadata, int fortune) { ArrayList drops = new ArrayList(); TileEntity te = world.getTileEntity(x, y, z); - if ((te != null) - && ((te instanceof TileExtendedNodeJar)) + if ((te != null) && ((te instanceof TileExtendedNodeJar)) && (((TileExtendedNodeJar) te).drop) && (((TileExtendedNodeJar) te).getAspects() != null)) { ItemStack drop = new ItemStack(RegisteredItems.itemExtendedNodeJar); - ((ItemExtendedNodeJar) drop.getItem()) - .setAspects(drop, ((TileExtendedNodeJar) te).getAspects().copy()); - ((ItemExtendedNodeJar) drop.getItem()) - .setNodeAttributes( - drop, - ((TileExtendedNodeJar) te).getNodeType(), - ((TileExtendedNodeJar) te).getNodeModifier(), - ((TileExtendedNodeJar) te).getExtendedNodeType(), - ((TileExtendedNodeJar) te).getId()); + ((ItemExtendedNodeJar) drop.getItem()).setAspects(drop, ((TileExtendedNodeJar) te).getAspects().copy()); + ((ItemExtendedNodeJar) drop.getItem()).setNodeAttributes( + drop, + ((TileExtendedNodeJar) te).getNodeType(), + ((TileExtendedNodeJar) te).getNodeModifier(), + ((TileExtendedNodeJar) te).getExtendedNodeType(), + ((TileExtendedNodeJar) te).getId()); ((ItemExtendedNodeJar) drop.getItem()) .setBehaviorSnapshot(drop, ((TileExtendedNodeJar) te).getBehaviorSnapshot()); drops.add(drop); @@ -115,8 +112,8 @@ public class BlockExtendedNodeJar extends BlockContainer { super.setBlockBoundsBasedOnState(world, i, j, k); } - public void addCollisionBoxesToList( - World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List arraylist, Entity par7Entity) { + public void addCollisionBoxesToList(World world, int i, int j, int k, AxisAlignedBB axisalignedbb, List arraylist, + Entity par7Entity) { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); super.addCollisionBoxesToList(world, i, j, k, axisalignedbb, arraylist, par7Entity); } diff --git a/src/main/java/makeo/gadomancy/common/blocks/BlockInfusionClaw.java b/src/main/java/makeo/gadomancy/common/blocks/BlockInfusionClaw.java index bc13cb2..39b356a 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/BlockInfusionClaw.java +++ b/src/main/java/makeo/gadomancy/common/blocks/BlockInfusionClaw.java @@ -6,6 +6,7 @@ import makeo.gadomancy.common.blocks.tiles.TileInfusionClaw; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.utils.ItemUtils; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -17,14 +18,13 @@ import net.minecraft.util.ChatComponentTranslation; import net.minecraft.world.World; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 05.10.2015 21:38 */ public class BlockInfusionClaw extends BlockTransparent { + public BlockInfusionClaw() { super(Material.rock); this.setHardness(3.5f); @@ -69,16 +69,8 @@ public class BlockInfusionClaw extends BlockTransparent { } @Override - public boolean onBlockActivated( - World world, - int x, - int y, - int z, - EntityPlayer player, - int p_149727_6_, - float p_149727_7_, - float p_149727_8_, - float p_149727_9_) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, + float p_149727_7_, float p_149727_8_, float p_149727_9_) { if (!world.isRemote) { TileInfusionClaw tile = (TileInfusionClaw) world.getTileEntity(x, y, z); if (tile.hasOwner()) { diff --git a/src/main/java/makeo/gadomancy/common/blocks/BlockKnowledgeBook.java b/src/main/java/makeo/gadomancy/common/blocks/BlockKnowledgeBook.java index 454fb6c..b1aa19b 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/BlockKnowledgeBook.java +++ b/src/main/java/makeo/gadomancy/common/blocks/BlockKnowledgeBook.java @@ -1,10 +1,12 @@ package makeo.gadomancy.common.blocks; import java.util.ArrayList; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.blocks.tiles.TileKnowledgeBook; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -16,14 +18,12 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.config.ConfigItems; /** - * HellFirePvP@Admin - * Date: 19.04.2016 / 14:52 - * on Gadomancy - * BlockKnowledgeBook + * HellFirePvP@Admin Date: 19.04.2016 / 14:52 on Gadomancy BlockKnowledgeBook */ public class BlockKnowledgeBook extends BlockContainer implements IBlockTransparent, TileKnowledgeBook.IKnowledgeProvider { @@ -54,26 +54,18 @@ public class BlockKnowledgeBook extends BlockContainer } @Override - public boolean onBlockActivated( - World world, - int x, - int y, - int z, - EntityPlayer player, - int p_149727_6_, - float p_149727_7_, - float p_149727_8_, - float p_149727_9_) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int p_149727_6_, + float p_149727_7_, float p_149727_8_, float p_149727_9_) { ItemStack thaumonomicon = new ItemStack(ConfigItems.itemThaumonomicon); ConfigItems.itemThaumonomicon.onItemRightClick(thaumonomicon, world, player); - /*if(world.isRemote) { - try { - player.openGui(Thaumcraft.instance, 12, world, x, y, z); - Minecraft.getMinecraft().theWorld.playSound(Minecraft.getMinecraft().thePlayer.posX, Minecraft.getMinecraft().thePlayer.posY, Minecraft.getMinecraft().thePlayer.posZ, "thaumcraft:page", 0.66F, 1.0F, false); - } catch (Throwable tr) { - Gadomancy.log.warn("Error on opening Thaumcraft Thaumonomicon via KnowledgeBook at world " + world.getWorldInfo().getWorldName() + ", x=" + x + ", y=" + y + ", z=" + z); - } - }*/ + /* + * if(world.isRemote) { try { player.openGui(Thaumcraft.instance, 12, world, x, y, z); + * Minecraft.getMinecraft().theWorld.playSound(Minecraft.getMinecraft().thePlayer.posX, + * Minecraft.getMinecraft().thePlayer.posY, Minecraft.getMinecraft().thePlayer.posZ, "thaumcraft:page", 0.66F, + * 1.0F, false); } catch (Throwable tr) { + * Gadomancy.log.warn("Error on opening Thaumcraft Thaumonomicon via KnowledgeBook at world " + + * world.getWorldInfo().getWorldName() + ", x=" + x + ", y=" + y + ", z=" + z); } } + */ return true; } diff --git a/src/main/java/makeo/gadomancy/common/blocks/BlockNode.java b/src/main/java/makeo/gadomancy/common/blocks/BlockNode.java index 327bac1..beb2aa3 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/BlockNode.java +++ b/src/main/java/makeo/gadomancy/common/blocks/BlockNode.java @@ -1,14 +1,13 @@ package makeo.gadomancy.common.blocks; import makeo.gadomancy.common.blocks.tiles.TileExtendedNode; + import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 22.10.2015 19:47 */ diff --git a/src/main/java/makeo/gadomancy/common/blocks/BlockNodeManipulator.java b/src/main/java/makeo/gadomancy/common/blocks/BlockNodeManipulator.java index e9775a3..8578fb7 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/BlockNodeManipulator.java +++ b/src/main/java/makeo/gadomancy/common/blocks/BlockNodeManipulator.java @@ -1,9 +1,11 @@ package makeo.gadomancy.common.blocks; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.blocks.tiles.TileNodeManipulator; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -11,16 +13,15 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.common.blocks.BlockStoneDevice; import thaumcraft.common.items.wands.ItemWandCasting; import thaumcraft.common.lib.research.ResearchManager; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 26.10.2015 19:23 */ @@ -71,8 +72,8 @@ public class BlockNodeManipulator extends BlockStoneDevice { } @Override - public boolean onBlockActivated( - World world, int x, int y, int z, EntityPlayer player, int side, float par7, float par8, float par9) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float par7, + float par8, float par9) { TileNodeManipulator tile = (TileNodeManipulator) world.getTileEntity(x, y, z); ItemStack heldItem = player.getHeldItem(); if (tile.isInMultiblock()) { diff --git a/src/main/java/makeo/gadomancy/common/blocks/BlockRemoteJar.java b/src/main/java/makeo/gadomancy/common/blocks/BlockRemoteJar.java index 0e5e99e..b5409cc 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/BlockRemoteJar.java +++ b/src/main/java/makeo/gadomancy/common/blocks/BlockRemoteJar.java @@ -2,11 +2,13 @@ package makeo.gadomancy.common.blocks; import java.util.ArrayList; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.blocks.tiles.TileRemoteJar; import makeo.gadomancy.common.blocks.tiles.TileStickyJar; import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -14,19 +16,19 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import thaumcraft.common.blocks.BlockJar; import thaumcraft.common.config.ConfigItems; import thaumcraft.common.tiles.TileJarFillable; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 14.10.2015 14:56 */ public class BlockRemoteJar extends BlockJar { + public BlockRemoteJar() { this.setCreativeTab(RegisteredItems.creativeTab); } @@ -68,13 +70,13 @@ public class BlockRemoteJar extends BlockJar { } @Override - public boolean onBlockActivated( - World world, int x, int y, int z, EntityPlayer player, int side, float these, float are, float variables) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float these, + float are, float variables) { ItemStack heldItem = player.getHeldItem(); if (heldItem != null && heldItem.getItem() == ConfigItems.itemEssence) { if (!world.isRemote) { - BlockStickyJar.handlePhial( - world, x, y, z, player, heldItem, (TileJarFillable) world.getTileEntity(x, y, z)); + BlockStickyJar + .handlePhial(world, x, y, z, player, heldItem, (TileJarFillable) world.getTileEntity(x, y, z)); } return true; } diff --git a/src/main/java/makeo/gadomancy/common/blocks/BlockStickyJar.java b/src/main/java/makeo/gadomancy/common/blocks/BlockStickyJar.java index 718478f..e10cbdf 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/BlockStickyJar.java +++ b/src/main/java/makeo/gadomancy/common/blocks/BlockStickyJar.java @@ -2,12 +2,14 @@ package makeo.gadomancy.common.blocks; import java.util.ArrayList; import java.util.Map; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.blocks.tiles.TileStickyJar; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.registration.StickyJarInfo; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; @@ -21,6 +23,7 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.IEssentiaContainerItem; @@ -30,10 +33,8 @@ import thaumcraft.common.items.ItemEssence; import thaumcraft.common.tiles.TileJarFillable; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 13.07.2015 15:42 */ @@ -214,8 +215,7 @@ public class BlockStickyJar extends BlockJar implements IBlockTransparent { ((TileStickyJar) tile).getParent().validate(); // Ugh... world.setTileEntity(x, y, z, ((TileStickyJar) tile).getParent()); // Ugh. that fix... - ArrayList drops = ((TileStickyJar) tile) - .getParentBlock() + ArrayList drops = ((TileStickyJar) tile).getParentBlock() .getDrops(world, x, y, z, ((TileStickyJar) tile).getParentMetadata(), fortune); ((TileStickyJar) tile).getParent().invalidate(); // Uhm... @@ -240,14 +240,14 @@ public class BlockStickyJar extends BlockJar implements IBlockTransparent { } @Override - public boolean onBlockActivated( - World world, int x, int y, int z, EntityPlayer player, int side, float these, float are, float variables) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float these, + float are, float variables) { TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof TileStickyJar) { TileStickyJar tileStickyJar = (TileStickyJar) tile; - StickyJarInfo info = - RegisteredBlocks.getStickyJarInfo(tileStickyJar.getParentBlock(), world.getBlockMetadata(x, y, z)); + StickyJarInfo info = RegisteredBlocks + .getStickyJarInfo(tileStickyJar.getParentBlock(), world.getBlockMetadata(x, y, z)); ItemStack heldItem = player.getHeldItem(); @@ -258,8 +258,7 @@ public class BlockStickyJar extends BlockJar implements IBlockTransparent { return true; } - boolean handleAspectFilter = info.needsLabelHandling() - && heldItem != null + boolean handleAspectFilter = info.needsLabelHandling() && heldItem != null && heldItem.getItem() == ConfigItems.itemResource && heldItem.getItemDamage() == 13 && tileStickyJar.aspectFilter == null @@ -267,8 +266,7 @@ public class BlockStickyJar extends BlockJar implements IBlockTransparent { || tileStickyJar.amount != 0); ForgeDirection newDir = tileStickyJar.changeDirection(ForgeDirection.getOrientation(side)); - boolean result = ((TileStickyJar) tile) - .getParentBlock() + boolean result = ((TileStickyJar) tile).getParentBlock() .onBlockActivated(world, x, y, z, player, newDir.ordinal(), these, are, variables); if (handleAspectFilter) { @@ -281,14 +279,13 @@ public class BlockStickyJar extends BlockJar implements IBlockTransparent { return false; } - public static void handlePhial( - World world, int x, int y, int z, EntityPlayer player, ItemStack stack, TileJarFillable tile) { + public static void handlePhial(World world, int x, int y, int z, EntityPlayer player, ItemStack stack, + TileJarFillable tile) { ItemEssence itemEssence = (ItemEssence) ConfigItems.itemEssence; AspectList aspects = itemEssence.getAspects(stack); if (aspects != null) { - Map.Entry entry = - aspects.aspects.entrySet().iterator().next(); + Map.Entry entry = aspects.aspects.entrySet().iterator().next(); Aspect jarAspect = tile.aspectFilter == null ? tile.aspect : tile.aspectFilter; diff --git a/src/main/java/makeo/gadomancy/common/blocks/BlockStoneMachine.java b/src/main/java/makeo/gadomancy/common/blocks/BlockStoneMachine.java index dc05059..6405e1c 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/BlockStoneMachine.java +++ b/src/main/java/makeo/gadomancy/common/blocks/BlockStoneMachine.java @@ -2,6 +2,7 @@ package makeo.gadomancy.common.blocks; import java.util.List; import java.util.Random; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.blocks.tiles.TileArcanePackager; import makeo.gadomancy.common.blocks.tiles.TileBlockProtector; @@ -10,6 +11,7 @@ import makeo.gadomancy.common.blocks.tiles.TileManipulatorPillar; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.utils.ItemUtils; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -27,20 +29,20 @@ import net.minecraft.util.MathHelper; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.lib.utils.InventoryUtils; import thaumcraft.common.tiles.TileJarFillable; import thaumcraft.common.tiles.TilePedestal; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 27.10.2015 13:16 */ public class BlockStoneMachine extends Block { + public BlockStoneMachine() { super(Material.rock); this.setHardness(3.0F); @@ -90,8 +92,7 @@ public class BlockStoneMachine extends Block { @Override public boolean hasTileEntity(int metadata) { - return metadata == 15 - || metadata == 0 + return metadata == 15 || metadata == 0 || metadata == 1 || metadata == 2 || metadata == 3 @@ -130,9 +131,9 @@ public class BlockStoneMachine extends Block { return new TileManipulationFocus(); } else if (metadata == 4) { return new TileArcanePackager(); - } /* else if(metadata == 5) { - return new TileAIShutdown(); - }*/ + } /* + * else if(metadata == 5) { return new TileAIShutdown(); } + */ return null; } @@ -191,8 +192,8 @@ public class BlockStoneMachine extends Block { public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase ent, ItemStack stack) { int metadata = world.getBlockMetadata(x, y, z); if (metadata == 2 || metadata == 4) { - ((TileJarFillable) world.getTileEntity(x, y, z)).facing = - MathHelper.floor_double(-ent.rotationYaw * 4.0F / 360.0F + 0.5D) & 0x3; + ((TileJarFillable) world.getTileEntity(x, y, z)).facing = MathHelper + .floor_double(-ent.rotationYaw * 4.0F / 360.0F + 0.5D) & 0x3; } } @@ -253,8 +254,8 @@ public class BlockStoneMachine extends Block { } @Override - public boolean onBlockActivated( - World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, + float hitY, float hitZ) { int metadata = world.getBlockMetadata(x, y, z); if (metadata == 0 || metadata == 3) { @@ -290,15 +291,15 @@ public class BlockStoneMachine extends Block { this.setBlockBounds(0, 0, 0, 1, 3 / 16f, 1); } else if (metadata == 4) { this.setBlockBounds(0, 0, 0, 1, 12 / 16f, 1); - } /* else if(metadata == 5) { - setBlockBounds(0, 0, 0, 1, 1, 1); - }*/ + } /* + * else if(metadata == 5) { setBlockBounds(0, 0, 0, 1, 1, 1); } + */ super.setBlockBoundsBasedOnState(world, x, y, z); } @Override - public void addCollisionBoxesToList( - World world, int x, int y, int z, AxisAlignedBB axisalignedbb, List list, Entity entity) { + public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB axisalignedbb, List list, + Entity entity) { int metadata = world.getBlockMetadata(x, y, z); if (metadata == 11 || metadata == 15 || metadata == 1) { this.setBlockBounds(0, 0, 0, 1, 1, 1); diff --git a/src/main/java/makeo/gadomancy/common/blocks/BlockTransparent.java b/src/main/java/makeo/gadomancy/common/blocks/BlockTransparent.java index dcdc0b1..f8c2de7 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/BlockTransparent.java +++ b/src/main/java/makeo/gadomancy/common/blocks/BlockTransparent.java @@ -2,16 +2,15 @@ package makeo.gadomancy.common.blocks; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.registration.RegisteredBlocks; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 29.09.2015 22:07 */ diff --git a/src/main/java/makeo/gadomancy/common/blocks/IBlockTransparent.java b/src/main/java/makeo/gadomancy/common/blocks/IBlockTransparent.java index a36cc3e..9b07484 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/IBlockTransparent.java +++ b/src/main/java/makeo/gadomancy/common/blocks/IBlockTransparent.java @@ -3,13 +3,12 @@ package makeo.gadomancy.common.blocks; import net.minecraft.util.IIcon; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 06.10.2015 21:26 */ public interface IBlockTransparent { + IIcon getTransparentIcon(); } diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/SynchronizedTileEntity.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/SynchronizedTileEntity.java index 0fbef02..94adf09 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/SynchronizedTileEntity.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/SynchronizedTileEntity.java @@ -8,10 +8,8 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 07.10.2015 18:39 */ diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAIShutdown.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAIShutdown.java index 47aedd0..56fec94 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAIShutdown.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAIShutdown.java @@ -1,11 +1,11 @@ package makeo.gadomancy.common.blocks.tiles; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; import java.util.*; + import makeo.gadomancy.client.effect.fx.Orbital; import makeo.gadomancy.common.registration.AIShutdownWhitelist; import makeo.gadomancy.common.utils.Injector; + import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.ai.EntityAIBase; @@ -16,17 +16,19 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.IAspectContainer; import thaumcraft.api.aspects.IEssentiaTransport; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 08.06.2016 22:56 */ @@ -80,8 +82,8 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon private void handleIO() { if (this.storedAmount < TileAIShutdown.MAX_AMT) { - TileEntity te = ThaumcraftApiHelper.getConnectableTile( - this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.UP); + TileEntity te = ThaumcraftApiHelper + .getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.UP); if (te != null) { IEssentiaTransport ic = (IEssentiaTransport) te; if (!ic.canOutputTo(ForgeDirection.DOWN)) { @@ -98,10 +100,10 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon private void killAI() { ChunkCoordinates cc = this.getCoords(); List objEntityList = this.worldObj.getEntitiesWithinAABB( - EntityLivingBase.class, TileAIShutdown.BOX.copy().offset(this.xCoord, this.yCoord, this.zCoord)); + EntityLivingBase.class, + TileAIShutdown.BOX.copy().offset(this.xCoord, this.yCoord, this.zCoord)); for (Object o : objEntityList) { - if (o != null - && o instanceof EntityLiving + if (o != null && o instanceof EntityLiving && !((EntityLiving) o).isDead && this.canAffect((EntityLiving) o)) { EntityLiving el = (EntityLiving) o; @@ -120,10 +122,10 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon } UUID uu = el.getUniqueID(); - List tasks = - new ArrayList(el.tasks.taskEntries); - List targetTasks = - new ArrayList(el.targetTasks.taskEntries); + List tasks = new ArrayList( + el.tasks.taskEntries); + List targetTasks = new ArrayList( + el.targetTasks.taskEntries); List> entries = AIShutdownWhitelist.getWhitelistedAIClasses(el); @@ -331,8 +333,7 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon if (TileAIShutdown.trackedEntities.containsKey(cc)) { for (AffectedEntity ae : TileAIShutdown.trackedEntities.get(cc)) { for (Object objE : world.getLoadedEntityList()) { - if (objE != null - && objE instanceof EntityLiving + if (objE != null && objE instanceof EntityLiving && !((EntityLiving) objE).isDead && ((EntityLiving) objE).getUniqueID().equals(ae.eUUID)) { ((EntityLiving) objE).tasks.taskEntries = ae.tasks; @@ -353,9 +354,7 @@ public class TileAIShutdown extends SynchronizedTileEntity implements IAspectCon public List tasks; public List targetTasks; - public AffectedEntity( - UUID eUUID, - List tasks, + public AffectedEntity(UUID eUUID, List tasks, List targetTasks) { this.eUUID = eUUID; this.tasks = tasks; diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAdditionalEldritchPortal.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAdditionalEldritchPortal.java index 912bed5..9876f01 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAdditionalEldritchPortal.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAdditionalEldritchPortal.java @@ -3,29 +3,29 @@ package makeo.gadomancy.common.blocks.tiles; import java.util.HashMap; import java.util.List; import java.util.Map; + import makeo.gadomancy.common.data.config.ModConfig; import makeo.gadomancy.common.utils.world.TCMazeHandler; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.server.MinecraftServer; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.WorldServer; + import thaumcraft.common.lib.research.ResearchManager; import thaumcraft.common.tiles.TileEldritchPortal; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 06.11.2015 23:32 */ public class TileAdditionalEldritchPortal extends TileEldritchPortal { - private static Map trackedPortalActivity = - new HashMap(); + private static Map trackedPortalActivity = new HashMap(); private EntityPlayer toTeleport; private int count; @@ -50,13 +50,12 @@ public class TileAdditionalEldritchPortal extends TileEldritchPortal { List players = this.worldObj.getEntitiesWithinAABB( EntityPlayerMP.class, AxisAlignedBB.getBoundingBox( - this.xCoord, - this.yCoord, - this.zCoord, - this.xCoord + 1, - this.yCoord + 1, - this.zCoord + 1) - .expand(0.5D, 1.0D, 0.5D)); + this.xCoord, + this.yCoord, + this.zCoord, + this.xCoord + 1, + this.yCoord + 1, + this.zCoord + 1).expand(0.5D, 1.0D, 0.5D)); if (players != null && !players.isEmpty()) { EntityPlayerMP toTeleport = players.get(0); diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileArcaneDropper.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileArcaneDropper.java index 3b8bb92..5d0b819 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileArcaneDropper.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileArcaneDropper.java @@ -2,7 +2,9 @@ package makeo.gadomancy.common.blocks.tiles; import java.util.ArrayList; import java.util.List; + import makeo.gadomancy.common.registration.RegisteredBlocks; + import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; @@ -12,17 +14,17 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.common.lib.utils.InventoryUtils; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 28.09.2015 20:13 */ public class TileArcaneDropper extends TileEntity implements ISidedInventory { + private static final double RADIUS = 1.5; private List items = new ArrayList(); @@ -222,7 +224,11 @@ public class TileArcaneDropper extends TileEntity implements ISidedInventory { @Override public boolean canInsertItem(int slot, ItemStack stack, int side) { return RegisteredBlocks.blockArcaneDropper.isSideSolid( - this.getWorldObj(), this.xCoord, this.yCoord, this.zCoord, ForgeDirection.getOrientation(side)); + this.getWorldObj(), + this.xCoord, + this.yCoord, + this.zCoord, + ForgeDirection.getOrientation(side)); } @Override diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileArcaneHand.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileArcaneHand.java index b660098..962324c 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileArcaneHand.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileArcaneHand.java @@ -1,12 +1,11 @@ package makeo.gadomancy.common.blocks.tiles; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.ModContainer; -import cpw.mods.fml.common.network.NetworkRegistry; import java.util.ArrayList; import java.util.List; import java.util.UUID; + import makeo.gadomancy.common.entities.fake.AdvancedFakePlayer; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ISidedInventory; @@ -19,15 +18,18 @@ import net.minecraft.world.World; import net.minecraft.world.WorldServer; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.ModContainer; +import cpw.mods.fml.common.network.NetworkRegistry; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 16.12.2015 11:50 */ public class TileArcaneHand extends SynchronizedTileEntity implements ISidedInventory { + private GuiFakePlayer fakePlayer; private ItemInWorldManager im; @@ -99,6 +101,7 @@ public class TileArcaneHand extends SynchronizedTileEntity implements ISidedInve } private static class GuiFakePlayer extends AdvancedFakePlayer { + private TileArcaneHand tile; public GuiFakePlayer(TileArcaneHand tile) { diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileArcanePackager.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileArcanePackager.java index 640e080..22fd2d3 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileArcanePackager.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileArcanePackager.java @@ -2,8 +2,10 @@ package makeo.gadomancy.common.blocks.tiles; import java.util.ArrayList; import java.util.List; + import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.utils.ItemUtils; + import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; @@ -12,18 +14,18 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.common.tiles.TileJarFillable; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 14.11.2015 12:22 */ public class TileArcanePackager extends TileJarFillable implements ISidedInventory { + private static final Aspect ASPECT = Aspect.CLOTH; private ItemStack[] contents = new ItemStack[12]; @@ -84,8 +86,8 @@ public class TileArcanePackager extends TileJarFillable implements ISidedInvento } } else { if (this.redstoneState == null) { - this.redstoneState = - this.worldObj.isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord); + this.redstoneState = this.worldObj + .isBlockIndirectlyGettingPowered(this.xCoord, this.yCoord, this.zCoord); } if (this.progress >= 47) { @@ -175,14 +177,18 @@ public class TileArcanePackager extends TileJarFillable implements ISidedInvento this.setInventorySlotContents(i, null); } } else { - this.worldObj.newExplosion( - null, this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5, 1, false, false); + this.worldObj + .newExplosion(null, this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5, 1, false, false); for (int i = 0; i < 9; i++) { ItemStack stack = this.contents[i]; if (stack != null) { EntityItem entityItem = new EntityItem( - this.worldObj, this.xCoord + 0.5, this.yCoord + (13 / 16f), this.zCoord + 0.5, stack); + this.worldObj, + this.xCoord + 0.5, + this.yCoord + (13 / 16f), + this.zCoord + 0.5, + stack); ItemUtils.applyRandomDropOffset(entityItem, this.worldObj.rand); this.worldObj.spawnEntityInWorld(entityItem); this.contents[i] = null; @@ -318,16 +324,16 @@ public class TileArcanePackager extends TileJarFillable implements ISidedInvento } else return slot != 11; } - private static final int[] ORIENTATION_MAPPING = {-1, -1, 0, 2, 1, 3}; + private static final int[] ORIENTATION_MAPPING = { -1, -1, 0, 2, 1, 3 }; @Override public int[] getAccessibleSlotsFromSide(int side) { if (side == 0) { - return new int[] {11}; + return new int[] { 11 }; } if (TileArcanePackager.ORIENTATION_MAPPING[side] == super.facing) { - return new int[] {9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8}; + return new int[] { 9, 10, 0, 1, 2, 3, 4, 5, 6, 7, 8 }; } return new int[0]; diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java index e8ea56c..ebab5b2 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylon.java @@ -1,12 +1,12 @@ package makeo.gadomancy.common.blocks.tiles; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; + import makeo.gadomancy.common.aura.AuraEffectHandler; import makeo.gadomancy.common.entities.EntityPermNoClipItem; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.block.Block; import net.minecraft.command.IEntitySelector; import net.minecraft.entity.Entity; @@ -17,6 +17,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MathHelper; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; @@ -27,12 +28,12 @@ import thaumcraft.client.fx.particles.FXEssentiaTrail; import thaumcraft.common.entities.EntityPermanentItem; import thaumcraft.common.entities.EntitySpecialItem; import thaumcraft.common.items.ItemCrystalEssence; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 11.11.2015 14:30 */ @@ -107,7 +108,12 @@ public class TileAuraPylon extends SynchronizedTileEntity if (!this.isMasterTile()) return; if (this.worldObj.isRemote) return; AuraEffectHandler.distributeEffects( - aspect, this.worldObj, this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5, this.ticksExisted); + aspect, + this.worldObj, + this.xCoord + 0.5, + this.yCoord + 0.5, + this.zCoord + 0.5, + this.ticksExisted); } private void drainEssentia(TileAuraPylon io) { @@ -143,10 +149,10 @@ public class TileAuraPylon extends SynchronizedTileEntity 1); essentiaTrail.noClip = true; essentiaTrail.motionY = (0.1F + MathHelper.sin(count / 3.0F) * 0.01F); - essentiaTrail.motionX = - (MathHelper.sin(count / 10.0F) * 0.001F + this.worldObj.rand.nextGaussian() * 0.002000000094994903D); - essentiaTrail.motionZ = - (MathHelper.sin(count / 10.0F) * 0.001F + this.worldObj.rand.nextGaussian() * 0.002000000094994903D); + essentiaTrail.motionX = (MathHelper.sin(count / 10.0F) * 0.001F + + this.worldObj.rand.nextGaussian() * 0.002000000094994903D); + essentiaTrail.motionZ = (MathHelper.sin(count / 10.0F) * 0.001F + + this.worldObj.rand.nextGaussian() * 0.002000000094994903D); ParticleEngine.instance.addEffect(tile.getWorldObj(), essentiaTrail); } @@ -175,26 +181,22 @@ public class TileAuraPylon extends SynchronizedTileEntity List entityItems = this.worldObj.selectEntitiesWithinAABB( EntityItem.class, AxisAlignedBB.getBoundingBox( - this.xCoord - 0.5, - yC - 0.5, - this.zCoord - 0.5, - this.xCoord + 0.5, - yC + 0.5, - this.zCoord + 0.5) - .expand(8, 8, 8), + this.xCoord - 0.5, + yC - 0.5, + this.zCoord - 0.5, + this.xCoord + 0.5, + yC + 0.5, + this.zCoord + 0.5).expand(8, 8, 8), new IEntitySelector() { + @Override public boolean isEntityApplicable(Entity e) { - return !(e instanceof EntityPermanentItem) - && !(e instanceof EntitySpecialItem) + return !(e instanceof EntityPermanentItem) && !(e instanceof EntitySpecialItem) && e instanceof EntityItem && ((EntityItem) e).getEntityItem() != null && ((EntityItem) e).getEntityItem().getItem() instanceof ItemCrystalEssence - && ((ItemCrystalEssence) ((EntityItem) e) - .getEntityItem() - .getItem()) - .getAspects(((EntityItem) e).getEntityItem()) - != null; + && ((ItemCrystalEssence) ((EntityItem) e).getEntityItem().getItem()) + .getAspects(((EntityItem) e).getEntityItem()) != null; } }); Entity dummy = new EntityItem(this.worldObj); @@ -242,8 +244,7 @@ public class TileAuraPylon extends SynchronizedTileEntity this.timeSinceLastItemInfo = 0; this.holdingAspect = ((ItemCrystalEssence) this.crystalEssentiaStack.getItem()) - .getAspects(this.crystalEssentiaStack) - .getAspects()[0]; + .getAspects(this.crystalEssentiaStack).getAspects()[0]; this.distributeAspectInformation(); if (inter.stackSize <= 0) entity.setDead(); @@ -274,11 +275,10 @@ public class TileAuraPylon extends SynchronizedTileEntity // Special to inputTile only! private void handleIO() { - if ((!this.worldObj.isRemote) - && ((this.ticksExisted & 15) == 0) + if ((!this.worldObj.isRemote) && ((this.ticksExisted & 15) == 0) && (this.getEssentiaAmount() < this.getMaxAmount())) { - TileEntity te = ThaumcraftApiHelper.getConnectableTile( - this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.DOWN); + TileEntity te = ThaumcraftApiHelper + .getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.DOWN); if (te != null) { IEssentiaTransport ic = (IEssentiaTransport) te; if (!ic.canOutputTo(ForgeDirection.UP)) { @@ -355,8 +355,12 @@ public class TileAuraPylon extends SynchronizedTileEntity if (pylon != null) { ArrayList stacks = pylon.getDrops(this.worldObj, this.xCoord, this.yCoord, this.zCoord, meta, 0); for (ItemStack i : stacks) { - EntityItem item = - new EntityItem(this.worldObj, this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5, i); + EntityItem item = new EntityItem( + this.worldObj, + this.xCoord + 0.5, + this.yCoord + 0.5, + this.zCoord + 0.5, + i); // ItemUtils.applyRandomDropOffset(item, worldObj.rand); this.worldObj.spawnEntityInWorld(item); } diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylonTop.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylonTop.java index 986ca5a..5eb4eb3 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylonTop.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileAuraPylonTop.java @@ -1,22 +1,23 @@ package makeo.gadomancy.common.blocks.tiles; import java.util.ArrayList; + import makeo.gadomancy.client.effect.EffectHandler; import makeo.gadomancy.client.effect.fx.Orbital; import makeo.gadomancy.common.registration.RegisteredBlocks; + import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.IAspectContainer; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 13.11.2015 00:01 */ @@ -43,8 +44,8 @@ public class TileAuraPylonTop extends SynchronizedTileEntity implements IAspectC if (pylon.isPartOfMultiblock() && !pylon.isMasterTile()) this.breakTile(); } else { this.shouldRender = te != null && te instanceof TileAuraPylon && ((TileAuraPylon) te).isPartOfMultiblock(); - this.shouldRenderAura = - te != null && te instanceof TileAuraPylon && ((TileAuraPylon) te).getEssentiaAmount() > 0; + this.shouldRenderAura = te != null && te instanceof TileAuraPylon + && ((TileAuraPylon) te).getEssentiaAmount() > 0; } } diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileBlockProtector.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileBlockProtector.java index 5a2fe9e..02649b5 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileBlockProtector.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileBlockProtector.java @@ -2,6 +2,7 @@ package makeo.gadomancy.common.blocks.tiles; import java.util.ArrayList; import java.util.List; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.EntityCreeper; @@ -13,6 +14,7 @@ import net.minecraft.util.Vec3; import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.IEssentiaTransport; @@ -20,14 +22,13 @@ import thaumcraft.common.Thaumcraft; import thaumcraft.common.tiles.TileJarFillable; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 08.11.2015 17:36 */ public class TileBlockProtector extends TileJarFillable { + private static final int UPDATE_TICKS = 15; private static final int MAX_RANGE = 15; private static final Aspect ASPECT = Aspect.ORDER; @@ -162,8 +163,8 @@ public class TileBlockProtector extends TileJarFillable { } if (this.range > 0) { - for (EntityLivingBase entity : (List) - this.worldObj.getEntitiesWithinAABB(EntityLivingBase.class, this.getProtectedAABB())) { + for (EntityLivingBase entity : (List) this.worldObj + .getEntitiesWithinAABB(EntityLivingBase.class, this.getProtectedAABB())) { if (entity instanceof EntityCreeper) { ((EntityCreeper) entity).timeSinceIgnited = 0; } @@ -216,8 +217,8 @@ public class TileBlockProtector extends TileJarFillable { } private void fillJar() { - TileEntity te = ThaumcraftApiHelper.getConnectableTile( - this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.DOWN); + TileEntity te = ThaumcraftApiHelper + .getConnectableTile(this.worldObj, this.xCoord, this.yCoord, this.zCoord, ForgeDirection.DOWN); if (te != null) { IEssentiaTransport ic = (IEssentiaTransport) te; if (!ic.canOutputTo(ForgeDirection.UP)) { @@ -231,8 +232,8 @@ public class TileBlockProtector extends TileJarFillable { } else if ((ic.getEssentiaAmount(ForgeDirection.UP) > 0) && (ic.getSuctionAmount(ForgeDirection.UP) < this.getSuctionAmount(ForgeDirection.DOWN)) && (this.getSuctionAmount(ForgeDirection.DOWN) >= ic.getMinimumSuction())) { - ta = ic.getEssentiaType(ForgeDirection.UP); - } + ta = ic.getEssentiaType(ForgeDirection.UP); + } if ((ta != null) && (ic.getSuctionAmount(ForgeDirection.UP) < this.getSuctionAmount(ForgeDirection.DOWN))) { this.addToContainer(ta, ic.takeEssentia(ta, 1, ForgeDirection.UP)); } @@ -268,6 +269,7 @@ public class TileBlockProtector extends TileJarFillable { public static boolean isSpotProtected(World world, final double x, final double y, final double z) { return TileBlockProtector.isSpotProtected(world, new ProtectionHelper() { + @Override public boolean checkProtection(TileBlockProtector tile) { return TileBlockProtector.isSpotProtected(tile, x, y, z); @@ -277,6 +279,7 @@ public class TileBlockProtector extends TileJarFillable { public static boolean isSpotProtected(World world, final Entity entity) { return TileBlockProtector.isSpotProtected(world, new ProtectionHelper() { + @Override public boolean checkProtection(TileBlockProtector tile) { return TileBlockProtector.isSpotProtected(tile, entity); @@ -298,6 +301,7 @@ public class TileBlockProtector extends TileJarFillable { } private interface ProtectionHelper { + boolean checkProtection(TileBlockProtector tile); } diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileEssentiaCompressor.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileEssentiaCompressor.java index 17387b0..c91515c 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileEssentiaCompressor.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileEssentiaCompressor.java @@ -1,12 +1,9 @@ package makeo.gadomancy.common.blocks.tiles; -import cpw.mods.fml.common.Optional; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.awt.*; import java.util.*; import java.util.List; + import makeo.gadomancy.client.events.ClientHandler; import makeo.gadomancy.common.network.packets.PacketAnimationAbsorb; import makeo.gadomancy.common.registration.RegisteredBlocks; @@ -14,6 +11,7 @@ import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.utils.ExplosionHelper; import makeo.gadomancy.common.utils.Injector; import makeo.gadomancy.common.utils.Vector3; + import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.entity.Entity; @@ -26,6 +24,7 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.WorldCoordinates; import thaumcraft.api.aspects.Aspect; @@ -43,19 +42,20 @@ import thaumcraft.common.lib.network.fx.PacketFXEssentiaSource; import thaumcraft.common.tiles.TilePedestal; import tuhljin.automagy.api.essentia.IAspectContainerWithMax; import tuhljin.automagy.api.essentia.IEssentiaLocusReadable; +import cpw.mods.fml.common.Optional; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 22.04.2016 21:42 */ @Optional.InterfaceList({ - @Optional.Interface(iface = "tuhljin.automagy.api.essentia.IEssentiaLocusReadable", modid = "Automagy"), - @Optional.Interface(iface = "tuhljin.automagy.api.essentia.IAspectContainerWithMax", modid = "Automagy") -}) + @Optional.Interface(iface = "tuhljin.automagy.api.essentia.IEssentiaLocusReadable", modid = "Automagy"), + @Optional.Interface(iface = "tuhljin.automagy.api.essentia.IAspectContainerWithMax", modid = "Automagy") }) public class TileEssentiaCompressor extends SynchronizedTileEntity implements IEssentiaTransport, IEssentiaLocusReadable, IAspectContainerWithMax { @@ -152,14 +152,22 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity makeo.gadomancy.common.network.PacketHandler.INSTANCE.sendToAllAround( absorb, new NetworkRegistry.TargetPoint( - this.getWorldObj().provider.dimensionId, this.xCoord, this.yCoord, this.zCoord, 16)); + this.getWorldObj().provider.dimensionId, + this.xCoord, + this.yCoord, + this.zCoord, + 16)); } else { TilePedestal te = (TilePedestal) this.worldObj.getTileEntity( - this.coordPedestal.getBlockX(), this.coordPedestal.getBlockY(), this.coordPedestal.getBlockZ()); + this.coordPedestal.getBlockX(), + this.coordPedestal.getBlockY(), + this.coordPedestal.getBlockZ()); te.setInventorySlotContents(0, null); te.markDirty(); this.worldObj.markBlockForUpdate( - this.coordPedestal.getBlockX(), this.coordPedestal.getBlockY(), this.coordPedestal.getBlockZ()); + this.coordPedestal.getBlockX(), + this.coordPedestal.getBlockY(), + this.coordPedestal.getBlockZ()); this.consumeTick = 0; this.coordPedestal = null; this.incSize += 1; @@ -183,12 +191,12 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity } private boolean checkPedestal(Vector3 coordPedestal) { - Block at = - this.worldObj.getBlock(coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ()); - int md = this.worldObj.getBlockMetadata( - coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ()); - TileEntity te = this.worldObj.getTileEntity( - coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ()); + Block at = this.worldObj + .getBlock(coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ()); + int md = this.worldObj + .getBlockMetadata(coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ()); + TileEntity te = this.worldObj + .getTileEntity(coordPedestal.getBlockX(), coordPedestal.getBlockY(), coordPedestal.getBlockZ()); if (at == null || te == null || md != 1) return false; if (!at.equals(RegisteredBlocks.blockStoneMachine) || !(te instanceof TilePedestal)) return false; ItemStack st = ((TilePedestal) te).getStackInSlot(0); @@ -233,7 +241,11 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity (byte) (this.zCoord - coordinate.z), a.getColor()), new NetworkRegistry.TargetPoint( - this.worldObj.provider.dimensionId, this.xCoord, this.yCoord + 1, this.zCoord, 32.0D)); + this.worldObj.provider.dimensionId, + this.xCoord, + this.yCoord + 1, + this.zCoord, + 32.0D)); return true; } } @@ -241,10 +253,9 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity } private int currentStorageSize() { - return TileEssentiaCompressor.STD_ASPECT_STORAGE - + this.incSize - * ((TileEssentiaCompressor.MAX_ASPECT_STORAGE - TileEssentiaCompressor.STD_ASPECT_STORAGE) - / TileEssentiaCompressor.MAX_SIZE); + return TileEssentiaCompressor.STD_ASPECT_STORAGE + this.incSize + * ((TileEssentiaCompressor.MAX_ASPECT_STORAGE - TileEssentiaCompressor.STD_ASPECT_STORAGE) + / TileEssentiaCompressor.MAX_SIZE); } private boolean canAccept(Aspect a) { @@ -330,8 +341,7 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity private List searchAndGetSources() { WorldCoordinates thisCoordinates = new WorldCoordinates(this); - Map> teSources = - new HashMap>(); + Map> teSources = new HashMap>(); this.getSourcesField(teSources); if (!teSources.containsKey(thisCoordinates)) { this.searchSources(); @@ -348,8 +358,11 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity } private void searchSources() { - WorldCoordinates thisCoord = - new WorldCoordinates(this.xCoord, this.yCoord, this.zCoord, this.worldObj.provider.dimensionId); + WorldCoordinates thisCoord = new WorldCoordinates( + this.xCoord, + this.yCoord, + this.zCoord, + this.worldObj.provider.dimensionId); List coords = new LinkedList(); for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) { this.unsafe_search(thisCoord, direction, coords); @@ -364,21 +377,19 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity .remove(coord); TileEssentiaCompressor.injEssentiaHandler.invokeMethod( "getSources", - new Class[] {World.class, WorldCoordinates.class, ForgeDirection.class, int.class}, + new Class[] { World.class, WorldCoordinates.class, ForgeDirection.class, int.class }, this.worldObj, coord, direction, 5); - List coords = ((Map>) - TileEssentiaCompressor.injEssentiaHandler.getField("sources")) - .get(coord); + List coords = ((Map>) TileEssentiaCompressor.injEssentiaHandler + .getField("sources")).get(coord); if (coords != null) { - out.addAll(((Map>) - TileEssentiaCompressor.injEssentiaHandler.getField("sources")) - .get(coord)); - ((Map>) - TileEssentiaCompressor.injEssentiaHandler.getField("sources")) - .remove(coord); + out.addAll( + ((Map>) TileEssentiaCompressor.injEssentiaHandler + .getField("sources")).get(coord)); + ((Map>) TileEssentiaCompressor.injEssentiaHandler + .getField("sources")).remove(coord); } } @@ -398,8 +409,8 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity Vec3 v1 = Vec3.createVectorHelper(this.xCoord + 0.5D, this.yCoord + 1.5D, this.zCoord + 0.5D); Vec3 v2 = Vec3.createVectorHelper(tx + 0.5D, ty + 0.5D, tz + 0.5D); - MovingObjectPosition mop = - ThaumcraftApiHelper.rayTraceIgnoringSource(this.worldObj, v1, v2, true, false, false); + MovingObjectPosition mop = ThaumcraftApiHelper + .rayTraceIgnoringSource(this.worldObj, v1, v2, true, false, false); if ((mop != null) && (this.getDistanceFrom(mop.blockX, mop.blockY, mop.blockZ) < 16.0D)) { tx = mop.blockX; ty = mop.blockY; @@ -407,8 +418,8 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity Block bi = this.worldObj.getBlock(tx, ty, tz); int md = this.worldObj.getBlockMetadata(tx, ty, tz); if (!bi.isAir(this.worldObj, tx, ty, tz)) { - Thaumcraft.proxy.hungryNodeFX( - this.worldObj, tx, ty, tz, this.xCoord, this.yCoord + 1, this.zCoord, bi, md); + Thaumcraft.proxy + .hungryNodeFX(this.worldObj, tx, ty, tz, this.xCoord, this.yCoord + 1, this.zCoord, bi, md); } } } @@ -451,13 +462,12 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity List entities = this.worldObj.getEntitiesWithinAABB( Entity.class, AxisAlignedBB.getBoundingBox( - this.xCoord - 0.5, - this.yCoord - 0.5, - this.zCoord - 0.5, - this.xCoord + 0.5, - this.yCoord + 0.5, - this.zCoord + 0.5) - .expand(4, 4, 4)); + this.xCoord - 0.5, + this.yCoord - 0.5, + this.zCoord - 0.5, + this.xCoord + 0.5, + this.yCoord + 0.5, + this.zCoord + 0.5).expand(4, 4, 4)); for (Object o : entities) { if (o == null || !(o instanceof Entity) || ((Entity) o).isDead) continue; this.applyMovementVectors((Entity) o); @@ -699,8 +709,7 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity @Override public boolean canInputFrom(ForgeDirection direction) { if (this.isMultiblockFormed() && this.multiblockYIndex == 1) { // The middle one - return direction == ForgeDirection.SOUTH - || direction == ForgeDirection.NORTH + return direction == ForgeDirection.SOUTH || direction == ForgeDirection.NORTH || direction == ForgeDirection.EAST || direction == ForgeDirection.WEST; } @@ -710,8 +719,7 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity @Override public boolean canOutputTo(ForgeDirection direction) { if (this.isMultiblockFormed() && this.multiblockYIndex == 1) { // The middle one - return direction == ForgeDirection.SOUTH - || direction == ForgeDirection.NORTH + return direction == ForgeDirection.SOUTH || direction == ForgeDirection.NORTH || direction == ForgeDirection.EAST || direction == ForgeDirection.WEST; } @@ -723,10 +731,11 @@ public class TileEssentiaCompressor extends SynchronizedTileEntity @Override public Aspect getSuctionType(ForgeDirection direction) { - /*if(isMultiblockFormed() && multiblockYIndex == 1) { //The middle one - List copyList = new ArrayList(Aspect.aspects.values()); - return copyList.get((int) ((System.currentTimeMillis() / 20) % copyList.size())); - }*/ + /* + * if(isMultiblockFormed() && multiblockYIndex == 1) { //The middle one List copyList = new + * ArrayList(Aspect.aspects.values()); return copyList.get((int) ((System.currentTimeMillis() / 20) % + * copyList.size())); } + */ return null; } diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileExtendedNode.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileExtendedNode.java index 68b9cc8..d0522f5 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileExtendedNode.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileExtendedNode.java @@ -1,7 +1,7 @@ package makeo.gadomancy.common.blocks.tiles; -import cpw.mods.fml.common.network.NetworkRegistry; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.network.PacketHandler; import makeo.gadomancy.common.network.packets.PacketTCNodeBolt; @@ -9,6 +9,7 @@ import makeo.gadomancy.common.node.ExtendedNodeType; import makeo.gadomancy.common.node.GrowingNodeBehavior; import makeo.gadomancy.common.utils.ExplosionHelper; import makeo.gadomancy.common.utils.ResearchHelper; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; @@ -18,6 +19,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import net.minecraft.world.EnumDifficulty; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.IEssentiaContainerItem; import thaumcraft.common.entities.EntityAspectOrb; @@ -26,12 +28,11 @@ import thaumcraft.common.items.ItemCrystalEssence; import thaumcraft.common.items.ItemManaBean; import thaumcraft.common.items.ItemWispEssence; import thaumcraft.common.tiles.TileNode; +import cpw.mods.fml.common.network.NetworkRegistry; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 21.10.2015 23:39 */ @@ -87,19 +88,19 @@ public class TileExtendedNode extends TileNode { List livingEntities = this.worldObj.getEntitiesWithinAABB( EntityLivingBase.class, AxisAlignedBB.getBoundingBox( - this.xCoord, - this.yCoord, - this.zCoord, - this.xCoord + 1, - this.yCoord + 1, - this.zCoord + 1) - .expand(6.0D, 6.0D, 6.0D)); + this.xCoord, + this.yCoord, + this.zCoord, + this.xCoord + 1, + this.yCoord + 1, + this.zCoord + 1).expand(6.0D, 6.0D, 6.0D)); if ((livingEntities != null) && (livingEntities.size() > 0)) { for (Object e : livingEntities) { EntityLivingBase livingEntity = (EntityLivingBase) e; if ((livingEntity.isEntityAlive()) && (!livingEntity.isEntityInvulnerable())) { if (livingEntity instanceof EntityPlayer - && ((EntityPlayer) livingEntity).capabilities.isCreativeMode) continue; + && ((EntityPlayer) livingEntity).capabilities.isCreativeMode) + continue; if (!this.behavior.mayZapNow()) continue; ResearchHelper.distributeResearch( @@ -113,7 +114,12 @@ public class TileExtendedNode extends TileNode { livingEntity.attackEntityFrom(DamageSource.magic, this.behavior.getZapDamage()); this.worldObj.playSoundEffect( - this.xCoord + 0.5, this.yCoord + 0.5, this.zCoord + 0.5, "thaumcraft:zap", 0.8F, 1.0F); + this.xCoord + 0.5, + this.yCoord + 0.5, + this.zCoord + 0.5, + "thaumcraft:zap", + 0.8F, + 1.0F); PacketTCNodeBolt packet = new PacketTCNodeBolt( this.xCoord + 0.5F, @@ -127,7 +133,11 @@ public class TileExtendedNode extends TileNode { PacketHandler.INSTANCE.sendToAllAround( packet, new NetworkRegistry.TargetPoint( - this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord, 32.0D)); + this.worldObj.provider.dimensionId, + this.xCoord, + this.yCoord, + this.zCoord, + 32.0D)); } } } @@ -139,6 +149,7 @@ public class TileExtendedNode extends TileNode { if (this.extendedNodeType == null || this.extendedNodeType != ExtendedNodeType.GROWING) return needUpdate; needUpdate = this.doVortex(EntityAspectOrb.class, needUpdate, new GrowingNodeVortexRunnable() { + @Override public Aspect getAspect(EntityAspectOrb entity) { return entity.getAspect(); @@ -150,6 +161,7 @@ public class TileExtendedNode extends TileNode { } }); needUpdate = this.doVortex(EntityItem.class, needUpdate, new GrowingNodeVortexRunnable() { + @Override public boolean doesVortex(EntityItem entity) { return entity.getEntityItem().getItem() instanceof ItemWispEssence @@ -159,8 +171,7 @@ public class TileExtendedNode extends TileNode { @Override public Aspect getAspect(EntityItem entity) { - IEssentiaContainerItem container = - (IEssentiaContainerItem) entity.getEntityItem().getItem(); + IEssentiaContainerItem container = (IEssentiaContainerItem) entity.getEntityItem().getItem(); return container.getAspects(entity.getEntityItem()).getAspects().length > 0 ? container.getAspects(entity.getEntityItem()).getAspects()[0] : null; @@ -176,6 +187,7 @@ public class TileExtendedNode extends TileNode { } }); needUpdate = this.doVortex(EntityWisp.class, needUpdate, new GrowingNodeVortexRunnable() { + @Override public Aspect getAspect(EntityWisp entity) { return Aspect.getAspect(entity.getType()); @@ -224,18 +236,17 @@ public class TileExtendedNode extends TileNode { } } - private boolean doVortex( - Class entityClass, boolean needUpdate, GrowingNodeVortexRunnable runnable) { + private boolean doVortex(Class entityClass, boolean needUpdate, + GrowingNodeVortexRunnable runnable) { List entities = this.worldObj.getEntitiesWithinAABB( entityClass, AxisAlignedBB.getBoundingBox( - this.xCoord, - this.yCoord, - this.zCoord, - this.xCoord + 1, - this.yCoord + 1, - this.zCoord + 1) - .expand(15.0D, 15.0D, 15.0D)); + this.xCoord, + this.yCoord, + this.zCoord, + this.xCoord + 1, + this.yCoord + 1, + this.zCoord + 1).expand(15.0D, 15.0D, 15.0D)); if ((entities != null) && (entities.size() > 0)) { for (Object eObj : entities) { E entity = (E) eObj; diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileExtendedNodeJar.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileExtendedNodeJar.java index 4619ec9..728f68a 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileExtendedNodeJar.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileExtendedNodeJar.java @@ -2,6 +2,7 @@ package makeo.gadomancy.common.blocks.tiles; import makeo.gadomancy.common.node.ExtendedNodeType; import makeo.gadomancy.common.utils.Injector; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -9,6 +10,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.nodes.NodeModifier; @@ -19,14 +21,11 @@ import thaumcraft.common.tiles.TileJarNode; import thaumcraft.common.tiles.TileNode; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

- * Original created by Azanor@Thaumcraft: thaumcraft.common.tiles.TileJar - * Modified to create compatibility with ExtendedNodes - * Created by HellFirePvP @ 25.10.2015 22:50 + * Original created by Azanor@Thaumcraft: thaumcraft.common.tiles.TileJar Modified to create compatibility with + * ExtendedNodes Created by HellFirePvP @ 25.10.2015 22:50 */ public class TileExtendedNodeJar extends TileJarNode { @@ -96,16 +95,11 @@ public class TileExtendedNodeJar extends TileJarNode { } } nbttagcompound.setByte("type", (byte) this.getNodeType().ordinal()); - nbttagcompound.setByte( - "modifier", - this.getNodeModifier() == null - ? -1 - : (byte) this.getNodeModifier().ordinal()); + nbttagcompound + .setByte("modifier", this.getNodeModifier() == null ? -1 : (byte) this.getNodeModifier().ordinal()); nbttagcompound.setByte( "extendedNodeType", - this.getExtendedNodeType() == null - ? -1 - : (byte) this.getExtendedNodeType().ordinal()); + this.getExtendedNodeType() == null ? -1 : (byte) this.getExtendedNodeType().ordinal()); if (this.behaviorSnapshot != null) { nbttagcompound.setTag("Behavior", this.behaviorSnapshot); } @@ -225,7 +219,12 @@ public class TileExtendedNodeJar extends TileJarNode { for (int xx = -1; xx < 2; xx++) { for (int zz = -1; zz < 2; zz++) { Thaumcraft.proxy.blockSparkle( - this.worldObj, this.xCoord + xx, this.yCoord + yy, this.zCoord + zz, -9999, 5); + this.worldObj, + this.xCoord + xx, + this.yCoord + yy, + this.zCoord + zz, + -9999, + 5); } } } @@ -238,8 +237,8 @@ public class TileExtendedNodeJar extends TileJarNode { public boolean drop = true; - public int onWandRightClick( - World world, ItemStack wandstack, EntityPlayer player, int x, int y, int z, int side, int md) { + public int onWandRightClick(World world, ItemStack wandstack, EntityPlayer player, int x, int y, int z, int side, + int md) { if (!world.isRemote) { this.drop = false; world.setBlock(x, y, z, ConfigBlocks.blockAiry, 0, 3); diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileInfusionClaw.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileInfusionClaw.java index 4644d73..c5cde93 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileInfusionClaw.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileInfusionClaw.java @@ -1,13 +1,10 @@ package makeo.gadomancy.common.blocks.tiles; -import cpw.mods.fml.common.ObfuscationReflectionHelper; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.io.File; import java.util.ArrayList; import java.util.Random; import java.util.UUID; + import makeo.gadomancy.api.ClickBehavior; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.entities.fake.AdvancedFakePlayer; @@ -15,6 +12,7 @@ import makeo.gadomancy.common.network.PacketHandler; import makeo.gadomancy.common.network.packets.PacketStartAnimation; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.client.Minecraft; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -28,6 +26,7 @@ import net.minecraft.world.WorldServer; import net.minecraft.world.storage.IPlayerFileData; import net.minecraft.world.storage.SaveHandler; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.Thaumcraft; @@ -35,28 +34,26 @@ import thaumcraft.common.config.ConfigItems; import thaumcraft.common.items.wands.ItemWandCasting; import thaumcraft.common.items.wands.foci.ItemFocusPrimal; import thaumcraft.common.lib.research.ResearchManager; +import cpw.mods.fml.common.ObfuscationReflectionHelper; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 05.10.2015 22:32 */ public class TileInfusionClaw extends SynchronizedTileEntity implements ISidedInventory { + private static final UUID FAKE_UUID = UUID.fromString("b23c8c3f-d7bd-49b3-970a-8e86728bab82"); private static final Random RANDOM = new Random(); private static final ItemWandCasting WAND_ITEM = (ItemWandCasting) ConfigItems.itemWandCasting; private static final ItemFocusPrimal WAND_FOCUS = (ItemFocusPrimal) ConfigItems.itemFocusPrimal; - private static final AspectList MAX_WAND_COST = new AspectList() - .add(Aspect.WATER, 250) - .add(Aspect.AIR, 250) - .add(Aspect.EARTH, 250) - .add(Aspect.FIRE, 250) - .add(Aspect.ORDER, 250) - .add(Aspect.ENTROPY, 250); + private static final AspectList MAX_WAND_COST = new AspectList().add(Aspect.WATER, 250).add(Aspect.AIR, 250) + .add(Aspect.EARTH, 250).add(Aspect.FIRE, 250).add(Aspect.ORDER, 250).add(Aspect.ENTROPY, 250); private ItemInWorldManager im; private Boolean redstoneState; @@ -73,12 +70,8 @@ public class TileInfusionClaw extends SynchronizedTileEntity implements ISidedIn public float lastRenderTick; /** - * 0-3: heightMov sides - * 4-7: widthMov sides - * 8: sides exp. speed - * 9: center exp. speed - * 10: rotation center - * 11: primal orb offset + * 0-3: heightMov sides 4-7: widthMov sides 8: sides exp. speed 9: center exp. speed 10: rotation center 11: primal + * orb offset */ @SideOnly(Side.CLIENT) public float[] animationStates; @@ -194,13 +187,11 @@ public class TileInfusionClaw extends SynchronizedTileEntity implements ISidedIn if (this.research == null) { Thaumcraft.proxy.getCompletedResearch().put(fakePlayer.getCommandSenderName(), new ArrayList()); - IPlayerFileData playerNBTManagerObj = MinecraftServer.getServer() - .worldServerForDimension(0) - .getSaveHandler() - .getSaveHandler(); + IPlayerFileData playerNBTManagerObj = MinecraftServer.getServer().worldServerForDimension(0) + .getSaveHandler().getSaveHandler(); SaveHandler sh = (SaveHandler) playerNBTManagerObj; - File dir = ObfuscationReflectionHelper.getPrivateValue( - SaveHandler.class, sh, "playersDirectory", "field_75771_c"); + File dir = ObfuscationReflectionHelper + .getPrivateValue(SaveHandler.class, sh, "playersDirectory", "field_75771_c"); File file1 = new File(dir, this.player + ".thaum"); File file2 = new File(dir, this.player + ".thaumbak"); ResearchManager.loadPlayerData(fakePlayer, file1, file2, false); @@ -209,11 +200,9 @@ public class TileInfusionClaw extends SynchronizedTileEntity implements ISidedIn } } - Thaumcraft.proxy - .getCompletedResearch() - .put( - fakePlayer.getCommandSenderName(), - this.research == null ? new ArrayList() : this.research); + Thaumcraft.proxy.getCompletedResearch().put( + fakePlayer.getCommandSenderName(), + this.research == null ? new ArrayList() : this.research); } public String getOwner() { @@ -226,8 +215,8 @@ public class TileInfusionClaw extends SynchronizedTileEntity implements ISidedIn private void startClickBlock() { if (!this.isRunning()) { - ClickBehavior behavior = - this.getClickBehavior(this.getWorldObj(), this.xCoord, this.yCoord - 1, this.zCoord); + ClickBehavior behavior = this + .getClickBehavior(this.getWorldObj(), this.xCoord, this.yCoord - 1, this.zCoord); if (behavior != null && (!behavior.hasVisCost() || this.hasSufficientVis())) { this.startRunning(); } @@ -278,14 +267,22 @@ public class TileInfusionClaw extends SynchronizedTileEntity implements ISidedIn fakePlayer.setHeldItem(this.wandStack); this.im.activateBlockOrUseItem( - fakePlayer, world, this.wandStack, x, y, z, ForgeDirection.UP.ordinal(), 0.5F, 0.5F, 0.5F); + fakePlayer, + world, + this.wandStack, + x, + y, + z, + ForgeDirection.UP.ordinal(), + 0.5F, + 0.5F, + 0.5F); this.addInstability(behavior); } } private ClickBehavior getClickBehavior(World world, int x, int y, int z) { - if (y >= 0 - && !world.isRemote + if (y >= 0 && !world.isRemote && world instanceof WorldServer && this.hasOwner() && !world.isAirBlock(x, y, z) @@ -324,8 +321,7 @@ public class TileInfusionClaw extends SynchronizedTileEntity implements ISidedIn instability -= Math.floor((maxVis > 300 ? 300 : maxVis) / 300f * 10f); instability -= TileInfusionClaw.WAND_ITEM.isStaff(this.wandStack) ? 6 : -1; - instability += - Math.floor((TileInfusionClaw.WAND_ITEM.getCap(this.wandStack).getBaseCostModifier() - 0.4) * 3); + instability += Math.floor((TileInfusionClaw.WAND_ITEM.getCap(this.wandStack).getBaseCostModifier() - 0.4) * 3); instability -= TileInfusionClaw.WAND_ITEM.getCap(this.wandStack) == ConfigItems.WAND_CAP_VOID ? 3 : 0; instability -= TileInfusionClaw.WAND_ITEM.getRod(this.wandStack) == ConfigItems.STAFF_ROD_PRIMAL ? 6 : 0; @@ -334,15 +330,18 @@ public class TileInfusionClaw extends SynchronizedTileEntity implements ISidedIn } private boolean hasSufficientVis() { - return this.wandStack != null - && this.wandStack.stackSize > 0 - && TileInfusionClaw.WAND_ITEM.consumeAllVis( - this.wandStack, null, TileInfusionClaw.MAX_WAND_COST, false, false); + return this.wandStack != null && this.wandStack.stackSize > 0 + && TileInfusionClaw.WAND_ITEM + .consumeAllVis(this.wandStack, null, TileInfusionClaw.MAX_WAND_COST, false, false); } private void consumeVis(EntityPlayer player) { TileInfusionClaw.WAND_ITEM.consumeAllVis( - this.wandStack, player, TileInfusionClaw.WAND_FOCUS.getVisCost(this.wandStack), true, false); + this.wandStack, + player, + TileInfusionClaw.WAND_FOCUS.getVisCost(this.wandStack), + true, + false); this.markForUpdate(); } @@ -422,7 +421,7 @@ public class TileInfusionClaw extends SynchronizedTileEntity implements ISidedIn @Override public int[] getAccessibleSlotsFromSide(int side) { - return new int[] {0}; + return new int[] { 0 }; } @Override diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileKnowledgeBook.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileKnowledgeBook.java index 0a5084b..adb30c3 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileKnowledgeBook.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileKnowledgeBook.java @@ -1,14 +1,13 @@ package makeo.gadomancy.common.blocks.tiles; -import cpw.mods.fml.common.network.NetworkRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.*; + import makeo.gadomancy.client.util.UtilsFX; import makeo.gadomancy.common.entities.EntityPermNoClipItem; import makeo.gadomancy.common.network.PacketHandler; import makeo.gadomancy.common.network.packets.PacketStartAnimation; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.command.IEntitySelector; @@ -22,6 +21,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.IAspectContainer; @@ -33,12 +33,12 @@ import thaumcraft.common.items.ItemResearchNotes; import thaumcraft.common.lib.events.EssentiaHandler; import thaumcraft.common.lib.research.ResearchManager; import thaumcraft.common.lib.research.ResearchNoteData; +import cpw.mods.fml.common.network.NetworkRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * HellFirePvP@Admin - * Date: 19.04.2016 / 14:53 - * on Gadomancy - * TileKnowledgeBook + * HellFirePvP@Admin Date: 19.04.2016 / 14:53 on Gadomancy TileKnowledgeBook */ public class TileKnowledgeBook extends SynchronizedTileEntity implements EntityPermNoClipItem.IItemMasterTile, IAspectContainer { @@ -157,14 +157,11 @@ public class TileKnowledgeBook extends SynchronizedTileEntity this.ticksEnvironmentCheck = 200; this.surroundingKnowledge = 0; for (int xx = -TileKnowledgeBook.SURROUNDINGS_SEARCH_XZ; xx <= TileKnowledgeBook.SURROUNDINGS_SEARCH_XZ; xx++) { - for (int zz = -TileKnowledgeBook.SURROUNDINGS_SEARCH_XZ; - zz <= TileKnowledgeBook.SURROUNDINGS_SEARCH_XZ; - zz++) { + for (int zz = -TileKnowledgeBook.SURROUNDINGS_SEARCH_XZ; zz + <= TileKnowledgeBook.SURROUNDINGS_SEARCH_XZ; zz++) { - lblYLoop: - for (int yy = -TileKnowledgeBook.SURROUNDINGS_SEARCH_Y; - yy <= TileKnowledgeBook.SURROUNDINGS_SEARCH_Y; - yy++) { + lblYLoop: for (int yy = -TileKnowledgeBook.SURROUNDINGS_SEARCH_Y; yy + <= TileKnowledgeBook.SURROUNDINGS_SEARCH_Y; yy++) { int absX = xx + this.xCoord; int absY = yy + this.yCoord; int absZ = zz + this.zCoord; @@ -174,11 +171,11 @@ public class TileKnowledgeBook extends SynchronizedTileEntity if (at.equals(Blocks.bookshelf)) { this.surroundingKnowledge += 1; } else if (te != null && te instanceof IKnowledgeProvider) { - this.surroundingKnowledge += - ((IKnowledgeProvider) te).getProvidedKnowledge(this.worldObj, absX, absY, absZ); + this.surroundingKnowledge += ((IKnowledgeProvider) te) + .getProvidedKnowledge(this.worldObj, absX, absY, absZ); } else if (at instanceof IKnowledgeProvider) { - this.surroundingKnowledge += - ((IKnowledgeProvider) at).getProvidedKnowledge(this.worldObj, absX, absY, absZ); + this.surroundingKnowledge += ((IKnowledgeProvider) at) + .getProvidedKnowledge(this.worldObj, absX, absY, absZ); } else { for (BlockSnapshot sn : TileKnowledgeBook.knowledgeIncreaseMap.keySet()) { if (sn.block.equals(at) && sn.metadata == meta) { @@ -263,8 +260,11 @@ public class TileKnowledgeBook extends SynchronizedTileEntity private void finishResearch() { this.stopResearch(); this.scheduleFinishItemChange(); - PacketStartAnimation packet = - new PacketStartAnimation(PacketStartAnimation.ID_SPARKLE_SPREAD, this.xCoord, this.yCoord, this.zCoord); + PacketStartAnimation packet = new PacketStartAnimation( + PacketStartAnimation.ID_SPARKLE_SPREAD, + this.xCoord, + this.yCoord, + this.zCoord); PacketHandler.INSTANCE.sendToAllAround(packet, this.getTargetPoint(32)); this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); this.markDirty(); @@ -272,11 +272,16 @@ public class TileKnowledgeBook extends SynchronizedTileEntity private NetworkRegistry.TargetPoint getTargetPoint(double radius) { return new NetworkRegistry.TargetPoint( - this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord, radius); + this.worldObj.provider.dimensionId, + this.xCoord, + this.yCoord, + this.zCoord, + radius); } private void scheduleFinishItemChange() { this.scheduledTask = new EntityPermNoClipItem.ItemChangeTask() { + @Override public void changeItem(EntityPermNoClipItem item) { ItemStack stack = item.getEntityItem(); @@ -318,8 +323,8 @@ public class TileKnowledgeBook extends SynchronizedTileEntity AspectList workResearchList = new AspectList(); for (Aspect a : researchTags.aspects.keySet()) { int value = researchTags.aspects.get(a); - int newVal = - (int) Math.max(TileKnowledgeBook.LOWEST_AMOUNT, ((double) value) * TileKnowledgeBook.MULTIPLIER); + int newVal = (int) Math + .max(TileKnowledgeBook.LOWEST_AMOUNT, ((double) value) * TileKnowledgeBook.MULTIPLIER); workResearchList.add(a, newVal); } this.workResearchAspects = workResearchList; @@ -374,18 +379,17 @@ public class TileKnowledgeBook extends SynchronizedTileEntity List entityItems = this.worldObj.selectEntitiesWithinAABB( EntityItem.class, AxisAlignedBB.getBoundingBox( - this.xCoord - 0.5, - centerY - 0.5, - this.zCoord - 0.5, - this.xCoord + 0.5, - centerY + 0.5, - this.zCoord + 0.5) - .expand(8, 8, 8), + this.xCoord - 0.5, + centerY - 0.5, + this.zCoord - 0.5, + this.xCoord + 0.5, + centerY + 0.5, + this.zCoord + 0.5).expand(8, 8, 8), new IEntitySelector() { + @Override public boolean isEntityApplicable(Entity e) { - return !(e instanceof EntityPermanentItem) - && !(e instanceof EntitySpecialItem) + return !(e instanceof EntityPermanentItem) && !(e instanceof EntitySpecialItem) && e instanceof EntityItem && ((EntityItem) e).getEntityItem() != null && ((EntityItem) e).getEntityItem().getItem() instanceof ItemResearchNotes @@ -589,8 +593,8 @@ public class TileKnowledgeBook extends SynchronizedTileEntity float f1 = this.field_145932_k; do { - this.field_145932_k += - (float) (TileKnowledgeBook.rand.nextInt(4) - TileKnowledgeBook.rand.nextInt(4)); + this.field_145932_k += (float) (TileKnowledgeBook.rand.nextInt(4) + - TileKnowledgeBook.rand.nextInt(4)); } while (f1 == this.field_145932_k); } } else { diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileManipulationFocus.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileManipulationFocus.java index 41967ef..45a6a2f 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileManipulationFocus.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileManipulationFocus.java @@ -3,14 +3,13 @@ package makeo.gadomancy.common.blocks.tiles; import net.minecraft.tileentity.TileEntity; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 28.10.2015 16:27 */ public class TileManipulationFocus extends TileEntity { + @Override public boolean canUpdate() { return false; diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileManipulatorPillar.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileManipulatorPillar.java index 316ba88..99febbd 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileManipulatorPillar.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileManipulatorPillar.java @@ -3,10 +3,8 @@ package makeo.gadomancy.common.blocks.tiles; import thaumcraft.common.tiles.TileInfusionPillar; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 27.10.2015 13:21 */ diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileNodeManipulator.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileNodeManipulator.java index 63d30b0..673ea04 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileNodeManipulator.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileNodeManipulator.java @@ -1,7 +1,7 @@ package makeo.gadomancy.common.blocks.tiles; -import cpw.mods.fml.common.network.NetworkRegistry; import java.util.*; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.network.PacketHandler; import makeo.gadomancy.common.network.packets.PacketStartAnimation; @@ -13,6 +13,7 @@ import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.registration.RegisteredMultiblocks; import makeo.gadomancy.common.registration.RegisteredRecipes; import makeo.gadomancy.common.utils.MultiblockHelper; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -22,6 +23,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.Vec3; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.nodes.INode; @@ -31,12 +33,11 @@ import thaumcraft.common.items.wands.ItemWandCasting; import thaumcraft.common.lib.utils.InventoryUtils; import thaumcraft.common.tiles.TilePedestal; import thaumcraft.common.tiles.TileWandPedestal; +import cpw.mods.fml.common.network.NetworkRegistry; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 26.10.2015 20:16 */ @@ -83,14 +84,13 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { RegisteredMultiblocks.completeNodeManipulatorMultiblock)) { this.multiblockType = MultiblockType.NODE_MANIPULATOR; } else if (MultiblockHelper.isMultiblockPresent( - this.worldObj, - this.xCoord, - this.yCoord, - this.zCoord, - RegisteredMultiblocks.completeEldritchPortalCreator) - && this.checkEldritchEyes(false)) { - this.multiblockType = MultiblockType.E_PORTAL_CREATOR; - } + this.worldObj, + this.xCoord, + this.yCoord, + this.zCoord, + RegisteredMultiblocks.completeEldritchPortalCreator) && this.checkEldritchEyes(false)) { + this.multiblockType = MultiblockType.E_PORTAL_CREATOR; + } } if (this.multiblockType == null) { this.breakMultiblock(); @@ -133,10 +133,8 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { int validPedestalsFound = 0; - labelIt: - for (int xDiff = -8; xDiff <= 8; xDiff++) { - labelZ: - for (int zDiff = -8; zDiff <= 8; zDiff++) { + labelIt: for (int xDiff = -8; xDiff <= 8; xDiff++) { + labelZ: for (int zDiff = -8; zDiff <= 8; zDiff++) { for (int yDiff = -5; yDiff <= 10; yDiff++) { int itX = this.xCoord + xDiff; int itY = this.yCoord + yDiff; @@ -145,8 +143,7 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { Block block = this.worldObj.getBlock(itX, itY, itZ); int meta = this.worldObj.getBlockMetadata(itX, itY, itZ); TileEntity te = this.worldObj.getTileEntity(itX, itY, itZ); - if (block != null - && block.equals(RegisteredBlocks.blockStoneMachine) + if (block != null && block.equals(RegisteredBlocks.blockStoneMachine) && meta == 1 && te != null && te instanceof TilePedestal @@ -174,7 +171,11 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { if (this.workTick < 400) { if ((this.workTick & 15) == 0) { PacketStartAnimation packet = new PacketStartAnimation( - PacketStartAnimation.ID_RUNES, this.xCoord, this.yCoord, this.zCoord, (byte) 1); + PacketStartAnimation.ID_RUNES, + this.xCoord, + this.yCoord, + this.zCoord, + (byte) 1); PacketHandler.INSTANCE.sendToAllAround(packet, this.getTargetPoint(32)); } if ((this.workTick & 7) == 0) { @@ -182,10 +183,13 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { try { ChunkCoordinates cc = this.bufferedCCPedestals.get(index); PacketStartAnimation packet = new PacketStartAnimation( - PacketStartAnimation.ID_RUNES, cc.posX, cc.posY, cc.posZ, (byte) 1); + PacketStartAnimation.ID_RUNES, + cc.posX, + cc.posY, + cc.posZ, + (byte) 1); PacketHandler.INSTANCE.sendToAllAround(packet, this.getTargetPoint(32)); - } catch (Exception exc) { - } + } catch (Exception exc) {} } if (this.worldObj.rand.nextBoolean()) { Vec3 rel = this.getRelPillarLoc(this.worldObj.rand.nextInt(4)); @@ -230,8 +234,8 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { this.worldObj.removeTileEntity(this.xCoord, this.yCoord + 2, this.zCoord); this.worldObj.setBlockToAir(this.xCoord, this.yCoord + 2, this.zCoord); - this.worldObj.setBlock( - this.xCoord, this.yCoord + 2, this.zCoord, RegisteredBlocks.blockAdditionalEldrichPortal); + this.worldObj + .setBlock(this.xCoord, this.yCoord + 2, this.zCoord, RegisteredBlocks.blockAdditionalEldrichPortal); this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord + 2, this.zCoord); @@ -243,11 +247,13 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { try { TilePedestal pedestal = (TilePedestal) this.worldObj.getTileEntity(cc.posX, cc.posY, cc.posZ); pedestal.setInventorySlotContents(0, null); - PacketStartAnimation packet = - new PacketStartAnimation(PacketStartAnimation.ID_SPARKLE_SPREAD, cc.posX, cc.posY, cc.posZ); + PacketStartAnimation packet = new PacketStartAnimation( + PacketStartAnimation.ID_SPARKLE_SPREAD, + cc.posX, + cc.posY, + cc.posZ); PacketHandler.INSTANCE.sendToAllAround(packet, this.getTargetPoint(32)); - } catch (Exception exc) { - } + } catch (Exception exc) {} } } @@ -255,8 +261,11 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { this.workTick++; if (this.workTick < 300) { if (this.workTick % 16 == 0) { - PacketStartAnimation packet = - new PacketStartAnimation(PacketStartAnimation.ID_RUNES, this.xCoord, this.yCoord, this.zCoord); + PacketStartAnimation packet = new PacketStartAnimation( + PacketStartAnimation.ID_RUNES, + this.xCoord, + this.yCoord, + this.zCoord); PacketHandler.INSTANCE.sendToAllAround(packet, this.getTargetPoint(32)); } if (this.worldObj.rand.nextInt(4) == 0) { @@ -281,8 +290,7 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { try { ChunkCoordinates cc = this.bufferedCCPedestals.get(pedestalId); return Vec3.createVectorHelper(this.xCoord - cc.posX, this.yCoord - cc.posY, this.zCoord - cc.posZ); - } catch (Exception exc) { - } + } catch (Exception exc) {} return Vec3.createVectorHelper(0, 0, 0); } @@ -321,7 +329,10 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { result = NodeManipulatorResultHandler.getRandomResult(this.worldObj, node, percChanceForBetter); } while (!result.affect(this.worldObj, node)); PacketStartAnimation packet = new PacketStartAnimation( - PacketStartAnimation.ID_SPARKLE_SPREAD, this.xCoord, this.yCoord + 2, this.zCoord); + PacketStartAnimation.ID_SPARKLE_SPREAD, + this.xCoord, + this.yCoord + 2, + this.zCoord); PacketHandler.INSTANCE.sendToAllAround(packet, this.getTargetPoint(32)); this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord + 2, this.zCoord); @@ -379,8 +390,7 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { } private List getRandomlyOrderedPrimalAspectList() { - ArrayList primals = - (ArrayList) Aspect.getPrimalAspects().clone(); + ArrayList primals = (ArrayList) Aspect.getPrimalAspects().clone(); Collections.shuffle(primals); return primals; } @@ -454,7 +464,8 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { if (info.block == RegisteredBlocks.blockNode || (info.block == RegisteredBlocks.blockStoneMachine && (info.meta == 0 || info.meta == 3)) || info.block == Blocks.air - || info.block == RegisteredBlocks.blockNodeManipulator) continue; + || info.block == RegisteredBlocks.blockNodeManipulator) + continue; int absX = v.x + this.xCoord; int absY = v.y + this.yCoord; int absZ = v.z + this.zCoord; @@ -492,7 +503,8 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { || (info.block == RegisteredBlocks.blockStoneMachine && (info.meta == 0 || info.meta == 1 || info.meta == 3)) || info.block == Blocks.air - || info.block == RegisteredBlocks.blockNodeManipulator) continue; + || info.block == RegisteredBlocks.blockNodeManipulator) + continue; int absX = v.x + this.xCoord; int absY = v.y + this.yCoord; int absZ = v.z + this.zCoord; @@ -501,26 +513,38 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { this.worldObj.markBlockForUpdate(absX, absY, absZ); } NetworkRegistry.TargetPoint target = this.getTargetPoint(32); - TileManipulatorPillar pillar = (TileManipulatorPillar) - this.worldObj.getTileEntity(this.xCoord + 1, this.yCoord, this.zCoord + 1); // wrong + TileManipulatorPillar pillar = (TileManipulatorPillar) this.worldObj + .getTileEntity(this.xCoord + 1, this.yCoord, this.zCoord + 1); // wrong pillar.setOrientation((byte) 5); - PacketStartAnimation animation = - new PacketStartAnimation(PacketStartAnimation.ID_RUNES, pillar.xCoord, pillar.yCoord, pillar.zCoord); + PacketStartAnimation animation = new PacketStartAnimation( + PacketStartAnimation.ID_RUNES, + pillar.xCoord, + pillar.yCoord, + pillar.zCoord); PacketHandler.INSTANCE.sendToAllAround(animation, target); - TileManipulatorPillar pillar2 = - (TileManipulatorPillar) this.worldObj.getTileEntity(this.xCoord - 1, this.yCoord, this.zCoord + 1); + TileManipulatorPillar pillar2 = (TileManipulatorPillar) this.worldObj + .getTileEntity(this.xCoord - 1, this.yCoord, this.zCoord + 1); pillar2.setOrientation((byte) 3); - animation = - new PacketStartAnimation(PacketStartAnimation.ID_RUNES, pillar2.xCoord, pillar2.yCoord, pillar2.zCoord); + animation = new PacketStartAnimation( + PacketStartAnimation.ID_RUNES, + pillar2.xCoord, + pillar2.yCoord, + pillar2.zCoord); PacketHandler.INSTANCE.sendToAllAround(animation, target); - TileManipulatorPillar pillar3 = (TileManipulatorPillar) - this.worldObj.getTileEntity(this.xCoord + 1, this.yCoord, this.zCoord - 1); // wrong + TileManipulatorPillar pillar3 = (TileManipulatorPillar) this.worldObj + .getTileEntity(this.xCoord + 1, this.yCoord, this.zCoord - 1); // wrong pillar3.setOrientation((byte) 4); - animation = - new PacketStartAnimation(PacketStartAnimation.ID_RUNES, pillar3.xCoord, pillar3.yCoord, pillar3.zCoord); + animation = new PacketStartAnimation( + PacketStartAnimation.ID_RUNES, + pillar3.xCoord, + pillar3.yCoord, + pillar3.zCoord); PacketHandler.INSTANCE.sendToAllAround(animation, target); - animation = - new PacketStartAnimation(PacketStartAnimation.ID_RUNES, this.xCoord - 1, this.yCoord, this.zCoord - 1); + animation = new PacketStartAnimation( + PacketStartAnimation.ID_RUNES, + this.xCoord - 1, + this.yCoord, + this.zCoord - 1); PacketHandler.INSTANCE.sendToAllAround(animation, target); this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); this.markDirty(); @@ -583,14 +607,13 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { RegisteredMultiblocks.completeNodeManipulatorMultiblock)) { this.multiblockType = MultiblockType.NODE_MANIPULATOR; } else if (MultiblockHelper.isMultiblockPresent( - this.worldObj, - this.xCoord, - this.yCoord, - this.zCoord, - RegisteredMultiblocks.completeEldritchPortalCreator) - && this.checkEldritchEyes(false)) { - this.multiblockType = MultiblockType.E_PORTAL_CREATOR; - } + this.worldObj, + this.xCoord, + this.yCoord, + this.zCoord, + RegisteredMultiblocks.completeEldritchPortalCreator) && this.checkEldritchEyes(false)) { + this.multiblockType = MultiblockType.E_PORTAL_CREATOR; + } } if (this.multiblockType == null) { this.breakMultiblock(); @@ -610,11 +633,11 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { case E_PORTAL_CREATOR: this.setMultiblockStructurePresent( MultiblockHelper.isMultiblockPresent( - this.worldObj, - this.xCoord, - this.yCoord, - this.zCoord, - RegisteredMultiblocks.completeEldritchPortalCreator) + this.worldObj, + this.xCoord, + this.yCoord, + this.zCoord, + RegisteredMultiblocks.completeEldritchPortalCreator) && this.checkEldritchEyes(false), MultiblockType.E_PORTAL_CREATOR); break; @@ -636,8 +659,7 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { } private void checkForNonExistingMultiblock() { - Map patternMap = - new HashMap(); + Map patternMap = new HashMap(); patternMap.put(RegisteredMultiblocks.incompleteEldritchPortalCreator, MultiblockType.E_PORTAL_CREATOR); patternMap.put(RegisteredMultiblocks.incompleteNodeManipulatorMultiblock, MultiblockType.NODE_MANIPULATOR); @@ -659,7 +681,11 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { public NetworkRegistry.TargetPoint getTargetPoint(double radius) { return new NetworkRegistry.TargetPoint( - this.worldObj.provider.dimensionId, this.xCoord, this.yCoord, this.zCoord, radius); + this.worldObj.provider.dimensionId, + this.xCoord, + this.yCoord, + this.zCoord, + radius); } @Override @@ -706,8 +732,8 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { } @Override - public int onWandRightClick( - World world, ItemStack stack, EntityPlayer player, int i, int i2, int i3, int i4, int i5) { + public int onWandRightClick(World world, ItemStack stack, EntityPlayer player, int i, int i2, int i3, int i4, + int i5) { return 0; } @@ -723,10 +749,10 @@ public class TileNodeManipulator extends TileWandPedestal implements IWandable { public void onWandStoppedUsing(ItemStack stack, World world, EntityPlayer player, int i) {} public enum MultiblockType { - NODE_MANIPULATOR( - Gadomancy.MODID.toUpperCase() + ".NODE_MANIPULATOR", RegisteredRecipes.costsNodeManipulatorMultiblock), - E_PORTAL_CREATOR( - Gadomancy.MODID.toUpperCase() + ".E_PORTAL_CREATOR", + + NODE_MANIPULATOR(Gadomancy.MODID.toUpperCase() + ".NODE_MANIPULATOR", + RegisteredRecipes.costsNodeManipulatorMultiblock), + E_PORTAL_CREATOR(Gadomancy.MODID.toUpperCase() + ".E_PORTAL_CREATOR", RegisteredRecipes.costsEldritchPortalCreatorMultiblock); private String research; diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileOverrideEldritchLock.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileOverrideEldritchLock.java index 237c45a..bc60aa5 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileOverrideEldritchLock.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileOverrideEldritchLock.java @@ -1,18 +1,19 @@ package makeo.gadomancy.common.blocks.tiles; import java.util.concurrent.ConcurrentHashMap; + import makeo.gadomancy.common.utils.world.TCMazeHandler; import makeo.gadomancy.common.utils.world.TCMazeSession; + import net.minecraft.entity.Entity; + import thaumcraft.common.lib.world.dim.CellLoc; import thaumcraft.common.lib.world.dim.MazeHandler; import thaumcraft.common.tiles.TileEldritchLock; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 09.11.2015 21:20 */ @@ -38,9 +39,8 @@ public class TileOverrideEldritchLock extends TileEldritchLock { MazeHandler.labyrinth = old; for (TCMazeSession session : TCMazeHandler.getSessions().values()) { - if (session.chunksAffected != null - && session.chunksAffected.containsKey( - new CellLoc(this.xCoord >> 4, this.zCoord >> 4))) { + if (session.chunksAffected != null && session.chunksAffected + .containsKey(new CellLoc(this.xCoord >> 4, this.zCoord >> 4))) { TCMazeHandler.putBosses(session, bosses); break; } diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileRemoteJar.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileRemoteJar.java index bd7e64f..46f7d27 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileRemoteJar.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileRemoteJar.java @@ -1,20 +1,22 @@ package makeo.gadomancy.common.blocks.tiles; import java.util.*; + import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.nbt.NBTTagCompound; import net.minecraft.server.MinecraftServer; + import thaumcraft.common.tiles.TileJarFillable; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 14.10.2015 15:06 */ public class TileRemoteJar extends TileJarFillable { + public UUID networkId; private int count; @@ -24,8 +26,7 @@ public class TileRemoteJar extends TileJarFillable { @Override public void updateEntity() { super.updateEntity(); - if (this.count % 3 == 0 - && !this.getWorldObj().isRemote + if (this.count % 3 == 0 && !this.getWorldObj().isRemote && this.networkId != null && (!this.registered_to_network || this.amount < this.maxAmount)) { this.count = 0; @@ -61,6 +62,7 @@ public class TileRemoteJar extends TileJarFillable { private static Map networks = new HashMap(); private static class JarNetwork { + private long lastTime; private List jars = new ArrayList(); @@ -69,6 +71,7 @@ public class TileRemoteJar extends TileJarFillable { if (time > this.lastTime) { if (this.jars.size() > 1) { Collections.sort(this.jars, new Comparator() { + @Override public int compare(TileJarFillable o1, TileJarFillable o2) { return o2.amount - o1.amount; @@ -96,8 +99,7 @@ public class TileRemoteJar extends TileJarFillable { } private static boolean isValid(TileJarFillable jar) { - return jar != null - && jar.getWorldObj() != null + return jar != null && jar.getWorldObj() != null && !jar.isInvalid() && jar.getWorldObj().blockExists(jar.xCoord, jar.yCoord, jar.zCoord); } diff --git a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileStickyJar.java b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileStickyJar.java index ebffcc4..1bf6625 100644 --- a/src/main/java/makeo/gadomancy/common/blocks/tiles/TileStickyJar.java +++ b/src/main/java/makeo/gadomancy/common/blocks/tiles/TileStickyJar.java @@ -1,8 +1,9 @@ package makeo.gadomancy.common.blocks.tiles; -import cpw.mods.fml.common.registry.GameData; import java.lang.reflect.Field; + import makeo.gadomancy.common.utils.Injector; + import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.init.Blocks; @@ -10,18 +11,18 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.IEssentiaTransport; import thaumcraft.common.tiles.TileJarFillable; import thaumcraft.common.tiles.TileJarFillableVoid; +import cpw.mods.fml.common.registry.GameData; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 13.07.2015 15:48 */ @@ -140,7 +141,11 @@ public class TileStickyJar extends TileJarFillable { ForgeDirection inputDir = this.placedOn.getOpposite(); TileEntity te = ThaumcraftApiHelper.getConnectableTile( - this.parent.getWorldObj(), this.parent.xCoord, this.parent.yCoord, this.parent.zCoord, inputDir); + this.parent.getWorldObj(), + this.parent.xCoord, + this.parent.yCoord, + this.parent.zCoord, + inputDir); if (te != null) { IEssentiaTransport ic = (IEssentiaTransport) te; if (!ic.canOutputTo(ForgeDirection.DOWN)) { @@ -154,8 +159,8 @@ public class TileStickyJar extends TileJarFillable { } else if ((ic.getEssentiaAmount(inputDir.getOpposite()) > 0) && (ic.getSuctionAmount(inputDir.getOpposite()) < this.getSuctionAmount(ForgeDirection.UP)) && (this.getSuctionAmount(ForgeDirection.UP) >= ic.getMinimumSuction())) { - ta = ic.getEssentiaType(inputDir.getOpposite()); - } + ta = ic.getEssentiaType(inputDir.getOpposite()); + } if ((ta != null) && (ic.getSuctionAmount(inputDir.getOpposite()) < this.getSuctionAmount(ForgeDirection.UP))) { this.addToContainer(ta, ic.takeEssentia(ta, 1, inputDir.getOpposite())); diff --git a/src/main/java/makeo/gadomancy/common/containers/ContainerArcanePackager.java b/src/main/java/makeo/gadomancy/common/containers/ContainerArcanePackager.java index ba8a868..9456e79 100644 --- a/src/main/java/makeo/gadomancy/common/containers/ContainerArcanePackager.java +++ b/src/main/java/makeo/gadomancy/common/containers/ContainerArcanePackager.java @@ -1,6 +1,7 @@ package makeo.gadomancy.common.containers; import makeo.gadomancy.common.blocks.tiles.TileArcanePackager; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.init.Items; @@ -10,14 +11,13 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 14.11.2015 18:08 */ public class ContainerArcanePackager extends Container { + public final InventoryPlayer playerInv; public final IInventory packagerInv; @@ -64,11 +64,10 @@ public class ContainerArcanePackager extends Container { return null; } } else { - int specialSlot = - itemstack1.getItem() == Items.leather ? 9 : itemstack1.getItem() == Items.string ? 10 : -1; - if (specialSlot != -1 - && (this.packagerInv.getStackInSlot(specialSlot) == null - || this.packagerInv.getStackInSlot(specialSlot).stackSize < 64)) { + int specialSlot = itemstack1.getItem() == Items.leather ? 9 + : itemstack1.getItem() == Items.string ? 10 : -1; + if (specialSlot != -1 && (this.packagerInv.getStackInSlot(specialSlot) == null + || this.packagerInv.getStackInSlot(specialSlot).stackSize < 64)) { this.mergeItemStack(itemstack1, specialSlot, specialSlot + 1, false); if (itemstack1.stackSize == 0) { diff --git a/src/main/java/makeo/gadomancy/common/containers/ContainerInfusionClaw.java b/src/main/java/makeo/gadomancy/common/containers/ContainerInfusionClaw.java index fb4a018..0b0701d 100644 --- a/src/main/java/makeo/gadomancy/common/containers/ContainerInfusionClaw.java +++ b/src/main/java/makeo/gadomancy/common/containers/ContainerInfusionClaw.java @@ -1,6 +1,7 @@ package makeo.gadomancy.common.containers; import makeo.gadomancy.common.blocks.tiles.TileInfusionClaw; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Container; @@ -9,14 +10,13 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 09.10.2015 20:34 */ public class ContainerInfusionClaw extends Container { + public final InventoryPlayer playerInv; public final IInventory clawInv; @@ -81,25 +81,13 @@ public class ContainerInfusionClaw extends Container { return false; } - /*public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int slot) { - ItemStack stack = null; - Slot slotObject = (Slot) this.inventorySlots.get(slot); - - if(slotObject != null && slotObject.getHasStack()) { - ItemStack stackInSlot = slotObject.getStack(); - - if (!mergeItemStack(stackInSlot, 0, 1, false)) { - return null; - } - - if (stackInSlot.stackSize == 0) { - slotObject.putStack(null); - } else { - slotObject.onSlotChanged(); - } - } - return stack; - }*/ + /* + * public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int slot) { ItemStack stack = null; Slot + * slotObject = (Slot) this.inventorySlots.get(slot); if(slotObject != null && slotObject.getHasStack()) { ItemStack + * stackInSlot = slotObject.getStack(); if (!mergeItemStack(stackInSlot, 0, 1, false)) { return null; } if + * (stackInSlot.stackSize == 0) { slotObject.putStack(null); } else { slotObject.onSlotChanged(); } } return stack; + * } + */ @Override public boolean canInteractWith(EntityPlayer player) { diff --git a/src/main/java/makeo/gadomancy/common/containers/FilteredSlot.java b/src/main/java/makeo/gadomancy/common/containers/FilteredSlot.java index 40bc716..b7cadc4 100644 --- a/src/main/java/makeo/gadomancy/common/containers/FilteredSlot.java +++ b/src/main/java/makeo/gadomancy/common/containers/FilteredSlot.java @@ -5,14 +5,13 @@ import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 10.10.2015 13:49 */ public class FilteredSlot extends Slot { + public FilteredSlot(IInventory inventory, int slotNumber, int xDisplayPosition, int yDisplayPosition) { super(inventory, slotNumber, xDisplayPosition, yDisplayPosition); } diff --git a/src/main/java/makeo/gadomancy/common/crafting/DeprecationItemPaybacks.java b/src/main/java/makeo/gadomancy/common/crafting/DeprecationItemPaybacks.java index 06cda8e..3a7ed68 100644 --- a/src/main/java/makeo/gadomancy/common/crafting/DeprecationItemPaybacks.java +++ b/src/main/java/makeo/gadomancy/common/crafting/DeprecationItemPaybacks.java @@ -2,9 +2,12 @@ package makeo.gadomancy.common.crafting; import java.util.ArrayList; import java.util.List; + import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.init.Items; import net.minecraft.item.ItemStack; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.config.ConfigBlocks; @@ -13,10 +16,8 @@ import thaumcraft.common.items.ItemEssence; import thaumcraft.common.items.ItemWispEssence; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 29.12.2015 15:03 */ diff --git a/src/main/java/makeo/gadomancy/common/crafting/EtherealFamiliarUpgradeRecipe.java b/src/main/java/makeo/gadomancy/common/crafting/EtherealFamiliarUpgradeRecipe.java index 84a97a1..6c4f103 100644 --- a/src/main/java/makeo/gadomancy/common/crafting/EtherealFamiliarUpgradeRecipe.java +++ b/src/main/java/makeo/gadomancy/common/crafting/EtherealFamiliarUpgradeRecipe.java @@ -1,34 +1,28 @@ package makeo.gadomancy.common.crafting; import java.util.ArrayList; + import makeo.gadomancy.common.familiar.FamiliarAugment; import makeo.gadomancy.common.items.baubles.ItemEtherealFamiliar; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.crafting.InfusionRecipe; /** - * HellFirePvP@Admin - * Date: 19.04.2016 / 02:02 - * on Gadomancy - * EtherealFamiliarUpgradeRecipe + * HellFirePvP@Admin Date: 19.04.2016 / 02:02 on Gadomancy EtherealFamiliarUpgradeRecipe */ public class EtherealFamiliarUpgradeRecipe extends InfusionRecipe { private FamiliarAugment toAdd; private int requiredPreviousLevel; - public EtherealFamiliarUpgradeRecipe( - String research, - int inst, - AspectList aspects2, - ItemStack familiarIn, - FamiliarAugment toAdd, - int reqPrev, - ItemStack... surroundings) { + public EtherealFamiliarUpgradeRecipe(String research, int inst, AspectList aspects2, ItemStack familiarIn, + FamiliarAugment toAdd, int reqPrev, ItemStack... surroundings) { super(research, null, inst, aspects2, familiarIn, surroundings); this.toAdd = toAdd; this.requiredPreviousLevel = reqPrev; @@ -36,8 +30,8 @@ public class EtherealFamiliarUpgradeRecipe extends InfusionRecipe { @Override public boolean matches(ArrayList input, ItemStack in, World world, EntityPlayer player) { - if (in == null || !(in.getItem() instanceof ItemEtherealFamiliar)) - return false; // We call it "FamiliarAugment" Recipe for a reason.. + if (in == null || !(in.getItem() instanceof ItemEtherealFamiliar)) return false; // We call it "FamiliarAugment" + // Recipe for a reason.. if (this.getRecipeInput() == null || !(this.getRecipeInput().getItem() instanceof ItemEtherealFamiliar)) return false; // A bit late but still working.. diff --git a/src/main/java/makeo/gadomancy/common/crafting/FamiliarUndoRecipe.java b/src/main/java/makeo/gadomancy/common/crafting/FamiliarUndoRecipe.java index 89dee57..21f378f 100644 --- a/src/main/java/makeo/gadomancy/common/crafting/FamiliarUndoRecipe.java +++ b/src/main/java/makeo/gadomancy/common/crafting/FamiliarUndoRecipe.java @@ -1,8 +1,10 @@ package makeo.gadomancy.common.crafting; import java.util.ArrayList; + import makeo.gadomancy.common.items.baubles.ItemFamiliar_Old; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.ShapelessRecipes; @@ -10,10 +12,8 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 29.12.2015 15:29 */ @@ -24,6 +24,7 @@ public class FamiliarUndoRecipe extends ShapelessRecipes { new ItemStack(RegisteredItems.itemPackage, 1, 2) .setStackDisplayName(EnumChatFormatting.GOLD + "Used Familiar Items"), new ArrayList() { + { this.add(new ItemStack(RegisteredItems.itemFamiliar_old)); } @@ -39,8 +40,7 @@ public class FamiliarUndoRecipe extends ShapelessRecipes { for (int j = 0; j < 3; ++j) { ItemStack itemstack = inv.getStackInRowAndColumn(j, i); - if (itemstack != null - && itemstack.getItem() != null + if (itemstack != null && itemstack.getItem() != null && itemstack.getItem() instanceof ItemFamiliar_Old) { if (foundOldFamiliar) return false; foundOldFamiliar = true; @@ -59,8 +59,7 @@ public class FamiliarUndoRecipe extends ShapelessRecipes { for (int i = 0; i < 3; ++i) { for (int j = 0; j < 3; ++j) { ItemStack itemstack = inv.getStackInRowAndColumn(j, i); - if (itemstack != null - && itemstack.getItem() != null + if (itemstack != null && itemstack.getItem() != null && itemstack.getItem() instanceof ItemFamiliar_Old) { return ItemFamiliar_Old.getPaybackPackage(itemstack); } diff --git a/src/main/java/makeo/gadomancy/common/crafting/Familiar_Old_AugmentInfusion.java b/src/main/java/makeo/gadomancy/common/crafting/Familiar_Old_AugmentInfusion.java index a4c89a0..8260a72 100644 --- a/src/main/java/makeo/gadomancy/common/crafting/Familiar_Old_AugmentInfusion.java +++ b/src/main/java/makeo/gadomancy/common/crafting/Familiar_Old_AugmentInfusion.java @@ -1,19 +1,20 @@ package makeo.gadomancy.common.crafting; import java.util.ArrayList; + import makeo.gadomancy.common.items.baubles.ItemFamiliar_Old; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.crafting.InfusionRecipe; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 02.11.2015 17:39 */ @@ -21,21 +22,17 @@ public class Familiar_Old_AugmentInfusion extends InfusionRecipe { private ItemFamiliar_Old.FamiliarUpgrade upgradeToAdd; - public Familiar_Old_AugmentInfusion( - String research, - int inst, - AspectList aspects2, - ItemStack input, - ItemFamiliar_Old.FamiliarUpgrade upgradeToAdd, - ItemStack[] recipe) { + public Familiar_Old_AugmentInfusion(String research, int inst, AspectList aspects2, ItemStack input, + ItemFamiliar_Old.FamiliarUpgrade upgradeToAdd, ItemStack[] recipe) { super(research, null, inst, aspects2, input, recipe); this.upgradeToAdd = upgradeToAdd; } @Override public boolean matches(ArrayList input, ItemStack central, World world, EntityPlayer player) { - if (central == null || !(central.getItem() instanceof ItemFamiliar_Old)) - return false; // We call it "FamiliarAugment" Recipe for a reason.. + if (central == null || !(central.getItem() instanceof ItemFamiliar_Old)) return false; // We call it + // "FamiliarAugment" + // Recipe for a reason.. if (this.getRecipeInput() == null || !(this.getRecipeInput().getItem() instanceof ItemFamiliar_Old)) return false; // A bit late but still working.. @@ -46,7 +43,8 @@ public class Familiar_Old_AugmentInfusion extends InfusionRecipe { ItemStack centralCopy = central.copy(); if (!((ItemFamiliar_Old) centralCopy.getItem()) - .hasUpgrade(centralCopy, this.getUpgradeToAdd().getNeededPreviousUpgrade())) return false; + .hasUpgrade(centralCopy, this.getUpgradeToAdd().getNeededPreviousUpgrade())) + return false; ArrayList ii = new ArrayList(); for (ItemStack is : input) { diff --git a/src/main/java/makeo/gadomancy/common/crafting/InfusionDisguiseArmor.java b/src/main/java/makeo/gadomancy/common/crafting/InfusionDisguiseArmor.java index 9c0ec8a..282bfd8 100644 --- a/src/main/java/makeo/gadomancy/common/crafting/InfusionDisguiseArmor.java +++ b/src/main/java/makeo/gadomancy/common/crafting/InfusionDisguiseArmor.java @@ -4,8 +4,10 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import makeo.gadomancy.common.research.SimpleResearchItem; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.entity.EntityLiving; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; @@ -14,6 +16,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.crafting.InfusionRecipe; @@ -22,30 +25,25 @@ import thaumcraft.common.lib.crafting.InfusionRunicAugmentRecipe; import thaumcraft.common.lib.research.ResearchManager; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 25.12.2015 15:35 */ public class InfusionDisguiseArmor extends InfusionRunicAugmentRecipe { - public static final ItemStack[] COMPONENTS = { - new ItemStack(Items.slime_ball), - new ItemStack(ConfigItems.itemResource, 1, 3), - new ItemStack(Items.slime_ball), - new ItemStack(ConfigItems.itemResource, 1, 3) - }; - public static final AspectList ASPECTS = - new AspectList().add(Aspect.SLIME, 12).add(Aspect.ARMOR, 10).add(Aspect.MAGIC, 8); + + public static final ItemStack[] COMPONENTS = { new ItemStack(Items.slime_ball), + new ItemStack(ConfigItems.itemResource, 1, 3), new ItemStack(Items.slime_ball), + new ItemStack(ConfigItems.itemResource, 1, 3) }; + public static final AspectList ASPECTS = new AspectList().add(Aspect.SLIME, 12).add(Aspect.ARMOR, 10) + .add(Aspect.MAGIC, 8); private Map> cachedItems = new HashMap>(); @Override public boolean matches(ArrayList input, ItemStack central, World world, EntityPlayer player) { - if (input.size() != InfusionDisguiseArmor.COMPONENTS.length + 1 - || !ResearchManager.isResearchComplete( - player.getCommandSenderName(), SimpleResearchItem.getFullName("ARMORDISGUISE"))) { + if (input.size() != InfusionDisguiseArmor.COMPONENTS.length + 1 || !ResearchManager + .isResearchComplete(player.getCommandSenderName(), SimpleResearchItem.getFullName("ARMORDISGUISE"))) { return false; } @@ -126,8 +124,7 @@ public class InfusionDisguiseArmor extends InfusionRunicAugmentRecipe { } private boolean isDisguised(ItemStack stack) { - return NBTHelper.hasPersistentData(stack) - && NBTHelper.getPersistentData(stack).hasKey("disguise"); + return NBTHelper.hasPersistentData(stack) && NBTHelper.getPersistentData(stack).hasKey("disguise"); } private boolean isInvisItem(ItemStack disguise) { diff --git a/src/main/java/makeo/gadomancy/common/crafting/InfusionUpgradeRecipe.java b/src/main/java/makeo/gadomancy/common/crafting/InfusionUpgradeRecipe.java index 7dc6fa3..74a0ca5 100644 --- a/src/main/java/makeo/gadomancy/common/crafting/InfusionUpgradeRecipe.java +++ b/src/main/java/makeo/gadomancy/common/crafting/InfusionUpgradeRecipe.java @@ -1,34 +1,36 @@ package makeo.gadomancy.common.crafting; import java.util.ArrayList; + import makeo.gadomancy.api.GadomancyApi; import makeo.gadomancy.api.golems.AdditionalGolemType; import makeo.gadomancy.common.entities.golems.upgrades.GolemUpgrade; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.api.aspects.AspectList; import thaumcraft.api.crafting.InfusionRecipe; import thaumcraft.common.config.ConfigItems; import thaumcraft.common.entities.golems.EnumGolemType; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 21.07.2015 20:16 */ public class InfusionUpgradeRecipe extends InfusionRecipe { + private static final ItemStack DEFAULT_OUTPUT = new ItemStack(Blocks.dirt); private final GolemUpgrade upgrade; - private InfusionUpgradeRecipe( - String research, GolemUpgrade upgrade, int inst, AspectList aspects2, ItemStack input, ItemStack[] recipe) { + private InfusionUpgradeRecipe(String research, GolemUpgrade upgrade, int inst, AspectList aspects2, ItemStack input, + ItemStack[] recipe) { super(research, InfusionUpgradeRecipe.DEFAULT_OUTPUT, inst, aspects2, input, recipe); this.upgrade = upgrade; @@ -46,8 +48,8 @@ public class InfusionUpgradeRecipe extends InfusionRecipe { return output; } - public static InfusionUpgradeRecipe[] createRecipes( - String research, GolemUpgrade upgrade, int inst, AspectList aspects, ItemStack[] recipe) { + public static InfusionUpgradeRecipe[] createRecipes(String research, GolemUpgrade upgrade, int inst, + AspectList aspects, ItemStack[] recipe) { InfusionUpgradeRecipe[] recipes = new InfusionUpgradeRecipe[EnumGolemType.values().length]; for (int i = 0; i < EnumGolemType.values().length; i++) { @@ -56,7 +58,12 @@ public class InfusionUpgradeRecipe extends InfusionRecipe { AdditionalGolemType addType = GadomancyApi.getAdditionalGolemType(type); Item input = addType == null ? ConfigItems.itemGolemPlacer : addType.getPlacerItem(); recipes[i] = new InfusionUpgradeRecipe( - research, upgrade, inst, aspects, new ItemStack(input, 1, type.ordinal()), recipe); + research, + upgrade, + inst, + aspects, + new ItemStack(input, 1, type.ordinal()), + recipe); } } return recipes; diff --git a/src/main/java/makeo/gadomancy/common/crafting/InfusionVisualDisguiseArmor.java b/src/main/java/makeo/gadomancy/common/crafting/InfusionVisualDisguiseArmor.java index 3002bf8..ade73c7 100644 --- a/src/main/java/makeo/gadomancy/common/crafting/InfusionVisualDisguiseArmor.java +++ b/src/main/java/makeo/gadomancy/common/crafting/InfusionVisualDisguiseArmor.java @@ -1,34 +1,36 @@ package makeo.gadomancy.common.crafting; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; import java.util.Random; + import makeo.gadomancy.common.Gadomancy; + import net.minecraft.client.Minecraft; import net.minecraft.entity.EntityLiving; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.crafting.InfusionRecipe; import thaumcraft.api.internal.DummyInternalMethodHandler; import thaumcraft.api.internal.IInternalMethodHandler; import thaumcraft.common.lib.research.ResearchManager; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 26.12.2015 18:10 */ public class InfusionVisualDisguiseArmor extends InfusionRecipe { + private static final IInternalMethodHandler FAKE_HANDLER = new FakeMethodHandler(); - private static final int[] POTION_METAS = {8206, 16398, 8270, 16462}; + private static final int[] POTION_METAS = { 8206, 16398, 8270, 16462 }; private static ItemStack[] armorItems; @@ -47,7 +49,11 @@ public class InfusionVisualDisguiseArmor extends InfusionRecipe { this.components = new ItemStack[InfusionDisguiseArmor.COMPONENTS.length + 1]; System.arraycopy( - InfusionDisguiseArmor.COMPONENTS, 0, this.components, 1, InfusionDisguiseArmor.COMPONENTS.length); + InfusionDisguiseArmor.COMPONENTS, + 0, + this.components, + 1, + InfusionDisguiseArmor.COMPONENTS.length); if (InfusionVisualDisguiseArmor.armorItems == null && Gadomancy.proxy.getSide() == Side.CLIENT) { this.findArmorItems(); @@ -62,8 +68,7 @@ public class InfusionVisualDisguiseArmor extends InfusionRecipe { try { ((Item) o).getSubItems((Item) o, ((Item) o).getCreativeTab(), list); - } catch (Throwable ignored) { - } + } catch (Throwable ignored) {} for (Object o2 : list) { if (o2 != null && o2 instanceof ItemStack && EntityLiving.getArmorPosition((ItemStack) o2) != 0) { @@ -77,9 +82,8 @@ public class InfusionVisualDisguiseArmor extends InfusionRecipe { private boolean canSee(ItemStack stack) { String research = InfusionVisualDisguiseArmor.getResearchKey(stack); - return research == null - || ResearchManager.isResearchComplete( - Minecraft.getMinecraft().thePlayer.getCommandSenderName(), research); + return research == null || ResearchManager + .isResearchComplete(Minecraft.getMinecraft().thePlayer.getCommandSenderName(), research); } public ItemStack getCurrentDisguise() { @@ -87,9 +91,8 @@ public class InfusionVisualDisguiseArmor extends InfusionRecipe { return new ItemStack( Items.potionitem, 1, - InfusionVisualDisguiseArmor.POTION_METAS[ - (int) ((System.currentTimeMillis() / 1000) - % InfusionVisualDisguiseArmor.POTION_METAS.length)]); + InfusionVisualDisguiseArmor.POTION_METAS[(int) ((System.currentTimeMillis() / 1000) + % InfusionVisualDisguiseArmor.POTION_METAS.length)]); } Random random = new Random(System.currentTimeMillis() / 1000); @@ -111,8 +114,8 @@ public class InfusionVisualDisguiseArmor extends InfusionRecipe { if (Minecraft.getMinecraft().thePlayer == null) { return new ItemStack(Items.cookie); } - return InfusionVisualDisguiseArmor.armorItems[ - this.getRecipeInput(new Random(System.currentTimeMillis() / 1000))]; + return InfusionVisualDisguiseArmor.armorItems[this + .getRecipeInput(new Random(System.currentTimeMillis() / 1000))]; } private int getRecipeInput(Random random) { @@ -149,6 +152,7 @@ public class InfusionVisualDisguiseArmor extends InfusionRecipe { } private static class FakeMethodHandler extends DummyInternalMethodHandler { + @Override public boolean isResearchComplete(String username, String researchkey) { return true; diff --git a/src/main/java/makeo/gadomancy/common/crafting/RecipeStickyJar.java b/src/main/java/makeo/gadomancy/common/crafting/RecipeStickyJar.java index 67986f4..0b1b229 100644 --- a/src/main/java/makeo/gadomancy/common/crafting/RecipeStickyJar.java +++ b/src/main/java/makeo/gadomancy/common/crafting/RecipeStickyJar.java @@ -3,21 +3,21 @@ package makeo.gadomancy.common.crafting; import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.research.SimpleResearchItem; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.crafting.IArcaneRecipe; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 13.07.2015 19:21 */ @@ -25,8 +25,8 @@ public class RecipeStickyJar implements IArcaneRecipe { @Override public boolean matches(IInventory inv, World world, EntityPlayer player) { - return ThaumcraftApiHelper.isResearchComplete( - player.getCommandSenderName(), SimpleResearchItem.getFullName("STICKYJAR")) + return ThaumcraftApiHelper + .isResearchComplete(player.getCommandSenderName(), SimpleResearchItem.getFullName("STICKYJAR")) && this.getJarItem(inv) != null; } @@ -64,8 +64,7 @@ public class RecipeStickyJar implements IArcaneRecipe { } boolean isSticky = RegisteredItems.isStickyableJar(current) - && (!current.hasTagCompound() - || !current.getTagCompound().getBoolean("isStickyJar")); + && (!current.hasTagCompound() || !current.getTagCompound().getBoolean("isStickyJar")); if (current.getItem() != Items.slime_ball && !isSticky) { return null; } diff --git a/src/main/java/makeo/gadomancy/common/crafting/RecipeVisualStickyJar.java b/src/main/java/makeo/gadomancy/common/crafting/RecipeVisualStickyJar.java index 5caa06e..32c9fbc 100644 --- a/src/main/java/makeo/gadomancy/common/crafting/RecipeVisualStickyJar.java +++ b/src/main/java/makeo/gadomancy/common/crafting/RecipeVisualStickyJar.java @@ -1,27 +1,29 @@ package makeo.gadomancy.common.crafting; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.List; + import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.client.Minecraft; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.crafting.ShapedArcaneRecipe; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 19.12.2015 23:08 */ public class RecipeVisualStickyJar extends ShapedArcaneRecipe { + public RecipeVisualStickyJar() { super( "Mirror mirror on the wall, who is the fairest one of all?", diff --git a/src/main/java/makeo/gadomancy/common/data/AbstractData.java b/src/main/java/makeo/gadomancy/common/data/AbstractData.java index d963407..f28e262 100644 --- a/src/main/java/makeo/gadomancy/common/data/AbstractData.java +++ b/src/main/java/makeo/gadomancy/common/data/AbstractData.java @@ -2,13 +2,12 @@ package makeo.gadomancy.common.data; import java.util.HashMap; import java.util.Map; + import net.minecraft.nbt.NBTTagCompound; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 13.12.2015 16:06 */ @@ -43,8 +42,7 @@ public abstract class AbstractData { public static class Registry { - private static Map> registry = - new HashMap>(); + private static Map> registry = new HashMap>(); public static void register(AbstractDataProvider provider) { Registry.registry.put(provider.getProviderId(), provider); diff --git a/src/main/java/makeo/gadomancy/common/data/DataAchromatic.java b/src/main/java/makeo/gadomancy/common/data/DataAchromatic.java index 6fd77cb..2447edf 100644 --- a/src/main/java/makeo/gadomancy/common/data/DataAchromatic.java +++ b/src/main/java/makeo/gadomancy/common/data/DataAchromatic.java @@ -2,7 +2,9 @@ package makeo.gadomancy.common.data; import java.util.ArrayList; import java.util.List; + import makeo.gadomancy.common.registration.RegisteredPotions; + import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -10,10 +12,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagIntArray; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 18.12.2015 20:21 */ diff --git a/src/main/java/makeo/gadomancy/common/data/DataFamiliar.java b/src/main/java/makeo/gadomancy/common/data/DataFamiliar.java index 2854a6a..3a77cbf 100644 --- a/src/main/java/makeo/gadomancy/common/data/DataFamiliar.java +++ b/src/main/java/makeo/gadomancy/common/data/DataFamiliar.java @@ -1,26 +1,27 @@ package makeo.gadomancy.common.data; -import baubles.api.BaublesApi; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import makeo.gadomancy.client.util.FamiliarHandlerClient; import makeo.gadomancy.common.familiar.FamiliarController; import makeo.gadomancy.common.items.baubles.ItemEtherealFamiliar; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; +import baubles.api.BaublesApi; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 14.12.2015 22:06 */ diff --git a/src/main/java/makeo/gadomancy/common/data/SyncDataHolder.java b/src/main/java/makeo/gadomancy/common/data/SyncDataHolder.java index 1fedf33..d600f5e 100644 --- a/src/main/java/makeo/gadomancy/common/data/SyncDataHolder.java +++ b/src/main/java/makeo/gadomancy/common/data/SyncDataHolder.java @@ -4,15 +4,15 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import makeo.gadomancy.common.network.PacketHandler; import makeo.gadomancy.common.network.packets.PacketSyncData; + import net.minecraft.entity.player.EntityPlayer; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 13.12.2015 15:53 */ diff --git a/src/main/java/makeo/gadomancy/common/data/config/ModConfig.java b/src/main/java/makeo/gadomancy/common/data/config/ModConfig.java index 14b932a..5cd0250 100644 --- a/src/main/java/makeo/gadomancy/common/data/config/ModConfig.java +++ b/src/main/java/makeo/gadomancy/common/data/config/ModConfig.java @@ -3,17 +3,18 @@ package makeo.gadomancy.common.data.config; import java.io.File; import java.util.ArrayList; import java.util.List; + import makeo.gadomancy.common.registration.RegisteredEnchantments; import makeo.gadomancy.common.registration.RegisteredPotions; + import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; + import thaumcraft.api.aspects.Aspect; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 15.09.2015 18:25 */ @@ -85,8 +86,8 @@ public class ModConfig { 31, "Do not edit unless you know what are you doing! - Datawatcher ID of the Auracore's current aspects"); - ModConfig.golemDatawatcherId = ModConfig.config.getInt( - "datawatcherId", "golem", 29, 0, 31, "Do not edit unless you know what are you doing!"); + ModConfig.golemDatawatcherId = ModConfig.config + .getInt("datawatcherId", "golem", 29, 0, 31, "Do not edit unless you know what are you doing!"); // Dimension stuff ModConfig.dimOuterId = ModConfig.config.getInt( diff --git a/src/main/java/makeo/gadomancy/common/data/config/ModData.java b/src/main/java/makeo/gadomancy/common/data/config/ModData.java index d5ea2d8..8e56e44 100644 --- a/src/main/java/makeo/gadomancy/common/data/config/ModData.java +++ b/src/main/java/makeo/gadomancy/common/data/config/ModData.java @@ -1,25 +1,26 @@ package makeo.gadomancy.common.data.config; +import java.io.*; +import java.util.HashMap; +import java.util.Map; + +import makeo.gadomancy.common.Gadomancy; + +import net.minecraft.server.MinecraftServer; + import com.google.gson.Gson; import com.google.gson.JsonIOException; import com.google.gson.JsonSyntaxException; import cpw.mods.fml.common.FMLLog; -import java.io.*; -import java.util.HashMap; -import java.util.Map; -import makeo.gadomancy.common.Gadomancy; -import net.minecraft.server.MinecraftServer; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * - * Created by makeo @ 26.07.2015 18:15 - * Modified by bartimaeusnek @ 31.12.2018, 19:00 GMT+1 + * Created by makeo @ 26.07.2015 18:15 Modified by bartimaeusnek @ 31.12.2018, 19:00 GMT+1 */ public class ModData { + private static final Gson GSON = new Gson(); private String name; @@ -91,8 +92,7 @@ public class ModData { try { if (inOBJ != null) inOBJ.close(); if (in != null) in.close(); - } catch (IOException ignored) { - } + } catch (IOException ignored) {} } } return true; @@ -125,8 +125,7 @@ public class ModData { try { if (outOBJ != null) outOBJ.close(); if (out != null) out.close(); - } catch (IOException ignored) { - } + } catch (IOException ignored) {} } return true; } diff --git a/src/main/java/makeo/gadomancy/common/data/config/Sync.java b/src/main/java/makeo/gadomancy/common/data/config/Sync.java index 2be086e..fee99a6 100644 --- a/src/main/java/makeo/gadomancy/common/data/config/Sync.java +++ b/src/main/java/makeo/gadomancy/common/data/config/Sync.java @@ -7,10 +7,8 @@ import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 15.11.2015 22:00 */ diff --git a/src/main/java/makeo/gadomancy/common/enchantments/EnchantmentRevealer.java b/src/main/java/makeo/gadomancy/common/enchantments/EnchantmentRevealer.java index 13b4093..e952a54 100644 --- a/src/main/java/makeo/gadomancy/common/enchantments/EnchantmentRevealer.java +++ b/src/main/java/makeo/gadomancy/common/enchantments/EnchantmentRevealer.java @@ -5,14 +5,13 @@ import net.minecraft.enchantment.EnumEnchantmentType; import net.minecraft.item.ItemStack; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 28.12.2015 16:15 */ public class EnchantmentRevealer extends Enchantment { + public EnchantmentRevealer(int id) { super(id, 1, EnumEnchantmentType.armor_head); } diff --git a/src/main/java/makeo/gadomancy/common/entities/EntityAuraCore.java b/src/main/java/makeo/gadomancy/common/entities/EntityAuraCore.java index 661be35..b3b590a 100644 --- a/src/main/java/makeo/gadomancy/common/entities/EntityAuraCore.java +++ b/src/main/java/makeo/gadomancy/common/entities/EntityAuraCore.java @@ -1,12 +1,11 @@ package makeo.gadomancy.common.entities; -import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; -import io.netty.buffer.ByteBuf; import java.awt.*; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Random; + import makeo.gadomancy.client.effect.EffectHandler; import makeo.gadomancy.client.effect.fx.EntityFXFlowPolicy; import makeo.gadomancy.client.effect.fx.FXFlow; @@ -19,6 +18,7 @@ import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.utils.MiscUtils; import makeo.gadomancy.common.utils.PrimalAspectList; import makeo.gadomancy.common.utils.Vector3; + import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.init.Blocks; @@ -32,17 +32,18 @@ import net.minecraft.util.Vec3; import net.minecraft.util.WeightedRandom; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ScanResult; import thaumcraft.common.lib.research.ScanManager; import thaumcraft.common.lib.utils.BlockUtils; +import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData; +import io.netty.buffer.ByteBuf; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 16.11.2015 14:42 */ @@ -55,8 +56,8 @@ public class EntityAuraCore extends EntityItem implements IEntityAdditionalSpawn private static final int GATHER_RANGE = 4; private static final int CLUSTER_WEIGHT = 10; // Counts as 10 'blocks' 'scanned' with the given aspect. public static final int CLUSTER_RANGE = 10; // Defines how close the clicked cluster has to be. - private static final int REQUIRED_BLOCKS = - (int) Math.round(Math.pow(EntityAuraCore.GATHER_RANGE * 2 + 1, 3) * 0.15); + private static final int REQUIRED_BLOCKS = (int) Math + .round(Math.pow(EntityAuraCore.GATHER_RANGE * 2 + 1, 3) * 0.15); public PrimalAspectList internalAuraList = new PrimalAspectList(); public Orbital auraOrbital; @@ -75,13 +76,7 @@ public class EntityAuraCore extends EntityItem implements IEntityAdditionalSpawn super(world); } - public EntityAuraCore( - World world, - double x, - double y, - double z, - ItemStack stack, - ChunkCoordinates startingCoords, + public EntityAuraCore(World world, double x, double y, double z, ItemStack stack, ChunkCoordinates startingCoords, Aspect[] aspects) { super(world, x, y, z, stack); this.activationLocation = startingCoords; @@ -110,8 +105,7 @@ public class EntityAuraCore extends EntityItem implements IEntityAdditionalSpawn public void onUpdate() { super.onUpdate(); - if (this.auraOrbital == null - && !MiscUtils.getPositionVector(this).equals(Vector3.ZERO) + if (this.auraOrbital == null && !MiscUtils.getPositionVector(this).equals(Vector3.ZERO) && this.worldObj.isRemote) { this.auraOrbital = new Orbital(MiscUtils.getPositionVector(this), this.worldObj); } @@ -147,8 +141,7 @@ public class EntityAuraCore extends EntityItem implements IEntityAdditionalSpawn continue; } - node = new Orbital.OrbitalRenderProperties( - Orbital.Axis.persisentRandomAxis(), 1D); // rand.nextDouble() + node = new Orbital.OrbitalRenderProperties(Orbital.Axis.persisentRandomAxis(), 1D); // rand.nextDouble() node.setColor(new Color(this.effectAspects[i].getColor())) .setTicksForFullCircle(120 + this.rand.nextInt(40)); node.setOffsetTicks(this.rand.nextInt(80)); @@ -156,6 +149,7 @@ public class EntityAuraCore extends EntityItem implements IEntityAdditionalSpawn node.setSubParticleColor(c); node.setParticleSize(0.1f); node.setSubSizeRunnable(new Orbital.OrbitalSubSizeRunnable() { + @Override public float getSubParticleSize(Random rand, int orbitalExisted) { return 0.05F + (rand.nextBoolean() ? 0.0F : 0.025F); @@ -170,20 +164,17 @@ public class EntityAuraCore extends EntityItem implements IEntityAdditionalSpawn this.activationLocation.posX + 0.5D, this.activationLocation.posY + 0.5D, this.activationLocation.posZ + 0.5D); - this.flows[i] = EffectHandler.getInstance() - .effectFlow( - this.worldObj, - v, - new FXFlow.EntityFlowProperties() - .setPolicy(EntityFXFlowPolicy.Policies.DEFAULT) - .setTarget(this.auraOrbital.getOrbitalStartPoints(node)[0]) - .setColor(new Color(this.effectAspects[i].getColor())) - .setFading(this.getSubParticleColor(this.effectAspects[i]))); + this.flows[i] = EffectHandler.getInstance().effectFlow( + this.worldObj, + v, + new FXFlow.EntityFlowProperties().setPolicy(EntityFXFlowPolicy.Policies.DEFAULT) + .setTarget(this.auraOrbital.getOrbitalStartPoints(node)[0]) + .setColor(new Color(this.effectAspects[i].getColor())) + .setFading(this.getSubParticleColor(this.effectAspects[i]))); this.flows[i].setLivingTicks(EntityAuraCore.PRE_GATHER_EFFECT_LENGTH - this.ticksExisted); } - if (this.flows[i] != null) - this.flows[i].applyTarget(this.auraOrbital.getOrbitalStartPoints(node)[0]); + if (this.flows[i] != null) this.flows[i].applyTarget(this.auraOrbital.getOrbitalStartPoints(node)[0]); if (changed) { if (this.effectProperties[i] != null) { @@ -255,8 +246,11 @@ public class EntityAuraCore extends EntityItem implements IEntityAdditionalSpawn Float.floatToIntBits(2F)); } else { animationPacket = new PacketStartAnimation( - PacketStartAnimation.ID_SPARKLE_SPREAD, (int) this.posX, (int) this.posY, (int) this.posZ, (byte) - 0); + PacketStartAnimation.ID_SPARKLE_SPREAD, + (int) this.posX, + (int) this.posY, + (int) this.posZ, + (byte) 0); } PacketHandler.INSTANCE.sendToAllAround(animationPacket, MiscUtils.getTargetPoint(this.worldObj, this, 32)); @@ -304,27 +298,33 @@ public class EntityAuraCore extends EntityItem implements IEntityAdditionalSpawn int meta = this.worldObj.getBlockMetadata(x, y, z); ScanResult result = null; MovingObjectPosition pos = new MovingObjectPosition( - x, y, z, ForgeDirection.UP.ordinal(), Vec3.createVectorHelper(0, 0, 0), true); + x, + y, + z, + ForgeDirection.UP.ordinal(), + Vec3.createVectorHelper(0, 0, 0), + true); ItemStack is = null; try { is = block.getPickBlock(pos, this.worldObj, x, y, z); - } catch (Throwable ignored) { - } + } catch (Throwable ignored) {} try { if (is == null) { is = BlockUtils.createStackedBlock(block, meta); } - } catch (Exception ignored) { - } + } catch (Exception ignored) {} try { if (is == null) { result = new ScanResult((byte) 1, Block.getIdFromBlock(block), meta, null, ""); } else { result = new ScanResult( - (byte) 1, Item.getIdFromItem(is.getItem()), is.getItemDamage(), null, ""); + (byte) 1, + Item.getIdFromItem(is.getItem()), + is.getItemDamage(), + null, + ""); } - } catch (Exception ignored) { - } + } catch (Exception ignored) {} if (result == null) continue; // We can't scan it BibleThump @@ -405,9 +405,8 @@ public class EntityAuraCore extends EntityItem implements IEntityAdditionalSpawn if (rec.equals("")) return false; String[] arr = rec.split(EntityAuraCore.SPLIT); - if (arr.length != 6) - throw new IllegalStateException( - "Server sent wrong Aura Data! '" + rec + "' Please report this error to the mod authors!"); + if (arr.length != 6) throw new IllegalStateException( + "Server sent wrong Aura Data! '" + rec + "' Please report this error to the mod authors!"); for (int i = 0; i < arr.length; i++) { String s = arr[i]; Aspect a = Aspect.getAspect(s); @@ -446,8 +445,7 @@ public class EntityAuraCore extends EntityItem implements IEntityAdditionalSpawn this.internalAuraList.add(Aspect.getAspect(cmp.getString("tag")), cmp.getInteger("amt")); } } - if (compound.hasKey("activationVecX") - && compound.hasKey("activationVecY") + if (compound.hasKey("activationVecX") && compound.hasKey("activationVecY") && compound.hasKey("activationVecZ")) { int x = compound.getInteger("activationVecX"); int y = compound.getInteger("activationVecY"); diff --git a/src/main/java/makeo/gadomancy/common/entities/EntityItemElement.java b/src/main/java/makeo/gadomancy/common/entities/EntityItemElement.java index df6b0c3..4e72895 100644 --- a/src/main/java/makeo/gadomancy/common/entities/EntityItemElement.java +++ b/src/main/java/makeo/gadomancy/common/entities/EntityItemElement.java @@ -1,22 +1,22 @@ package makeo.gadomancy.common.entities; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.List; + import makeo.gadomancy.common.items.ItemElement; + import net.minecraft.client.Minecraft; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; + import thaumcraft.client.fx.bolt.FXLightningBolt; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * HellFirePvP@Admin - * Date: 23.04.2016 / 13:45 - * on Gadomancy - * EntityItemElement + * HellFirePvP@Admin Date: 23.04.2016 / 13:45 on Gadomancy EntityItemElement */ public class EntityItemElement extends EntityItem { @@ -38,8 +38,8 @@ public class EntityItemElement extends EntityItem { ItemStack stack = this.getEntityItem(); if (stack == null || !(stack.getItem() instanceof ItemElement)) return; int meta = stack.getItemDamage(); - ItemElement.EnumElementType element = - ItemElement.EnumElementType.values()[meta % ItemElement.EnumElementType.values().length]; + ItemElement.EnumElementType element = ItemElement.EnumElementType.values()[meta + % ItemElement.EnumElementType.values().length]; if (!this.worldObj.isRemote && (this.ticksExisted & 15) == 0) { EntityItemElement.doElementServerEffects(element, this.worldObj, this.posX, this.posY, this.posZ); @@ -54,8 +54,8 @@ public class EntityItemElement extends EntityItem { } } - public static void doElementServerEffects( - ItemElement.EnumElementType type, World world, double posX, double posY, double posZ) { + public static void doElementServerEffects(ItemElement.EnumElementType type, World world, double posX, double posY, + double posZ) { List entities = world.getEntitiesWithinAABB( EntityLivingBase.class, AxisAlignedBB.getBoundingBox(posX - 0.5, posY - 0.5, posZ - 0.5, posX + 0.5, posY + 0.5, posZ + 0.5) @@ -67,8 +67,8 @@ public class EntityItemElement extends EntityItem { } @SideOnly(Side.CLIENT) - public static void playClientElementEffect( - ItemElement.EnumElementType element, World worldObj, double posX, double posY, double posZ) { + public static void playClientElementEffect(ItemElement.EnumElementType element, World worldObj, double posX, + double posY, double posZ) { float randOffsetX = worldObj.rand.nextFloat() * (worldObj.rand.nextBoolean() ? 1 : -1); float randOffsetY = worldObj.rand.nextFloat() * (worldObj.rand.nextBoolean() ? 1 : -1); float randOffsetZ = worldObj.rand.nextFloat() * (worldObj.rand.nextBoolean() ? 1 : -1); @@ -90,13 +90,12 @@ public class EntityItemElement extends EntityItem { bolt.setType(5); bolt.finalizeBolt(); break; - /*case ORDER: - Thaumcraft.proxy.wispFX(worldObj, posX + randOffsetX / 4, posY + 0.2F + randOffsetY / 4, posZ + randOffsetZ / 4, 0.1F, 0xFF, 0xFF, 0xFF); - break; - case FIRE: - Minecraft.getMinecraft().effectRenderer.addEffect( - new EntityFlameFX(worldObj, posX + randOffsetX / 4, posY + 0.2F + randOffsetY / 4, posZ + randOffsetZ / 4, 0, 0, 0)); - break;*/ + /* + * case ORDER: Thaumcraft.proxy.wispFX(worldObj, posX + randOffsetX / 4, posY + 0.2F + randOffsetY / 4, posZ + * + randOffsetZ / 4, 0.1F, 0xFF, 0xFF, 0xFF); break; case FIRE: + * Minecraft.getMinecraft().effectRenderer.addEffect( new EntityFlameFX(worldObj, posX + randOffsetX / 4, + * posY + 0.2F + randOffsetY / 4, posZ + randOffsetZ / 4, 0, 0, 0)); break; + */ } } } diff --git a/src/main/java/makeo/gadomancy/common/entities/EntityPermNoClipItem.java b/src/main/java/makeo/gadomancy/common/entities/EntityPermNoClipItem.java index 90bb22b..c878aee 100644 --- a/src/main/java/makeo/gadomancy/common/entities/EntityPermNoClipItem.java +++ b/src/main/java/makeo/gadomancy/common/entities/EntityPermNoClipItem.java @@ -1,6 +1,7 @@ package makeo.gadomancy.common.entities; import makeo.gadomancy.common.data.config.ModConfig; + import net.minecraft.entity.item.EntityItem; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -8,29 +9,27 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.DamageSource; import net.minecraft.world.World; + import thaumcraft.common.entities.EntityPermanentItem; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 16.11.2015 19:59 */ public class EntityPermNoClipItem extends EntityPermanentItem { - private float fixPosX = -1, - fixPosY = -1, - fixPosZ = -1; // Can never actually get those values since pylon coords are never .0 + private float fixPosX = -1, fixPosY = -1, fixPosZ = -1; // Can never actually get those values since pylon coords + // are never .0 private int masterX, masterY, masterZ; // Coords of its master tile. public EntityPermNoClipItem(World world) { super(world); } - public EntityPermNoClipItem( - World world, float x, float y, float z, ItemStack stack, int masterX, int masterY, int masterZ) { + public EntityPermNoClipItem(World world, float x, float y, float z, ItemStack stack, int masterX, int masterY, + int masterZ) { super(world, x, y, z, stack); this.fixPosX = x; this.fixPosY = y; @@ -67,15 +66,12 @@ public class EntityPermNoClipItem extends EntityPermanentItem { this.motionX = 0; this.motionY = 0; this.motionZ = 0; - if (this.getDataWatcher() - .getWatchedObject(ModConfig.entityNoClipItemDatawatcherFixedId) - .getObject() - == null) return; + if (this.getDataWatcher().getWatchedObject(ModConfig.entityNoClipItemDatawatcherFixedId).getObject() == null) + return; if ((this.ticksExisted & 1) == 0) { ChunkCoordinates cc = (ChunkCoordinates) this.getDataWatcher() - .getWatchedObject(ModConfig.entityNoClipItemDatawatcherMasterId) - .getObject(); + .getWatchedObject(ModConfig.entityNoClipItemDatawatcherMasterId).getObject(); if (cc == null) return; TileEntity te = this.worldObj.getTileEntity(cc.posX, cc.posY, cc.posZ); if (te instanceof IItemMasterTile) { @@ -89,8 +85,7 @@ public class EntityPermNoClipItem extends EntityPermanentItem { } ChunkCoordinates fixC = (ChunkCoordinates) this.getDataWatcher() - .getWatchedObject(ModConfig.entityNoClipItemDatawatcherFixedId) - .getObject(); + .getWatchedObject(ModConfig.entityNoClipItemDatawatcherFixedId).getObject(); float fX = Float.intBitsToFloat(fixC.posX); float fY = Float.intBitsToFloat(fixC.posY); float fZ = Float.intBitsToFloat(fixC.posZ); @@ -98,8 +93,7 @@ public class EntityPermNoClipItem extends EntityPermanentItem { if ((this.ticksExisted & 7) == 0 && !this.worldObj.isRemote) { ChunkCoordinates masterCoords = (ChunkCoordinates) this.getDataWatcher() - .getWatchedObject(ModConfig.entityNoClipItemDatawatcherMasterId) - .getObject(); + .getWatchedObject(ModConfig.entityNoClipItemDatawatcherMasterId).getObject(); TileEntity te = this.worldObj.getTileEntity(masterCoords.posX, masterCoords.posY, masterCoords.posZ); if (!(te instanceof IItemMasterTile) || !((IItemMasterTile) te).canStillHoldItem()) { EntityItem item = new EntityItem(this.worldObj, this.posX, this.posY, this.posZ, this.getEntityItem()); @@ -116,13 +110,8 @@ public class EntityPermNoClipItem extends EntityPermanentItem { } @Override - public void setPositionAndRotation2( - double p_70056_1_, - double p_70056_3_, - double p_70056_5_, - float p_70056_7_, - float p_70056_8_, - int p_70056_9_) { + public void setPositionAndRotation2(double p_70056_1_, double p_70056_3_, double p_70056_5_, float p_70056_7_, + float p_70056_8_, int p_70056_9_) { this.setPosition(p_70056_1_, p_70056_3_, p_70056_5_); this.setRotation(p_70056_7_, p_70056_8_); } @@ -139,10 +128,9 @@ public class EntityPermNoClipItem extends EntityPermanentItem { this.masterY = com.getInteger("mY"); this.masterZ = com.getInteger("mZ"); - this.getDataWatcher() - .updateObject( - ModConfig.entityNoClipItemDatawatcherMasterId, - new ChunkCoordinates(this.masterX, this.masterY, this.masterZ)); + this.getDataWatcher().updateObject( + ModConfig.entityNoClipItemDatawatcherMasterId, + new ChunkCoordinates(this.masterX, this.masterY, this.masterZ)); ChunkCoordinates cc = new ChunkCoordinates( Float.floatToIntBits(this.fixPosX), Float.floatToIntBits(this.fixPosY), diff --git a/src/main/java/makeo/gadomancy/common/entities/ai/AIBreakBlock.java b/src/main/java/makeo/gadomancy/common/entities/ai/AIBreakBlock.java index 7f388ae..36f0da5 100644 --- a/src/main/java/makeo/gadomancy/common/entities/ai/AIBreakBlock.java +++ b/src/main/java/makeo/gadomancy/common/entities/ai/AIBreakBlock.java @@ -4,8 +4,10 @@ import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.util.Map; + import makeo.gadomancy.common.entities.fake.AdvancedFakePlayer; import makeo.gadomancy.common.entities.fake.GolemFakePlayer; + import net.minecraft.block.Block; import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.init.Blocks; @@ -17,20 +19,20 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.WorldServer; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.common.config.Config; import thaumcraft.common.entities.golems.EntityGolemBase; import thaumcraft.common.entities.golems.Marker; import thaumcraft.common.lib.utils.InventoryUtils; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 17.09.2015 20:22 */ public class AIBreakBlock extends EntityAIBase { + private static final int BLACKLIST_TICKS = 20 * 40; private EntityGolemBase golem; @@ -89,14 +91,12 @@ public class AIBreakBlock extends EntityAIBase { } this.clickCount++; - this.golem - .getLookHelper() - .setLookPosition( - this.currentMarker.x + 0.5D, - this.currentMarker.y + 0.5D, - this.currentMarker.z + 0.5D, - 30.0F, - 30.0F); + this.golem.getLookHelper().setLookPosition( + this.currentMarker.x + 0.5D, + this.currentMarker.y + 0.5D, + this.currentMarker.z + 0.5D, + 30.0F, + 30.0F); this.count = 0; } else { @@ -104,13 +104,11 @@ public class AIBreakBlock extends EntityAIBase { this.count = 0; ForgeDirection dir = ForgeDirection.getOrientation(this.currentMarker.side); - boolean path = this.golem - .getNavigator() - .tryMoveToXYZ( - this.currentMarker.x + 0.5D + dir.offsetX, - this.currentMarker.y + 0.5D + dir.offsetY, - this.currentMarker.z + 0.5D + dir.offsetZ, - this.golem.getAIMoveSpeed()); + boolean path = this.golem.getNavigator().tryMoveToXYZ( + this.currentMarker.x + 0.5D + dir.offsetX, + this.currentMarker.y + 0.5D + dir.offsetY, + this.currentMarker.z + 0.5D + dir.offsetZ, + this.golem.getAIMoveSpeed()); if (!path) { if (this.blacklistCount > 10) { this.blacklist.put(this.currentMarker, this.golem.ticksExisted); @@ -154,24 +152,26 @@ public class AIBreakBlock extends EntityAIBase { if (this.player.theItemInWorldManager.durabilityRemainingOnBlock == -1 || !this.player.theItemInWorldManager.isDestroyingBlock) { this.player.theItemInWorldManager.onBlockClicked( - this.currentMarker.x, this.currentMarker.y, this.currentMarker.z, this.currentMarker.side); + this.currentMarker.x, + this.currentMarker.y, + this.currentMarker.z, + this.currentMarker.side); } else if (this.player.theItemInWorldManager.durabilityRemainingOnBlock >= 9) { - this.player.theItemInWorldManager.uncheckedTryHarvestBlock( - this.currentMarker.x, this.currentMarker.y, this.currentMarker.z); + this.player.theItemInWorldManager + .uncheckedTryHarvestBlock(this.currentMarker.x, this.currentMarker.y, this.currentMarker.z); this.player.theItemInWorldManager.durabilityRemainingOnBlock = -1; if (tool != null) { - Block block = - this.golem.worldObj.getBlock(this.currentMarker.x, this.currentMarker.y, this.currentMarker.z); - tool.getItem() - .onBlockDestroyed( - tool, - this.golem.worldObj, - block, - this.currentMarker.x, - this.currentMarker.y, - this.currentMarker.z, - this.player); + Block block = this.golem.worldObj + .getBlock(this.currentMarker.x, this.currentMarker.y, this.currentMarker.z); + tool.getItem().onBlockDestroyed( + tool, + this.golem.worldObj, + block, + this.currentMarker.x, + this.currentMarker.y, + this.currentMarker.z, + this.player); } } this.hasValidTool(); @@ -180,11 +180,10 @@ public class AIBreakBlock extends EntityAIBase { private void cancelLeftClick() { ItemInWorldManager manager = this.player.theItemInWorldManager; - if (manager.isDestroyingBlock) - this.player.theItemInWorldManager.cancelDestroyingBlock( - manager.partiallyDestroyedBlockX, - manager.partiallyDestroyedBlockY, - manager.partiallyDestroyedBlockZ); + if (manager.isDestroyingBlock) this.player.theItemInWorldManager.cancelDestroyingBlock( + manager.partiallyDestroyedBlockX, + manager.partiallyDestroyedBlockY, + manager.partiallyDestroyedBlockZ); } private Marker getNextMarker() { @@ -207,7 +206,9 @@ public class AIBreakBlock extends EntityAIBase { private double distanceSquaredToGolem(double x, double y, double z, int facing) { ForgeDirection dir = ForgeDirection.getOrientation(facing); return this.golem.getDistanceSq( - x + 0.5 + (0.5 * dir.offsetX), y + 0.5 + (0.5 * dir.offsetY), z + 0.5 + (0.5 * dir.offsetZ)); + x + 0.5 + (0.5 * dir.offsetX), + y + 0.5 + (0.5 * dir.offsetY), + z + 0.5 + (0.5 * dir.offsetZ)); } private boolean isInHomeRange() { @@ -265,7 +266,9 @@ public class AIBreakBlock extends EntityAIBase { ChunkCoordinates coords = this.golem.getHomePosition(); ForgeDirection facing = ForgeDirection.getOrientation(this.golem.homeFacing); TileEntity tile = this.golem.worldObj.getTileEntity( - coords.posX - facing.offsetX, coords.posY - facing.offsetY, coords.posZ - facing.offsetZ); + coords.posX - facing.offsetX, + coords.posY - facing.offsetY, + coords.posZ - facing.offsetZ); if (tile instanceof IInventory) { return (IInventory) tile; } @@ -318,10 +321,8 @@ public class AIBreakBlock extends EntityAIBase { boolean empty = true; for (int slot = 0; slot < this.golem.inventory.slotCount; slot++) { ItemStack stack = this.golem.inventory.inventory[slot]; - if (stack != null - && Block.getBlockFromItem(stack.getItem()) == Blocks.air - && (this.currentMarker == null - || this.golem.colors[slot] == -1 + if (stack != null && Block.getBlockFromItem(stack.getItem()) == Blocks.air + && (this.currentMarker == null || this.golem.colors[slot] == -1 || this.currentMarker.color == -1 || this.golem.colors[slot] == this.currentMarker.color)) { empty = false; diff --git a/src/main/java/makeo/gadomancy/common/entities/ai/AIFollowOwner.java b/src/main/java/makeo/gadomancy/common/entities/ai/AIFollowOwner.java index efe4619..22f5dd1 100644 --- a/src/main/java/makeo/gadomancy/common/entities/ai/AIFollowOwner.java +++ b/src/main/java/makeo/gadomancy/common/entities/ai/AIFollowOwner.java @@ -4,14 +4,13 @@ import net.minecraft.entity.ai.EntityAIFollowOwner; import net.minecraft.entity.passive.EntityTameable; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 31.10.2015 15:55 */ public class AIFollowOwner extends EntityAIFollowOwner { + private EntityTameable entity; public AIFollowOwner(EntityTameable entity, float minDist, float maxDist) { diff --git a/src/main/java/makeo/gadomancy/common/entities/ai/AISit.java b/src/main/java/makeo/gadomancy/common/entities/ai/AISit.java index 65db026..c94c87e 100644 --- a/src/main/java/makeo/gadomancy/common/entities/ai/AISit.java +++ b/src/main/java/makeo/gadomancy/common/entities/ai/AISit.java @@ -2,18 +2,19 @@ package makeo.gadomancy.common.entities.ai; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.entities.golems.nbt.ExtendedGolemProperties; + import net.minecraft.entity.ai.EntityAIBase; + import thaumcraft.common.entities.golems.EntityGolemBase; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 31.10.2015 20:15 */ public class AISit extends EntityAIBase { + private EntityGolemBase golem; private ExtendedGolemProperties properties; diff --git a/src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedAttackOnCollide.java b/src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedAttackOnCollide.java index ac5e655..921b7e8 100644 --- a/src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedAttackOnCollide.java +++ b/src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedAttackOnCollide.java @@ -1,20 +1,21 @@ package makeo.gadomancy.common.entities.ai; import makeo.gadomancy.common.utils.Injector; + import net.minecraft.entity.EntityLivingBase; import net.minecraft.pathfinding.PathEntity; + import thaumcraft.common.entities.ai.combat.AIGolemAttackOnCollide; import thaumcraft.common.entities.golems.EntityGolemBase; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 31.10.2015 19:11 */ public class AIUncheckedAttackOnCollide extends AIGolemAttackOnCollide { + private static final Injector INJECTOR = new Injector(AIGolemAttackOnCollide.class); private EntityGolemBase golem; diff --git a/src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedDartAttack.java b/src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedDartAttack.java index 27c9ce8..d299226 100644 --- a/src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedDartAttack.java +++ b/src/main/java/makeo/gadomancy/common/entities/ai/AIUncheckedDartAttack.java @@ -1,19 +1,20 @@ package makeo.gadomancy.common.entities.ai; import makeo.gadomancy.common.utils.Injector; + import net.minecraft.entity.EntityLivingBase; + import thaumcraft.common.entities.ai.combat.AIDartAttack; import thaumcraft.common.entities.golems.EntityGolemBase; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 31.10.2015 20:03 */ public class AIUncheckedDartAttack extends AIDartAttack { + private static final Injector INJECTOR = new Injector(AIDartAttack.class); private EntityGolemBase golem; diff --git a/src/main/java/makeo/gadomancy/common/entities/fake/AdvancedFakePlayer.java b/src/main/java/makeo/gadomancy/common/entities/fake/AdvancedFakePlayer.java index 1c517a5..9e550f6 100644 --- a/src/main/java/makeo/gadomancy/common/entities/fake/AdvancedFakePlayer.java +++ b/src/main/java/makeo/gadomancy/common/entities/fake/AdvancedFakePlayer.java @@ -1,8 +1,9 @@ package makeo.gadomancy.common.entities.fake; -import com.mojang.authlib.GameProfile; import java.util.UUID; + import makeo.gadomancy.common.Gadomancy; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; @@ -10,15 +11,16 @@ import net.minecraft.server.MinecraftServer; import net.minecraft.world.WorldServer; import net.minecraftforge.common.util.FakePlayer; +import com.mojang.authlib.GameProfile; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 19.09.2015 17:14 */ public class AdvancedFakePlayer extends FakePlayer { + protected static final UUID DEFAULT_UUID = UUID.fromString("d36a4fa5-c70e-4358-8418-9ed683687d0a"); public AdvancedFakePlayer(WorldServer world, UUID uuid, String name) { @@ -48,10 +50,7 @@ public class AdvancedFakePlayer extends FakePlayer { EntityPlayerMP mp = (EntityPlayerMP) player; if (mp.playerNetServerHandler == null - || !MinecraftServer.getServer() - .getConfigurationManager() - .playerEntityList - .contains(player) + || !MinecraftServer.getServer().getConfigurationManager().playerEntityList.contains(player) || mp.getPlayerIP() == null || mp.getPlayerIP().trim().isEmpty()) { return true; diff --git a/src/main/java/makeo/gadomancy/common/entities/fake/FakeNetServerHandler.java b/src/main/java/makeo/gadomancy/common/entities/fake/FakeNetServerHandler.java index 1cd7e1c..f2e0fbf 100644 --- a/src/main/java/makeo/gadomancy/common/entities/fake/FakeNetServerHandler.java +++ b/src/main/java/makeo/gadomancy/common/entities/fake/FakeNetServerHandler.java @@ -1,25 +1,27 @@ package makeo.gadomancy.common.entities.fake; -import io.netty.channel.Channel; -import io.netty.channel.ChannelHandlerContext; -import io.netty.util.concurrent.GenericFutureListener; import java.net.SocketAddress; + import javax.crypto.SecretKey; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.network.*; import net.minecraft.network.play.client.*; import net.minecraft.server.MinecraftServer; import net.minecraft.util.IChatComponent; +import io.netty.channel.Channel; +import io.netty.channel.ChannelHandlerContext; +import io.netty.util.concurrent.GenericFutureListener; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 19.09.2015 17:26 */ public class FakeNetServerHandler extends NetHandlerPlayServer { + public FakeNetServerHandler(MinecraftServer server, EntityPlayerMP player) { super(server, new NetworkManagerFake(), player); } @@ -28,8 +30,8 @@ public class FakeNetServerHandler extends NetHandlerPlayServer { public void onNetworkTick() {} @Override - public void setPlayerLocation( - double p_147364_1_, double p_147364_3_, double p_147364_5_, float p_147364_7_, float p_147364_8_) {} + public void setPlayerLocation(double p_147364_1_, double p_147364_3_, double p_147364_5_, float p_147364_7_, + float p_147364_8_) {} @Override public void onDisconnect(IChatComponent p_147231_1_) {} @@ -107,6 +109,7 @@ public class FakeNetServerHandler extends NetHandlerPlayServer { public void processHeldItemChange(C09PacketHeldItemChange p_147355_1_) {} private static class NetworkManagerFake extends NetworkManager { + public NetworkManagerFake() { super(false); } diff --git a/src/main/java/makeo/gadomancy/common/entities/fake/GolemFakePlayer.java b/src/main/java/makeo/gadomancy/common/entities/fake/GolemFakePlayer.java index b2fe7cf..351e278 100644 --- a/src/main/java/makeo/gadomancy/common/entities/fake/GolemFakePlayer.java +++ b/src/main/java/makeo/gadomancy/common/entities/fake/GolemFakePlayer.java @@ -2,21 +2,22 @@ package makeo.gadomancy.common.entities.fake; import java.util.Collection; import java.util.UUID; + import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.world.WorldServer; + import thaumcraft.common.entities.golems.EntityGolemBase; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 19.09.2015 18:02 */ public class GolemFakePlayer extends AdvancedFakePlayer { + private EntityGolemBase golem; public GolemFakePlayer(WorldServer world, EntityGolemBase golem, UUID uuid) { diff --git a/src/main/java/makeo/gadomancy/common/entities/golems/ItemAdditionalGolemPlacer.java b/src/main/java/makeo/gadomancy/common/entities/golems/ItemAdditionalGolemPlacer.java index 59b2b59..59b8d8b 100644 --- a/src/main/java/makeo/gadomancy/common/entities/golems/ItemAdditionalGolemPlacer.java +++ b/src/main/java/makeo/gadomancy/common/entities/golems/ItemAdditionalGolemPlacer.java @@ -1,10 +1,10 @@ package makeo.gadomancy.common.entities.golems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.List; + import makeo.gadomancy.api.golems.AdditionalGolemType; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -12,17 +12,19 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; + import thaumcraft.common.entities.golems.ItemGolemPlacer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 02.06.2015 23:05 */ public class ItemAdditionalGolemPlacer extends Item { + private final ItemGolemPlacer placer = new ItemGolemPlacer(); private final AdditionalGolemType type; @@ -45,8 +47,7 @@ public class ItemAdditionalGolemPlacer extends Item { @Override public void getSubItems(Item item, CreativeTabs tab, List list) { - list.add(new ItemStack( - this.type.getPlacerItem(), 1, this.type.getEnumEntry().ordinal())); + list.add(new ItemStack(this.type.getPlacerItem(), 1, this.type.getEnumEntry().ordinal())); } public IIcon getIcon(ItemStack stack, int pass) { @@ -95,17 +96,8 @@ public class ItemAdditionalGolemPlacer extends Item { } @Override - public boolean onItemUseFirst( - ItemStack stack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int side, - float hitX, - float hitY, - float hitZ) { + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, + float hitX, float hitY, float hitZ) { return this.placer.onItemUseFirst(stack, player, world, x, y, z, side, hitX, hitY, hitZ); } } diff --git a/src/main/java/makeo/gadomancy/common/entities/golems/cores/BodyguardGolemCore.java b/src/main/java/makeo/gadomancy/common/entities/golems/cores/BodyguardGolemCore.java index 4a9910d..13c7584 100644 --- a/src/main/java/makeo/gadomancy/common/entities/golems/cores/BodyguardGolemCore.java +++ b/src/main/java/makeo/gadomancy/common/entities/golems/cores/BodyguardGolemCore.java @@ -2,6 +2,7 @@ package makeo.gadomancy.common.entities.golems.cores; import java.util.ArrayList; import java.util.Random; + import makeo.gadomancy.api.golems.cores.AdditionalGolemCore; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.entities.ai.AIFollowOwner; @@ -10,6 +11,7 @@ import makeo.gadomancy.common.entities.ai.AIUncheckedAttackOnCollide; import makeo.gadomancy.common.entities.ai.AIUncheckedDartAttack; import makeo.gadomancy.common.entities.golems.nbt.ExtendedGolemProperties; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityLivingBase; @@ -20,19 +22,19 @@ import net.minecraft.entity.passive.EntityTameable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.pathfinding.PathNavigate; + import thaumcraft.common.entities.ai.misc.AIOpenDoor; import thaumcraft.common.entities.golems.EntityGolemBase; import thaumcraft.common.entities.golems.Marker; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 31.10.2015 15:35 */ public class BodyguardGolemCore extends AdditionalGolemCore { + @Override public void setupGolem(EntityGolemBase golem) { WrappedGolem wrapped = new WrappedGolem(golem); @@ -63,6 +65,7 @@ public class BodyguardGolemCore extends AdditionalGolemCore { } private static class WrappedGolem extends EntityTameable { + private EntityGolemBase golem; public WrappedGolem(EntityGolemBase golem) { diff --git a/src/main/java/makeo/gadomancy/common/entities/golems/cores/BreakGolemCore.java b/src/main/java/makeo/gadomancy/common/entities/golems/cores/BreakGolemCore.java index e8a7a43..5d56bdf 100644 --- a/src/main/java/makeo/gadomancy/common/entities/golems/cores/BreakGolemCore.java +++ b/src/main/java/makeo/gadomancy/common/entities/golems/cores/BreakGolemCore.java @@ -3,23 +3,24 @@ package makeo.gadomancy.common.entities.golems.cores; import makeo.gadomancy.api.golems.cores.AdditionalGolemCore; import makeo.gadomancy.common.entities.ai.AIBreakBlock; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; + import thaumcraft.common.entities.ai.misc.AIOpenDoor; import thaumcraft.common.entities.ai.misc.AIReturnHome; import thaumcraft.common.entities.golems.EntityGolemBase; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 31.08.2015 13:38 */ public class BreakGolemCore extends AdditionalGolemCore { + @Override public void setupGolem(EntityGolemBase golem) { golem.tasks.addTask(0, new AIBreakBlock(golem)); diff --git a/src/main/java/makeo/gadomancy/common/entities/golems/cores/EntityAITasksWrapper.java b/src/main/java/makeo/gadomancy/common/entities/golems/cores/EntityAITasksWrapper.java index 6736d45..bd99fb2 100644 --- a/src/main/java/makeo/gadomancy/common/entities/golems/cores/EntityAITasksWrapper.java +++ b/src/main/java/makeo/gadomancy/common/entities/golems/cores/EntityAITasksWrapper.java @@ -2,22 +2,24 @@ package makeo.gadomancy.common.entities.golems.cores; import java.util.ArrayList; import java.util.Collection; + import makeo.gadomancy.api.GadomancyApi; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.entities.golems.nbt.ExtendedGolemProperties; + import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.entity.ai.EntityAITasks; + import thaumcraft.common.entities.golems.EntityGolemBase; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 25.08.2015 22:24 */ public class EntityAITasksWrapper extends EntityAITasks { + private final EntityGolemBase golem; private final EntityAITasks original; private boolean locked = true; @@ -37,6 +39,7 @@ public class EntityAITasksWrapper extends EntityAITasks { } private class WrapperList extends ArrayList { + private WrapperList(Collection c) { super(c); } diff --git a/src/main/java/makeo/gadomancy/common/entities/golems/nbt/ExtendedGolemProperties.java b/src/main/java/makeo/gadomancy/common/entities/golems/nbt/ExtendedGolemProperties.java index 615a148..637a086 100644 --- a/src/main/java/makeo/gadomancy/common/entities/golems/nbt/ExtendedGolemProperties.java +++ b/src/main/java/makeo/gadomancy/common/entities/golems/nbt/ExtendedGolemProperties.java @@ -7,21 +7,22 @@ import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.data.config.ModConfig; import makeo.gadomancy.common.entities.golems.cores.EntityAITasksWrapper; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; import net.minecraftforge.common.IExtendedEntityProperties; + import thaumcraft.common.entities.golems.EntityGolemBase; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 28.07.2015 17:25 */ public class ExtendedGolemProperties implements IExtendedEntityProperties { + private static final String TYPE_TAG = "golemTypeOverride"; private static final String FORGE_TAG = "ForgeData"; @@ -95,8 +96,7 @@ public class ExtendedGolemProperties implements IExtendedEntityProperties { AdditionalGolemType type = ExtendedGolemProperties.readAdvancedGolemType(this.golem.getEntityData()); if (type != null) { byte lastType = compound.getByte("GolemType"); - compound.setTag("GolemType", new OverrideNBTTagByte(lastType, (byte) - type.getEnumEntry().ordinal())); + compound.setTag("GolemType", new OverrideNBTTagByte(lastType, (byte) type.getEnumEntry().ordinal())); this.health = compound.getFloat("HealF") * -1; this.updateHealth = true; diff --git a/src/main/java/makeo/gadomancy/common/entities/golems/nbt/OverrideNBTTagByte.java b/src/main/java/makeo/gadomancy/common/entities/golems/nbt/OverrideNBTTagByte.java index 56e5044..dd8d8f8 100644 --- a/src/main/java/makeo/gadomancy/common/entities/golems/nbt/OverrideNBTTagByte.java +++ b/src/main/java/makeo/gadomancy/common/entities/golems/nbt/OverrideNBTTagByte.java @@ -3,14 +3,13 @@ package makeo.gadomancy.common.entities.golems.nbt; import net.minecraft.nbt.NBTTagByte; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 28.07.2015 17:03 */ public class OverrideNBTTagByte extends NBTTagByte { + private boolean override = true; private byte overrideData; diff --git a/src/main/java/makeo/gadomancy/common/entities/golems/nbt/OverrideRidingEntity.java b/src/main/java/makeo/gadomancy/common/entities/golems/nbt/OverrideRidingEntity.java index e6e98bd..2f0d5d2 100644 --- a/src/main/java/makeo/gadomancy/common/entities/golems/nbt/OverrideRidingEntity.java +++ b/src/main/java/makeo/gadomancy/common/entities/golems/nbt/OverrideRidingEntity.java @@ -2,18 +2,18 @@ package makeo.gadomancy.common.entities.golems.nbt; import net.minecraft.entity.Entity; import net.minecraft.nbt.NBTTagCompound; + import thaumcraft.common.entities.golems.EntityGolemBase; import thaumcraft.common.entities.golems.EnumGolemType; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 28.07.2015 18:11 */ public class OverrideRidingEntity extends Entity { + private static final EnumGolemType DEFAULT_TYPE = EnumGolemType.WOOD; private EntityGolemBase golem; diff --git a/src/main/java/makeo/gadomancy/common/entities/golems/types/ObsidianGolemType.java b/src/main/java/makeo/gadomancy/common/entities/golems/types/ObsidianGolemType.java index 8d550ad..4a2b65c 100644 --- a/src/main/java/makeo/gadomancy/common/entities/golems/types/ObsidianGolemType.java +++ b/src/main/java/makeo/gadomancy/common/entities/golems/types/ObsidianGolemType.java @@ -3,20 +3,20 @@ package makeo.gadomancy.common.entities.golems.types; import makeo.gadomancy.api.golems.AdditionalGolemType; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.utils.SimpleResourceLocation; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 21.12.2015 19:29 */ public class ObsidianGolemType extends AdditionalGolemType { + public ObsidianGolemType() { super(50, 18, 0.27F, true, 2, 32, 100, 6); } diff --git a/src/main/java/makeo/gadomancy/common/entities/golems/types/RemovedGolemType.java b/src/main/java/makeo/gadomancy/common/entities/golems/types/RemovedGolemType.java index 833923a..41c7436 100644 --- a/src/main/java/makeo/gadomancy/common/entities/golems/types/RemovedGolemType.java +++ b/src/main/java/makeo/gadomancy/common/entities/golems/types/RemovedGolemType.java @@ -1,20 +1,20 @@ package makeo.gadomancy.common.entities.golems.types; import makeo.gadomancy.api.golems.AdditionalGolemType; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 29.07.2015 00:15 */ public class RemovedGolemType extends AdditionalGolemType { + public RemovedGolemType() { super(0, 0, 0, false, 0, 0, 1000, 0); } diff --git a/src/main/java/makeo/gadomancy/common/entities/golems/types/SilverwoodGolemType.java b/src/main/java/makeo/gadomancy/common/entities/golems/types/SilverwoodGolemType.java index 94aa14c..db29368 100644 --- a/src/main/java/makeo/gadomancy/common/entities/golems/types/SilverwoodGolemType.java +++ b/src/main/java/makeo/gadomancy/common/entities/golems/types/SilverwoodGolemType.java @@ -3,20 +3,20 @@ package makeo.gadomancy.common.entities.golems.types; import makeo.gadomancy.api.golems.AdditionalGolemType; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.utils.SimpleResourceLocation; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 28.07.2015 02:39 */ public class SilverwoodGolemType extends AdditionalGolemType { + public SilverwoodGolemType() { super(20, 9, 0.38f, false, 3, 8, 75, 1); } diff --git a/src/main/java/makeo/gadomancy/common/entities/golems/upgrades/GolemUpgrade.java b/src/main/java/makeo/gadomancy/common/entities/golems/upgrades/GolemUpgrade.java index d8ccccc..361d305 100644 --- a/src/main/java/makeo/gadomancy/common/entities/golems/upgrades/GolemUpgrade.java +++ b/src/main/java/makeo/gadomancy/common/entities/golems/upgrades/GolemUpgrade.java @@ -2,21 +2,22 @@ package makeo.gadomancy.common.entities.golems.upgrades; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagByte; import net.minecraft.nbt.NBTTagCompound; + import thaumcraft.common.entities.golems.EntityGolemBase; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 16.06.2015 14:38 */ public abstract class GolemUpgrade { + private static final String UPGRADE_COMPOUND = "upgrades"; public abstract String getName(); @@ -50,8 +51,7 @@ public abstract class GolemUpgrade { NBTTagCompound upgrades = compound.getCompoundTag(GolemUpgrade.UPGRADE_COMPOUND); try { return (T) upgrades.getTag(this.getTagName()); - } catch (ClassCastException ignored) { - } + } catch (ClassCastException ignored) {} } return null; } diff --git a/src/main/java/makeo/gadomancy/common/entities/golems/upgrades/GolemUpgradeRunicShield.java b/src/main/java/makeo/gadomancy/common/entities/golems/upgrades/GolemUpgradeRunicShield.java index a0ce141..05ae589 100644 --- a/src/main/java/makeo/gadomancy/common/entities/golems/upgrades/GolemUpgradeRunicShield.java +++ b/src/main/java/makeo/gadomancy/common/entities/golems/upgrades/GolemUpgradeRunicShield.java @@ -1,24 +1,25 @@ package makeo.gadomancy.common.entities.golems.upgrades; -import cpw.mods.fml.common.network.NetworkRegistry; import makeo.gadomancy.common.registration.RegisteredGolemStuff; + import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; + import thaumcraft.common.entities.golems.EntityGolemBase; import thaumcraft.common.entities.golems.EnumGolemType; import thaumcraft.common.lib.network.PacketHandler; import thaumcraft.common.lib.network.fx.PacketFXShield; +import cpw.mods.fml.common.network.NetworkRegistry; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 16.06.2015 12:50 */ public class GolemUpgradeRunicShield extends GolemUpgrade { + private static final String LAST_DISCHARGE_TAG = "lastRunicDischarge"; @Override @@ -59,7 +60,11 @@ public class GolemUpgradeRunicShield extends GolemUpgrade { PacketHandler.INSTANCE.sendToAllAround( new PacketFXShield(golem.getEntityId(), target), new NetworkRegistry.TargetPoint( - golem.worldObj.provider.dimensionId, golem.posX, golem.posY, golem.posZ, 64.0D)); + golem.worldObj.provider.dimensionId, + golem.posX, + golem.posY, + golem.posZ, + 64.0D)); } public float getCharge(EntityGolemBase golem) { @@ -98,8 +103,7 @@ public class GolemUpgradeRunicShield extends GolemUpgrade { public int getChargeLimit(ItemStack stack) { EnumGolemType type = EnumGolemType.getType(stack.getItemDamage()); float maxHealth = type.health; - if (stack.hasTagCompound() - && stack.getTagCompound().hasKey("deco") + if (stack.hasTagCompound() && stack.getTagCompound().hasKey("deco") && stack.getTagCompound().getString("deco").contains("H")) { maxHealth += 5; } diff --git a/src/main/java/makeo/gadomancy/common/entities/player/ExtendedPlayerProperties.java b/src/main/java/makeo/gadomancy/common/entities/player/ExtendedPlayerProperties.java index 53ab00f..8d422d7 100644 --- a/src/main/java/makeo/gadomancy/common/entities/player/ExtendedPlayerProperties.java +++ b/src/main/java/makeo/gadomancy/common/entities/player/ExtendedPlayerProperties.java @@ -1,6 +1,7 @@ package makeo.gadomancy.common.entities.player; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; @@ -8,14 +9,13 @@ import net.minecraft.world.World; import net.minecraftforge.common.IExtendedEntityProperties; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 05.07.2015 12:39 */ public class ExtendedPlayerProperties implements IExtendedEntityProperties { + private static final int TRANSFORM_INDEX = 26; private static final ExtendedPlayerProperties DEFAULTS = new ExtendedPlayerProperties(null); @@ -39,8 +39,8 @@ public class ExtendedPlayerProperties implements IExtendedEntityProperties { public void loadNBTData(NBTTagCompound compound) { NBTTagCompound modData = NBTHelper.getPersistentData(compound); - this.isTransformed = - NBTHelper.getBoolean(modData, "isTransformed", ExtendedPlayerProperties.DEFAULTS.isTransformed); + this.isTransformed = NBTHelper + .getBoolean(modData, "isTransformed", ExtendedPlayerProperties.DEFAULTS.isTransformed); this.player.getDataWatcher().updateObject(ExtendedPlayerProperties.TRANSFORM_INDEX, this.isTransformed); } diff --git a/src/main/java/makeo/gadomancy/common/entities/player/FakePlayerEntity.java b/src/main/java/makeo/gadomancy/common/entities/player/FakePlayerEntity.java index 18f8077..4715da0 100644 --- a/src/main/java/makeo/gadomancy/common/entities/player/FakePlayerEntity.java +++ b/src/main/java/makeo/gadomancy/common/entities/player/FakePlayerEntity.java @@ -1,22 +1,23 @@ package makeo.gadomancy.common.entities.player; -import com.mojang.authlib.GameProfile; import java.util.UUID; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.IChatComponent; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import com.mojang.authlib.GameProfile; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 06.12.2015 01:01 */ public class FakePlayerEntity extends EntityPlayer { + public FakePlayerEntity(World world) { super(world, new GameProfile(UUID.fromString("d36a4fa5-c70e-4358-8418-9ed683687d0a"), "bla")); } diff --git a/src/main/java/makeo/gadomancy/common/events/EventHandlerEntity.java b/src/main/java/makeo/gadomancy/common/events/EventHandlerEntity.java index 4fcc71a..03781a3 100644 --- a/src/main/java/makeo/gadomancy/common/events/EventHandlerEntity.java +++ b/src/main/java/makeo/gadomancy/common/events/EventHandlerEntity.java @@ -1,9 +1,8 @@ package makeo.gadomancy.common.events; -import cpw.mods.fml.common.eventhandler.Event; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import java.util.ArrayList; import java.util.List; + import makeo.gadomancy.common.aura.AuraEffects; import makeo.gadomancy.common.blocks.tiles.TileAIShutdown; import makeo.gadomancy.common.blocks.tiles.TileBlockProtector; @@ -12,6 +11,7 @@ import makeo.gadomancy.common.entities.EntityPermNoClipItem; import makeo.gadomancy.common.utils.MiscUtils; import makeo.gadomancy.common.utils.Vector3; import makeo.gadomancy.common.utils.world.TCMazeHandler; + import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.boss.IBossDisplayData; @@ -26,13 +26,14 @@ import net.minecraftforge.event.entity.living.LivingDeathEvent; import net.minecraftforge.event.entity.living.LivingEvent; import net.minecraftforge.event.entity.living.LivingSpawnEvent; import net.minecraftforge.event.entity.player.EntityItemPickupEvent; + import thaumcraft.common.items.armor.Hover; +import cpw.mods.fml.common.eventhandler.Event; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 31.10.2015 15:28 */ @@ -40,12 +41,11 @@ public class EventHandlerEntity { public static List registeredLuxPylons = new ArrayList(); - /*@SubscribeEvent(priority = EventPriority.LOWEST) - public void on(EntityEvent.EntityConstructing e) { - if (e.entity instanceof EntityPlayer) { - //e.entity.registerExtendedProperties(Gadomancy.MODID, new ExtendedPlayerProperties((EntityPlayer) e.entity)); - } - }*/ + /* + * @SubscribeEvent(priority = EventPriority.LOWEST) public void on(EntityEvent.EntityConstructing e) { if (e.entity + * instanceof EntityPlayer) { //e.entity.registerExtendedProperties(Gadomancy.MODID, new + * ExtendedPlayerProperties((EntityPlayer) e.entity)); } } + */ @SubscribeEvent public void on(LivingSpawnEvent.CheckSpawn event) { @@ -71,12 +71,11 @@ public class EventHandlerEntity { } } - /*@SubscribeEvent - public void on(LivingSetAttackTargetEvent targetEvent) { - if (targetEvent.target instanceof EntityPlayer) { - FamiliarAIController_Old.notifyTargetEvent(targetEvent.entityLiving, (EntityPlayer) targetEvent.target); - } - }*/ + /* + * @SubscribeEvent public void on(LivingSetAttackTargetEvent targetEvent) { if (targetEvent.target instanceof + * EntityPlayer) { FamiliarAIController_Old.notifyTargetEvent(targetEvent.entityLiving, (EntityPlayer) + * targetEvent.target); } } + */ @SubscribeEvent public void on(LivingDeathEvent event) { @@ -96,8 +95,7 @@ public class EventHandlerEntity { if (event.item instanceof EntityPermNoClipItem) { EntityPermNoClipItem item = (EntityPermNoClipItem) event.item; ChunkCoordinates master = (ChunkCoordinates) item.getDataWatcher() - .getWatchedObject(ModConfig.entityNoClipItemDatawatcherMasterId) - .getObject(); + .getWatchedObject(ModConfig.entityNoClipItemDatawatcherMasterId).getObject(); TileEntity te = event.entityPlayer.worldObj.getTileEntity(master.posX, master.posY, master.posZ); if (!(te instanceof EntityPermNoClipItem.IItemMasterTile)) return; ((EntityPermNoClipItem.IItemMasterTile) te).informItemRemoval(); @@ -109,8 +107,7 @@ public class EventHandlerEntity { public void on(LivingEvent.LivingUpdateEvent event) { if (!(event.entityLiving instanceof EntityPlayer)) return; EntityPlayer player = (EntityPlayer) event.entity; - if ((event.entity.worldObj.provider.dimensionId == ModConfig.dimOuterId) - && ((player.ticksExisted & 7) == 0) + if ((event.entity.worldObj.provider.dimensionId == ModConfig.dimOuterId) && ((player.ticksExisted & 7) == 0) && ((player.capabilities.isFlying) || (Hover.getHover(player.getEntityId())))) { if (player.capabilities.isCreativeMode && MiscUtils.isANotApprovedOrMisunderstoodPersonFromMoreDoor(player)) return; diff --git a/src/main/java/makeo/gadomancy/common/events/EventHandlerGolem.java b/src/main/java/makeo/gadomancy/common/events/EventHandlerGolem.java index d182775..3e8546a 100644 --- a/src/main/java/makeo/gadomancy/common/events/EventHandlerGolem.java +++ b/src/main/java/makeo/gadomancy/common/events/EventHandlerGolem.java @@ -1,9 +1,8 @@ package makeo.gadomancy.common.events; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import java.util.HashMap; import java.util.Map; + import makeo.gadomancy.api.GadomancyApi; import makeo.gadomancy.api.golems.AdditionalGolemType; import makeo.gadomancy.api.golems.cores.AdditionalGolemCore; @@ -18,6 +17,7 @@ import makeo.gadomancy.common.entities.golems.nbt.ExtendedGolemProperties; import makeo.gadomancy.common.registration.RegisteredGolemStuff; import makeo.gadomancy.common.registration.RegisteredPotions; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.item.EntityItem; @@ -34,21 +34,23 @@ import net.minecraftforge.event.entity.player.AttackEntityEvent; import net.minecraftforge.event.entity.player.EntityInteractEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.event.entity.player.PlayerInteractEvent; + import thaumcraft.common.config.ConfigItems; import thaumcraft.common.entities.golems.EntityGolemBase; import thaumcraft.common.entities.golems.EnumGolemType; import thaumcraft.common.entities.golems.ItemGolemPlacer; import thaumcraft.common.items.wands.ItemWandCasting; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 13.03.2015 13:56 */ public class EventHandlerGolem { + @SubscribeEvent(priority = EventPriority.LOWEST) public void on(EntityEvent.EntityConstructing e) { if (e.entity instanceof EntityGolemBase) { @@ -65,8 +67,8 @@ public class EventHandlerGolem { if (event.entity instanceof EntityGolemBase) { EntityGolemBase golem = (EntityGolemBase) event.entity; if (GadomancyApi.isAdditionalGolemType(golem.getGolemType())) { - ExtendedGolemProperties props = - (ExtendedGolemProperties) event.entity.getExtendedProperties(Gadomancy.MODID); + ExtendedGolemProperties props = (ExtendedGolemProperties) event.entity + .getExtendedProperties(Gadomancy.MODID); if (props.shouldUpdateHealth()) { props.resetUpdateHealth(); golem.setHealth(props.getHealth()); @@ -90,8 +92,8 @@ public class EventHandlerGolem { ItemStack stack = item.getEntityItem(); if (stack.getItem() == ConfigItems.itemGolemPlacer) { - AdditionalGolemType type = - GadomancyApi.getAdditionalGolemType(EnumGolemType.getType(stack.getItemDamage())); + AdditionalGolemType type = GadomancyApi + .getAdditionalGolemType(EnumGolemType.getType(stack.getItemDamage())); if (type != null) { ItemStack fakePlacer = new ItemStack(type.getPlacerItem()); fakePlacer.setTagCompound(stack.getTagCompound()); @@ -114,12 +116,10 @@ public class EventHandlerGolem { public void on(PlayerInteractEvent e) { if (!e.world.isRemote && e.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { ItemStack itemInHand = e.entityPlayer.getHeldItem(); - if (itemInHand != null - && (itemInHand.getItem() instanceof ItemGolemPlacer - || itemInHand.getItem() instanceof ItemAdditionalGolemPlacer)) { + if (itemInHand != null && (itemInHand.getItem() instanceof ItemGolemPlacer + || itemInHand.getItem() instanceof ItemAdditionalGolemPlacer)) { int entityId = Entity.nextEntityID; - if (itemInHand - .getItem() + if (itemInHand.getItem() .onItemUseFirst(itemInHand, e.entityPlayer, e.world, e.x, e.y, e.z, e.face, 0, 0, 0)) { e.setCanceled(true); Entity entity = e.world.getEntityByID(entityId); @@ -127,15 +127,12 @@ public class EventHandlerGolem { EntityGolemBase golem = (EntityGolemBase) entity; // move persistent data to entity - golem.getEntityData() - .setTag( - Gadomancy.MODID, - NBTHelper.getPersistentData(itemInHand).copy()); + golem.getEntityData().setTag(Gadomancy.MODID, NBTHelper.getPersistentData(itemInHand).copy()); MinecraftForge.EVENT_BUS.post(new PlacerCreateGolemEvent(e.entityPlayer, golem, itemInHand)); - ExtendedGolemProperties props = - (ExtendedGolemProperties) golem.getExtendedProperties(Gadomancy.MODID); + ExtendedGolemProperties props = (ExtendedGolemProperties) golem + .getExtendedProperties(Gadomancy.MODID); if (props != null) { props.updateGolemCore(); props.updateGolem(); @@ -155,8 +152,7 @@ public class EventHandlerGolem { @SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true) public void on(PlaySoundAtEntityEvent event) { - if (!event.entity.worldObj.isRemote - && event.entity instanceof EntityGolemBase + if (!event.entity.worldObj.isRemote && event.entity instanceof EntityGolemBase && event.name.equals("thaumcraft:zap") && event.volume == 0.5F && event.pitch == 1.0F) { @@ -180,8 +176,7 @@ public class EventHandlerGolem { if (!movedPlacer && item.getItem() instanceof ItemGolemPlacer || item.getItem() instanceof ItemAdditionalGolemPlacer) { // move persistent data to item - NBTTagCompound persistent = (NBTTagCompound) - NBTHelper.getPersistentData(golem).copy(); + NBTTagCompound persistent = (NBTTagCompound) NBTHelper.getPersistentData(golem).copy(); if (player.isSneaking()) { persistent.removeTag("Core"); } @@ -204,8 +199,7 @@ public class EventHandlerGolem { @SubscribeEvent(priority = EventPriority.LOWEST) public void on(AttackEntityEvent event) { ItemStack heldItem = event.entityPlayer.getHeldItem(); - if (heldItem != null - && heldItem.getItem() == ConfigItems.itemGolemBell + if (heldItem != null && heldItem.getItem() == ConfigItems.itemGolemBell && event.target instanceof EntityGolemBase && !event.target.worldObj.isRemote && !event.target.isDead) { @@ -224,11 +218,12 @@ public class EventHandlerGolem { } } - /*if(event.source.getEntity() != null && event.source.getEntity() instanceof EntityGolemBase - && ((EntityGolemBase) event.source.getEntity()).getGolemType() - == RegisteredGolemStuff.typeObsidian.getEnumEntry()) { - event.entityLiving.addPotionEffect(new PotionEffect(Potion.wither.getId(), 3*20, 1)); - }*/ + /* + * if(event.source.getEntity() != null && event.source.getEntity() instanceof EntityGolemBase && + * ((EntityGolemBase) event.source.getEntity()).getGolemType() == + * RegisteredGolemStuff.typeObsidian.getEnumEntry()) { event.entityLiving.addPotionEffect(new + * PotionEffect(Potion.wither.getId(), 3*20, 1)); } + */ } } @@ -258,16 +253,15 @@ public class EventHandlerGolem { } } else { if (!event.target.worldObj.isRemote) { - if (heldItem == null - || (heldItem.getItem() != ConfigItems.itemGolemBell - && heldItem.getItem() != ConfigItems.itemGolemUpgrade - && heldItem.getItem() != ConfigItems.itemGolemDecoration - && !(heldItem.getItem() instanceof ItemWandCasting))) { + if (heldItem == null || (heldItem.getItem() != ConfigItems.itemGolemBell + && heldItem.getItem() != ConfigItems.itemGolemUpgrade + && heldItem.getItem() != ConfigItems.itemGolemDecoration + && !(heldItem.getItem() instanceof ItemWandCasting))) { AdditionalGolemCore core = GadomancyApi.getAdditionalGolemCore(golem); if (core != null) { if (core.hasGui() && !core.openGui(event.entityPlayer, golem)) { - event.entityPlayer.openGui( - Gadomancy.instance, 0, golem.worldObj, golem.getEntityId(), 0, 0); + event.entityPlayer + .openGui(Gadomancy.instance, 0, golem.worldObj, golem.getEntityId(), 0, 0); } event.setCanceled(true); } @@ -289,8 +283,10 @@ public class EventHandlerGolem { if (event.itemStack.getItem() instanceof ItemGolemPlacer || event.itemStack.getItem() instanceof ItemAdditionalGolemPlacer) { if (RegisteredGolemStuff.upgradeRunicShield.hasUpgrade(event.itemStack)) { - event.toolTip.add("\u00a76" + StatCollector.translateToLocal("item.runic.charge") + " +" - + RegisteredGolemStuff.upgradeRunicShield.getChargeLimit(event.itemStack)); + event.toolTip.add( + "\u00a76" + StatCollector.translateToLocal("item.runic.charge") + + " +" + + RegisteredGolemStuff.upgradeRunicShield.getChargeLimit(event.itemStack)); } AdditionalGolemCore core = GadomancyApi.getAdditionalGolemCore(event.itemStack); diff --git a/src/main/java/makeo/gadomancy/common/events/EventHandlerNetwork.java b/src/main/java/makeo/gadomancy/common/events/EventHandlerNetwork.java index 2f1d080..7c9ef95 100644 --- a/src/main/java/makeo/gadomancy/common/events/EventHandlerNetwork.java +++ b/src/main/java/makeo/gadomancy/common/events/EventHandlerNetwork.java @@ -1,7 +1,5 @@ package makeo.gadomancy.common.events; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.PlayerEvent; import makeo.gadomancy.common.data.DataAchromatic; import makeo.gadomancy.common.data.DataFamiliar; import makeo.gadomancy.common.data.SyncDataHolder; @@ -11,15 +9,17 @@ import makeo.gadomancy.common.network.packets.PacketUpdateGolemTypeOrder; import makeo.gadomancy.common.network.packets.PacketUpdateOnlineState; import makeo.gadomancy.common.utils.GolemEnumHelper; import makeo.gadomancy.common.utils.world.TCMazeHandler; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.server.MinecraftServer; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.PlayerEvent; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 30.07.2015 18:26 */ @@ -31,8 +31,8 @@ public class EventHandlerNetwork { EntityPlayerMP p = (EntityPlayerMP) e.player; PacketHandler.INSTANCE.sendTo(new PacketUpdateGolemTypeOrder(GolemEnumHelper.getCurrentMapping()), p); PacketHandler.INSTANCE.sendTo(new PacketSyncConfigs(), p); - PacketHandler.INSTANCE.sendTo( - new PacketUpdateOnlineState(MinecraftServer.getServer().isServerInOnlineMode()), p); + PacketHandler.INSTANCE + .sendTo(new PacketUpdateOnlineState(MinecraftServer.getServer().isServerInOnlineMode()), p); ((DataFamiliar) SyncDataHolder.getDataServer("FamiliarData")).checkPlayerEquipment(p); ((DataAchromatic) SyncDataHolder.getDataServer("AchromaticData")).checkPotionEffect(p); SyncDataHolder.syncAllDataTo(p); diff --git a/src/main/java/makeo/gadomancy/common/events/EventHandlerRedirect.java b/src/main/java/makeo/gadomancy/common/events/EventHandlerRedirect.java index aedb172..8d028e6 100644 --- a/src/main/java/makeo/gadomancy/common/events/EventHandlerRedirect.java +++ b/src/main/java/makeo/gadomancy/common/events/EventHandlerRedirect.java @@ -1,11 +1,11 @@ package makeo.gadomancy.common.events; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.List; + import makeo.gadomancy.common.registration.RegisteredEnchantments; import makeo.gadomancy.common.registration.RegisteredPotions; import makeo.gadomancy.common.utils.MiscUtils; + import net.minecraft.client.Minecraft; import net.minecraft.enchantment.Enchantment; import net.minecraft.enchantment.EnchantmentHelper; @@ -17,18 +17,20 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.server.MinecraftServer; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.client.event.DrawBlockHighlightEvent; + import thaumcraft.api.aspects.Aspect; import thaumcraft.common.config.ConfigItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 15.12.2015 14:57 */ public class EventHandlerRedirect { + private static final ItemStack ITEM_GOGGLES = new ItemStack(ConfigItems.itemGoggles); private static boolean hasChanged; @@ -78,33 +80,29 @@ public class EventHandlerRedirect { public static int getAdditionalVisDiscount(EntityPlayer player, Aspect aspect, int currentTotalDiscount) { if (player.isPotionActive(RegisteredPotions.VIS_DISCOUNT)) { - currentTotalDiscount += (player.getActivePotionEffect(RegisteredPotions.VIS_DISCOUNT) - .getAmplifier() - + 1) + currentTotalDiscount += (player.getActivePotionEffect(RegisteredPotions.VIS_DISCOUNT).getAmplifier() + 1) * 8; } return currentTotalDiscount; } public static int getFortuneLevel(EntityLivingBase entity) { - int fortuneLevel = - EventHandlerRedirect.getRealEnchantmentLevel(Enchantment.fortune.effectId, entity.getHeldItem()); + int fortuneLevel = EventHandlerRedirect + .getRealEnchantmentLevel(Enchantment.fortune.effectId, entity.getHeldItem()); if (entity.isPotionActive(RegisteredPotions.POTION_LUCK)) { - int lvl = - entity.getActivePotionEffect(RegisteredPotions.POTION_LUCK).getAmplifier() - + 1; // Amplifier 0-indexed + int lvl = entity.getActivePotionEffect(RegisteredPotions.POTION_LUCK).getAmplifier() + 1; // Amplifier + // 0-indexed fortuneLevel += lvl; } return fortuneLevel; } public static int getLootingLevel(EntityLivingBase entity) { - int lootingLevel = - EventHandlerRedirect.getRealEnchantmentLevel(Enchantment.looting.effectId, entity.getHeldItem()); + int lootingLevel = EventHandlerRedirect + .getRealEnchantmentLevel(Enchantment.looting.effectId, entity.getHeldItem()); if (entity.isPotionActive(RegisteredPotions.POTION_LUCK)) { - int lvl = - entity.getActivePotionEffect(RegisteredPotions.POTION_LUCK).getAmplifier() - + 1; // Amplifier 0-indexed + int lvl = entity.getActivePotionEffect(RegisteredPotions.POTION_LUCK).getAmplifier() + 1; // Amplifier + // 0-indexed lootingLevel += lvl; } return lootingLevel; diff --git a/src/main/java/makeo/gadomancy/common/events/EventHandlerWorld.java b/src/main/java/makeo/gadomancy/common/events/EventHandlerWorld.java index cc78bea..58603a7 100644 --- a/src/main/java/makeo/gadomancy/common/events/EventHandlerWorld.java +++ b/src/main/java/makeo/gadomancy/common/events/EventHandlerWorld.java @@ -1,11 +1,9 @@ package makeo.gadomancy.common.events; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; import java.util.HashMap; import java.util.Iterator; import java.util.Map; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.blocks.tiles.TileAIShutdown; import makeo.gadomancy.common.blocks.tiles.TileBlockProtector; @@ -19,6 +17,7 @@ import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.utils.*; import makeo.gadomancy.common.utils.world.TCMazeHandler; + import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; @@ -40,19 +39,22 @@ import net.minecraftforge.event.entity.player.PlayerInteractEvent; import net.minecraftforge.event.world.BlockEvent; import net.minecraftforge.event.world.ExplosionEvent; import net.minecraftforge.event.world.WorldEvent; + import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.items.wands.ItemWandCasting; import thaumcraft.common.tiles.TileJarFillable; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 05.07.2015 13:20 */ public class EventHandlerWorld { + public Map trackedItems = new HashMap(); @SubscribeEvent(priority = EventPriority.LOW) @@ -82,12 +84,10 @@ public class EventHandlerWorld { @SubscribeEvent public void on(TickEvent.WorldTickEvent event) { - if (event.phase == TickEvent.Phase.START - && !event.world.isRemote + if (event.phase == TickEvent.Phase.START && !event.world.isRemote && event.world.getTotalWorldTime() % 10 == 0) { - Iterator> iterator = - this.trackedItems.entrySet().iterator(); + Iterator> iterator = this.trackedItems.entrySet().iterator(); while (iterator.hasNext()) { Map.Entry entry = iterator.next(); EntityItem entity = entry.getKey(); @@ -110,8 +110,12 @@ public class EventHandlerWorld { NBTBase base = compound.getTag("disguise"); if (base instanceof NBTTagCompound) { ItemStack stack = ItemStack.loadItemStackFromNBT((NBTTagCompound) base); - EntityItem newEntity = - new EntityItem(event.world, entity.posX, entity.posY, entity.posZ, stack); + EntityItem newEntity = new EntityItem( + event.world, + entity.posX, + entity.posY, + entity.posZ, + stack); ItemUtils.applyRandomDropOffset(newEntity, event.world.rand); event.world.spawnEntityInWorld(newEntity); } @@ -126,7 +130,11 @@ public class EventHandlerWorld { } } else { Gadomancy.proxy.spawnBubbles( - event.world, (float) entity.posX, (float) entity.posY, (float) entity.posZ, 0.2f); + event.world, + (float) entity.posX, + (float) entity.posY, + (float) entity.posZ, + 0.2f); } } } @@ -134,8 +142,7 @@ public class EventHandlerWorld { } private boolean isDisguised(ItemStack stack) { - return NBTHelper.hasPersistentData(stack) - && NBTHelper.getPersistentData(stack).hasKey("disguise"); + return NBTHelper.hasPersistentData(stack) && NBTHelper.getPersistentData(stack).hasKey("disguise"); } private int serverTick; @@ -161,17 +168,15 @@ public class EventHandlerWorld { GameRules rules = e.world.getGameRules(); rules.theGameRules.put( - "mobGriefing", new ValueOverride(this, String.valueOf(rules.getGameRuleBooleanValue("mobGriefing")))); + "mobGriefing", + new ValueOverride(this, String.valueOf(rules.getGameRuleBooleanValue("mobGriefing")))); } @SubscribeEvent(priority = EventPriority.HIGH) public void on(ExplosionEvent.Start e) { Explosion expl = e.explosion; - if (expl.isSmoking - && (expl.exploder != null - ? TileBlockProtector.isSpotProtected(e.world, expl.exploder) - : TileBlockProtector.isSpotProtected( - e.world, expl.explosionX, expl.explosionY, expl.explosionZ))) { + if (expl.isSmoking && (expl.exploder != null ? TileBlockProtector.isSpotProtected(e.world, expl.exploder) + : TileBlockProtector.isSpotProtected(e.world, expl.explosionX, expl.explosionY, expl.explosionZ))) { // why? // expl.isSmoking = false; e.setCanceled(true); @@ -223,13 +228,11 @@ public class EventHandlerWorld { TileEntity tile = e.world.getTileEntity(e.x, e.y, e.z); if (tile instanceof TileStickyJar) { Integer sideHit = this.interacts.get(e.player); - ((TileStickyJar) tile) - .init( - (TileJarFillable) parent, - e.placedBlock, - metadata, - ForgeDirection.getOrientation(sideHit == null ? 1 : sideHit) - .getOpposite()); + ((TileStickyJar) tile).init( + (TileJarFillable) parent, + e.placedBlock, + metadata, + ForgeDirection.getOrientation(sideHit == null ? 1 : sideHit).getOpposite()); RegisteredBlocks.blockStickyJar.onBlockPlacedBy(e.world, e.x, e.y, e.z, e.player, e.itemInHand); } } @@ -252,12 +255,15 @@ public class EventHandlerWorld { if (event.world.provider.dimensionId == ModConfig.dimOuterId) { if (event.block == ConfigBlocks.blockEldritchNothing) { if (event.getPlayer().capabilities.isCreativeMode - && MiscUtils.isANotApprovedOrMisunderstoodPersonFromMoreDoor(event.getPlayer())) return; + && MiscUtils.isANotApprovedOrMisunderstoodPersonFromMoreDoor(event.getPlayer())) + return; event.setCanceled(true); - event.getPlayer() - .addChatMessage(new ChatComponentText(EnumChatFormatting.ITALIC + "" - + EnumChatFormatting.GRAY - + StatCollector.translateToLocal("gadomancy.eldritch.nobreakPortalNothing"))); + event.getPlayer().addChatMessage( + new ChatComponentText( + EnumChatFormatting.ITALIC + "" + + EnumChatFormatting.GRAY + + StatCollector + .translateToLocal("gadomancy.eldritch.nobreakPortalNothing"))); } } } @@ -265,8 +271,7 @@ public class EventHandlerWorld { @SubscribeEvent(priority = EventPriority.LOWEST) public void on(PlayerInteractEvent e) { - if (!e.world.isRemote - && e.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK + if (!e.world.isRemote && e.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK && this.isStickyJar(e.entityPlayer.getHeldItem())) { if (this.interacts == null) { this.interacts = new HashMap(); @@ -283,8 +288,7 @@ public class EventHandlerWorld { } private boolean isStickyJar(ItemStack stack) { - return stack != null - && RegisteredItems.isStickyableJar(stack) + return stack != null && RegisteredItems.isStickyableJar(stack) && stack.hasTagCompound() && stack.stackTagCompound.getBoolean("isStickyJar"); } @@ -316,6 +320,7 @@ public class EventHandlerWorld { } private static class ValueOverride extends GameRules.Value { + private final EventHandlerWorld handler; public ValueOverride(EventHandlerWorld handler, String value) { @@ -326,18 +331,13 @@ public class EventHandlerWorld { @Override public boolean getGameRuleBooleanValue() { boolean mobGriefing = super.getGameRuleBooleanValue(); - /*if(mobGriefing) { - Entity lastUpdated = this.handler.lastUpdated; - if(lastUpdated != null) { - StackTraceElement[] elements = Thread.currentThread().getStackTrace(); - for(StackTraceElement element : elements) { - if(element.getClassName().equals(EntityLivingBase.class.getName()) - && (element.getMethodName().equals("func_70071_h") || element.getMethodName().equals("onUpdate"))) { - return !TileBlockProtector.isSpotProtected(lastUpdated.worldObj, lastUpdated); - } - } - } - }*/ + /* + * if(mobGriefing) { Entity lastUpdated = this.handler.lastUpdated; if(lastUpdated != null) { + * StackTraceElement[] elements = Thread.currentThread().getStackTrace(); for(StackTraceElement element : + * elements) { if(element.getClassName().equals(EntityLivingBase.class.getName()) && + * (element.getMethodName().equals("func_70071_h") || element.getMethodName().equals("onUpdate"))) { return + * !TileBlockProtector.isSpotProtected(lastUpdated.worldObj, lastUpdated); } } } } + */ return mobGriefing; } } diff --git a/src/main/java/makeo/gadomancy/common/familiar/FamiliarAIController_Old.java b/src/main/java/makeo/gadomancy/common/familiar/FamiliarAIController_Old.java index 7e16adf..1051bd7 100644 --- a/src/main/java/makeo/gadomancy/common/familiar/FamiliarAIController_Old.java +++ b/src/main/java/makeo/gadomancy/common/familiar/FamiliarAIController_Old.java @@ -1,17 +1,18 @@ package makeo.gadomancy.common.familiar; -import baubles.api.BaublesApi; import java.util.*; + import makeo.gadomancy.common.registration.RegisteredFamiliarAI_Old; + import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import baubles.api.BaublesApi; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 31.10.2015 14:08 */ @@ -19,8 +20,7 @@ public class FamiliarAIController_Old { private static final Random RAND = new Random(); - private static Map> targetMap = - new HashMap>(); + private static Map> targetMap = new HashMap>(); private List availableTasks = new ArrayList(); private Map cooldownProcesses = new HashMap(); @@ -75,12 +75,12 @@ public class FamiliarAIController_Old { int index = (randIndex + i) % size; FamiliarAIProcess_Old process = this.availableTasks.get(index); if (process.canRun( - this.owningPlayer.worldObj, - this.owningPlayer.posX, - this.owningPlayer.posY, - this.owningPlayer.posZ, - this.owningPlayer, - BaublesApi.getBaubles(this.owningPlayer).getStackInSlot(0)) + this.owningPlayer.worldObj, + this.owningPlayer.posX, + this.owningPlayer.posY, + this.owningPlayer.posZ, + this.owningPlayer, + BaublesApi.getBaubles(this.owningPlayer).getStackInSlot(0)) && !this.cooldownProcesses.containsKey(process)) { this.runningTask = process; } @@ -88,8 +88,7 @@ public class FamiliarAIController_Old { } private void reduceRunningCooldowns() { - Iterator itProcesses = - this.cooldownProcesses.keySet().iterator(); + Iterator itProcesses = this.cooldownProcesses.keySet().iterator(); while (itProcesses.hasNext()) { FamiliarAIProcess_Old process = itProcesses.next(); int cd = this.cooldownProcesses.get(process) - 1; @@ -118,8 +117,7 @@ public class FamiliarAIController_Old { public static void cleanTargetterList(EntityPlayer player) { if (!FamiliarAIController_Old.targetMap.containsKey(player)) return; - Iterator it = - FamiliarAIController_Old.targetMap.get(player).iterator(); + Iterator it = FamiliarAIController_Old.targetMap.get(player).iterator(); while (it.hasNext()) { EntityLivingBase living = it.next(); if (living.isDead) it.remove(); diff --git a/src/main/java/makeo/gadomancy/common/familiar/FamiliarAIProcess_Old.java b/src/main/java/makeo/gadomancy/common/familiar/FamiliarAIProcess_Old.java index 7c68f52..50f189a 100644 --- a/src/main/java/makeo/gadomancy/common/familiar/FamiliarAIProcess_Old.java +++ b/src/main/java/makeo/gadomancy/common/familiar/FamiliarAIProcess_Old.java @@ -5,10 +5,8 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 31.10.2015 14:05 */ diff --git a/src/main/java/makeo/gadomancy/common/familiar/FamiliarAugment.java b/src/main/java/makeo/gadomancy/common/familiar/FamiliarAugment.java index 5c38a8a..abde040 100644 --- a/src/main/java/makeo/gadomancy/common/familiar/FamiliarAugment.java +++ b/src/main/java/makeo/gadomancy/common/familiar/FamiliarAugment.java @@ -4,15 +4,15 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import net.minecraft.util.StatCollector; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 28.12.2015 23:44 */ @@ -21,33 +21,48 @@ public class FamiliarAugment { private static final String FORMAT_NAME = "familiar.augment.%s.name"; // Main effects - public static final FamiliarAugment SHOCK = - new FamiliarAugment("shock", new AspectList().add(Aspect.AIR, 3).add(Aspect.ENTROPY, 2)); + public static final FamiliarAugment SHOCK = new FamiliarAugment( + "shock", + new AspectList().add(Aspect.AIR, 3).add(Aspect.ENTROPY, 2)); public static final FamiliarAugment POISON = new FamiliarAugment( - "poison", new AspectList().add(Aspect.WATER, 3).add(Aspect.ENTROPY, 4)) - .addConflict(FamiliarAugment.SHOCK); + "poison", + new AspectList().add(Aspect.WATER, 3).add(Aspect.ENTROPY, 4)).addConflict(FamiliarAugment.SHOCK); public static final FamiliarAugment FIRE = new FamiliarAugment( - "fire", new AspectList().add(Aspect.FIRE, 4).add(Aspect.ORDER, 2)) - .addConflict(FamiliarAugment.SHOCK, FamiliarAugment.POISON); + "fire", + new AspectList().add(Aspect.FIRE, 4).add(Aspect.ORDER, 2)) + .addConflict(FamiliarAugment.SHOCK, FamiliarAugment.POISON); public static final FamiliarAugment WEAKNESS = new FamiliarAugment( - "weakness", new AspectList().add(Aspect.ENTROPY, 3).add(Aspect.EARTH, 3)) - .addConflict(FamiliarAugment.SHOCK, FamiliarAugment.POISON, FamiliarAugment.FIRE); + "weakness", + new AspectList().add(Aspect.ENTROPY, 3).add(Aspect.EARTH, 3)) + .addConflict(FamiliarAugment.SHOCK, FamiliarAugment.POISON, FamiliarAugment.FIRE); // Side effects public static final FamiliarAugment DAMAGE_INCREASE = new FamiliarAugment( - "damage", new AspectList().add(Aspect.FIRE, 3)) - .addCondition(new PreconditionAny( - FamiliarAugment.SHOCK, FamiliarAugment.POISON, FamiliarAugment.FIRE, FamiliarAugment.WEAKNESS)); + "damage", + new AspectList().add(Aspect.FIRE, 3)).addCondition( + new PreconditionAny( + FamiliarAugment.SHOCK, + FamiliarAugment.POISON, + FamiliarAugment.FIRE, + FamiliarAugment.WEAKNESS)); public static final FamiliarAugment RANGE_INCREASE = new FamiliarAugment( - "range", new AspectList().add(Aspect.AIR, 2).add(Aspect.ORDER, 1)) - .addConflict(FamiliarAugment.DAMAGE_INCREASE) - .addCondition(new PreconditionAny( - FamiliarAugment.SHOCK, FamiliarAugment.POISON, FamiliarAugment.FIRE, FamiliarAugment.WEAKNESS)); + "range", + new AspectList().add(Aspect.AIR, 2).add(Aspect.ORDER, 1)).addConflict(FamiliarAugment.DAMAGE_INCREASE) + .addCondition( + new PreconditionAny( + FamiliarAugment.SHOCK, + FamiliarAugment.POISON, + FamiliarAugment.FIRE, + FamiliarAugment.WEAKNESS)); public static final FamiliarAugment ATTACK_SPEED = new FamiliarAugment( - "speed", new AspectList().add(Aspect.ORDER, 2).add(Aspect.FIRE, 1)) - .addConflict(FamiliarAugment.DAMAGE_INCREASE, FamiliarAugment.RANGE_INCREASE) - .addCondition(new PreconditionAny( - FamiliarAugment.SHOCK, FamiliarAugment.POISON, FamiliarAugment.FIRE, FamiliarAugment.WEAKNESS)); + "speed", + new AspectList().add(Aspect.ORDER, 2).add(Aspect.FIRE, 1)) + .addConflict(FamiliarAugment.DAMAGE_INCREASE, FamiliarAugment.RANGE_INCREASE).addCondition( + new PreconditionAny( + FamiliarAugment.SHOCK, + FamiliarAugment.POISON, + FamiliarAugment.FIRE, + FamiliarAugment.WEAKNESS)); private final String unlocalizedName; private List preconditions = new ArrayList(); diff --git a/src/main/java/makeo/gadomancy/common/familiar/FamiliarController.java b/src/main/java/makeo/gadomancy/common/familiar/FamiliarController.java index 4b844ab..0c728c2 100644 --- a/src/main/java/makeo/gadomancy/common/familiar/FamiliarController.java +++ b/src/main/java/makeo/gadomancy/common/familiar/FamiliarController.java @@ -1,16 +1,16 @@ package makeo.gadomancy.common.familiar; -import baubles.api.BaublesApi; -import cpw.mods.fml.common.network.NetworkRegistry; import java.util.ArrayList; import java.util.Iterator; import java.util.List; import java.util.Random; + import makeo.gadomancy.common.items.baubles.ItemEtherealFamiliar; import makeo.gadomancy.common.network.PacketHandler; import makeo.gadomancy.common.network.packets.PacketFamiliarBolt; import makeo.gadomancy.common.utils.MiscUtils; import makeo.gadomancy.common.utils.Vector3; + import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.monster.IMob; import net.minecraft.entity.player.EntityPlayer; @@ -20,16 +20,17 @@ import net.minecraft.potion.Potion; import net.minecraft.potion.PotionEffect; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; + import thaumcraft.api.aspects.AspectList; import thaumcraft.common.config.Config; import thaumcraft.common.items.baubles.ItemAmuletVis; import thaumcraft.common.items.wands.ItemWandCasting; +import baubles.api.BaublesApi; +import cpw.mods.fml.common.network.NetworkRegistry; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 29.12.2015 18:12 */ @@ -76,8 +77,7 @@ public class FamiliarController { FamiliarAugment.FamiliarAugmentPair effectElement = null; for (FamiliarAugment.FamiliarAugmentPair pair : augments) { FamiliarAugment augment = pair.augment; - if (augment.equals(FamiliarAugment.SHOCK) - || augment.equals(FamiliarAugment.FIRE) + if (augment.equals(FamiliarAugment.SHOCK) || augment.equals(FamiliarAugment.FIRE) || augment.equals(FamiliarAugment.POISON) || augment.equals(FamiliarAugment.WEAKNESS)) { effectElement = pair; @@ -111,8 +111,8 @@ public class FamiliarController { double damage = FamiliarController.DMG_DEF + (dmgLevel != -1 ? FamiliarController.DMG_INC * dmgLevel : 0); int ticksUntilNextAttack = FamiliarController.AS_DELAY_DEF - (attackSpeedLevel != -1 ? FamiliarController.AS_INC * attackSpeedLevel : 0); - double range = - FamiliarController.RANGE_DEF + (rangeLevel != -1 ? FamiliarController.RANGE_INC * rangeLevel : 0); + double range = FamiliarController.RANGE_DEF + + (rangeLevel != -1 ? FamiliarController.RANGE_INC * rangeLevel : 0); if (effectElement != null) { for (int i = 0; i < effectElement.level; i++) { @@ -172,9 +172,7 @@ public class FamiliarController { for (EntityLivingBase entity : toAttack) { if (FamiliarController.RAND.nextBoolean()) { Vector3 vel = MiscUtils.getPositionVector(entity) - .subtract(MiscUtils.getPositionVector(this.owningPlayer)) - .normalize() - .divide(2) + .subtract(MiscUtils.getPositionVector(this.owningPlayer)).normalize().divide(2) .multiply(0.8 * effectLevel); if (vel.getY() < 0) vel.setY(-vel.getY()); entity.motionX += vel.getX(); @@ -259,7 +257,12 @@ public class FamiliarController { private void attack(EntityLivingBase toAttack, double damage, int boltType) { toAttack.attackEntityFrom(DamageSource.magic, (float) damage); toAttack.worldObj.playSoundEffect( - toAttack.posX + 0.5, toAttack.posY + 0.5, toAttack.posZ + 0.5, "thaumcraft:zap", 0.8F, 1.0F); + toAttack.posX + 0.5, + toAttack.posY + 0.5, + toAttack.posZ + 0.5, + "thaumcraft:zap", + 0.8F, + 1.0F); PacketFamiliarBolt bolt = new PacketFamiliarBolt( this.owningPlayer.getCommandSenderName(), (float) toAttack.posX, diff --git a/src/main/java/makeo/gadomancy/common/integration/IntegrationAutomagy.java b/src/main/java/makeo/gadomancy/common/integration/IntegrationAutomagy.java index 763d4d7..884e0e8 100644 --- a/src/main/java/makeo/gadomancy/common/integration/IntegrationAutomagy.java +++ b/src/main/java/makeo/gadomancy/common/integration/IntegrationAutomagy.java @@ -6,6 +6,7 @@ import makeo.gadomancy.common.data.config.ModConfig; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.utils.Injector; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -13,29 +14,23 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; + import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.config.ConfigBlocks; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 04.10.2015 02:30 */ public class IntegrationAutomagy extends IntegrationMod { // TODO sync with Automagy some time... - private static final AspectList visCostAdvNodeJar = new AspectList() - .add(Aspect.FIRE, 125) - .add(Aspect.EARTH, 125) - .add(Aspect.ORDER, 125) - .add(Aspect.AIR, 125) - .add(Aspect.ENTROPY, 125) - .add(Aspect.WATER, 125); + private static final AspectList visCostAdvNodeJar = new AspectList().add(Aspect.FIRE, 125).add(Aspect.EARTH, 125) + .add(Aspect.ORDER, 125).add(Aspect.AIR, 125).add(Aspect.ENTROPY, 125).add(Aspect.WATER, 125); @Override public String getModId() { @@ -63,8 +58,8 @@ public class IntegrationAutomagy extends IntegrationMod { } public boolean handleNodeJarVisCost(ItemStack wandStack, EntityPlayer player) { - return ThaumcraftApiHelper.consumeVisFromWandCrafting( - wandStack, player, IntegrationAutomagy.visCostAdvNodeJar, true); + return ThaumcraftApiHelper + .consumeVisFromWandCrafting(wandStack, player, IntegrationAutomagy.visCostAdvNodeJar, true); } public void tryFillGolemCrafttable(ChunkCoordinates cc, World world) { @@ -84,8 +79,7 @@ public class IntegrationAutomagy extends IntegrationMod { if (heat > impact) { i.setField("craftingHeat", heat - 700); } - } catch (Exception e) { - } + } catch (Exception e) {} } } } diff --git a/src/main/java/makeo/gadomancy/common/integration/IntegrationMod.java b/src/main/java/makeo/gadomancy/common/integration/IntegrationMod.java index dea8b30..debb6d3 100644 --- a/src/main/java/makeo/gadomancy/common/integration/IntegrationMod.java +++ b/src/main/java/makeo/gadomancy/common/integration/IntegrationMod.java @@ -3,14 +3,13 @@ package makeo.gadomancy.common.integration; import cpw.mods.fml.common.Loader; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 09.07.2015 15:29 */ public abstract class IntegrationMod { + public abstract String getModId(); private boolean isPresent; diff --git a/src/main/java/makeo/gadomancy/common/integration/IntegrationMorph.java b/src/main/java/makeo/gadomancy/common/integration/IntegrationMorph.java index c8e8896..15fc523 100644 --- a/src/main/java/makeo/gadomancy/common/integration/IntegrationMorph.java +++ b/src/main/java/makeo/gadomancy/common/integration/IntegrationMorph.java @@ -1,21 +1,23 @@ package makeo.gadomancy.common.integration; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.lang.reflect.Method; + import makeo.gadomancy.common.utils.Injector; + import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 09.07.2015 14:45 */ public class IntegrationMorph extends IntegrationMod { + private static final Injector INJECTOR = new Injector(); private Method methodHasMorph; @@ -30,7 +32,7 @@ public class IntegrationMorph extends IntegrationMod { // methodHasMorph = Injector.getMethod("hasMorph", "morph.common.core.ApiHandler", String.class, Boolean.class); // if(methodHasMorph == null) { - // FMLLog.severe("Morph mod is loaded but failed to find method \"hasMorph\"!"); + // FMLLog.severe("Morph mod is loaded but failed to find method \"hasMorph\"!"); // } } @@ -38,8 +40,8 @@ public class IntegrationMorph extends IntegrationMod { public boolean isMorphed() { if (this.methodHasMorph != null) { EntityPlayer player = Minecraft.getMinecraft().thePlayer; - Boolean result = - IntegrationMorph.INJECTOR.invokeMethod(this.methodHasMorph, player.getCommandSenderName(), true); + Boolean result = IntegrationMorph.INJECTOR + .invokeMethod(this.methodHasMorph, player.getCommandSenderName(), true); return result != null ? result : false; } return false; diff --git a/src/main/java/makeo/gadomancy/common/integration/IntegrationNEI.java b/src/main/java/makeo/gadomancy/common/integration/IntegrationNEI.java index 939e488..8b4bfbb 100644 --- a/src/main/java/makeo/gadomancy/common/integration/IntegrationNEI.java +++ b/src/main/java/makeo/gadomancy/common/integration/IntegrationNEI.java @@ -2,23 +2,24 @@ package makeo.gadomancy.common.integration; import java.util.ArrayList; import java.util.Iterator; + import makeo.gadomancy.common.items.ItemFakeGolemPlacer; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.utils.Injector; + import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 02.12.2015 13:46 */ public class IntegrationNEI extends IntegrationMod { + @Override public String getModId() { return "NotEnoughItems"; @@ -36,8 +37,8 @@ public class IntegrationNEI extends IntegrationMod { this.hideItem(new ItemStack(RegisteredItems.itemFakeLootbag, 1, Short.MAX_VALUE)); this.hideItem(new ItemStack(RegisteredBlocks.blockExtendedNodeJar, 1, Short.MAX_VALUE)); this.hideItem(new ItemStack(RegisteredItems.itemExtendedNodeJar, 1, Short.MAX_VALUE)); - this.hideItem( - new ItemStack(RegisteredItems.itemFakeGolemPlacer, 1, Short.MAX_VALUE)); // This does... nothing? ffs. + this.hideItem(new ItemStack(RegisteredItems.itemFakeGolemPlacer, 1, Short.MAX_VALUE)); // This does... nothing? + // ffs. this.hideItem(new ItemStack(RegisteredItems.itemTransformationFocus, 1, Short.MAX_VALUE)); this.hideItem(new ItemStack(RegisteredItems.itemFamiliar_old, 1, Short.MAX_VALUE)); } @@ -46,8 +47,7 @@ public class IntegrationNEI extends IntegrationMod { Iterator iterator = items.iterator(); while (iterator.hasNext()) { Object item = iterator.next(); - if (item != null - && item instanceof ItemStack + if (item != null && item instanceof ItemStack && ((ItemStack) item).getItem() != null && ((ItemStack) item).getItem() instanceof ItemFakeGolemPlacer) { iterator.remove(); @@ -64,6 +64,6 @@ public class IntegrationNEI extends IntegrationMod { } public void setItemListEntries(Item item, Iterable items) { - this.nei.invokeMethod("setItemListEntries", new Class[] {Item.class, Iterable.class}, item, items); + this.nei.invokeMethod("setItemListEntries", new Class[] { Item.class, Iterable.class }, item, items); } } diff --git a/src/main/java/makeo/gadomancy/common/integration/IntegrationThaumicExploration.java b/src/main/java/makeo/gadomancy/common/integration/IntegrationThaumicExploration.java index ee475e4..97b5a73 100644 --- a/src/main/java/makeo/gadomancy/common/integration/IntegrationThaumicExploration.java +++ b/src/main/java/makeo/gadomancy/common/integration/IntegrationThaumicExploration.java @@ -2,19 +2,19 @@ package makeo.gadomancy.common.integration; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 04.10.2015 01:52 */ public class IntegrationThaumicExploration extends IntegrationMod { + @Override public String getModId() { return "ThaumicExploration"; diff --git a/src/main/java/makeo/gadomancy/common/integration/IntegrationThaumicTinkerer.java b/src/main/java/makeo/gadomancy/common/integration/IntegrationThaumicTinkerer.java index 72f177e..0052730 100644 --- a/src/main/java/makeo/gadomancy/common/integration/IntegrationThaumicTinkerer.java +++ b/src/main/java/makeo/gadomancy/common/integration/IntegrationThaumicTinkerer.java @@ -1,14 +1,12 @@ package makeo.gadomancy.common.integration; import makeo.gadomancy.common.Gadomancy; + import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; /** - * HellFirePvP@Admin - * Date: 20.04.2016 / 00:43 - * on Gadomancy - * IntegrationThaumicTinkerer + * HellFirePvP@Admin Date: 20.04.2016 / 00:43 on Gadomancy IntegrationThaumicTinkerer */ public class IntegrationThaumicTinkerer extends IntegrationMod { @@ -22,16 +20,15 @@ public class IntegrationThaumicTinkerer extends IntegrationMod { @Override public void doInit() { try { - IntegrationThaumicTinkerer.infusedCropBlockClass = - Class.forName("thaumic.tinkerer.common.block.BlockInfusedGrain"); - IntegrationThaumicTinkerer.infusedCropTile = - Class.forName("thaumic.tinkerer.common.block.tile.TileInfusedGrain"); + IntegrationThaumicTinkerer.infusedCropBlockClass = Class + .forName("thaumic.tinkerer.common.block.BlockInfusedGrain"); + IntegrationThaumicTinkerer.infusedCropTile = Class + .forName("thaumic.tinkerer.common.block.tile.TileInfusedGrain"); if (IntegrationThaumicTinkerer.infusedCropBlockClass != null && IntegrationThaumicTinkerer.infusedCropTile != null) { Gadomancy.log.info("Hooked TTinkerer magic-crops"); } - } catch (Throwable tr) { - } + } catch (Throwable tr) {} } public static boolean isCropBlock(Block block) { diff --git a/src/main/java/makeo/gadomancy/common/integration/mystcraft/EventHandlerMystcraft.java b/src/main/java/makeo/gadomancy/common/integration/mystcraft/EventHandlerMystcraft.java index 2200341..f6c982c 100644 --- a/src/main/java/makeo/gadomancy/common/integration/mystcraft/EventHandlerMystcraft.java +++ b/src/main/java/makeo/gadomancy/common/integration/mystcraft/EventHandlerMystcraft.java @@ -1,14 +1,13 @@ package makeo.gadomancy.common.integration.mystcraft; +import makeo.gadomancy.common.data.config.ModConfig; + import com.xcompwiz.mystcraft.api.event.LinkEvent; import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import makeo.gadomancy.common.data.config.ModConfig; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 20.12.2015 15:53 */ diff --git a/src/main/java/makeo/gadomancy/common/integration/mystcraft/IntegrationMystcraft.java b/src/main/java/makeo/gadomancy/common/integration/mystcraft/IntegrationMystcraft.java index f9370e0..d3d4812 100644 --- a/src/main/java/makeo/gadomancy/common/integration/mystcraft/IntegrationMystcraft.java +++ b/src/main/java/makeo/gadomancy/common/integration/mystcraft/IntegrationMystcraft.java @@ -1,14 +1,14 @@ package makeo.gadomancy.common.integration.mystcraft; -import cpw.mods.fml.common.FMLCommonHandler; import makeo.gadomancy.common.integration.IntegrationMod; + import net.minecraftforge.common.MinecraftForge; +import cpw.mods.fml.common.FMLCommonHandler; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 20.12.2015 15:50 */ diff --git a/src/main/java/makeo/gadomancy/common/integration/thaumichorizions/IntegrationThaumicHorizions.java b/src/main/java/makeo/gadomancy/common/integration/thaumichorizions/IntegrationThaumicHorizions.java index 3b61dfd..5e8dbcc 100644 --- a/src/main/java/makeo/gadomancy/common/integration/thaumichorizions/IntegrationThaumicHorizions.java +++ b/src/main/java/makeo/gadomancy/common/integration/thaumichorizions/IntegrationThaumicHorizions.java @@ -1,19 +1,12 @@ package makeo.gadomancy.common.integration.thaumichorizions; -import com.kentington.thaumichorizons.client.renderer.entity.RenderGolemTH; -import com.kentington.thaumichorizons.common.entities.EntityGolemTH; -import com.kentington.thaumichorizons.common.tiles.TileVat; -import com.kentington.thaumichorizons.common.tiles.TileVatMatrix; -import cpw.mods.fml.client.registry.RenderingRegistry; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.relauncher.Side; import makeo.gadomancy.api.ClickBehavior; import makeo.gadomancy.client.ClientProxy; import makeo.gadomancy.common.CommonProxy; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.integration.IntegrationMod; import makeo.gadomancy.common.registration.RegisteredBlocks; + import net.minecraft.block.Block; import net.minecraft.client.renderer.entity.RendererLivingEntity; import net.minecraft.entity.player.EntityPlayer; @@ -22,15 +15,24 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.PlaySoundAtEntityEvent; import net.minecraftforge.event.entity.player.AttackEntityEvent; +import com.kentington.thaumichorizons.client.renderer.entity.RenderGolemTH; +import com.kentington.thaumichorizons.common.entities.EntityGolemTH; +import com.kentington.thaumichorizons.common.tiles.TileVat; +import com.kentington.thaumichorizons.common.tiles.TileVatMatrix; + +import cpw.mods.fml.client.registry.RenderingRegistry; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.relauncher.Side; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 07.10.2015 13:10 */ public class IntegrationThaumicHorizions extends IntegrationMod { + private static Block modMatrix; @Override @@ -44,12 +46,14 @@ public class IntegrationThaumicHorizions extends IntegrationMod { RendererLivingEntity render = ClientProxy.unregisterRenderer(EntityGolemTH.class, RenderGolemTH.class); if (render != null) { RenderingRegistry.registerEntityRenderingHandler( - EntityGolemTH.class, new RenderAdditionalGolemTH(render.mainModel)); + EntityGolemTH.class, + new RenderAdditionalGolemTH(render.mainModel)); } IntegrationThaumicHorizions.modMatrix = Block.getBlockFromName("ThaumicHorizons:modMatrix"); RegisteredBlocks.registerClawClickBehavior(new ClickBehavior(true) { + private TileVat vat; @Override diff --git a/src/main/java/makeo/gadomancy/common/integration/thaumichorizions/RenderAdditionalGolemTH.java b/src/main/java/makeo/gadomancy/common/integration/thaumichorizions/RenderAdditionalGolemTH.java index 4c47367..f0002c6 100644 --- a/src/main/java/makeo/gadomancy/common/integration/thaumichorizions/RenderAdditionalGolemTH.java +++ b/src/main/java/makeo/gadomancy/common/integration/thaumichorizions/RenderAdditionalGolemTH.java @@ -1,29 +1,32 @@ package makeo.gadomancy.common.integration.thaumichorizions; -import com.kentington.thaumichorizons.client.renderer.entity.RenderGolemTH; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import makeo.gadomancy.api.GadomancyApi; import makeo.gadomancy.api.golems.AdditionalGolemType; import makeo.gadomancy.api.golems.cores.AdditionalGolemCore; import makeo.gadomancy.client.renderers.entity.RenderGolemHelper; + import net.minecraft.client.model.ModelBase; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; + import thaumcraft.common.entities.golems.EntityGolemBase; +import com.kentington.thaumichorizons.client.renderer.entity.RenderGolemTH; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 07.10.2015 13:09 */ @SideOnly(Side.CLIENT) public class RenderAdditionalGolemTH extends RenderGolemTH { + private ItemStack toolItem; public RenderAdditionalGolemTH(ModelBase mainModel) { diff --git a/src/main/java/makeo/gadomancy/common/integration/waila/AdvancedGolemProvider.java b/src/main/java/makeo/gadomancy/common/integration/waila/AdvancedGolemProvider.java index 733603f..7ecc664 100644 --- a/src/main/java/makeo/gadomancy/common/integration/waila/AdvancedGolemProvider.java +++ b/src/main/java/makeo/gadomancy/common/integration/waila/AdvancedGolemProvider.java @@ -1,52 +1,54 @@ package makeo.gadomancy.common.integration.waila; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.ModContainer; import java.util.List; + import makeo.gadomancy.api.GadomancyApi; import makeo.gadomancy.api.golems.AdditionalGolemType; import makeo.gadomancy.common.utils.ColorHelper; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaEntityAccessor; import mcp.mobius.waila.api.IWailaEntityProvider; + import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; + import thaumcraft.common.entities.golems.EntityGolemBase; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.ModContainer; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 25.07.2015 14:14 */ public class AdvancedGolemProvider implements IWailaEntityProvider { + @Override public Entity getWailaOverride(IWailaEntityAccessor data, IWailaConfigHandler config) { return null; } @Override - public List getWailaHead( - Entity paramEntity, List strings, IWailaEntityAccessor data, IWailaConfigHandler config) { + public List getWailaHead(Entity paramEntity, List strings, IWailaEntityAccessor data, + IWailaConfigHandler config) { return null; } @Override - public List getWailaBody( - Entity paramEntity, List strings, IWailaEntityAccessor data, IWailaConfigHandler config) { + public List getWailaBody(Entity paramEntity, List strings, IWailaEntityAccessor data, + IWailaConfigHandler config) { return null; } @Override - public List getWailaTail( - Entity paramEntity, List strings, IWailaEntityAccessor data, IWailaConfigHandler config) { + public List getWailaTail(Entity paramEntity, List strings, IWailaEntityAccessor data, + IWailaConfigHandler config) { if (data.getEntity() instanceof EntityGolemBase) { - AdditionalGolemType type = - GadomancyApi.getAdditionalGolemType(((EntityGolemBase) data.getEntity()).getGolemType()); + AdditionalGolemType type = GadomancyApi + .getAdditionalGolemType(((EntityGolemBase) data.getEntity()).getGolemType()); if (type != null && strings.size() > 0) { String oldMod = strings.get(strings.size() - 1); @@ -63,11 +65,8 @@ public class AdvancedGolemProvider implements IWailaEntityProvider { } @Override - public NBTTagCompound getNBTData( - EntityPlayerMP paramEntityPlayerMP, - Entity paramEntity, - NBTTagCompound paramNBTTagCompound, - World paramWorld) { + public NBTTagCompound getNBTData(EntityPlayerMP paramEntityPlayerMP, Entity paramEntity, + NBTTagCompound paramNBTTagCompound, World paramWorld) { return null; } } diff --git a/src/main/java/makeo/gadomancy/common/integration/waila/InfusionClawProvider.java b/src/main/java/makeo/gadomancy/common/integration/waila/InfusionClawProvider.java index 63868a6..09cee92 100644 --- a/src/main/java/makeo/gadomancy/common/integration/waila/InfusionClawProvider.java +++ b/src/main/java/makeo/gadomancy/common/integration/waila/InfusionClawProvider.java @@ -1,10 +1,12 @@ package makeo.gadomancy.common.integration.waila; import java.util.List; + import makeo.gadomancy.common.blocks.tiles.TileInfusionClaw; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataProvider; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -13,34 +15,27 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 07.10.2015 18:02 */ public class InfusionClawProvider implements IWailaDataProvider { - @Override - public ItemStack getWailaStack( - IWailaDataAccessor paramIWailaDataAccessor, IWailaConfigHandler paramIWailaConfigHandler) { - return null; - } @Override - public List getWailaHead( - ItemStack paramItemStack, - List paramList, - IWailaDataAccessor paramIWailaDataAccessor, + public ItemStack getWailaStack(IWailaDataAccessor paramIWailaDataAccessor, IWailaConfigHandler paramIWailaConfigHandler) { return null; } @Override - public List getWailaBody( - ItemStack paramItemStack, - List strings, - IWailaDataAccessor dataAccessor, + public List getWailaHead(ItemStack paramItemStack, List paramList, + IWailaDataAccessor paramIWailaDataAccessor, IWailaConfigHandler paramIWailaConfigHandler) { + return null; + } + + @Override + public List getWailaBody(ItemStack paramItemStack, List strings, IWailaDataAccessor dataAccessor, IWailaConfigHandler paramIWailaConfigHandler) { TileInfusionClaw tile = (TileInfusionClaw) dataAccessor.getTileEntity(); if (tile.hasOwner()) { @@ -50,23 +45,14 @@ public class InfusionClawProvider implements IWailaDataProvider { } @Override - public List getWailaTail( - ItemStack paramItemStack, - List paramList, - IWailaDataAccessor dataAccessor, + public List getWailaTail(ItemStack paramItemStack, List paramList, IWailaDataAccessor dataAccessor, IWailaConfigHandler paramIWailaConfigHandler) { return null; } @Override - public NBTTagCompound getNBTData( - EntityPlayerMP paramEntityPlayerMP, - TileEntity paramTileEntity, - NBTTagCompound paramNBTTagCompound, - World paramWorld, - int paramInt1, - int paramInt2, - int paramInt3) { + public NBTTagCompound getNBTData(EntityPlayerMP paramEntityPlayerMP, TileEntity paramTileEntity, + NBTTagCompound paramNBTTagCompound, World paramWorld, int paramInt1, int paramInt2, int paramInt3) { return null; } } diff --git a/src/main/java/makeo/gadomancy/common/integration/waila/IntegrationWaila.java b/src/main/java/makeo/gadomancy/common/integration/waila/IntegrationWaila.java index abba5d5..5fb8486 100644 --- a/src/main/java/makeo/gadomancy/common/integration/waila/IntegrationWaila.java +++ b/src/main/java/makeo/gadomancy/common/integration/waila/IntegrationWaila.java @@ -8,14 +8,13 @@ import mcp.mobius.waila.api.impl.ModuleRegistrar; import thaumcraft.common.entities.golems.EntityGolemBase; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 24.07.2015 14:48 */ public class IntegrationWaila extends IntegrationMod { + @Override public String getModId() { return "Waila"; diff --git a/src/main/java/makeo/gadomancy/common/integration/waila/RemoteJarProvider.java b/src/main/java/makeo/gadomancy/common/integration/waila/RemoteJarProvider.java index 7bf9f71..8630a0d 100644 --- a/src/main/java/makeo/gadomancy/common/integration/waila/RemoteJarProvider.java +++ b/src/main/java/makeo/gadomancy/common/integration/waila/RemoteJarProvider.java @@ -1,12 +1,14 @@ package makeo.gadomancy.common.integration.waila; import java.util.List; + import makeo.gadomancy.common.blocks.BlockRemoteJar; import makeo.gadomancy.common.blocks.tiles.TileRemoteJar; import makeo.gadomancy.common.items.ItemBlockRemoteJar; import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataProvider; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -15,61 +17,46 @@ import net.minecraft.util.StatCollector; import net.minecraft.world.World; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 20.10.2015 22:17 */ public class RemoteJarProvider implements IWailaDataProvider { + @Override public ItemStack getWailaStack(IWailaDataAccessor dataAccessor, IWailaConfigHandler iWailaConfigHandler) { return null; } @Override - public List getWailaHead( - ItemStack stack, - List strings, - IWailaDataAccessor dataAccessor, + public List getWailaHead(ItemStack stack, List strings, IWailaDataAccessor dataAccessor, IWailaConfigHandler iWailaConfigHandler) { return null; } @Override - public List getWailaBody( - ItemStack stack, - List strings, - IWailaDataAccessor dataAccessor, + public List getWailaBody(ItemStack stack, List strings, IWailaDataAccessor dataAccessor, IWailaConfigHandler iWailaConfigHandler) { TileRemoteJar tile = BlockRemoteJar.getJarTile(dataAccessor.getTileEntity()); if (tile.networkId != null) { - strings.add(String.format( - StatCollector.translateToLocal("gadomancy.lore.remotejar"), - ItemBlockRemoteJar.generateName(tile.networkId))); + strings.add( + String.format( + StatCollector.translateToLocal("gadomancy.lore.remotejar"), + ItemBlockRemoteJar.generateName(tile.networkId))); } return strings; } @Override - public List getWailaTail( - ItemStack stack, - List strings, - IWailaDataAccessor dataAccessor, + public List getWailaTail(ItemStack stack, List strings, IWailaDataAccessor dataAccessor, IWailaConfigHandler iWailaConfigHandler) { return null; } @Override - public NBTTagCompound getNBTData( - EntityPlayerMP entityPlayerMP, - TileEntity tileEntity, - NBTTagCompound compound, - World world, - int i, - int i2, - int i3) { + public NBTTagCompound getNBTData(EntityPlayerMP entityPlayerMP, TileEntity tileEntity, NBTTagCompound compound, + World world, int i, int i2, int i3) { return null; } } diff --git a/src/main/java/makeo/gadomancy/common/integration/waila/StickyJarProvider.java b/src/main/java/makeo/gadomancy/common/integration/waila/StickyJarProvider.java index 1a9016d..5762a8b 100644 --- a/src/main/java/makeo/gadomancy/common/integration/waila/StickyJarProvider.java +++ b/src/main/java/makeo/gadomancy/common/integration/waila/StickyJarProvider.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.blocks.tiles.TileStickyJar; import makeo.gadomancy.common.utils.ColorHelper; @@ -11,6 +12,7 @@ import mcp.mobius.waila.api.IWailaConfigHandler; import mcp.mobius.waila.api.IWailaDataAccessor; import mcp.mobius.waila.api.IWailaDataProvider; import mcp.mobius.waila.api.impl.ModuleRegistrar; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -18,14 +20,13 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 24.07.2015 16:43 */ public class StickyJarProvider implements IWailaDataProvider { + @Override public ItemStack getWailaStack(final IWailaDataAccessor data, final IWailaConfigHandler config) { if (data.getTileEntity() instanceof TileStickyJar) { @@ -45,8 +46,8 @@ public class StickyJarProvider implements IWailaDataProvider { return null; } - private List getParentProviders( - LinkedHashMap> providerMap, Class... classes) { + private List getParentProviders(LinkedHashMap> providerMap, + Class... classes) { List providers = new ArrayList(); for (Class parent : classes) { ArrayList providerList = providerMap.get(parent); @@ -56,16 +57,14 @@ public class StickyJarProvider implements IWailaDataProvider { } @Override - public List getWailaHead( - final ItemStack stack, - final List strings, - final IWailaDataAccessor data, + public List getWailaHead(final ItemStack stack, final List strings, final IWailaDataAccessor data, final IWailaConfigHandler config) { TileStickyJar tile = (TileStickyJar) data.getTileEntity(); if (tile != null && tile.isValid()) { this.callParentProviders( ModuleRegistrar.instance().getBodyProviders(tile.getParentBlock()), new Callable() { + @Override public void call(IWailaDataProvider provider) { provider.getWailaHead(stack, strings, data, config); @@ -76,16 +75,14 @@ public class StickyJarProvider implements IWailaDataProvider { } @Override - public List getWailaBody( - final ItemStack stack, - final List strings, - final IWailaDataAccessor data, + public List getWailaBody(final ItemStack stack, final List strings, final IWailaDataAccessor data, final IWailaConfigHandler config) { TileStickyJar tile = (TileStickyJar) data.getTileEntity(); if (tile != null && tile.isValid()) { this.callParentProviders( ModuleRegistrar.instance().getBodyProviders(tile.getParentBlock()), new Callable() { + @Override public void call(IWailaDataProvider provider) { provider.getWailaBody(stack, strings, data, config); @@ -96,16 +93,14 @@ public class StickyJarProvider implements IWailaDataProvider { } @Override - public List getWailaTail( - final ItemStack stack, - final List strings, - final IWailaDataAccessor data, + public List getWailaTail(final ItemStack stack, final List strings, final IWailaDataAccessor data, final IWailaConfigHandler config) { TileStickyJar tile = (TileStickyJar) data.getTileEntity(); if (tile != null && tile.isValid()) { this.callParentProviders( ModuleRegistrar.instance().getBodyProviders(tile.getParentBlock()), new Callable() { + @Override public void call(IWailaDataProvider provider) { provider.getWailaTail(stack, strings, data, config); @@ -125,19 +120,13 @@ public class StickyJarProvider implements IWailaDataProvider { } @Override - public NBTTagCompound getNBTData( - EntityPlayerMP paramEntityPlayerMP, - TileEntity paramTileEntity, - NBTTagCompound paramNBTTagCompound, - World paramWorld, - int paramInt1, - int paramInt2, - int paramInt3) { + public NBTTagCompound getNBTData(EntityPlayerMP paramEntityPlayerMP, TileEntity paramTileEntity, + NBTTagCompound paramNBTTagCompound, World paramWorld, int paramInt1, int paramInt2, int paramInt3) { return null; } - private void callParentProviders( - Map> providers, Callable callable) { + private void callParentProviders(Map> providers, + Callable callable) { for (Map.Entry> entry : providers.entrySet()) { for (IWailaDataProvider provider : entry.getValue()) { callable.call(provider); @@ -146,6 +135,7 @@ public class StickyJarProvider implements IWailaDataProvider { } private abstract static class Callable { + public abstract void call(IWailaDataProvider provider); } } diff --git a/src/main/java/makeo/gadomancy/common/items/ItemArcanePackage.java b/src/main/java/makeo/gadomancy/common/items/ItemArcanePackage.java index a68975f..4c26e75 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemArcanePackage.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemArcanePackage.java @@ -5,9 +5,11 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.InventoryBasic; @@ -18,17 +20,17 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.StatCollector; import net.minecraft.world.World; + import thaumcraft.common.lib.utils.InventoryUtils; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 14.11.2015 12:34 */ public class ItemArcanePackage extends ItemFakeLootbag { + private static final int MAX_PACKAGE_SIZE = 65536; public ItemArcanePackage() { @@ -63,10 +65,10 @@ public class ItemArcanePackage extends ItemFakeLootbag { } Collections.sort(items, new Comparator() { + @Override public int compare(ItemStack i1, ItemStack i2) { - return i1.writeToNBT(new NBTTagCompound()).hashCode() - - i2.writeToNBT(new NBTTagCompound()).hashCode(); + return i1.writeToNBT(new NBTTagCompound()).hashCode() - i2.writeToNBT(new NBTTagCompound()).hashCode(); } }); @@ -106,9 +108,8 @@ public class ItemArcanePackage extends ItemFakeLootbag { if (data.length > 0) { NBTTagList stackList; try { - stackList = - (NBTTagList) CompressedStreamTools.func_152457_a(data, new NBTSizeTracker(Long.MAX_VALUE)) - .getTag("data"); + stackList = (NBTTagList) CompressedStreamTools + .func_152457_a(data, new NBTSizeTracker(Long.MAX_VALUE)).getTag("data"); } catch (Exception e) { return contents; } diff --git a/src/main/java/makeo/gadomancy/common/items/ItemAuraCore.java b/src/main/java/makeo/gadomancy/common/items/ItemAuraCore.java index 29c8ddb..bd487bb 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemAuraCore.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemAuraCore.java @@ -1,8 +1,10 @@ package makeo.gadomancy.common.items; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -12,15 +14,15 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; + import org.lwjgl.opengl.GL11; + import thaumcraft.api.aspects.Aspect; import thaumcraft.common.blocks.BlockCustomOreItem; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 16.11.2015 15:23 */ @@ -113,6 +115,7 @@ public class ItemAuraCore extends Item { } public enum AuraCoreType { + BLANK("blank"), AIR(Aspect.AIR), @@ -155,8 +158,7 @@ public class ItemAuraCore extends Item { } public String getLocalizedName() { - String name = this.isAspect() - ? this.aspect.getName() + String name = this.isAspect() ? this.aspect.getName() : StatCollector.translateToLocal("gadomancy.auracore." + this.unlocName); if (this.unused) { name += " " + StatCollector.translateToLocal("gadomancy.auracore.unused"); diff --git a/src/main/java/makeo/gadomancy/common/items/ItemBlockAdditionalEldritchPortal.java b/src/main/java/makeo/gadomancy/common/items/ItemBlockAdditionalEldritchPortal.java index 1e03692..5bc07e2 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemBlockAdditionalEldritchPortal.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemBlockAdditionalEldritchPortal.java @@ -1,7 +1,9 @@ package makeo.gadomancy.common.items; import java.util.List; + import makeo.gadomancy.common.Gadomancy; + import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -12,14 +14,13 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 07.11.2015 00:35 */ public class ItemBlockAdditionalEldritchPortal extends ItemBlock { + public ItemBlockAdditionalEldritchPortal(Block block) { super(block); } @@ -34,8 +35,9 @@ public class ItemBlockAdditionalEldritchPortal extends ItemBlock { @Override public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean flag) { - list.add(EnumChatFormatting.DARK_PURPLE - + StatCollector.translateToLocal("gadomancy.eldritch.portalPlacerCreative")); + list.add( + EnumChatFormatting.DARK_PURPLE + + StatCollector.translateToLocal("gadomancy.eldritch.portalPlacerCreative")); super.addInformation(stack, player, list, flag); } diff --git a/src/main/java/makeo/gadomancy/common/items/ItemBlockAuraPylon.java b/src/main/java/makeo/gadomancy/common/items/ItemBlockAuraPylon.java index 7dc28de..f50d2b4 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemBlockAuraPylon.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemBlockAuraPylon.java @@ -1,16 +1,15 @@ package makeo.gadomancy.common.items; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.block.Block; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 13.11.2015 00:43 */ diff --git a/src/main/java/makeo/gadomancy/common/items/ItemBlockEssentiaCompressor.java b/src/main/java/makeo/gadomancy/common/items/ItemBlockEssentiaCompressor.java index e2b008c..f416aec 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemBlockEssentiaCompressor.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemBlockEssentiaCompressor.java @@ -1,16 +1,14 @@ package makeo.gadomancy.common.items; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.block.Block; import net.minecraft.item.EnumRarity; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; /** - * HellFirePvP@Admin - * Date: 22.04.2016 / 21:58 - * on Gadomancy - * ItemBlockEssentiaCompressor + * HellFirePvP@Admin Date: 22.04.2016 / 21:58 on Gadomancy ItemBlockEssentiaCompressor */ public class ItemBlockEssentiaCompressor extends ItemBlock { diff --git a/src/main/java/makeo/gadomancy/common/items/ItemBlockKnowledgeBook.java b/src/main/java/makeo/gadomancy/common/items/ItemBlockKnowledgeBook.java index 96c7fa8..bc831e4 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemBlockKnowledgeBook.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemBlockKnowledgeBook.java @@ -1,6 +1,7 @@ package makeo.gadomancy.common.items; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; @@ -8,13 +9,11 @@ import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.common.config.ConfigBlocks; /** - * HellFirePvP@Admin - * Date: 19.04.2016 / 14:51 - * on Gadomancy - * ItemBlockKnowledgeBook + * HellFirePvP@Admin Date: 19.04.2016 / 14:51 on Gadomancy ItemBlockKnowledgeBook */ public class ItemBlockKnowledgeBook extends ItemBlock { @@ -30,22 +29,12 @@ public class ItemBlockKnowledgeBook extends ItemBlock { } @Override - public boolean onItemUse( - ItemStack stack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int side, - float hitX, - float hitY, - float hitZ) { + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, + float hitX, float hitY, float hitZ) { ForgeDirection placedAgainstDir = ForgeDirection.getOrientation(side); Block placedAgainst = world.getBlock(x, y, z); int againstMeta = world.getBlockMetadata(x, y, z); - if (placedAgainstDir.equals(ForgeDirection.UP) - && placedAgainst.equals(ConfigBlocks.blockStoneDevice) + if (placedAgainstDir.equals(ForgeDirection.UP) && placedAgainst.equals(ConfigBlocks.blockStoneDevice) && againstMeta == 1) { if (world.isAirBlock(x, y + 2, z)) { return super.onItemUse(stack, player, world, x, y, z, side, hitX, hitY, hitZ); diff --git a/src/main/java/makeo/gadomancy/common/items/ItemBlockRemoteJar.java b/src/main/java/makeo/gadomancy/common/items/ItemBlockRemoteJar.java index ae6fcdc..1e03651 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemBlockRemoteJar.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemBlockRemoteJar.java @@ -1,17 +1,17 @@ package makeo.gadomancy.common.items; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; import java.util.Random; import java.util.UUID; + import makeo.gadomancy.client.events.ResourceReloadListener; import makeo.gadomancy.common.blocks.BlockRemoteJar; import makeo.gadomancy.common.blocks.tiles.TileRemoteJar; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.utils.NBTHelper; import makeo.gadomancy.common.utils.StringHelper; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; @@ -21,19 +21,21 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.util.StatCollector; import net.minecraft.world.World; + import thaumcraft.api.aspects.AspectList; import thaumcraft.common.blocks.ItemJarFilled; import thaumcraft.common.config.ConfigItems; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 14.10.2015 17:51 */ public class ItemBlockRemoteJar extends ItemBlock { + public ItemBlockRemoteJar() { super(RegisteredBlocks.blockRemoteJar); } @@ -63,17 +65,8 @@ public class ItemBlockRemoteJar extends ItemBlock { } @Override - public boolean onItemUse( - ItemStack p_77648_1_, - EntityPlayer p_77648_2_, - World p_77648_3_, - int p_77648_4_, - int p_77648_5_, - int p_77648_6_, - int p_77648_7_, - float p_77648_8_, - float p_77648_9_, - float p_77648_10_) { + public boolean onItemUse(ItemStack p_77648_1_, EntityPlayer p_77648_2_, World p_77648_3_, int p_77648_4_, + int p_77648_5_, int p_77648_6_, int p_77648_7_, float p_77648_8_, float p_77648_9_, float p_77648_10_) { return super.onItemUse( p_77648_1_, p_77648_2_, @@ -88,17 +81,8 @@ public class ItemBlockRemoteJar extends ItemBlock { } @Override - public boolean onItemUseFirst( - ItemStack stack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int side, - float hitX, - float hitY, - float hitZ) { + public boolean onItemUseFirst(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, + float hitX, float hitY, float hitZ) { TileRemoteJar tile = BlockRemoteJar.getJarTile(world, x, y, z); if (tile != null) { if (!world.isRemote) { @@ -132,18 +116,8 @@ public class ItemBlockRemoteJar extends ItemBlock { } @Override - 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) { + 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 && stack.hasTagCompound()) { TileRemoteJar tile = (TileRemoteJar) world.getTileEntity(x, y, z); @@ -172,9 +146,10 @@ public class ItemBlockRemoteJar extends ItemBlock { if (stack.hasTagCompound()) { UUID networkId = NBTHelper.getUUID(stack.getTagCompound(), "networkId"); if (networkId != null) { - list.add(String.format( - StatCollector.translateToLocal("gadomancy.lore.remotejar"), - ItemBlockRemoteJar.generateName(networkId))); + list.add( + String.format( + StatCollector.translateToLocal("gadomancy.lore.remotejar"), + ItemBlockRemoteJar.generateName(networkId))); } } ConfigItems.itemJarFilled.addInformation(stack, player, list, advancedItemTooltips); diff --git a/src/main/java/makeo/gadomancy/common/items/ItemBlockStoneMachine.java b/src/main/java/makeo/gadomancy/common/items/ItemBlockStoneMachine.java index 90d6460..2949daa 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemBlockStoneMachine.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemBlockStoneMachine.java @@ -6,14 +6,13 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 27.10.2015 17:05 */ public class ItemBlockStoneMachine extends ItemBlock { + public ItemBlockStoneMachine(Block block) { super(block); this.setMaxDamage(0); diff --git a/src/main/java/makeo/gadomancy/common/items/ItemCreativeNode.java b/src/main/java/makeo/gadomancy/common/items/ItemCreativeNode.java index bbd5fc4..5dd78fc 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemCreativeNode.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemCreativeNode.java @@ -1,8 +1,10 @@ package makeo.gadomancy.common.items; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -10,6 +12,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.nodes.NodeModifier; @@ -19,14 +22,13 @@ import thaumcraft.common.lib.world.ThaumcraftWorldGenerator; import thaumcraft.common.tiles.TileNode; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 04.11.2015 09:57 */ public class ItemCreativeNode extends Item { + public ItemCreativeNode() { this.setCreativeTab(RegisteredItems.creativeTab); this.setUnlocalizedName("nodePlacer"); @@ -47,17 +49,8 @@ public class ItemCreativeNode extends Item { } @Override - public boolean onItemUse( - ItemStack stack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int side, - float hitX, - float hitY, - float hitZ) { + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, + float hitX, float hitY, float hitZ) { ForgeDirection dir = ForgeDirection.getOrientation(side); x += dir.offsetX; y += dir.offsetY; @@ -101,8 +94,7 @@ public class ItemCreativeNode extends Item { if (metadata == 0) { list.add("\u00a75Place a huge and bright aura node"); } else { - list.add("\u00a75Place a node of type " - + NodeType.values()[metadata].name().toLowerCase()); + list.add("\u00a75Place a node of type " + NodeType.values()[metadata].name().toLowerCase()); } list.add("\u00a7oCreative Mode Only"); } diff --git a/src/main/java/makeo/gadomancy/common/items/ItemElement.java b/src/main/java/makeo/gadomancy/common/items/ItemElement.java index 862fa22..58f0d4b 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemElement.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemElement.java @@ -1,9 +1,11 @@ package makeo.gadomancy.common.items; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.entities.EntityItemElement; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; @@ -15,10 +17,7 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.world.World; /** - * HellFirePvP@Admin - * Date: 23.04.2016 / 01:52 - * on Gadomancy - * ItemElementVoid + * HellFirePvP@Admin Date: 23.04.2016 / 01:52 on Gadomancy ItemElementVoid */ public class ItemElement extends Item { @@ -44,8 +43,8 @@ public class ItemElement extends Item { public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean isHolding) { if (stack == null || !(stack.getItem() instanceof ItemElement)) return; int meta = stack.getItemDamage(); - ItemElement.EnumElementType element = - ItemElement.EnumElementType.values()[meta % ItemElement.EnumElementType.values().length]; + ItemElement.EnumElementType element = ItemElement.EnumElementType.values()[meta + % ItemElement.EnumElementType.values().length]; if (!world.isRemote) { if ((world.getTotalWorldTime() & 15) == 0) { @@ -81,24 +80,20 @@ public class ItemElement extends Item { } public enum EnumElementType { + DARKNESS(0x000000, new ElementRunnable() { + @Override public void affectEntity(EntityLivingBase livingBase) { livingBase.addPotionEffect(new PotionEffect(Potion.blindness.getId(), 100, 0, true)); } }); - /*ORDER(0xFFFFFF, new ElementRunnable() { - @Override - public void affectEntity(EntityLivingBase livingBase) { - livingBase.addPotionEffect(new PotionEffect(Potion.nightVision.getId(), 300, 0, true)); - } - }), - FIRE(0x970000, new ElementRunnable() { - @Override - public void affectEntity(EntityLivingBase livingBase) { - livingBase.setFire(10); - } - });*/ + /* + * ORDER(0xFFFFFF, new ElementRunnable() { + * @Override public void affectEntity(EntityLivingBase livingBase) { livingBase.addPotionEffect(new + * PotionEffect(Potion.nightVision.getId(), 300, 0, true)); } }), FIRE(0x970000, new ElementRunnable() { + * @Override public void affectEntity(EntityLivingBase livingBase) { livingBase.setFire(10); } }); + */ private final int renderColor; private final ElementRunnable runnable; diff --git a/src/main/java/makeo/gadomancy/common/items/ItemExtendedNodeJar.java b/src/main/java/makeo/gadomancy/common/items/ItemExtendedNodeJar.java index 724f4f9..3db4227 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemExtendedNodeJar.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemExtendedNodeJar.java @@ -1,9 +1,11 @@ package makeo.gadomancy.common.items; import java.util.List; + import makeo.gadomancy.common.blocks.tiles.TileExtendedNodeJar; import makeo.gadomancy.common.node.ExtendedNodeType; import makeo.gadomancy.common.registration.RegisteredBlocks; + import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; @@ -17,6 +19,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.aspects.IEssentiaContainerItem; @@ -27,14 +30,11 @@ import thaumcraft.common.blocks.ItemJarNode; import thaumcraft.common.config.ConfigItems; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

- * Original created by Azanor@Thaumcraft: thaumcraft.common.blocks.ItemJarNode - * Modified to create compatibility with ExtendedNodes - * Created by HellFirePvP @ 25.10.2015 22:33 + * Original created by Azanor@Thaumcraft: thaumcraft.common.blocks.ItemJarNode Modified to create compatibility with + * ExtendedNodes Created by HellFirePvP @ 25.10.2015 22:33 */ public class ItemExtendedNodeJar extends Item implements IEssentiaContainerItem { @@ -85,43 +85,33 @@ public class ItemExtendedNodeJar extends Item implements IEssentiaContainerItem super.addInformation(stack, player, list, par4); } - public boolean onItemUse( - ItemStack stack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int side, - float par8, - float par9, - float par10) { + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, + float par8, float par9, float par10) { Block var11 = world.getBlock(x, y, z); if (var11 == Blocks.snow_layer) { side = 1; - } else if ((var11 != Blocks.vine) - && (var11 != Blocks.tallgrass) + } else if ((var11 != Blocks.vine) && (var11 != Blocks.tallgrass) && (var11 != Blocks.deadbush) && ((var11.isAir(world, x, y, z)) || (!var11.isReplaceable(world, x, y, z)))) { - if (side == 0) { - y--; - } - if (side == 1) { - y++; - } - if (side == 2) { - z--; - } - if (side == 3) { - z++; - } - if (side == 4) { - x--; - } - if (side == 5) { - x++; - } - } + if (side == 0) { + y--; + } + if (side == 1) { + y++; + } + if (side == 2) { + z--; + } + if (side == 3) { + z++; + } + if (side == 4) { + x--; + } + if (side == 5) { + x++; + } + } if (stack.stackSize == 0) { return false; } @@ -134,8 +124,8 @@ public class ItemExtendedNodeJar extends Item implements IEssentiaContainerItem if (world.canPlaceEntityOnSide(RegisteredBlocks.blockExtendedNodeJar, x, y, z, false, side, player, stack)) { Block var12 = RegisteredBlocks.blockExtendedNodeJar; int var13 = 2; - int var14 = - RegisteredBlocks.blockExtendedNodeJar.onBlockPlaced(world, x, y, z, side, par8, par9, par10, var13); + int var14 = RegisteredBlocks.blockExtendedNodeJar + .onBlockPlaced(world, x, y, z, side, par8, par9, par10, var13); if (this.placeBlockAt(stack, player, world, x, y, z, side, par8, par9, par10, var14)) { TileEntity te = world.getTileEntity(x, y, z); @@ -167,18 +157,8 @@ public class ItemExtendedNodeJar extends Item implements IEssentiaContainerItem return 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) { + 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) { if (!world.setBlock(x, y, z, RegisteredBlocks.blockExtendedNodeJar, metadata, 3)) { return false; } @@ -207,8 +187,8 @@ public class ItemExtendedNodeJar extends Item implements IEssentiaContainerItem aspects.writeToNBT(itemstack.getTagCompound()); } - public void setNodeAttributes( - ItemStack itemstack, NodeType type, NodeModifier mod, ExtendedNodeType extendedNodeType, String id) { + public void setNodeAttributes(ItemStack itemstack, NodeType type, NodeModifier mod, + ExtendedNodeType extendedNodeType, String id) { if (!itemstack.hasTagCompound()) { itemstack.setTagCompound(new NBTTagCompound()); } diff --git a/src/main/java/makeo/gadomancy/common/items/ItemFakeGolemPlacer.java b/src/main/java/makeo/gadomancy/common/items/ItemFakeGolemPlacer.java index d9b52a2..027afc7 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemFakeGolemPlacer.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemFakeGolemPlacer.java @@ -1,27 +1,29 @@ package makeo.gadomancy.common.items; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.List; + import makeo.gadomancy.api.GadomancyApi; import makeo.gadomancy.api.golems.AdditionalGolemType; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; + import thaumcraft.common.entities.golems.EnumGolemType; import thaumcraft.common.entities.golems.ItemGolemPlacer; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 03.08.2015 14:43 */ public class ItemFakeGolemPlacer extends Item { + private static final ItemGolemPlacer PLACER = new ItemGolemPlacer(); @SideOnly(Side.CLIENT) diff --git a/src/main/java/makeo/gadomancy/common/items/ItemFakeGolemShield.java b/src/main/java/makeo/gadomancy/common/items/ItemFakeGolemShield.java index dbe3604..237dd96 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemFakeGolemShield.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemFakeGolemShield.java @@ -1,24 +1,26 @@ package makeo.gadomancy.common.items; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.List; + import makeo.gadomancy.common.Gadomancy; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 25.06.2015 22:25 */ public class ItemFakeGolemShield extends Item { + private final Item golemItem = new ItemFakeGolemPlacer(); private IIcon shieldIcon; diff --git a/src/main/java/makeo/gadomancy/common/items/ItemFakeLootbag.java b/src/main/java/makeo/gadomancy/common/items/ItemFakeLootbag.java index 02192e5..6e2702c 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemFakeLootbag.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemFakeLootbag.java @@ -1,24 +1,26 @@ package makeo.gadomancy.common.items; import java.util.List; + import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.world.World; + import thaumcraft.common.items.ItemLootBag; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 19.12.2015 21:46 */ public class ItemFakeLootbag extends ItemLootBag { + public ItemFakeLootbag() { this.setCreativeTab(null); this.setUnlocalizedName("ItemLootBag"); diff --git a/src/main/java/makeo/gadomancy/common/items/ItemFakeModIcon.java b/src/main/java/makeo/gadomancy/common/items/ItemFakeModIcon.java index 2fbf4af..9c27b67 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemFakeModIcon.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemFakeModIcon.java @@ -1,15 +1,14 @@ package makeo.gadomancy.common.items; import makeo.gadomancy.common.Gadomancy; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.item.Item; import net.minecraft.util.IIcon; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 20.10.2015 22:49 */ diff --git a/src/main/java/makeo/gadomancy/common/items/ItemGolemCoreBreak.java b/src/main/java/makeo/gadomancy/common/items/ItemGolemCoreBreak.java index 9d64f19..ba4611b 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemGolemCoreBreak.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemGolemCoreBreak.java @@ -1,8 +1,10 @@ package makeo.gadomancy.common.items; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -13,10 +15,8 @@ import net.minecraft.util.IIcon; import net.minecraft.util.StatCollector; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 02.10.2015 19:40 */ diff --git a/src/main/java/makeo/gadomancy/common/items/ItemNodeManipulator.java b/src/main/java/makeo/gadomancy/common/items/ItemNodeManipulator.java index ea0ea06..840a267 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemNodeManipulator.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemNodeManipulator.java @@ -1,13 +1,12 @@ package makeo.gadomancy.common.items; import net.minecraft.block.Block; + import thaumcraft.common.blocks.BlockStoneDeviceItem; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 27.10.2015 13:00 */ diff --git a/src/main/java/makeo/gadomancy/common/items/ItemTransformationFocus.java b/src/main/java/makeo/gadomancy/common/items/ItemTransformationFocus.java index 486391d..d2bb7b7 100644 --- a/src/main/java/makeo/gadomancy/common/items/ItemTransformationFocus.java +++ b/src/main/java/makeo/gadomancy/common/items/ItemTransformationFocus.java @@ -1,8 +1,7 @@ package makeo.gadomancy.common.items; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import makeo.gadomancy.common.Gadomancy; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; @@ -10,22 +9,24 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.wands.FocusUpgradeType; import thaumcraft.api.wands.ItemFocusBasic; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 13.07.2015 02:14 */ public class ItemTransformationFocus extends ItemFocusBasic { - private static final AspectList VIS_USAGE = - new AspectList().add(Aspect.AIR, 15).add(Aspect.EARTH, 15).add(Aspect.ORDER, 15); + + private static final AspectList VIS_USAGE = new AspectList().add(Aspect.AIR, 15).add(Aspect.EARTH, 15) + .add(Aspect.ORDER, 15); private IIcon iconOrnament; private IIcon iconDepth; @@ -37,8 +38,8 @@ public class ItemTransformationFocus extends ItemFocusBasic { } @Override - public ItemStack onFocusRightClick( - ItemStack wandStack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) { + public ItemStack onFocusRightClick(ItemStack wandStack, World world, EntityPlayer player, + MovingObjectPosition movingobjectposition) { player.setItemInUse(wandStack, 2147483647); // WandManager.setCooldown(player, -1); return wandStack; diff --git a/src/main/java/makeo/gadomancy/common/items/baubles/ItemEtherealFamiliar.java b/src/main/java/makeo/gadomancy/common/items/baubles/ItemEtherealFamiliar.java index 7de0f76..6943f10 100644 --- a/src/main/java/makeo/gadomancy/common/items/baubles/ItemEtherealFamiliar.java +++ b/src/main/java/makeo/gadomancy/common/items/baubles/ItemEtherealFamiliar.java @@ -1,10 +1,9 @@ package makeo.gadomancy.common.items.baubles; -import baubles.api.BaubleType; -import baubles.api.IBauble; import java.util.ArrayList; import java.util.List; import java.util.Set; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.data.DataFamiliar; import makeo.gadomancy.common.data.SyncDataHolder; @@ -12,6 +11,7 @@ import makeo.gadomancy.common.familiar.FamiliarAugment; import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.utils.MiscUtils; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -21,15 +21,17 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; + import org.lwjgl.input.Keyboard; + import thaumcraft.api.aspects.Aspect; import thaumcraft.common.lib.research.ResearchManager; +import baubles.api.BaubleType; +import baubles.api.IBauble; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 28.12.2015 23:09 */ @@ -80,22 +82,24 @@ public class ItemEtherealFamiliar extends Item implements IBauble { List newLore = new ArrayList(); if (ItemEtherealFamiliar.hasFamiliarAspect(stack)) { - newLore.add(EnumChatFormatting.GRAY - + ItemEtherealFamiliar.getFamiliarAspect(stack).getName()); + newLore.add(EnumChatFormatting.GRAY + ItemEtherealFamiliar.getFamiliarAspect(stack).getName()); } List augments = ItemEtherealFamiliar.getAugments(stack); for (FamiliarAugment.FamiliarAugmentPair pair : augments) { - newLore.add(EnumChatFormatting.GRAY + pair.augment.getLocalizedName() + " " - + MiscUtils.toRomanNumeral(pair.level)); + newLore.add( + EnumChatFormatting.GRAY + pair.augment.getLocalizedName() + + " " + + MiscUtils.toRomanNumeral(pair.level)); } if (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54)) { lore.addAll(newLore); } else { - if (!newLore.isEmpty()) - lore.add(EnumChatFormatting.DARK_GRAY + "" + EnumChatFormatting.ITALIC - + StatCollector.translateToLocal("gadomancy.lore.hasAdditionalLore")); + if (!newLore.isEmpty()) lore.add( + EnumChatFormatting.DARK_GRAY + "" + + EnumChatFormatting.ITALIC + + StatCollector.translateToLocal("gadomancy.lore.hasAdditionalLore")); } } @@ -148,14 +152,12 @@ public class ItemEtherealFamiliar extends Item implements IBauble { return augmentList; } - /*public static boolean doesAcceptAugment(ItemStack stack, FamiliarAugment augment, int level) { - if(stack == null || !(stack.getItem() instanceof ItemEtherealFamiliar)) return false; - FamiliarAugment.FamiliarAugmentList currentAugments = getAugments(stack); - for(FamiliarAugment.FamiliarAugmentPair pair : currentAugments) { - if(pair.augment.equals(augment)) return false; - } - return augment.checkConditions(currentAugments, level); - }*/ + /* + * public static boolean doesAcceptAugment(ItemStack stack, FamiliarAugment augment, int level) { if(stack == null + * || !(stack.getItem() instanceof ItemEtherealFamiliar)) return false; FamiliarAugment.FamiliarAugmentList + * currentAugments = getAugments(stack); for(FamiliarAugment.FamiliarAugmentPair pair : currentAugments) { + * if(pair.augment.equals(augment)) return false; } return augment.checkConditions(currentAugments, level); } + */ public static boolean incrementAugmentLevel(ItemStack stack, FamiliarAugment toAdd) { if (!ItemEtherealFamiliar.hasAugment(stack, toAdd)) { @@ -166,10 +168,11 @@ public class ItemEtherealFamiliar extends Item implements IBauble { } } - /*public static boolean addAugment(ItemStack stack, FamiliarAugment augment, int level) { - if(stack == null || !(stack.getItem() instanceof ItemEtherealFamiliar) || level <= 0) return false; - return doesAcceptAugment(stack, augment, level) && addAugmentUnsafe(stack, augment, level); - }*/ + /* + * public static boolean addAugment(ItemStack stack, FamiliarAugment augment, int level) { if(stack == null || + * !(stack.getItem() instanceof ItemEtherealFamiliar) || level <= 0) return false; return doesAcceptAugment(stack, + * augment, level) && addAugmentUnsafe(stack, augment, level); } + */ public static boolean addAugmentUnsafe(ItemStack stack, FamiliarAugment augment, int level) { if (stack == null || !(stack.getItem() instanceof ItemEtherealFamiliar) || level <= 0) return false; @@ -222,7 +225,8 @@ public class ItemEtherealFamiliar extends Item implements IBauble { public boolean canEquip(ItemStack itemStack, EntityLivingBase entityLivingBase) { if (!(entityLivingBase instanceof EntityPlayer)) return false; return ResearchManager.isResearchComplete( - entityLivingBase.getCommandSenderName(), Gadomancy.MODID.toUpperCase() + ".ETHEREAL_FAMILIAR"); + entityLivingBase.getCommandSenderName(), + Gadomancy.MODID.toUpperCase() + ".ETHEREAL_FAMILIAR"); } @Override diff --git a/src/main/java/makeo/gadomancy/common/items/baubles/ItemFamiliar_Old.java b/src/main/java/makeo/gadomancy/common/items/baubles/ItemFamiliar_Old.java index 2b8ff20..dced901 100644 --- a/src/main/java/makeo/gadomancy/common/items/baubles/ItemFamiliar_Old.java +++ b/src/main/java/makeo/gadomancy/common/items/baubles/ItemFamiliar_Old.java @@ -1,13 +1,13 @@ package makeo.gadomancy.common.items.baubles; -import baubles.api.BaubleType; -import baubles.api.IBauble; import java.util.ArrayList; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.crafting.DeprecationItemPaybacks; import makeo.gadomancy.common.registration.RegisteredItems; import makeo.gadomancy.common.utils.NBTHelper; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -16,14 +16,16 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.StatCollector; + import org.lwjgl.input.Keyboard; + import thaumcraft.api.aspects.Aspect; +import baubles.api.BaubleType; +import baubles.api.IBauble; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 31.10.2015 11:38 */ @@ -52,8 +54,7 @@ public class ItemFamiliar_Old extends Item implements IBauble { } if (Keyboard.isKeyDown(42) || Keyboard.isKeyDown(54)) { - if (this.hasUpgrade(stack, FamiliarUpgrade.ATTACK_1) - || this.hasUpgrade(stack, FamiliarUpgrade.ATTACK_2) + if (this.hasUpgrade(stack, FamiliarUpgrade.ATTACK_1) || this.hasUpgrade(stack, FamiliarUpgrade.ATTACK_2) || this.hasUpgrade(stack, FamiliarUpgrade.ATTACK_3)) { String strength = EnumChatFormatting.DARK_RED + "Strength "; if (this.hasUpgrade(stack, FamiliarUpgrade.ATTACK_1)) strength += "I"; @@ -71,8 +72,10 @@ public class ItemFamiliar_Old extends Item implements IBauble { } } else { if (this.hasAnyUpgrade(stack)) { - lore.add(EnumChatFormatting.DARK_GRAY + "" + EnumChatFormatting.ITALIC - + StatCollector.translateToLocal("gadomancy.lore.hasAdditionalLore")); + lore.add( + EnumChatFormatting.DARK_GRAY + "" + + EnumChatFormatting.ITALIC + + StatCollector.translateToLocal("gadomancy.lore.hasAdditionalLore")); } } } @@ -117,52 +120,35 @@ public class ItemFamiliar_Old extends Item implements IBauble { @Override public void onWornTick(ItemStack itemStack, EntityLivingBase entity) { /* - if(itemStack == null) return; - if(entity instanceof EntityPlayer && itemStack.getItem() instanceof ItemFamiliar_Old) { - DataFamiliar familiarData = SyncDataHolder.getDataServer("FamiliarData"); - Aspect a = getAspect(itemStack); - if(a != null) { - familiarData.equipTick(((EntityPlayer) entity).worldObj, (EntityPlayer) entity, a); - } - - if(((EntityPlayer) entity).worldObj.isRemote) return; - - int probability = 0; - if(hasUpgrade(itemStack, FamiliarUpgrade.ATTACK_2)) probability += 1; - if(hasUpgrade(itemStack, FamiliarUpgrade.ATTACK_3)) probability += 1; - if(probability > 0) { - int rand = itemRand.nextInt(20000 / probability); - if(rand == 42) { - Thaumcraft.addWarpToPlayer((EntityPlayer) entity, 1 + itemRand.nextInt(4), true); - } - } - }*/ + * if(itemStack == null) return; if(entity instanceof EntityPlayer && itemStack.getItem() instanceof + * ItemFamiliar_Old) { DataFamiliar familiarData = SyncDataHolder.getDataServer("FamiliarData"); Aspect a = + * getAspect(itemStack); if(a != null) { familiarData.equipTick(((EntityPlayer) entity).worldObj, (EntityPlayer) + * entity, a); } if(((EntityPlayer) entity).worldObj.isRemote) return; int probability = 0; + * if(hasUpgrade(itemStack, FamiliarUpgrade.ATTACK_2)) probability += 1; if(hasUpgrade(itemStack, + * FamiliarUpgrade.ATTACK_3)) probability += 1; if(probability > 0) { int rand = itemRand.nextInt(20000 / + * probability); if(rand == 42) { Thaumcraft.addWarpToPlayer((EntityPlayer) entity, 1 + itemRand.nextInt(4), + * true); } } } + */ } @Override public void onEquipped(ItemStack itemStack, EntityLivingBase entity) { /* - if(itemStack == null) return; - if(entity instanceof EntityPlayer && itemStack.getItem() instanceof ItemFamiliar_Old) { - DataFamiliar familiarData = SyncDataHolder.getDataServer("FamiliarData"); - Aspect a = getAspect(itemStack); - if(a != null) { - familiarData.handleEquip(((EntityPlayer) entity).worldObj, (EntityPlayer) entity, a); - } - }*/ + * if(itemStack == null) return; if(entity instanceof EntityPlayer && itemStack.getItem() instanceof + * ItemFamiliar_Old) { DataFamiliar familiarData = SyncDataHolder.getDataServer("FamiliarData"); Aspect a = + * getAspect(itemStack); if(a != null) { familiarData.handleEquip(((EntityPlayer) entity).worldObj, + * (EntityPlayer) entity, a); } } + */ } @Override public void onUnequipped(ItemStack itemStack, EntityLivingBase entity) { /* - if(itemStack == null) return; - if(entity instanceof EntityPlayer && itemStack.getItem() instanceof ItemFamiliar_Old) { - DataFamiliar familiarData = SyncDataHolder.getDataServer("FamiliarData"); - Aspect a = getAspect(itemStack); - if(a != null) { - familiarData.handleUnequip(((EntityPlayer) entity).worldObj, (EntityPlayer) entity, a); - } - }*/ + * if(itemStack == null) return; if(entity instanceof EntityPlayer && itemStack.getItem() instanceof + * ItemFamiliar_Old) { DataFamiliar familiarData = SyncDataHolder.getDataServer("FamiliarData"); Aspect a = + * getAspect(itemStack); if(a != null) { familiarData.handleUnequip(((EntityPlayer) entity).worldObj, + * (EntityPlayer) entity, a); } } + */ } @Override @@ -252,6 +238,7 @@ public class ItemFamiliar_Old extends Item implements IBauble { } public enum FamiliarUpgrade { + ATTACK_1("AttackUpgrade1"), ATTACK_2("AttackUpgrade2", FamiliarUpgrade.ATTACK_1), ATTACK_3("AttackUpgrade3", FamiliarUpgrade.ATTACK_2), diff --git a/src/main/java/makeo/gadomancy/common/network/PacketHandler.java b/src/main/java/makeo/gadomancy/common/network/PacketHandler.java index cbf41e8..12f986c 100644 --- a/src/main/java/makeo/gadomancy/common/network/PacketHandler.java +++ b/src/main/java/makeo/gadomancy/common/network/PacketHandler.java @@ -1,39 +1,38 @@ package makeo.gadomancy.common.network; +import makeo.gadomancy.common.Gadomancy; +import makeo.gadomancy.common.network.packets.*; import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; import cpw.mods.fml.relauncher.Side; -import makeo.gadomancy.common.Gadomancy; -import makeo.gadomancy.common.network.packets.*; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 03.07.2015 19:13 */ public class PacketHandler { - public static final SimpleNetworkWrapper INSTANCE = - NetworkRegistry.INSTANCE.newSimpleChannel(Gadomancy.MODID.toLowerCase()); + + public static final SimpleNetworkWrapper INSTANCE = NetworkRegistry.INSTANCE + .newSimpleChannel(Gadomancy.MODID.toLowerCase()); public static void init() { int id = 0; // Random stuff - PacketHandler.INSTANCE.registerMessage( - PacketUpdateGolemTypeOrder.class, PacketUpdateGolemTypeOrder.class, id++, Side.CLIENT); - PacketHandler.INSTANCE.registerMessage( - PacketStartAnimation.class, PacketStartAnimation.class, id++, Side.CLIENT); - PacketHandler.INSTANCE.registerMessage( - PacketAnimationAbsorb.class, PacketAnimationAbsorb.class, id++, Side.CLIENT); + PacketHandler.INSTANCE + .registerMessage(PacketUpdateGolemTypeOrder.class, PacketUpdateGolemTypeOrder.class, id++, Side.CLIENT); + PacketHandler.INSTANCE + .registerMessage(PacketStartAnimation.class, PacketStartAnimation.class, id++, Side.CLIENT); + PacketHandler.INSTANCE + .registerMessage(PacketAnimationAbsorb.class, PacketAnimationAbsorb.class, id++, Side.CLIENT); // Using TC Clientside content PacketHandler.INSTANCE.registerMessage(PacketTCNodeBolt.class, PacketTCNodeBolt.class, id++, Side.CLIENT); PacketHandler.INSTANCE.registerMessage(PacketTCWispyLine.class, PacketTCWispyLine.class, id++, Side.CLIENT); - PacketHandler.INSTANCE.registerMessage( - PacketTCNotificationText.class, PacketTCNotificationText.class, id++, Side.CLIENT); + PacketHandler.INSTANCE + .registerMessage(PacketTCNotificationText.class, PacketTCNotificationText.class, id++, Side.CLIENT); // Familiar PacketHandler.INSTANCE.registerMessage(PacketFamiliarBolt.class, PacketFamiliarBolt.class, id++, Side.CLIENT); @@ -41,7 +40,7 @@ public class PacketHandler { // Sync data PacketHandler.INSTANCE.registerMessage(PacketSyncConfigs.class, PacketSyncConfigs.class, id++, Side.CLIENT); PacketHandler.INSTANCE.registerMessage(PacketSyncData.class, PacketSyncData.class, id++, Side.CLIENT); - PacketHandler.INSTANCE.registerMessage( - PacketUpdateOnlineState.class, PacketUpdateOnlineState.class, id++, Side.CLIENT); + PacketHandler.INSTANCE + .registerMessage(PacketUpdateOnlineState.class, PacketUpdateOnlineState.class, id++, Side.CLIENT); } } diff --git a/src/main/java/makeo/gadomancy/common/network/packets/PacketAbortTransform.java b/src/main/java/makeo/gadomancy/common/network/packets/PacketAbortTransform.java index d3d6c98..fc4b146 100644 --- a/src/main/java/makeo/gadomancy/common/network/packets/PacketAbortTransform.java +++ b/src/main/java/makeo/gadomancy/common/network/packets/PacketAbortTransform.java @@ -1,21 +1,20 @@ package makeo.gadomancy.common.network.packets; +import makeo.gadomancy.client.transformation.TransformationHelper; 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 cpw.mods.fml.relauncher.Side; import io.netty.buffer.ByteBuf; -import makeo.gadomancy.client.transformation.TransformationHelper; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 03.07.2015 21:42 */ public class PacketAbortTransform implements IMessage, IMessageHandler { + private int entityId; private byte reason; diff --git a/src/main/java/makeo/gadomancy/common/network/packets/PacketAnimationAbsorb.java b/src/main/java/makeo/gadomancy/common/network/packets/PacketAnimationAbsorb.java index 40ee39a..bf61d50 100644 --- a/src/main/java/makeo/gadomancy/common/network/packets/PacketAnimationAbsorb.java +++ b/src/main/java/makeo/gadomancy/common/network/packets/PacketAnimationAbsorb.java @@ -1,20 +1,20 @@ package makeo.gadomancy.common.network.packets; +import makeo.gadomancy.client.util.MultiTickEffectDispatcher; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; + 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 cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; -import makeo.gadomancy.client.util.MultiTickEffectDispatcher; -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 25.10.2015 18:04 */ @@ -37,8 +37,8 @@ public class PacketAnimationAbsorb implements IMessage, IMessageHandler * Created by HellFirePvP @ 31.10.2015 14:36 */ @@ -24,8 +22,8 @@ public class PacketFamiliarBolt implements IMessage, IMessageHandler * Created by makeo @ 15.11.2015 21:10 */ public class PacketSyncConfigs implements IMessage, IMessageHandler { + private Tuple[] fieldData; @Override @@ -38,8 +38,7 @@ public class PacketSyncConfigs implements IMessage, IMessageHandler provider = - AbstractData.Registry.getProvider(providerId); + AbstractData.AbstractDataProvider provider = AbstractData.Registry + .getProvider(providerId); if (provider == null) { Gadomancy.log.warn("Provider for ID " + providerId + " doesn't exist! Skipping..."); continue; @@ -91,8 +92,8 @@ public class PacketSyncData implements IMessage, IMessageHandler * Created by HellFirePvP @ 25.10.2015 19:42 */ @@ -23,13 +22,7 @@ public class PacketTCNodeBolt implements IMessage, IMessageHandler * Created by HellFirePvP @ 29.11.2015 18:40 */ diff --git a/src/main/java/makeo/gadomancy/common/network/packets/PacketTCWispyLine.java b/src/main/java/makeo/gadomancy/common/network/packets/PacketTCWispyLine.java index 53f41e7..099aa58 100644 --- a/src/main/java/makeo/gadomancy/common/network/packets/PacketTCWispyLine.java +++ b/src/main/java/makeo/gadomancy/common/network/packets/PacketTCWispyLine.java @@ -1,16 +1,14 @@ package makeo.gadomancy.common.network.packets; +import makeo.gadomancy.client.util.MultiTickEffectDispatcher; 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 io.netty.buffer.ByteBuf; -import makeo.gadomancy.client.util.MultiTickEffectDispatcher; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 28.10.2015 23:28 */ @@ -24,16 +22,8 @@ public class PacketTCWispyLine implements IMessage, IMessageHandler * Created by makeo @ 25.10.2015 15:03 */ public class PacketTransformationInfo implements IMessage, IMessageHandler { + private static final World WORLD = new FakeWorld(); private EntityGolemBase golem; @@ -34,8 +35,8 @@ public class PacketTransformationInfo implements IMessage, IMessageHandler { + private int player; public Request(EntityPlayer player) { @@ -69,9 +71,9 @@ public class PacketTransformationInfo implements IMessage, IMessageHandler { + private Map mapping; public PacketUpdateGolemTypeOrder() {} @@ -34,8 +34,7 @@ public class PacketUpdateGolemTypeOrder implements IMessage, IMessageHandler) new ObjectInputStream(in).readObject(); in.close(); - } catch (Exception ignored) { - } // IOException | ClassNotFoundException ignored + } catch (Exception ignored) {} // IOException | ClassNotFoundException ignored } @Override @@ -43,8 +42,7 @@ public class PacketUpdateGolemTypeOrder implements IMessage, IMessageHandler * Created by HellFirePvP @ 07.07.2016 / 21:46 */ diff --git a/src/main/java/makeo/gadomancy/common/node/ExtendedNodeType.java b/src/main/java/makeo/gadomancy/common/node/ExtendedNodeType.java index 36dd54b..029363f 100644 --- a/src/main/java/makeo/gadomancy/common/node/ExtendedNodeType.java +++ b/src/main/java/makeo/gadomancy/common/node/ExtendedNodeType.java @@ -1,10 +1,8 @@ package makeo.gadomancy.common.node; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 25.10.2015 10:33 */ diff --git a/src/main/java/makeo/gadomancy/common/node/GrowingNodeBehavior.java b/src/main/java/makeo/gadomancy/common/node/GrowingNodeBehavior.java index 09dc3f5..778b322 100644 --- a/src/main/java/makeo/gadomancy/common/node/GrowingNodeBehavior.java +++ b/src/main/java/makeo/gadomancy/common/node/GrowingNodeBehavior.java @@ -1,8 +1,8 @@ package makeo.gadomancy.common.node; -import cpw.mods.fml.common.network.NetworkRegistry; import java.util.LinkedHashMap; import java.util.Map; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.blocks.tiles.TileExtendedNode; import makeo.gadomancy.common.network.PacketHandler; @@ -10,20 +10,21 @@ import makeo.gadomancy.common.network.packets.PacketAnimationAbsorb; import makeo.gadomancy.common.network.packets.PacketTCNodeBolt; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.utils.ResearchHelper; + import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.Vec3; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.entities.EntityAspectOrb; import thaumcraft.common.tiles.TileNode; +import cpw.mods.fml.common.network.NetworkRegistry; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 24.10.2015 10:50 */ @@ -109,11 +110,8 @@ public class GrowingNodeBehavior { } public boolean mayZapNow() { - return this.overallHappiness - > this.owningNode - .getWorldObj() - .rand - .nextInt(GrowingNodeBehavior.HAPPINESS_CAP * GrowingNodeBehavior.HAPPINESS_CAP); + return this.overallHappiness > this.owningNode.getWorldObj().rand + .nextInt(GrowingNodeBehavior.HAPPINESS_CAP * GrowingNodeBehavior.HAPPINESS_CAP); } public float getZapDamage() { @@ -166,14 +164,11 @@ public class GrowingNodeBehavior { public boolean updateBehavior(boolean needUpdate) { if (this.fixedNode != null && this.owningNode.ticksExisted % 3 == 0) { - if (this.owningNode - .getWorldObj() - .getBlock(this.fixedNode.xCoord, this.fixedNode.yCoord, this.fixedNode.zCoord) - != RegisteredBlocks.blockNode - || this.owningNode - .getWorldObj() - .getTileEntity(this.fixedNode.xCoord, this.fixedNode.yCoord, this.fixedNode.zCoord) - == null + if (this.owningNode.getWorldObj() + .getBlock(this.fixedNode.xCoord, this.fixedNode.yCoord, this.fixedNode.zCoord) + != RegisteredBlocks.blockNode + || this.owningNode.getWorldObj() + .getTileEntity(this.fixedNode.xCoord, this.fixedNode.yCoord, this.fixedNode.zCoord) == null || this.fixedNode.isInvalid()) { this.fixedNode = null; return needUpdate; @@ -187,8 +182,8 @@ public class GrowingNodeBehavior { this.removeFixedNode(x, y, z); return needUpdate; } - Aspect a = baseAspects - .getAspects()[this.owningNode.getWorldObj().rand.nextInt(baseAspects.getAspects().length)]; + Aspect a = baseAspects.getAspects()[this.owningNode.getWorldObj().rand + .nextInt(baseAspects.getAspects().length)]; if (baseAspects.getAmount(a) > 0) { if (baseAspects.reduce(a, 1)) { World world = this.owningNode.getWorldObj(); @@ -210,19 +205,28 @@ public class GrowingNodeBehavior { EntityAspectOrb aspectOrb = new EntityAspectOrb(world, fx + 0.5D, fy + 0.5D, fz + 0.5D, a, 1); Vec3 dir = Vec3.createVectorHelper(fx + 0.5D, fy + 0.5D, fz + 0.5D) - .subtract(Vec3.createVectorHelper(ox + 0.5D, oy + 0.5D, oz + 0.5D)) - .normalize(); - dir.addVector(this.randOffset(), this.randOffset(), this.randOffset()) - .normalize(); + .subtract(Vec3.createVectorHelper(ox + 0.5D, oy + 0.5D, oz + 0.5D)).normalize(); + dir.addVector(this.randOffset(), this.randOffset(), this.randOffset()).normalize(); aspectOrb.motionX = dir.xCoord; aspectOrb.motionY = dir.yCoord; aspectOrb.motionZ = dir.zCoord; this.fixedNode.getWorldObj().spawnEntityInWorld(aspectOrb); NetworkRegistry.TargetPoint point = new NetworkRegistry.TargetPoint( - world.provider.dimensionId, ox + 0.5F, oy + 0.5F, oz + 0.5F, 32); + world.provider.dimensionId, + ox + 0.5F, + oy + 0.5F, + oz + 0.5F, + 32); PacketTCNodeBolt bolt = new PacketTCNodeBolt( - ox + 0.5F, oy + 0.5F, oz + 0.5F, fx + 0.5F, fy + 0.5F, fz + 0.5F, 0, false); + ox + 0.5F, + oy + 0.5F, + oz + 0.5F, + fx + 0.5F, + fy + 0.5F, + fz + 0.5F, + 0, + false); PacketHandler.INSTANCE.sendToAllAround(bolt, point); PacketAnimationAbsorb packet = new PacketAnimationAbsorb(ox, oy, oz, fx, fy, fz, 7); @@ -277,8 +281,9 @@ public class GrowingNodeBehavior { } if (this.aspectSaturation.containsKey(aspect)) { - double percentageToSaturation = - this.aspectSaturation.get(aspect) / GrowingNodeBehavior.SATURATION_CAP; // 0.0 - 1.0 + double percentageToSaturation = this.aspectSaturation.get(aspect) / GrowingNodeBehavior.SATURATION_CAP; // 0.0 + // - + // 1.0 boolean mayAdd = this.owningNode.getWorldObj().rand.nextFloat() > percentageToSaturation; if (mayAdd) { double inc = 1D / (1D - percentageToSaturation); diff --git a/src/main/java/makeo/gadomancy/common/node/NodeManipulatorResult.java b/src/main/java/makeo/gadomancy/common/node/NodeManipulatorResult.java index a1b6bda..8a2c760 100644 --- a/src/main/java/makeo/gadomancy/common/node/NodeManipulatorResult.java +++ b/src/main/java/makeo/gadomancy/common/node/NodeManipulatorResult.java @@ -2,13 +2,12 @@ package makeo.gadomancy.common.node; import net.minecraft.util.WeightedRandom; import net.minecraft.world.World; + import thaumcraft.api.nodes.INode; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 28.10.2015 11:45 */ diff --git a/src/main/java/makeo/gadomancy/common/node/NodeManipulatorResultHandler.java b/src/main/java/makeo/gadomancy/common/node/NodeManipulatorResultHandler.java index 2c1d48c..a1dc621 100644 --- a/src/main/java/makeo/gadomancy/common/node/NodeManipulatorResultHandler.java +++ b/src/main/java/makeo/gadomancy/common/node/NodeManipulatorResultHandler.java @@ -3,19 +3,20 @@ package makeo.gadomancy.common.node; import java.util.ArrayList; import java.util.List; import java.util.Random; + import makeo.gadomancy.common.data.config.ModConfig; import makeo.gadomancy.common.registration.RegisteredManipulations; + import net.minecraft.util.WeightedRandom; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.nodes.INode; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 28.10.2015 11:43 */ @@ -29,8 +30,8 @@ public class NodeManipulatorResultHandler { return NodeManipulatorResultHandler.getRandomResult(world, world.rand, affectedNode, percChance); } - public static NodeManipulatorResult getRandomResult( - World world, Random random, INode affectedNode, int percChance) { + public static NodeManipulatorResult getRandomResult(World world, Random random, INode affectedNode, + int percChance) { int resultPositiveChance = Math.round(((float) percChance) / 5F); List localResults = new ArrayList(); for (NodeManipulatorResult result : NodeManipulatorResultHandler.possibleResults) { diff --git a/src/main/java/makeo/gadomancy/common/potions/PotionAchromatic.java b/src/main/java/makeo/gadomancy/common/potions/PotionAchromatic.java index 3e3c29d..7186335 100644 --- a/src/main/java/makeo/gadomancy/common/potions/PotionAchromatic.java +++ b/src/main/java/makeo/gadomancy/common/potions/PotionAchromatic.java @@ -1,41 +1,43 @@ package makeo.gadomancy.common.potions; import java.util.List; + import makeo.gadomancy.common.data.DataAchromatic; import makeo.gadomancy.common.data.SyncDataHolder; import makeo.gadomancy.common.utils.Vector3; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.IProjectile; import net.minecraft.entity.ai.attributes.BaseAttributeMap; import net.minecraft.util.AxisAlignedBB; + import thaumcraft.api.aspects.Aspect; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 11.12.2015 17:32 */ public class PotionAchromatic extends PotionCustomTexture { + public PotionAchromatic(int id) { super(id, false, Aspect.CRYSTAL.getColor(), Aspect.CRYSTAL.getImage()); this.setPotionName("potion.achromatic"); } @Override - public void applyAttributesModifiersToEntity( - EntityLivingBase entity, BaseAttributeMap p_111185_2_, int p_111185_3_) { + public void applyAttributesModifiersToEntity(EntityLivingBase entity, BaseAttributeMap p_111185_2_, + int p_111185_3_) { super.applyAttributesModifiersToEntity(entity, p_111185_2_, p_111185_3_); ((DataAchromatic) SyncDataHolder.getDataServer("AchromaticData")).handleApplication(entity); } @Override - public void removeAttributesModifiersFromEntity( - EntityLivingBase entity, BaseAttributeMap p_111187_2_, int p_111187_3_) { + public void removeAttributesModifiersFromEntity(EntityLivingBase entity, BaseAttributeMap p_111187_2_, + int p_111187_3_) { super.removeAttributesModifiersFromEntity(entity, p_111187_2_, p_111187_3_); ((DataAchromatic) SyncDataHolder.getDataServer("AchromaticData")).handleRemoval(entity); @@ -48,47 +50,24 @@ public class PotionAchromatic extends PotionCustomTexture { @Override public void performEffect(EntityLivingBase entity, int p_76394_2_) { - /*if(entity.boundingBox != null) { - List projectiles = entity.worldObj.getEntitiesWithinAABB(IProjectile.class, entity.boundingBox.expand(3, 3, 3)); - - for(Entity e : projectiles) { - AxisAlignedBB boundingBox = e.boundingBox != null ? e.boundingBox : AxisAlignedBB.getBoundingBox(e.posX, e.posY, e.posZ, e.posX, e.posY, e.posZ); - if(entity.boundingBox.expand(1.5, 1.5, 1.5).intersectsWith(boundingBox)) { - double pMaxDist = new Vector3(entity.boundingBox.minX, entity.boundingBox.minY, entity.boundingBox.minZ).distance(new Vector3(entity.boundingBox.maxX, entity.boundingBox.maxY, entity.boundingBox.maxZ)); - double eMaxDist = new Vector3(boundingBox.minX, boundingBox.minY, boundingBox.minZ).distance(new Vector3(boundingBox.maxX, boundingBox.maxY, boundingBox.maxZ)); - double timeoutDist = pMaxDist + eMaxDist*2 + 4.5; - - Vector3 vec = new Vector3(e.motionX, e.motionY, e.motionZ).normalize(); - float dist = 0; - - boolean success = false; - boolean state = true; - - Vector3 temp; - do { - temp = vec.clone().multiply(dist); - if(state) { - if(entity.boundingBox.intersectsWith(boundingBox.copy().offset(temp.getX(), temp.getY(), temp.getZ()))) { - state = false; - } - } else { - if(!entity.boundingBox.intersectsWith(boundingBox.copy().offset(temp.getX(), temp.getY(), temp.getZ()))) { - success = true; - break; - } - } - dist += 0.1; - } while(dist < timeoutDist); - - temp = vec.clone().multiply(dist + 1.25); - if(success) { - e.posX += temp.getX(); - e.posY += temp.getY(); - e.posZ += temp.getZ(); - } - } - } - }*/ + /* + * if(entity.boundingBox != null) { List projectiles = + * entity.worldObj.getEntitiesWithinAABB(IProjectile.class, entity.boundingBox.expand(3, 3, 3)); for(Entity e : + * projectiles) { AxisAlignedBB boundingBox = e.boundingBox != null ? e.boundingBox : + * AxisAlignedBB.getBoundingBox(e.posX, e.posY, e.posZ, e.posX, e.posY, e.posZ); + * if(entity.boundingBox.expand(1.5, 1.5, 1.5).intersectsWith(boundingBox)) { double pMaxDist = new + * Vector3(entity.boundingBox.minX, entity.boundingBox.minY, entity.boundingBox.minZ).distance(new + * Vector3(entity.boundingBox.maxX, entity.boundingBox.maxY, entity.boundingBox.maxZ)); double eMaxDist = new + * Vector3(boundingBox.minX, boundingBox.minY, boundingBox.minZ).distance(new Vector3(boundingBox.maxX, + * boundingBox.maxY, boundingBox.maxZ)); double timeoutDist = pMaxDist + eMaxDist*2 + 4.5; Vector3 vec = new + * Vector3(e.motionX, e.motionY, e.motionZ).normalize(); float dist = 0; boolean success = false; boolean state + * = true; Vector3 temp; do { temp = vec.clone().multiply(dist); if(state) { + * if(entity.boundingBox.intersectsWith(boundingBox.copy().offset(temp.getX(), temp.getY(), temp.getZ()))) { + * state = false; } } else { if(!entity.boundingBox.intersectsWith(boundingBox.copy().offset(temp.getX(), + * temp.getY(), temp.getZ()))) { success = true; break; } } dist += 0.1; } while(dist < timeoutDist); temp = + * vec.clone().multiply(dist + 1.25); if(success) { e.posX += temp.getX(); e.posY += temp.getY(); e.posZ += + * temp.getZ(); } } } } + */ List projectiles = entity.worldObj.getEntitiesWithinAABB( IProjectile.class, @@ -100,9 +79,9 @@ public class PotionAchromatic extends PotionCustomTexture { entity.posY + 3.0D, entity.posZ + 3.0D)); for (Entity e : projectiles) { - Vector3 motionVec = new Vector3(e.motionX, e.motionY, e.motionZ) - .normalize() - .multiply(Math.sqrt((e.posX - entity.posX) * (e.posX - entity.posX) + Vector3 motionVec = new Vector3(e.motionX, e.motionY, e.motionZ).normalize().multiply( + Math.sqrt( + (e.posX - entity.posX) * (e.posX - entity.posX) + (e.posY - entity.posY) * (e.posY - entity.posY) + (e.posZ - entity.posZ) * (e.posZ - entity.posZ)) * 2.0D); diff --git a/src/main/java/makeo/gadomancy/common/potions/PotionBuffGolem.java b/src/main/java/makeo/gadomancy/common/potions/PotionBuffGolem.java index c79099e..cac49c7 100644 --- a/src/main/java/makeo/gadomancy/common/potions/PotionBuffGolem.java +++ b/src/main/java/makeo/gadomancy/common/potions/PotionBuffGolem.java @@ -1,19 +1,19 @@ package makeo.gadomancy.common.potions; import java.util.UUID; + import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.attributes.AttributeModifier; import net.minecraft.entity.ai.attributes.BaseAttributeMap; import net.minecraft.entity.ai.attributes.IAttributeInstance; + import thaumcraft.api.aspects.Aspect; import thaumcraft.common.entities.golems.EntityGolemBase; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 09.12.2015 15:59 */ diff --git a/src/main/java/makeo/gadomancy/common/potions/PotionCustomTexture.java b/src/main/java/makeo/gadomancy/common/potions/PotionCustomTexture.java index 60b6e15..e7134b3 100644 --- a/src/main/java/makeo/gadomancy/common/potions/PotionCustomTexture.java +++ b/src/main/java/makeo/gadomancy/common/potions/PotionCustomTexture.java @@ -1,6 +1,7 @@ package makeo.gadomancy.common.potions; import java.awt.*; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; import net.minecraft.potion.Potion; @@ -8,10 +9,8 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.util.ResourceLocation; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 07.12.2015 20:31 */ diff --git a/src/main/java/makeo/gadomancy/common/potions/PotionEldritch.java b/src/main/java/makeo/gadomancy/common/potions/PotionEldritch.java index cc261d9..091cd7d 100644 --- a/src/main/java/makeo/gadomancy/common/potions/PotionEldritch.java +++ b/src/main/java/makeo/gadomancy/common/potions/PotionEldritch.java @@ -3,14 +3,13 @@ package makeo.gadomancy.common.potions; import thaumcraft.api.aspects.Aspect; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 11.12.2015 20:50 */ public class PotionEldritch extends PotionCustomTexture { + public PotionEldritch(int id) { super(id, false, Aspect.ELDRITCH.getColor(), Aspect.ELDRITCH.getImage()); this.setPotionName("potion.eldritch"); diff --git a/src/main/java/makeo/gadomancy/common/potions/PotionInactiveGolem.java b/src/main/java/makeo/gadomancy/common/potions/PotionInactiveGolem.java index 085e9bf..86bbf47 100644 --- a/src/main/java/makeo/gadomancy/common/potions/PotionInactiveGolem.java +++ b/src/main/java/makeo/gadomancy/common/potions/PotionInactiveGolem.java @@ -1,20 +1,22 @@ package makeo.gadomancy.common.potions; import java.awt.*; + import makeo.gadomancy.common.utils.ColorHelper; + import net.minecraft.entity.EntityLivingBase; import net.minecraft.potion.Potion; + import thaumcraft.common.entities.golems.EntityGolemBase; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 31.10.2015 23:01 */ public class PotionInactiveGolem extends Potion { + public PotionInactiveGolem(int id) { super(id, false, ColorHelper.toHex(Color.WHITE)); } diff --git a/src/main/java/makeo/gadomancy/common/potions/PotionMiningLuck.java b/src/main/java/makeo/gadomancy/common/potions/PotionMiningLuck.java index f348da3..3b119a7 100644 --- a/src/main/java/makeo/gadomancy/common/potions/PotionMiningLuck.java +++ b/src/main/java/makeo/gadomancy/common/potions/PotionMiningLuck.java @@ -3,10 +3,8 @@ package makeo.gadomancy.common.potions; import thaumcraft.api.aspects.Aspect; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 07.12.2015 20:05 */ diff --git a/src/main/java/makeo/gadomancy/common/potions/PotionVisAffinity.java b/src/main/java/makeo/gadomancy/common/potions/PotionVisAffinity.java index cdc9174..4b06c33 100644 --- a/src/main/java/makeo/gadomancy/common/potions/PotionVisAffinity.java +++ b/src/main/java/makeo/gadomancy/common/potions/PotionVisAffinity.java @@ -3,10 +3,8 @@ package makeo.gadomancy.common.potions; import thaumcraft.api.aspects.Aspect; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 15.12.2015 19:06 */ diff --git a/src/main/java/makeo/gadomancy/common/registration/AIShutdownWhitelist.java b/src/main/java/makeo/gadomancy/common/registration/AIShutdownWhitelist.java index a494369..05afbb3 100644 --- a/src/main/java/makeo/gadomancy/common/registration/AIShutdownWhitelist.java +++ b/src/main/java/makeo/gadomancy/common/registration/AIShutdownWhitelist.java @@ -1,20 +1,20 @@ package makeo.gadomancy.common.registration; -import com.google.common.collect.Lists; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; + import net.minecraft.entity.EntityLiving; import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.entity.ai.EntityAIEatGrass; import net.minecraft.entity.passive.EntitySheep; +import com.google.common.collect.Lists; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 08.06.2016 / 23:12 */ @@ -22,11 +22,10 @@ public class AIShutdownWhitelist { private AIShutdownWhitelist() {} - private static Map, List>> whitelistedAI = - new HashMap, List>>(); + private static Map, List>> whitelistedAI = new HashMap, List>>(); - public static void whitelistAIClass( - Class entityClass, Class aiClass) { + public static void whitelistAIClass(Class entityClass, + Class aiClass) { if (!AIShutdownWhitelist.whitelistedAI.containsKey(entityClass)) { AIShutdownWhitelist.whitelistedAI.put(entityClass, new LinkedList>()); } diff --git a/src/main/java/makeo/gadomancy/common/registration/ModSubstitutions.java b/src/main/java/makeo/gadomancy/common/registration/ModSubstitutions.java index d1151fc..165faec 100644 --- a/src/main/java/makeo/gadomancy/common/registration/ModSubstitutions.java +++ b/src/main/java/makeo/gadomancy/common/registration/ModSubstitutions.java @@ -1,21 +1,23 @@ package makeo.gadomancy.common.registration; -import com.google.common.collect.BiMap; -import cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry; -import cpw.mods.fml.common.registry.GameData; import makeo.gadomancy.common.CommonProxy; import makeo.gadomancy.common.data.config.ModConfig; + import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; + import thaumcraft.common.config.ConfigBlocks; +import com.google.common.collect.BiMap; + +import cpw.mods.fml.common.registry.FMLControlledNamespacedRegistry; +import cpw.mods.fml.common.registry.GameData; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 24.10.2015 16:48 */ @@ -30,10 +32,10 @@ public class ModSubstitutions { // Hacky way FMLControlledNamespacedRegistry registry = GameData.getBlockRegistry(); - registry.underlyingIntegerMap.field_148749_a.put( - RegisteredBlocks.blockNode, Block.getIdFromBlock(ConfigBlocks.blockAiry)); - registry.underlyingIntegerMap.field_148748_b.set( - Block.getIdFromBlock(ConfigBlocks.blockAiry), RegisteredBlocks.blockNode); + registry.underlyingIntegerMap.field_148749_a + .put(RegisteredBlocks.blockNode, Block.getIdFromBlock(ConfigBlocks.blockAiry)); + registry.underlyingIntegerMap.field_148748_b + .set(Block.getIdFromBlock(ConfigBlocks.blockAiry), RegisteredBlocks.blockNode); ((BiMap) registry.field_148758_b) .forcePut(RegisteredBlocks.blockNode, registry.field_148758_b.get(ConfigBlocks.blockAiry)); diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredBlocks.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredBlocks.java index c43b046..c62b2e7 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredBlocks.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredBlocks.java @@ -1,31 +1,33 @@ package makeo.gadomancy.common.registration; -import cpw.mods.fml.common.registry.GameRegistry; import java.util.ArrayList; import java.util.List; + import makeo.gadomancy.api.ClickBehavior; import makeo.gadomancy.common.blocks.*; import makeo.gadomancy.common.blocks.tiles.*; import makeo.gadomancy.common.data.config.ModConfig; import makeo.gadomancy.common.items.*; + import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemBlock; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import thaumcraft.common.blocks.BlockAiry; import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.tiles.TileInfusionMatrix; +import cpw.mods.fml.common.registry.GameRegistry; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 13.07.2015 18:38 */ public class RegisteredBlocks { + private RegisteredBlocks() {} public static int rendererTransparentBlock; @@ -59,24 +61,24 @@ public class RegisteredBlocks { RegisteredBlocks.blockStickyJar = RegisteredBlocks.registerBlock(new BlockStickyJar()); RegisteredBlocks.blockArcaneDropper = RegisteredBlocks.registerBlock(new BlockArcaneDropper()); RegisteredBlocks.blockInfusionClaw = RegisteredBlocks.registerBlock(new BlockInfusionClaw()); - RegisteredBlocks.blockRemoteJar = - RegisteredBlocks.registerBlock(new BlockRemoteJar(), ItemBlockRemoteJar.class); + RegisteredBlocks.blockRemoteJar = RegisteredBlocks + .registerBlock(new BlockRemoteJar(), ItemBlockRemoteJar.class); RegisteredBlocks.blockNode = ModConfig.enableAdditionalNodeTypes ? (BlockAiry) new BlockNode().setBlockName("blockAiry") : (BlockAiry) ConfigBlocks.blockAiry; RegisteredBlocks.blockExtendedNodeJar = RegisteredBlocks.registerBlock(new BlockExtendedNodeJar()); - RegisteredBlocks.blockNodeManipulator = - RegisteredBlocks.registerBlock(new BlockNodeManipulator(), ItemNodeManipulator.class); - RegisteredBlocks.blockStoneMachine = - RegisteredBlocks.registerBlock(new BlockStoneMachine(), ItemBlockStoneMachine.class); - RegisteredBlocks.blockAdditionalEldrichPortal = RegisteredBlocks.registerBlock( - new BlockAdditionalEldritchPortal(), ItemBlockAdditionalEldritchPortal.class); - RegisteredBlocks.blockAuraPylon = - RegisteredBlocks.registerBlock(new BlockAuraPylon(), ItemBlockAuraPylon.class); - RegisteredBlocks.blockKnowledgeBook = - RegisteredBlocks.registerBlock(new BlockKnowledgeBook(), ItemBlockKnowledgeBook.class); - RegisteredBlocks.blockEssentiaCompressor = - RegisteredBlocks.registerBlock(new BlockEssentiaCompressor(), ItemBlockEssentiaCompressor.class); + RegisteredBlocks.blockNodeManipulator = RegisteredBlocks + .registerBlock(new BlockNodeManipulator(), ItemNodeManipulator.class); + RegisteredBlocks.blockStoneMachine = RegisteredBlocks + .registerBlock(new BlockStoneMachine(), ItemBlockStoneMachine.class); + RegisteredBlocks.blockAdditionalEldrichPortal = RegisteredBlocks + .registerBlock(new BlockAdditionalEldritchPortal(), ItemBlockAdditionalEldritchPortal.class); + RegisteredBlocks.blockAuraPylon = RegisteredBlocks + .registerBlock(new BlockAuraPylon(), ItemBlockAuraPylon.class); + RegisteredBlocks.blockKnowledgeBook = RegisteredBlocks + .registerBlock(new BlockKnowledgeBook(), ItemBlockKnowledgeBook.class); + RegisteredBlocks.blockEssentiaCompressor = RegisteredBlocks + .registerBlock(new BlockEssentiaCompressor(), ItemBlockEssentiaCompressor.class); } private static T registerBlock(String name, T block) { @@ -156,6 +158,7 @@ public class RegisteredBlocks { // Infusion Claw private static void registerDefaultClawBehaviors() { RegisteredBlocks.registerClawClickBehavior(new ClickBehavior() { + @Override public boolean isValidForBlock() { return (this.block == Blocks.bookshelf && this.metadata == 0) @@ -164,6 +167,7 @@ public class RegisteredBlocks { }); RegisteredBlocks.registerClawClickBehavior(new ClickBehavior(true) { + private TileInfusionMatrix matrix; @Override @@ -186,17 +190,12 @@ public class RegisteredBlocks { } }); - /*registerClawClickBehavior(new ClickBehavior(true) { - @Override - public boolean isValidForBlock() { - return block.equals(ConfigBlocks.blockCrystal) && metadata <= 6; - } - - @Override - public AspectList getVisCost() { - return RegisteredRecipes.costsAuraCoreStart; - } - });*/ + /* + * registerClawClickBehavior(new ClickBehavior(true) { + * @Override public boolean isValidForBlock() { return block.equals(ConfigBlocks.blockCrystal) && metadata <= 6; + * } + * @Override public AspectList getVisCost() { return RegisteredRecipes.costsAuraCoreStart; } }); + */ } private static List clawBehaviors = new ArrayList(); diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredEnchantments.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredEnchantments.java index d03f465..080050e 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredEnchantments.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredEnchantments.java @@ -1,21 +1,22 @@ package makeo.gadomancy.common.registration; import java.lang.reflect.Field; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.data.config.ModConfig; import makeo.gadomancy.common.enchantments.EnchantmentRevealer; import makeo.gadomancy.common.utils.Injector; + import net.minecraft.enchantment.Enchantment; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 28.12.2015 15:52 */ public class RegisteredEnchantments { + public static EnchantmentRevealer revealer; public static void init() { @@ -44,7 +45,10 @@ public class RegisteredEnchantments { return i; } } - throw new RuntimeException("Failed to find free id for " + Gadomancy.NAME + " enchantment (" - + enchClass.getName() + ")! Please consider using the config option to change the enchantment id."); + throw new RuntimeException( + "Failed to find free id for " + Gadomancy.NAME + + " enchantment (" + + enchClass.getName() + + ")! Please consider using the config option to change the enchantment id."); } } diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredEntities.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredEntities.java index 687f452..ebb8a83 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredEntities.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredEntities.java @@ -1,18 +1,18 @@ package makeo.gadomancy.common.registration; -import cpw.mods.fml.common.registry.EntityRegistry; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.entities.EntityAuraCore; import makeo.gadomancy.common.entities.EntityItemElement; import makeo.gadomancy.common.entities.EntityPermNoClipItem; import makeo.gadomancy.common.entities.player.FakePlayerEntity; + import net.minecraft.entity.Entity; +import cpw.mods.fml.common.registry.EntityRegistry; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 01.12.2015 13:59 */ @@ -25,15 +25,17 @@ public class RegisteredEntities { RegisteredEntities.registerEntity(EntityItemElement.class, "EntityItemElement", 32, 40, true); } - private static void registerEntity( - Class entityClass, - String name, - int trackingRange, - int updateFreq, - boolean sendVelUpdates) { + private static void registerEntity(Class entityClass, String name, int trackingRange, + int updateFreq, boolean sendVelUpdates) { int id = EntityRegistry.findGlobalUniqueEntityId(); EntityRegistry.registerGlobalEntityID(entityClass, name, id); EntityRegistry.registerModEntity( - entityClass, name, id, Gadomancy.instance, trackingRange, updateFreq, sendVelUpdates); + entityClass, + name, + id, + Gadomancy.instance, + trackingRange, + updateFreq, + sendVelUpdates); } } diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredFamiliarAI_Old.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredFamiliarAI_Old.java index 25164dc..44022c0 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredFamiliarAI_Old.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredFamiliarAI_Old.java @@ -1,15 +1,16 @@ package makeo.gadomancy.common.registration; -import cpw.mods.fml.common.network.NetworkRegistry; import java.util.ArrayList; import java.util.Iterator; import java.util.LinkedList; import java.util.List; + import makeo.gadomancy.common.familiar.FamiliarAIController_Old; import makeo.gadomancy.common.familiar.FamiliarAIProcess_Old; import makeo.gadomancy.common.items.baubles.ItemFamiliar_Old; import makeo.gadomancy.common.network.PacketHandler; import makeo.gadomancy.common.network.packets.PacketFamiliarBolt; + import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -17,17 +18,18 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import net.minecraft.world.World; +import cpw.mods.fml.common.network.NetworkRegistry; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 31.10.2015 14:12 */ public class RegisteredFamiliarAI_Old { public static FamiliarAIProcess_Old familiarAIIdle = new FamiliarAIProcess_Old(1) { + @Override public boolean canRun(World world, double x, double y, double z, EntityPlayer parent, ItemStack stackInSlot) { return true; @@ -66,16 +68,26 @@ public class RegisteredFamiliarAI_Old { } mob.attackEntityFrom( - DamageSource.magic, ((ItemFamiliar_Old) itemStack.getItem()).getAttackStrength(itemStack)); + DamageSource.magic, + ((ItemFamiliar_Old) itemStack.getItem()).getAttackStrength(itemStack)); world.playSoundEffect(mob.posX + 0.5, mob.posY + 0.5, mob.posZ + 0.5, "thaumcraft:zap", 0.8F, 1.0F); PacketFamiliarBolt bolt = new PacketFamiliarBolt( - parent.getCommandSenderName(), (float) mob.posX, (float) mob.posY, (float) mob.posZ, 6, true); + parent.getCommandSenderName(), + (float) mob.posX, + (float) mob.posY, + (float) mob.posZ, + 6, + true); PacketHandler.INSTANCE.sendToAllAround( bolt, new NetworkRegistry.TargetPoint( - mob.worldObj.provider.dimensionId, mob.posX, mob.posY, mob.posZ, 32)); + mob.worldObj.provider.dimensionId, + mob.posX, + mob.posY, + mob.posZ, + 32)); FamiliarAIController_Old.cleanTargetterList(parent); } @@ -84,8 +96,7 @@ public class RegisteredFamiliarAI_Old { EntityLivingBase attacker = player.getLastAttacker(); int range = 8 + rangeInc; - if (attacker != null - && !validTargets.contains(attacker) + if (attacker != null && !validTargets.contains(attacker) && !attacker.isDead && attacker.getDistanceSq(player.posX, player.posY, player.posZ) <= range * range) { validTargets.add(attacker); @@ -107,13 +118,12 @@ public class RegisteredFamiliarAI_Old { List livingAround = world.getEntitiesWithinAABB( EntityLivingBase.class, AxisAlignedBB.getBoundingBox( - parent.posX - 0.5, - parent.posY - 0.5, - parent.posZ - 0.5, - parent.posX + 0.5, - parent.posY + 0.5, - parent.posZ + 0.5) - .expand(range, range, range)); + parent.posX - 0.5, + parent.posY - 0.5, + parent.posZ - 0.5, + parent.posX + 0.5, + parent.posY + 0.5, + parent.posZ + 0.5).expand(range, range, range)); for (Object living : livingAround) { if (!(living instanceof EntityLivingBase)) continue; if (lastTargetters.contains(living)) closeEnoughLastTargetters.add((EntityLivingBase) living); diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredGolemStuff.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredGolemStuff.java index 6579912..b906acd 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredGolemStuff.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredGolemStuff.java @@ -2,6 +2,7 @@ package makeo.gadomancy.common.registration; import java.util.ArrayList; import java.util.List; + import makeo.gadomancy.api.GadomancyApi; import makeo.gadomancy.api.golems.AdditionalGolemType; import makeo.gadomancy.api.golems.cores.AdditionalGolemCore; @@ -13,14 +14,13 @@ import makeo.gadomancy.common.entities.golems.upgrades.GolemUpgrade; import makeo.gadomancy.common.entities.golems.upgrades.GolemUpgradeRunicShield; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 22.06.2015 02:58 */ public class RegisteredGolemStuff { + private RegisteredGolemStuff() {} public static final List UPGRADES = new ArrayList(); @@ -33,16 +33,16 @@ public class RegisteredGolemStuff { public static AdditionalGolemCore bodyguardCore; public static void init() { - RegisteredGolemStuff.typeSilverwood = - RegisteredGolemStuff.registerGolemType("SILVERWOOD", new SilverwoodGolemType()); + RegisteredGolemStuff.typeSilverwood = RegisteredGolemStuff + .registerGolemType("SILVERWOOD", new SilverwoodGolemType()); // typeObsidian = registerGolemType("OBSIDIAN", new ObsidianGolemType()); RegisteredGolemStuff.breakCore = RegisteredGolemStuff.registerGolemCore("breakCore", new BreakGolemCore()); - RegisteredGolemStuff.bodyguardCore = - RegisteredGolemStuff.registerGolemCore("bodyguardCore", new BodyguardGolemCore()); + RegisteredGolemStuff.bodyguardCore = RegisteredGolemStuff + .registerGolemCore("bodyguardCore", new BodyguardGolemCore()); - RegisteredGolemStuff.upgradeRunicShield = - RegisteredGolemStuff.registerGolemUpgrade(new GolemUpgradeRunicShield()); + RegisteredGolemStuff.upgradeRunicShield = RegisteredGolemStuff + .registerGolemUpgrade(new GolemUpgradeRunicShield()); } private static T registerGolemType(String name, T type) { diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredIntegrations.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredIntegrations.java index 7c7f228..5222b8d 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredIntegrations.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredIntegrations.java @@ -1,20 +1,19 @@ package makeo.gadomancy.common.registration; -import cpw.mods.fml.common.Loader; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.integration.*; import makeo.gadomancy.common.integration.mystcraft.IntegrationMystcraft; import makeo.gadomancy.common.utils.Injector; +import cpw.mods.fml.common.Loader; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 09.07.2015 16:00 */ public class RegisteredIntegrations { + public static IntegrationMorph morph; public static IntegrationThaumicExploration thaumicExploration; public static IntegrationAutomagy automagy; @@ -26,16 +25,17 @@ public class RegisteredIntegrations { public static void init() { RegisteredIntegrations.morph = RegisteredIntegrations.registerIndependent(IntegrationMorph.class); - RegisteredIntegrations.thaumicExploration = - RegisteredIntegrations.registerIndependent(IntegrationThaumicExploration.class); + RegisteredIntegrations.thaumicExploration = RegisteredIntegrations + .registerIndependent(IntegrationThaumicExploration.class); RegisteredIntegrations.automagy = RegisteredIntegrations.registerIndependent(IntegrationAutomagy.class); RegisteredIntegrations.nei = RegisteredIntegrations.registerIndependent(IntegrationNEI.class); RegisteredIntegrations.mystcraft = RegisteredIntegrations.registerIndependent(IntegrationMystcraft.class); - RegisteredIntegrations.thaumicTinkerer = - RegisteredIntegrations.registerIndependent(IntegrationThaumicTinkerer.class); + RegisteredIntegrations.thaumicTinkerer = RegisteredIntegrations + .registerIndependent(IntegrationThaumicTinkerer.class); RegisteredIntegrations.registerDependent( - "ThaumicHorizons", "makeo.gadomancy.common.integration.thaumichorizions.IntegrationThaumicHorizions"); + "ThaumicHorizons", + "makeo.gadomancy.common.integration.thaumichorizions.IntegrationThaumicHorizions"); RegisteredIntegrations.registerDependent("Waila", "makeo.gadomancy.common.integration.waila.IntegrationWaila"); } diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredItems.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredItems.java index 3585c28..7af4fc3 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredItems.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredItems.java @@ -1,16 +1,15 @@ package makeo.gadomancy.common.registration; -import cpw.mods.fml.common.LoadController; -import cpw.mods.fml.common.Loader; -import cpw.mods.fml.common.registry.GameRegistry; import java.util.ArrayList; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.items.*; import makeo.gadomancy.common.items.baubles.ItemEtherealFamiliar; import makeo.gadomancy.common.items.baubles.ItemFamiliar_Old; import makeo.gadomancy.common.research.SimpleResearchItem; import makeo.gadomancy.common.utils.Injector; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.EnumRarity; @@ -18,6 +17,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.util.EnumHelper; + import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; @@ -26,16 +26,18 @@ import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.config.ConfigItems; import thaumcraft.common.lib.crafting.ThaumcraftCraftingManager; import thaumcraft.common.lib.research.ResearchManager; +import cpw.mods.fml.common.LoadController; +import cpw.mods.fml.common.Loader; +import cpw.mods.fml.common.registry.GameRegistry; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 03.06.2015 03:37 */ public class RegisteredItems { + private RegisteredItems() {} public static EnumRarity raritySacred = EnumHelper.addRarity("Sacred", EnumChatFormatting.GOLD, "Sacred"); @@ -59,6 +61,7 @@ public class RegisteredItems { public static void preInit() { RegisteredItems.creativeTab = new CreativeTabs(Gadomancy.MODID) { + @Override public Item getTabIconItem() { return RegisteredItems.itemFakeModIcon; @@ -109,10 +112,10 @@ public class RegisteredItems { private static T registerItem(String modId, T item, String name) { Injector modController = new Injector( - new Injector(Loader.instance(), Loader.class).getField("modController"), LoadController.class); + new Injector(Loader.instance(), Loader.class).getField("modController"), + LoadController.class); Object old = modController.getField("activeContainer"); - modController.setField( - "activeContainer", Loader.instance().getIndexedModList().get(modId)); + modController.setField("activeContainer", Loader.instance().getIndexedModList().get(modId)); GameRegistry.registerItem(item, name); @@ -121,85 +124,82 @@ public class RegisteredItems { } private static void registerItemAspects() { - AspectList oldAspects = - ThaumcraftCraftingManager.getObjectTags(new ItemStack(RegisteredBlocks.blockStoneMachine)); + AspectList oldAspects = ThaumcraftCraftingManager + .getObjectTags(new ItemStack(RegisteredBlocks.blockStoneMachine)); ThaumcraftApi.registerObjectTag( new ItemStack(Item.getItemFromBlock(RegisteredBlocks.blockStoneMachine)), - new int[] {11, 15}, + new int[] { 11, 15 }, new AspectList()); ThaumcraftApi.registerObjectTag( - new ItemStack(Item.getItemFromBlock(RegisteredBlocks.blockStoneMachine)), new int[] {0}, oldAspects); + new ItemStack(Item.getItemFromBlock(RegisteredBlocks.blockStoneMachine)), + new int[] { 0 }, + oldAspects); - AspectList pylon = new AspectList() - .add(Aspect.WATER, 10) - .add(Aspect.MAGIC, 12) - .add(Aspect.VOID, 4) + AspectList pylon = new AspectList().add(Aspect.WATER, 10).add(Aspect.MAGIC, 12).add(Aspect.VOID, 4) .add(Aspect.MECHANISM, 4); ThaumcraftApi.registerObjectTag( - new ItemStack(Item.getItemFromBlock(RegisteredBlocks.blockAuraPylon)), new int[] {0}, pylon); - pylon = new AspectList() - .add(Aspect.FIRE, 10) - .add(Aspect.AURA, 12) - .add(Aspect.MAGIC, 8) - .add(Aspect.LIGHT, 4) + new ItemStack(Item.getItemFromBlock(RegisteredBlocks.blockAuraPylon)), + new int[] { 0 }, + pylon); + pylon = new AspectList().add(Aspect.FIRE, 10).add(Aspect.AURA, 12).add(Aspect.MAGIC, 8).add(Aspect.LIGHT, 4) .add(Aspect.MECHANISM, 4); ThaumcraftApi.registerObjectTag( - new ItemStack(Item.getItemFromBlock(RegisteredBlocks.blockAuraPylon)), new int[] {1}, pylon); + new ItemStack(Item.getItemFromBlock(RegisteredBlocks.blockAuraPylon)), + new int[] { 1 }, + pylon); - AspectList packager = new AspectList() - .add(Aspect.TREE, 10) - .add(Aspect.MECHANISM, 8) - .add(Aspect.CRAFT, 8) + AspectList packager = new AspectList().add(Aspect.TREE, 10).add(Aspect.MECHANISM, 8).add(Aspect.CRAFT, 8) .add(Aspect.AURA, 12); ThaumcraftApi.registerObjectTag( - new ItemStack(Item.getItemFromBlock(RegisteredBlocks.blockStoneMachine)), new int[] {4}, packager); + new ItemStack(Item.getItemFromBlock(RegisteredBlocks.blockStoneMachine)), + new int[] { 4 }, + packager); AspectList aspect = new AspectList(); aspect.add(Aspect.MAGIC, 6).add(Aspect.AURA, 12).add(Aspect.ELDRITCH, 4).add(Aspect.VOID, 10); - ThaumcraftApi.registerObjectTag(new ItemStack(RegisteredItems.itemAuraCore), new int[] {0}, aspect.copy()); + ThaumcraftApi.registerObjectTag(new ItemStack(RegisteredItems.itemAuraCore), new int[] { 0 }, aspect.copy()); ThaumcraftApi.registerObjectTag( new ItemStack(RegisteredItems.itemAuraCore), - new int[] {1}, + new int[] { 1 }, aspect.copy().add(Aspect.AIR, 26)); ThaumcraftApi.registerObjectTag( new ItemStack(RegisteredItems.itemAuraCore), - new int[] {2}, + new int[] { 2 }, aspect.copy().add(Aspect.FIRE, 26)); ThaumcraftApi.registerObjectTag( new ItemStack(RegisteredItems.itemAuraCore), - new int[] {3}, + new int[] { 3 }, aspect.copy().add(Aspect.WATER, 26)); ThaumcraftApi.registerObjectTag( new ItemStack(RegisteredItems.itemAuraCore), - new int[] {4}, + new int[] { 4 }, aspect.copy().add(Aspect.EARTH, 26)); ThaumcraftApi.registerObjectTag( new ItemStack(RegisteredItems.itemAuraCore), - new int[] {5}, + new int[] { 5 }, aspect.copy().add(Aspect.ORDER, 26)); ThaumcraftApi.registerObjectTag( new ItemStack(RegisteredItems.itemAuraCore), - new int[] {6}, + new int[] { 6 }, aspect.copy().add(Aspect.ENTROPY, 26)); ThaumcraftApi.registerObjectTag( new ItemStack(RegisteredItems.itemPackage, 1, 0), new AspectList().add(Aspect.CLOTH, 2).add(Aspect.BEAST, 2).add(Aspect.ARMOR, 1)); ThaumcraftApi.registerObjectTag( - new ItemStack(RegisteredItems.itemPackage, 1, 1), new AspectList().add(Aspect.CLOTH, 4)); + new ItemStack(RegisteredItems.itemPackage, 1, 1), + new AspectList().add(Aspect.CLOTH, 4)); ThaumcraftApi.registerObjectTag( new ItemStack(RegisteredItems.itemFakeLootbag, 1, 0), new AspectList().add(Aspect.CLOTH, 2).add(Aspect.BEAST, 2).add(Aspect.ARMOR, 1)); ThaumcraftApi.registerObjectTag( - new ItemStack(RegisteredItems.itemFakeLootbag, 1, 1), new AspectList().add(Aspect.CLOTH, 4)); + new ItemStack(RegisteredItems.itemFakeLootbag, 1, 1), + new AspectList().add(Aspect.CLOTH, 4)); ThaumcraftApi.registerObjectTag( new ItemStack(RegisteredBlocks.blockKnowledgeBook), - new AspectList() - .add(Aspect.MIND, 8) - .add(Aspect.MECHANISM, 4) - .add(Aspect.MAGIC, 6) + new AspectList().add(Aspect.MIND, 8).add(Aspect.MECHANISM, 4).add(Aspect.MAGIC, 6) .add(Aspect.ORDER, 4)); } @@ -214,7 +214,10 @@ public class RegisteredItems { Item itemRemoteJar = Item.getItemFromBlock(RegisteredBlocks.blockRemoteJar); RegisteredItems.registerStickyJar( - itemRemoteJar, 0, new ItemStack(itemRemoteJar), SimpleResearchItem.getFullName("REMOTEJAR")); + itemRemoteJar, + 0, + new ItemStack(itemRemoteJar), + SimpleResearchItem.getFullName("REMOTEJAR")); } private static List stickyJarItems = new ArrayList(); @@ -260,10 +263,8 @@ public class RegisteredItems { public static List getStickyJarStacks(EntityPlayer player) { List stacks = new ArrayList(); for (StickyJarItemInfo info : RegisteredItems.stickyJarItems) { - if (info.recipeStack != null - && (player == null - || info.research == null - || ResearchManager.isResearchComplete(player.getCommandSenderName(), info.research))) { + if (info.recipeStack != null && (player == null || info.research == null + || ResearchManager.isResearchComplete(player.getCommandSenderName(), info.research))) { stacks.add(info.recipeStack); } } @@ -271,6 +272,7 @@ public class RegisteredItems { } private static class StickyJarItemInfo { + public Item item; public int damage; public ItemStack recipeStack; diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredManipulations.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredManipulations.java index 04b21e4..39e7324 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredManipulations.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredManipulations.java @@ -1,13 +1,16 @@ package makeo.gadomancy.common.registration; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.blocks.tiles.TileExtendedNode; import makeo.gadomancy.common.node.ExtendedNodeType; import makeo.gadomancy.common.node.NodeManipulatorResult; import makeo.gadomancy.common.node.NodeManipulatorResultHandler; import makeo.gadomancy.common.utils.ResearchHelper; + import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.nodes.INode; @@ -15,226 +18,233 @@ import thaumcraft.api.nodes.NodeModifier; import thaumcraft.api.nodes.NodeType; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 28.10.2015 11:52 */ public class RegisteredManipulations { - public static NodeManipulatorResult resultBreakCompounds = - new NodeManipulatorResult(4, NodeManipulatorResultHandler.ResultType.NEGATIVE) { - @Override - public boolean affect(World world, INode node) { - AspectList baseList = node.getAspectsBase(); - AspectList list = node.getAspects(); - for (Aspect a : baseList.getAspects()) { - if (!a.isPrimal()) { - Aspect[] subComponents = a.getComponents(); - int initialValue = baseList.getAmount(a); - list.remove(a); - baseList.remove(a); - baseList.add(subComponents[0], initialValue); - list.add(subComponents[0], initialValue); - baseList.add(subComponents[1], initialValue); - list.add(subComponents[1], initialValue); - return true; - } - } - return false; - } - }; + public static NodeManipulatorResult resultBreakCompounds = new NodeManipulatorResult( + 4, + NodeManipulatorResultHandler.ResultType.NEGATIVE) { - public static NodeManipulatorResult resultCombineAspects = - new NodeManipulatorResult(5, NodeManipulatorResultHandler.ResultType.POSITIVE) { - @Override - public boolean affect(World world, INode node) { - AspectList base = node.getAspectsBase(); - if (base.getAspects().length < 2) return false; - if (base.getAspects().length == 2) { - if (!NodeManipulatorResultHandler.canCombine(base.getAspects()[0], base.getAspects()[1])) - return false; - int addition = world.rand.nextInt(4); - NodeManipulatorResultHandler.combine( - base, base.getAspects()[0], base.getAspects()[1], addition); - NodeManipulatorResultHandler.combine( - node.getAspects(), base.getAspects()[0], base.getAspects()[1], addition); - return true; - } - if (base.getAspects().length > 2) { - int actuallyCombined = 0; - int combineCount = world.rand.nextInt(1) + 1; - doLabel: - do { - if (base.getAspects().length < 2) break; - - int randIndexForA = world.rand.nextInt(base.getAspects().length); - for (int i = 0; i < base.getAspects().length; i++) { - int indexA = (i + randIndexForA) % base.getAspects().length; - Aspect a = base.getAspects()[indexA]; - int randIndexForB = world.rand.nextInt(base.getAspects().length); - for (int j = 0; j < base.getAspects().length; j++) { - int indexB = (j + randIndexForB) % base.getAspects().length; - Aspect b = base.getAspects()[indexB]; - - if (NodeManipulatorResultHandler.canCombine(a, b)) { - int addition = world.rand.nextInt(4); - NodeManipulatorResultHandler.combine(base, a, b, addition); - NodeManipulatorResultHandler.combine(node.getAspects(), a, b, addition); - combineCount--; - actuallyCombined++; - continue doLabel; - } else if (base.getAspects().length <= 2) { - break doLabel; - } - } - } - combineCount--; - } while (combineCount > 0); - return actuallyCombined > 0; - } - return false; - } - }; - - public static NodeManipulatorResult resultIncreaseModifier = - new NodeManipulatorResult(4, NodeManipulatorResultHandler.ResultType.POSITIVE) { - - @Override - public boolean canAffect(World world, INode node) { - return node.getNodeModifier() != NodeModifier.BRIGHT; - } - - @Override - public boolean affect(World world, INode node) { - if (node.getNodeModifier() == null) { - node.setNodeModifier(NodeModifier.BRIGHT); - return true; - } - switch (node.getNodeModifier()) { - case BRIGHT: - return false; - case PALE: - node.setNodeModifier(null); - break; - case FADING: - node.setNodeModifier(NodeModifier.PALE); - break; - } + @Override + public boolean affect(World world, INode node) { + AspectList baseList = node.getAspectsBase(); + AspectList list = node.getAspects(); + for (Aspect a : baseList.getAspects()) { + if (!a.isPrimal()) { + Aspect[] subComponents = a.getComponents(); + int initialValue = baseList.getAmount(a); + list.remove(a); + baseList.remove(a); + baseList.add(subComponents[0], initialValue); + list.add(subComponents[0], initialValue); + baseList.add(subComponents[1], initialValue); + list.add(subComponents[1], initialValue); return true; } - }; + } + return false; + } + }; - public static NodeManipulatorResult resultDecreaseModifier = - new NodeManipulatorResult(5, NodeManipulatorResultHandler.ResultType.NEGATIVE) { + public static NodeManipulatorResult resultCombineAspects = new NodeManipulatorResult( + 5, + NodeManipulatorResultHandler.ResultType.POSITIVE) { - @Override - public boolean canAffect(World world, INode node) { - return node.getNodeModifier() != NodeModifier.FADING; - } + @Override + public boolean affect(World world, INode node) { + AspectList base = node.getAspectsBase(); + if (base.getAspects().length < 2) return false; + if (base.getAspects().length == 2) { + if (!NodeManipulatorResultHandler.canCombine(base.getAspects()[0], base.getAspects()[1])) return false; + int addition = world.rand.nextInt(4); + NodeManipulatorResultHandler.combine(base, base.getAspects()[0], base.getAspects()[1], addition); + NodeManipulatorResultHandler + .combine(node.getAspects(), base.getAspects()[0], base.getAspects()[1], addition); + return true; + } + if (base.getAspects().length > 2) { + int actuallyCombined = 0; + int combineCount = world.rand.nextInt(1) + 1; + doLabel: do { + if (base.getAspects().length < 2) break; - @Override - public boolean affect(World world, INode node) { - if (node.getNodeModifier() == null) { - node.setNodeModifier(NodeModifier.PALE); - return true; - } - switch (node.getNodeModifier()) { - case BRIGHT: - node.setNodeModifier(null); - break; - case PALE: - node.setNodeModifier(NodeModifier.FADING); - break; - case FADING: - return false; - } - return true; - } - }; + int randIndexForA = world.rand.nextInt(base.getAspects().length); + for (int i = 0; i < base.getAspects().length; i++) { + int indexA = (i + randIndexForA) % base.getAspects().length; + Aspect a = base.getAspects()[indexA]; + int randIndexForB = world.rand.nextInt(base.getAspects().length); + for (int j = 0; j < base.getAspects().length; j++) { + int indexB = (j + randIndexForB) % base.getAspects().length; + Aspect b = base.getAspects()[indexB]; - public static NodeManipulatorResult resultGainPrimal = - new NodeManipulatorResult(3, NodeManipulatorResultHandler.ResultType.POSITIVE) { - @Override - public boolean affect(World world, INode node) { - List primals = Aspect.getPrimalAspects(); - int visSize = node.getAspectsBase().visSize(); - int size = node.getAspectsBase().size(); - int modulo = primals.size(); - int index = world.rand.nextInt(primals.size()); - for (int i = 0; i < primals.size(); i++) { - int get = (index + i) % modulo; - Aspect rand = primals.get(get); - if (node.getAspectsBase().getAmount(rand) <= 0) { - int randGain = visSize / (size * 2); - if (randGain > 0) { - node.getAspectsBase().add(rand, randGain); - node.getAspects().add(rand, randGain); - return true; + if (NodeManipulatorResultHandler.canCombine(a, b)) { + int addition = world.rand.nextInt(4); + NodeManipulatorResultHandler.combine(base, a, b, addition); + NodeManipulatorResultHandler.combine(node.getAspects(), a, b, addition); + combineCount--; + actuallyCombined++; + continue doLabel; + } else if (base.getAspects().length <= 2) { + break doLabel; } - return false; } } + combineCount--; + } while (combineCount > 0); + return actuallyCombined > 0; + } + return false; + } + }; + + public static NodeManipulatorResult resultIncreaseModifier = new NodeManipulatorResult( + 4, + NodeManipulatorResultHandler.ResultType.POSITIVE) { + + @Override + public boolean canAffect(World world, INode node) { + return node.getNodeModifier() != NodeModifier.BRIGHT; + } + + @Override + public boolean affect(World world, INode node) { + if (node.getNodeModifier() == null) { + node.setNodeModifier(NodeModifier.BRIGHT); + return true; + } + switch (node.getNodeModifier()) { + case BRIGHT: + return false; + case PALE: + node.setNodeModifier(null); + break; + case FADING: + node.setNodeModifier(NodeModifier.PALE); + break; + } + return true; + } + }; + + public static NodeManipulatorResult resultDecreaseModifier = new NodeManipulatorResult( + 5, + NodeManipulatorResultHandler.ResultType.NEGATIVE) { + + @Override + public boolean canAffect(World world, INode node) { + return node.getNodeModifier() != NodeModifier.FADING; + } + + @Override + public boolean affect(World world, INode node) { + if (node.getNodeModifier() == null) { + node.setNodeModifier(NodeModifier.PALE); + return true; + } + switch (node.getNodeModifier()) { + case BRIGHT: + node.setNodeModifier(null); + break; + case PALE: + node.setNodeModifier(NodeModifier.FADING); + break; + case FADING: + return false; + } + return true; + } + }; + + public static NodeManipulatorResult resultGainPrimal = new NodeManipulatorResult( + 3, + NodeManipulatorResultHandler.ResultType.POSITIVE) { + + @Override + public boolean affect(World world, INode node) { + List primals = Aspect.getPrimalAspects(); + int visSize = node.getAspectsBase().visSize(); + int size = node.getAspectsBase().size(); + int modulo = primals.size(); + int index = world.rand.nextInt(primals.size()); + for (int i = 0; i < primals.size(); i++) { + int get = (index + i) % modulo; + Aspect rand = primals.get(get); + if (node.getAspectsBase().getAmount(rand) <= 0) { + int randGain = visSize / (size * 2); + if (randGain > 0) { + node.getAspectsBase().add(rand, randGain); + node.getAspects().add(rand, randGain); + return true; + } return false; } - }; + } + return false; + } + }; - public static NodeManipulatorResult resultSwitchType = - new NodeManipulatorResult(2, NodeManipulatorResultHandler.ResultType.NEUTRAL) { - @Override - public boolean affect(World world, INode node) { - NodeType newType = node.getNodeType(); - int random = world.rand.nextInt(40); - if (random > 38) { - if (node instanceof TileExtendedNode) { - TileExtendedNode tNode = (TileExtendedNode) node; - if (!(tNode.getExtendedNodeType() != null - && tNode.getExtendedNodeType().equals(ExtendedNodeType.GROWING))) { - newType = NodeType.HUNGRY; // 1 of 40 - } - } else { - newType = NodeType.HUNGRY; // 1 of 40 - } - } else if (random > 37) { - newType = NodeType.TAINTED; // 1 of 40 - } else if (random > 34) { - newType = NodeType.UNSTABLE; // 3 of 40 - } else if (random > 29) { - newType = NodeType.DARK; // 5 of 40 - } else if (random > 24) { - newType = NodeType.PURE; // 5 of 40 - } else if (random > 14) { - newType = NodeType.NORMAL; // 10 of 40 - } - // 15 of 40 chance nothing happens - boolean changed = !newType.equals(node.getNodeType()); - if (changed) node.setNodeType(newType); - return changed; - } - }; + public static NodeManipulatorResult resultSwitchType = new NodeManipulatorResult( + 2, + NodeManipulatorResultHandler.ResultType.NEUTRAL) { - public static NodeManipulatorResult resultApplyGrowing = - new NodeManipulatorResult(1, NodeManipulatorResultHandler.ResultType.POSITIVE) { - @Override - public boolean affect(World world, INode inode) { - if (!(inode instanceof TileExtendedNode)) return false; - TileExtendedNode node = (TileExtendedNode) inode; - boolean isGrowingAlready = node.getExtendedNodeType() != null - && node.getExtendedNodeType().equals(ExtendedNodeType.GROWING); - if (isGrowingAlready) if (node.getNodeType().equals(NodeType.HUNGRY)) isGrowingAlready = false; - if (!isGrowingAlready) { - node.setExtendedNodeType(ExtendedNodeType.GROWING); - ResearchHelper.distributeResearch( - Gadomancy.MODID.toUpperCase() + ".GROWING", - node.getWorldObj(), - node.xCoord, - node.yCoord, - node.zCoord, - 12); + @Override + public boolean affect(World world, INode node) { + NodeType newType = node.getNodeType(); + int random = world.rand.nextInt(40); + if (random > 38) { + if (node instanceof TileExtendedNode) { + TileExtendedNode tNode = (TileExtendedNode) node; + if (!(tNode.getExtendedNodeType() != null + && tNode.getExtendedNodeType().equals(ExtendedNodeType.GROWING))) { + newType = NodeType.HUNGRY; // 1 of 40 } - return isGrowingAlready; + } else { + newType = NodeType.HUNGRY; // 1 of 40 } - }; + } else if (random > 37) { + newType = NodeType.TAINTED; // 1 of 40 + } else if (random > 34) { + newType = NodeType.UNSTABLE; // 3 of 40 + } else if (random > 29) { + newType = NodeType.DARK; // 5 of 40 + } else if (random > 24) { + newType = NodeType.PURE; // 5 of 40 + } else if (random > 14) { + newType = NodeType.NORMAL; // 10 of 40 + } + // 15 of 40 chance nothing happens + boolean changed = !newType.equals(node.getNodeType()); + if (changed) node.setNodeType(newType); + return changed; + } + }; + + public static NodeManipulatorResult resultApplyGrowing = new NodeManipulatorResult( + 1, + NodeManipulatorResultHandler.ResultType.POSITIVE) { + + @Override + public boolean affect(World world, INode inode) { + if (!(inode instanceof TileExtendedNode)) return false; + TileExtendedNode node = (TileExtendedNode) inode; + boolean isGrowingAlready = node.getExtendedNodeType() != null + && node.getExtendedNodeType().equals(ExtendedNodeType.GROWING); + if (isGrowingAlready) if (node.getNodeType().equals(NodeType.HUNGRY)) isGrowingAlready = false; + if (!isGrowingAlready) { + node.setExtendedNodeType(ExtendedNodeType.GROWING); + ResearchHelper.distributeResearch( + Gadomancy.MODID.toUpperCase() + ".GROWING", + node.getWorldObj(), + node.xCoord, + node.yCoord, + node.zCoord, + 12); + } + return isGrowingAlready; + } + }; } diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredMultiblocks.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredMultiblocks.java index 7ed35e9..3efb352 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredMultiblocks.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredMultiblocks.java @@ -4,19 +4,16 @@ import makeo.gadomancy.common.utils.MultiblockHelper; import thaumcraft.common.config.ConfigBlocks; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 27.10.2015 14:05 */ public class RegisteredMultiblocks { - public static final MultiblockHelper.MultiblockPattern incompleteNodeManipulatorMultiblock = - new MultiblockHelper.MultiblockPattern(RegisteredBlocks.blockNodeManipulator, 5) - .addBlock(0, 2, 0, RegisteredBlocks.blockNode, 0) - .addBlock(0, 1, 0, RegisteredBlocks.blockStoneMachine, 0) + public static final MultiblockHelper.MultiblockPattern incompleteNodeManipulatorMultiblock = new MultiblockHelper.MultiblockPattern( + RegisteredBlocks.blockNodeManipulator, + 5).addBlock(0, 2, 0, RegisteredBlocks.blockNode, 0).addBlock(0, 1, 0, RegisteredBlocks.blockStoneMachine, 0) .addBlock(1, 0, 1, ConfigBlocks.blockCosmeticSolid, 15) .addBlock(-1, 0, 1, ConfigBlocks.blockCosmeticSolid, 15) .addBlock(-1, 0, -1, ConfigBlocks.blockCosmeticSolid, 15) @@ -26,10 +23,9 @@ public class RegisteredMultiblocks { .addBlock(-1, 1, -1, ConfigBlocks.blockCosmeticSolid, 11) .addBlock(1, 1, -1, ConfigBlocks.blockCosmeticSolid, 11); - public static final MultiblockHelper.MultiblockPattern completeNodeManipulatorMultiblock = - new MultiblockHelper.MultiblockPattern(RegisteredBlocks.blockNodeManipulator, 5) - .addBlock(0, 2, 0, RegisteredBlocks.blockNode, 0) - .addBlock(0, 1, 0, RegisteredBlocks.blockStoneMachine, 0) + public static final MultiblockHelper.MultiblockPattern completeNodeManipulatorMultiblock = new MultiblockHelper.MultiblockPattern( + RegisteredBlocks.blockNodeManipulator, + 5).addBlock(0, 2, 0, RegisteredBlocks.blockNode, 0).addBlock(0, 1, 0, RegisteredBlocks.blockStoneMachine, 0) .addBlock(1, 0, 1, RegisteredBlocks.blockStoneMachine, 15) .addBlock(-1, 0, 1, RegisteredBlocks.blockStoneMachine, 15) .addBlock(-1, 0, -1, RegisteredBlocks.blockStoneMachine, 15) @@ -39,10 +35,9 @@ public class RegisteredMultiblocks { .addBlock(-1, 1, -1, RegisteredBlocks.blockStoneMachine, 11) .addBlock(1, 1, -1, RegisteredBlocks.blockStoneMachine, 11); - public static final MultiblockHelper.MultiblockPattern incompleteEldritchPortalCreator = - new MultiblockHelper.MultiblockPattern(RegisteredBlocks.blockNodeManipulator, 5) - .addBlock(0, 2, 0, RegisteredBlocks.blockNode, 0) - .addBlock(0, 1, 0, RegisteredBlocks.blockStoneMachine, 3) + public static final MultiblockHelper.MultiblockPattern incompleteEldritchPortalCreator = new MultiblockHelper.MultiblockPattern( + RegisteredBlocks.blockNodeManipulator, + 5).addBlock(0, 2, 0, RegisteredBlocks.blockNode, 0).addBlock(0, 1, 0, RegisteredBlocks.blockStoneMachine, 3) // .addBlock(3, 0, 0, RegisteredBlocks.blockStoneMachine, 1).addBlock(0, 0, 3, // RegisteredBlocks.blockStoneMachine, 1) // .addBlock(-3, 0, 0, RegisteredBlocks.blockStoneMachine, 1).addBlock(0, 0, -3, @@ -56,10 +51,9 @@ public class RegisteredMultiblocks { .addBlock(-1, 1, -1, ConfigBlocks.blockCosmeticSolid, 11) .addBlock(1, 1, -1, ConfigBlocks.blockCosmeticSolid, 11); - public static final MultiblockHelper.MultiblockPattern completeEldritchPortalCreator = - new MultiblockHelper.MultiblockPattern(RegisteredBlocks.blockNodeManipulator, 5) - .addBlock(0, 2, 0, RegisteredBlocks.blockNode, 0) - .addBlock(0, 1, 0, RegisteredBlocks.blockStoneMachine, 3) + public static final MultiblockHelper.MultiblockPattern completeEldritchPortalCreator = new MultiblockHelper.MultiblockPattern( + RegisteredBlocks.blockNodeManipulator, + 5).addBlock(0, 2, 0, RegisteredBlocks.blockNode, 0).addBlock(0, 1, 0, RegisteredBlocks.blockStoneMachine, 3) // .addBlock(3, 0, 0, RegisteredBlocks.blockStoneMachine, 1).addBlock(0, 0, 3, // RegisteredBlocks.blockStoneMachine, 1) // .addBlock(-3, 0, 0, RegisteredBlocks.blockStoneMachine, 1).addBlock(0, 0, -3, @@ -74,8 +68,8 @@ public class RegisteredMultiblocks { .addBlock(1, 1, -1, RegisteredBlocks.blockStoneMachine, 11); public static final MultiblockHelper.MultiblockPattern auraPylonPattern = new MultiblockHelper.MultiblockPattern( - RegisteredBlocks.blockAuraPylon, 1) - .addBlock(0, -1, 0, RegisteredBlocks.blockAuraPylon, 0) - .addBlock(0, -2, 0, RegisteredBlocks.blockAuraPylon, 0) - .addBlock(0, -3, 0, RegisteredBlocks.blockAuraPylon, 0); + RegisteredBlocks.blockAuraPylon, + 1).addBlock(0, -1, 0, RegisteredBlocks.blockAuraPylon, 0) + .addBlock(0, -2, 0, RegisteredBlocks.blockAuraPylon, 0) + .addBlock(0, -3, 0, RegisteredBlocks.blockAuraPylon, 0); } diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredPotions.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredPotions.java index 8abc3ad..ab80aba 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredPotions.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredPotions.java @@ -1,22 +1,24 @@ package makeo.gadomancy.common.registration; -import cpw.mods.fml.common.FMLLog; import java.lang.reflect.Field; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.data.config.ModConfig; import makeo.gadomancy.common.potions.*; import makeo.gadomancy.common.utils.Injector; + import net.minecraft.potion.Potion; +import cpw.mods.fml.common.FMLLog; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 31.10.2015 23:09 */ public class RegisteredPotions { + public static PotionMiningLuck POTION_LUCK; public static PotionBuffGolem BUFF_GOLEM; public static PotionAchromatic ACHROMATIC; @@ -57,8 +59,13 @@ public class RegisteredPotions { } if (id > 127) { - FMLLog.warning("The potion id '" + id + "' of potion '" + Gadomancy.NAME + ":" + potionClass.getSimpleName() - + "' is bigger then 127 this might cause errors as well. Please consider changing the config."); + FMLLog.warning( + "The potion id '" + id + + "' of potion '" + + Gadomancy.NAME + + ":" + + potionClass.getSimpleName() + + "' is bigger then 127 this might cause errors as well. Please consider changing the config."); } if (id >= Potion.potionTypes.length) { @@ -69,9 +76,16 @@ public class RegisteredPotions { Potion conflict = Potion.potionTypes[id]; throw new RuntimeException( "Potion id conflict! Do not report this bug you just have to change the configuration files. Failed to register potion '" - + Gadomancy.NAME + ":" + potionClass.getSimpleName() + "' with id '" + id - + "'. Another potion with this id already exists: " + conflict.getName() + " (as " - + conflict.getClass().getName() + ")"); + + Gadomancy.NAME + + ":" + + potionClass.getSimpleName() + + "' with id '" + + id + + "'. Another potion with this id already exists: " + + conflict.getName() + + " (as " + + conflict.getClass().getName() + + ")"); } return new Injector(potionClass).invokeConstructor(int.class, id); diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredRecipes.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredRecipes.java index a467827..7091f4b 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredRecipes.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredRecipes.java @@ -1,9 +1,9 @@ package makeo.gadomancy.common.registration; -import cpw.mods.fml.common.registry.GameRegistry; import java.util.ArrayList; import java.util.Arrays; import java.util.List; + import makeo.gadomancy.api.golems.AdditionalGolemType; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.crafting.*; @@ -14,11 +14,13 @@ import makeo.gadomancy.common.items.ItemElement; import makeo.gadomancy.common.items.baubles.ItemEtherealFamiliar; import makeo.gadomancy.common.research.SimpleResearchItem; import makeo.gadomancy.common.utils.RandomizedAspectList; + import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; + import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; @@ -31,45 +33,28 @@ import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.config.ConfigItems; import thaumcraft.common.items.ItemWispEssence; import thaumcraft.common.items.wands.ItemWandCasting; +import cpw.mods.fml.common.registry.GameRegistry; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 16.06.2015 01:17 */ public class RegisteredRecipes { + private RegisteredRecipes() {} - public static AspectList costsNodeManipulatorMultiblock = new AspectList() - .add(Aspect.FIRE, 100) - .add(Aspect.WATER, 100) - .add(Aspect.EARTH, 100) - .add(Aspect.AIR, 100) - .add(Aspect.ORDER, 100) + public static AspectList costsNodeManipulatorMultiblock = new AspectList().add(Aspect.FIRE, 100) + .add(Aspect.WATER, 100).add(Aspect.EARTH, 100).add(Aspect.AIR, 100).add(Aspect.ORDER, 100) .add(Aspect.ENTROPY, 100); - public static AspectList costsEldritchPortalCreatorMultiblock = new AspectList() - .add(Aspect.FIRE, 150) - .add(Aspect.WATER, 150) - .add(Aspect.EARTH, 150) - .add(Aspect.AIR, 150) - .add(Aspect.ORDER, 150) + public static AspectList costsEldritchPortalCreatorMultiblock = new AspectList().add(Aspect.FIRE, 150) + .add(Aspect.WATER, 150).add(Aspect.EARTH, 150).add(Aspect.AIR, 150).add(Aspect.ORDER, 150) .add(Aspect.ENTROPY, 150); - public static AspectList costsAuraPylonMultiblock = new AspectList() - .add(Aspect.FIRE, 150) - .add(Aspect.WATER, 150) - .add(Aspect.EARTH, 150) - .add(Aspect.AIR, 150) - .add(Aspect.ORDER, 150) - .add(Aspect.ENTROPY, 150); - public static AspectList costsCompressorMultiblock = new AspectList() - .add(Aspect.WATER, 140) - .add(Aspect.EARTH, 80) - .add(Aspect.AIR, 150) - .add(Aspect.ORDER, 20) - .add(Aspect.ENTROPY, 140); + public static AspectList costsAuraPylonMultiblock = new AspectList().add(Aspect.FIRE, 150).add(Aspect.WATER, 150) + .add(Aspect.EARTH, 150).add(Aspect.AIR, 150).add(Aspect.ORDER, 150).add(Aspect.ENTROPY, 150); + public static AspectList costsCompressorMultiblock = new AspectList().add(Aspect.WATER, 140).add(Aspect.EARTH, 80) + .add(Aspect.AIR, 150).add(Aspect.ORDER, 20).add(Aspect.ENTROPY, 140); // public static AspectList costsAuraCoreStart = new AspectList().add(Aspect.FIRE, 70).add(Aspect.WATER, // 70).add(Aspect.EARTH, 70).add(Aspect.AIR, 70).add(Aspect.ORDER, 70).add(Aspect.ENTROPY, 70); @@ -118,41 +103,27 @@ public class RegisteredRecipes { AdditionalGolemType typeSilverwood = RegisteredGolemStuff.typeSilverwood; RegisteredRecipes.recipeGolemSilverwood = ThaumcraftApi.addInfusionCraftingRecipe( SimpleResearchItem.getFullName("GOLEMSILVERWOOD"), - /*new ItemStack(Items.bread, 1, 0),*/ new ItemStack( + /* new ItemStack(Items.bread, 1, 0), */ new ItemStack( typeSilverwood.getPlacerItem(), 1, typeSilverwood.getEnumEntry().ordinal()), 7, - new AspectList() - .add(Aspect.MOTION, 16) - .add(Aspect.MAGIC, 16) - .add(Aspect.MAN, 16) + new AspectList().add(Aspect.MOTION, 16).add(Aspect.MAGIC, 16).add(Aspect.MAN, 16) .add(Aspect.SENSES, 16), new ItemStack(ConfigBlocks.blockMagicalLog, 1, 1), - new ItemStack[] { - new ItemStack(ConfigItems.itemResource, 1, 15), - new ItemStack(ConfigItems.itemResource, 1, 14), - new ItemStack(ConfigItems.itemResource, 1, 9), - new ItemStack(ConfigItems.itemResource, 1, 3), - new ItemStack(ConfigItems.itemResource, 1, 14), - new ItemStack(ConfigItems.itemResource, 1, 9), - new ItemStack(ConfigItems.itemResource, 1, 3) - }); + new ItemStack[] { new ItemStack(ConfigItems.itemResource, 1, 15), + new ItemStack(ConfigItems.itemResource, 1, 14), new ItemStack(ConfigItems.itemResource, 1, 9), + new ItemStack(ConfigItems.itemResource, 1, 3), new ItemStack(ConfigItems.itemResource, 1, 14), + new ItemStack(ConfigItems.itemResource, 1, 9), new ItemStack(ConfigItems.itemResource, 1, 3) }); RegisteredRecipes.recipesGolemRunicShield = InfusionUpgradeRecipe.createRecipes( SimpleResearchItem.getFullName("GOLEMRUNICSHIELD"), RegisteredGolemStuff.upgradeRunicShield, 5, - new AspectList() - .add(Aspect.MAGIC, 16) - .add(Aspect.ENERGY, 16) - .add(Aspect.ARMOR, 8) - .add(Aspect.AURA, 4), - new ItemStack[] { - new ItemStack(ConfigItems.itemGirdleRunic, 1, 0), - new ItemStack(ConfigItems.itemResource, 1, 14), - new ItemStack(ConfigItems.itemResource, 1, 14) - }); + new AspectList().add(Aspect.MAGIC, 16).add(Aspect.ENERGY, 16).add(Aspect.ARMOR, 8).add(Aspect.AURA, 4), + new ItemStack[] { new ItemStack(ConfigItems.itemGirdleRunic, 1, 0), + new ItemStack(ConfigItems.itemResource, 1, 14), + new ItemStack(ConfigItems.itemResource, 1, 14) }); ThaumcraftApi.getCraftingRecipes().addAll(Arrays.asList(RegisteredRecipes.recipesGolemRunicShield)); RegisteredRecipes.recipeStickyJar = new RecipeStickyJar(); @@ -180,35 +151,24 @@ public class RegisteredRecipes { 3, new AspectList().add(Aspect.ENTROPY, 16).add(Aspect.TOOL, 24).add(Aspect.MECHANISM, 16), new ItemStack(ConfigItems.itemGolemCore, 1, 3), - new ItemStack[] { - new ItemStack(ConfigItems.itemShovelElemental), - new ItemStack(ConfigItems.itemPickElemental), - new ItemStack(ConfigItems.itemAxeElemental) - }); + new ItemStack[] { new ItemStack(ConfigItems.itemShovelElemental), + new ItemStack(ConfigItems.itemPickElemental), new ItemStack(ConfigItems.itemAxeElemental) }); RegisteredRecipes.recipeInfusionClaw = ThaumcraftApi.addInfusionCraftingRecipe( SimpleResearchItem.getFullName("INFUSIONCLAW"), new ItemStack(RegisteredBlocks.blockInfusionClaw), 10, - new AspectList() - .add(Aspect.ELDRITCH, 25) - .add(Aspect.MECHANISM, 20) - .add(Aspect.MAGIC, 16) - .add(Aspect.ORDER, 20) - .add(Aspect.DARKNESS, 12), + new AspectList().add(Aspect.ELDRITCH, 25).add(Aspect.MECHANISM, 20).add(Aspect.MAGIC, 16) + .add(Aspect.ORDER, 20).add(Aspect.DARKNESS, 12), new ItemStack(ConfigBlocks.blockStoneDevice, 1, 5), - new ItemStack[] { - new ItemStack(ConfigItems.itemFocusPrimal), /*new ItemStack(Items.redstone),*/ - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6), - new ItemStack(ConfigItems.itemGolemCore, 1, 8), - new ItemStack(ConfigItems.itemResource, 1, 16), - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6), - new ItemStack(ConfigItems.itemResource, 1, 15), /*new ItemStack(Items.redstone),*/ - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6), - new ItemStack(ConfigItems.itemZombieBrain), - new ItemStack(ConfigItems.itemResource, 1, 16), - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6) - }); + new ItemStack[] { new ItemStack(ConfigItems.itemFocusPrimal), /* new ItemStack(Items.redstone), */ + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6), + new ItemStack(ConfigItems.itemGolemCore, 1, 8), new ItemStack(ConfigItems.itemResource, 1, 16), + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6), + new ItemStack(ConfigItems.itemResource, 1, 15), /* new ItemStack(Items.redstone), */ + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6), + new ItemStack(ConfigItems.itemZombieBrain), new ItemStack(ConfigItems.itemResource, 1, 16), + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 6) }); RegisteredRecipes.recipeRemoteJar = ThaumcraftApi.addArcaneCraftingRecipe( SimpleResearchItem.getFullName("REMOTEJAR"), @@ -221,79 +181,52 @@ public class RegisteredRecipes { 'J', new ItemStack(ConfigBlocks.blockJar), 'M', - (Config.allowMirrors - ? new ItemStack(ConfigBlocks.blockMirror, 1, 6) + (Config.allowMirrors ? new ItemStack(ConfigBlocks.blockMirror, 1, 6) : new ItemStack(ConfigItems.itemResource, 1, 10))); RegisteredRecipes.recipeNodeManipulator = ThaumcraftApi.addInfusionCraftingRecipe( Gadomancy.MODID.toUpperCase() + ".NODE_MANIPULATOR", new ItemStack(RegisteredBlocks.blockNodeManipulator, 1, 5), 10, - new AspectList() - .add(Aspect.AURA, 42) - .add(Aspect.ELDRITCH, 22) - .add(Aspect.MAGIC, 38) - .add(Aspect.MECHANISM, 28) - .add(Aspect.DARKNESS, 14), + new AspectList().add(Aspect.AURA, 42).add(Aspect.ELDRITCH, 22).add(Aspect.MAGIC, 38) + .add(Aspect.MECHANISM, 28).add(Aspect.DARKNESS, 14), new ItemStack(ConfigBlocks.blockStoneDevice, 1, 5), - new ItemStack[] { - new ItemStack(ConfigBlocks.blockStoneDevice, 1, 9), - new ItemStack(ConfigBlocks.blockCrystal, 1, 6), - new ItemStack(ConfigItems.itemResource, 1, 17), - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 11), - new ItemStack(ConfigItems.itemResource, 1, 1), - new ItemStack(ConfigItems.itemResource, 1, 15), - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 3), - new ItemStack(ConfigBlocks.blockCrystal, 1, 6), - new ItemStack(ConfigItems.itemResource, 1, 17), - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 11), - new ItemStack(ConfigItems.itemResource, 1, 1), - new ItemStack(ConfigItems.itemResource, 1, 15) - }); + new ItemStack[] { new ItemStack(ConfigBlocks.blockStoneDevice, 1, 9), + new ItemStack(ConfigBlocks.blockCrystal, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 17), + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 11), + new ItemStack(ConfigItems.itemResource, 1, 1), new ItemStack(ConfigItems.itemResource, 1, 15), + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 3), + new ItemStack(ConfigBlocks.blockCrystal, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 17), + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 11), + new ItemStack(ConfigItems.itemResource, 1, 1), + new ItemStack(ConfigItems.itemResource, 1, 15) }); RegisteredRecipes.recipeRandomizationFocus = ThaumcraftApi.addInfusionCraftingRecipe( Gadomancy.MODID.toUpperCase() + ".NODE_MANIPULATOR", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 0), 7, - new AspectList() - .add(Aspect.ELDRITCH, 18) - .add(Aspect.MAGIC, 18) - .add(Aspect.MECHANISM, 20) - .add(Aspect.DARKNESS, 28) - .add(Aspect.ORDER, 30), + new AspectList().add(Aspect.ELDRITCH, 18).add(Aspect.MAGIC, 18).add(Aspect.MECHANISM, 20) + .add(Aspect.DARKNESS, 28).add(Aspect.ORDER, 30), new ItemStack(ConfigBlocks.blockStoneDevice, 1, 8), - new ItemStack[] { - new ItemStack(ConfigItems.itemResource, 1, 15), - new ItemStack(ConfigItems.itemResource, 1, 16), - new ItemStack(ConfigBlocks.blockCrystal, 1, 6), - new ItemStack(ConfigItems.itemResource, 1, 16), - new ItemStack(ConfigItems.itemResource, 1, 15), - new ItemStack(ConfigItems.itemResource, 1, 16), - new ItemStack(ConfigBlocks.blockCrystal, 1, 6), - new ItemStack(ConfigItems.itemResource, 1, 16) - }); + new ItemStack[] { new ItemStack(ConfigItems.itemResource, 1, 15), + new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(ConfigBlocks.blockCrystal, 1, 6), + new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(ConfigItems.itemResource, 1, 15), + new ItemStack(ConfigItems.itemResource, 1, 16), new ItemStack(ConfigBlocks.blockCrystal, 1, 6), + new ItemStack(ConfigItems.itemResource, 1, 16) }); RegisteredRecipes.recipePortalFocus = ThaumcraftApi.addInfusionCraftingRecipe( Gadomancy.MODID.toUpperCase() + ".E_PORTAL_CREATOR", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 3), 7, - new AspectList() - .add(Aspect.ELDRITCH, 22) - .add(Aspect.VOID, 38) - .add(Aspect.MECHANISM, 30) - .add(Aspect.DARKNESS, 28) - .add(Aspect.EXCHANGE, 38), + new AspectList().add(Aspect.ELDRITCH, 22).add(Aspect.VOID, 38).add(Aspect.MECHANISM, 30) + .add(Aspect.DARKNESS, 28).add(Aspect.EXCHANGE, 38), new ItemStack(ConfigBlocks.blockStoneDevice, 1, 8), - new ItemStack[] { - new ItemStack(ConfigItems.itemEldritchObject, 1, 0), - new ItemStack(ConfigBlocks.blockCrystal, 1, 5), - new ItemStack(ConfigItems.itemResource, 1, 16), - new ItemStack(ConfigBlocks.blockCrystal, 1, 5), - new ItemStack(ConfigItems.itemEldritchObject, 1, 0), - new ItemStack(ConfigBlocks.blockCrystal, 1, 5), - new ItemStack(ConfigItems.itemResource, 1, 16), - new ItemStack(ConfigBlocks.blockCrystal, 1, 5) - }); + new ItemStack[] { new ItemStack(ConfigItems.itemEldritchObject, 1, 0), + new ItemStack(ConfigBlocks.blockCrystal, 1, 5), new ItemStack(ConfigItems.itemResource, 1, 16), + new ItemStack(ConfigBlocks.blockCrystal, 1, 5), + new ItemStack(ConfigItems.itemEldritchObject, 1, 0), + new ItemStack(ConfigBlocks.blockCrystal, 1, 5), new ItemStack(ConfigItems.itemResource, 1, 16), + new ItemStack(ConfigBlocks.blockCrystal, 1, 5) }); RegisteredRecipes.multiblockNodeManipulator = Arrays.asList( RegisteredRecipes.costsNodeManipulatorMultiblock, @@ -329,7 +262,7 @@ public class RegisteredRecipes { null, new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 15))); - // x y z + // x y z RegisteredRecipes.multiblockEldritchPortalCreator = Arrays.asList( RegisteredRecipes.costsEldritchPortalCreatorMultiblock, 7, @@ -499,18 +432,12 @@ public class RegisteredRecipes { Gadomancy.MODID.toUpperCase() + ".GOLEMCOREBODYGUARD", new ItemStack(RegisteredItems.itemGolemCoreBreak, 1, 1), 3, - new AspectList() - .add(Aspect.TOOL, 28) - .add(Aspect.MECHANISM, 20) - .add(Aspect.WEAPON, 10) + new AspectList().add(Aspect.TOOL, 28).add(Aspect.MECHANISM, 20).add(Aspect.WEAPON, 10) .add(Aspect.ARMOR, 16), new ItemStack(ConfigItems.itemGolemCore, 1, 4), - new ItemStack[] { - new ItemStack(ConfigItems.itemBootsTraveller, 1, 0), - new ItemStack(Items.ender_pearl, 1, 0), - new ItemStack(ConfigItems.itemSwordElemental, 1, 0), - new ItemStack(Items.ender_pearl, 1, 0) - }); + new ItemStack[] { new ItemStack(ConfigItems.itemBootsTraveller, 1, 0), + new ItemStack(Items.ender_pearl, 1, 0), new ItemStack(ConfigItems.itemSwordElemental, 1, 0), + new ItemStack(Items.ender_pearl, 1, 0) }); RegisteredRecipes.recipeAncientPedestal = ThaumcraftApi.addArcaneCraftingRecipe( Gadomancy.MODID.toUpperCase() + ".E_PORTAL_CREATOR", @@ -626,10 +553,7 @@ public class RegisteredRecipes { Gadomancy.MODID.toUpperCase() + ".ANCIENT_STONES", new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 15), new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 7), - new AspectList() - .add(Aspect.ELDRITCH, 8) - .add(Aspect.EXCHANGE, 8) - .add(Aspect.ENTROPY, 12)); + new AspectList().add(Aspect.ELDRITCH, 8).add(Aspect.EXCHANGE, 8).add(Aspect.ENTROPY, 12)); } ItemAuraCore.AuraCoreType[] auraCoreTypes = ItemAuraCore.AuraCoreType.values(); @@ -641,14 +565,13 @@ public class RegisteredRecipes { Gadomancy.MODID.toUpperCase() + ".CLEAN_AURA_CORE", new ItemStack(RegisteredItems.itemAuraCore), new ItemStack(RegisteredItems.itemAuraCore, 1, i), - new AspectList() - .add(Aspect.MAGIC, 12) - .add(Aspect.WATER, 12) - .add(Aspect.HEAL, 18)); // damn those heal potions + new AspectList().add(Aspect.MAGIC, 12).add(Aspect.WATER, 12).add(Aspect.HEAL, 18)); // damn those + // heal potions if (auraCoreTypes[i].isUnused()) { GameRegistry.addShapelessRecipe( - new ItemStack(RegisteredItems.itemAuraCore), new ItemStack(RegisteredItems.itemAuraCore, 1, i)); + new ItemStack(RegisteredItems.itemAuraCore), + new ItemStack(RegisteredItems.itemAuraCore, 1, i)); List list = CraftingManager.getInstance().getRecipeList(); recipesUndoAuraCore.add((IRecipe) list.get(list.size() - 1)); @@ -663,36 +586,22 @@ public class RegisteredRecipes { Gadomancy.MODID.toUpperCase() + ".AURA_CORE", blankCore, 6, - new RandomizedAspectList() - .setHalfCap(true) - .addAspectRandomBase(Aspect.AURA, 9) - .addAspectRandomBase(Aspect.MAGIC, 19) - .addAspectRandomBase(Aspect.ELDRITCH, 17) + new RandomizedAspectList().setHalfCap(true).addAspectRandomBase(Aspect.AURA, 9) + .addAspectRandomBase(Aspect.MAGIC, 19).addAspectRandomBase(Aspect.ELDRITCH, 17) .addAspectRandomBase(Aspect.VOID, 34), new ItemStack(ConfigItems.itemResource, 1, 15), - new ItemStack[] { - new ItemStack(ConfigItems.itemShard, 1, 6), - new ItemStack(ConfigItems.itemResource, 1, 2), - new ItemStack(ConfigItems.itemResource, 1, 2), - new ItemStack(ConfigItems.itemShard, 1, 6), - new ItemStack(ConfigItems.itemResource, 1, 2), - new ItemStack(ConfigItems.itemResource, 1, 2), - new ItemStack(ConfigItems.itemShard, 1, 6), - new ItemStack(ConfigItems.itemResource, 1, 2), - new ItemStack(ConfigItems.itemResource, 1, 2), - new ItemStack(ConfigItems.itemShard, 1, 6), - new ItemStack(ConfigItems.itemResource, 1, 2), - new ItemStack(ConfigItems.itemResource, 1, 2) - }); + new ItemStack[] { new ItemStack(ConfigItems.itemShard, 1, 6), + new ItemStack(ConfigItems.itemResource, 1, 2), new ItemStack(ConfigItems.itemResource, 1, 2), + new ItemStack(ConfigItems.itemShard, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 2), + new ItemStack(ConfigItems.itemResource, 1, 2), new ItemStack(ConfigItems.itemShard, 1, 6), + new ItemStack(ConfigItems.itemResource, 1, 2), new ItemStack(ConfigItems.itemResource, 1, 2), + new ItemStack(ConfigItems.itemShard, 1, 6), new ItemStack(ConfigItems.itemResource, 1, 2), + new ItemStack(ConfigItems.itemResource, 1, 2) }); RegisteredRecipes.recipeAuraPylon = ThaumcraftApi.addArcaneCraftingRecipe( Gadomancy.MODID.toUpperCase() + ".AURA_PYLON", new ItemStack(RegisteredBlocks.blockAuraPylon, 1, 0), - new AspectList() - .add(Aspect.ORDER, 80) - .add(Aspect.WATER, 50) - .add(Aspect.FIRE, 50) - .add(Aspect.AIR, 50), + new AspectList().add(Aspect.ORDER, 80).add(Aspect.WATER, 50).add(Aspect.FIRE, 50).add(Aspect.AIR, 50), "TST", "S S", "TJT", @@ -735,8 +644,7 @@ public class RegisteredRecipes { 'S', new ItemStack(Blocks.piston), 'G', - (Config.wardedStone - ? new ItemStack(ConfigBlocks.blockCosmeticOpaque, 1, 2) + (Config.wardedStone ? new ItemStack(ConfigBlocks.blockCosmeticOpaque, 1, 2) : new ItemStack(Blocks.glass)), 'C', aerCore, @@ -751,11 +659,7 @@ public class RegisteredRecipes { RegisteredRecipes.recipeKnowledgeBook = ThaumcraftApi.addArcaneCraftingRecipe( Gadomancy.MODID.toUpperCase() + ".KNOWLEDGE_BOOK", new ItemStack(RegisteredBlocks.blockKnowledgeBook), - new AspectList() - .add(Aspect.ORDER, 70) - .add(Aspect.ENTROPY, 20) - .add(Aspect.AIR, 20) - .add(Aspect.FIRE, 30), + new AspectList().add(Aspect.ORDER, 70).add(Aspect.ENTROPY, 20).add(Aspect.AIR, 20).add(Aspect.FIRE, 30), "STS", "BOB", "MGM", @@ -779,23 +683,12 @@ public class RegisteredRecipes { Gadomancy.MODID.toUpperCase() + ".ESSENTIA_COMPRESSOR", new ItemStack(RegisteredItems.itemElement, 1, ItemElement.EnumElementType.DARKNESS.ordinal()), 6, - new RandomizedAspectList() - .setHalfCap(true) - .addAspectRandomBase(Aspect.VOID, 22) - .addAspectRandomBase(Aspect.DARKNESS, 18) - .addAspectRandomBase(Aspect.ELDRITCH, 20) + new RandomizedAspectList().setHalfCap(true).addAspectRandomBase(Aspect.VOID, 22) + .addAspectRandomBase(Aspect.DARKNESS, 18).addAspectRandomBase(Aspect.ELDRITCH, 20) .addAspectRandomBase(Aspect.AURA, 10), new ItemStack(ConfigItems.itemResource, 1, 17), - new ItemStack[] { - alumentum, - voidMetalIngot, - voidMetalIngot, - salisMundus, - alumentum, - voidMetalIngot, - voidMetalIngot, - salisMundus - }); + new ItemStack[] { alumentum, voidMetalIngot, voidMetalIngot, salisMundus, alumentum, voidMetalIngot, + voidMetalIngot, salisMundus }); ItemStack waterCore = new ItemStack(RegisteredItems.itemAuraCore); RegisteredItems.itemAuraCore.setCoreType(waterCore, ItemAuraCore.AuraCoreType.WATER); @@ -803,13 +696,8 @@ public class RegisteredRecipes { RegisteredRecipes.recipeEssentiaCompressor = ThaumcraftApi.addArcaneCraftingRecipe( Gadomancy.MODID.toUpperCase() + ".ESSENTIA_COMPRESSOR", new ItemStack(RegisteredBlocks.blockEssentiaCompressor, 3), - new AspectList() - .add(Aspect.WATER, 190) - .add(Aspect.ORDER, 150) - .add(Aspect.ENTROPY, 120) - .add(Aspect.FIRE, 100) - .add(Aspect.AIR, 160) - .add(Aspect.EARTH, 60), + new AspectList().add(Aspect.WATER, 190).add(Aspect.ORDER, 150).add(Aspect.ENTROPY, 120) + .add(Aspect.FIRE, 100).add(Aspect.AIR, 160).add(Aspect.EARTH, 60), "LRL", "TET", "LCL", @@ -837,16 +725,17 @@ public class RegisteredRecipes { ItemStack earthCore = new ItemStack(RegisteredItems.itemAuraCore); RegisteredItems.itemAuraCore.setCoreType(earthCore, ItemAuraCore.AuraCoreType.EARTH); - /*recipeAiShutdown = ThaumcraftApi.addInfusionCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".AI_SHUTDOWN", new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 5), 9, - new AspectList().add(Aspect.ENTROPY, 16).add(Aspect.BEAST, 23).add(Aspect.EARTH, 22).add(Aspect.AURA, 12).add(Aspect.MIND, 17), - earthCore, new ItemStack[] { - new ItemStack(ConfigItems.itemZombieBrain), new ItemStack(ConfigBlocks.blockTube), - new ItemStack(ConfigItems.itemWandRod), new ItemStack(ConfigItems.itemShard, 1, 5), - new ItemStack(ConfigBlocks.blockJar), new ItemStack(ConfigBlocks.blockTube), - new ItemStack(ConfigItems.itemZombieBrain), new ItemStack(ConfigBlocks.blockTube), - new ItemStack(ConfigBlocks.blockJar), new ItemStack(ConfigItems.itemShard, 1, 5), - new ItemStack(ConfigItems.itemWandRod), new ItemStack(ConfigBlocks.blockTube) - });*/ + /* + * recipeAiShutdown = ThaumcraftApi.addInfusionCraftingRecipe(Gadomancy.MODID.toUpperCase() + ".AI_SHUTDOWN", + * new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 5), 9, new AspectList().add(Aspect.ENTROPY, + * 16).add(Aspect.BEAST, 23).add(Aspect.EARTH, 22).add(Aspect.AURA, 12).add(Aspect.MIND, 17), earthCore, new + * ItemStack[] { new ItemStack(ConfigItems.itemZombieBrain), new ItemStack(ConfigBlocks.blockTube), new + * ItemStack(ConfigItems.itemWandRod), new ItemStack(ConfigItems.itemShard, 1, 5), new + * ItemStack(ConfigBlocks.blockJar), new ItemStack(ConfigBlocks.blockTube), new + * ItemStack(ConfigItems.itemZombieBrain), new ItemStack(ConfigBlocks.blockTube), new + * ItemStack(ConfigBlocks.blockJar), new ItemStack(ConfigItems.itemShard, 1, 5), new + * ItemStack(ConfigItems.itemWandRod), new ItemStack(ConfigBlocks.blockTube) }); + */ RegisteredRecipes.auraCoreRecipes = RegisteredRecipes.createAuraCoreRecipes(); @@ -857,11 +746,9 @@ public class RegisteredRecipes { RegisteredEnchantments.revealer, 4, new AspectList().add(Aspect.SENSES, 16).add(Aspect.MAGIC, 8), - new ItemStack[] { - new ItemStack(ConfigItems.itemGoggles), - new ItemStack(ConfigItems.itemResource, 1, 14), - new ItemStack(ConfigItems.itemResource, 1, 14) - }); + new ItemStack[] { new ItemStack(ConfigItems.itemGoggles), + new ItemStack(ConfigItems.itemResource, 1, 14), + new ItemStack(ConfigItems.itemResource, 1, 14) }); CraftingManager.getInstance().getRecipeList().add(new FamiliarUndoRecipe()); } @@ -890,12 +777,8 @@ public class RegisteredRecipes { cost.add(Aspect.ENTROPY, 84); break; case 6: - cost.add(Aspect.AIR, 14) - .add(Aspect.FIRE, 14) - .add(Aspect.WATER, 14) - .add(Aspect.EARTH, 14) - .add(Aspect.ORDER, 14) - .add(Aspect.ENTROPY, 14); + cost.add(Aspect.AIR, 14).add(Aspect.FIRE, 14).add(Aspect.WATER, 14).add(Aspect.EARTH, 14) + .add(Aspect.ORDER, 14).add(Aspect.ENTROPY, 14); } ItemWandCasting item = (ItemWandCasting) ConfigItems.itemWandCasting; @@ -932,17 +815,10 @@ public class RegisteredRecipes { } /* - Indexing: - 0 = Shock 0 -> 1; 3 = Fire 0 -> 1; 6 = Poison 0 -> 1 - 1 = Shock 1 -> 2; 4 = Fire 1 -> 2; 7 = Poison 1 -> 2 - 2 = Shock 2 -> 3; 5 = Fire 2 -> 3; 8 = Poison 2 -> 3 - - 9 = Enervation 0 -> 1; 12 = Damage 0 -> 1 - 10 = Enervation 1 -> 2; 13 = Damage 1 -> 2 - 11 = Enervation 2 -> 3; 14 = Damage 2 -> 3 - - 15 = Range 0 -> 1; 17 = Speed 0 -> 1 - 16 = Range 1 -> 2; 18 = Speed 1 -> 2 + * Indexing: 0 = Shock 0 -> 1; 3 = Fire 0 -> 1; 6 = Poison 0 -> 1 1 = Shock 1 -> 2; 4 = Fire 1 -> 2; 7 = Poison 1 -> + * 2 2 = Shock 2 -> 3; 5 = Fire 2 -> 3; 8 = Poison 2 -> 3 9 = Enervation 0 -> 1; 12 = Damage 0 -> 1 10 = Enervation + * 1 -> 2; 13 = Damage 1 -> 2 11 = Enervation 2 -> 3; 14 = Damage 2 -> 3 15 = Range 0 -> 1; 17 = Speed 0 -> 1 16 = + * Range 1 -> 2; 18 = Speed 1 -> 2 */ private static InfusionRecipe[][] createEtherealFamiliarUpgradeRecipes() { List aspects = new ArrayList(Aspect.aspects.values()); @@ -996,11 +872,7 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_SHOCK", 5, - new AspectList() - .add(Aspect.MOTION, 22) - .add(a, 28) - .add(Aspect.AURA, 20) - .add(Aspect.WEAPON, 18) + new AspectList().add(Aspect.MOTION, 22).add(a, 28).add(Aspect.AURA, 20).add(Aspect.WEAPON, 18) .add(Aspect.AIR, 38), famIn, FamiliarAugment.SHOCK, @@ -1031,11 +903,7 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_SHOCK", 8, - new AspectList() - .add(Aspect.MOTION, 40) - .add(Aspect.AURA, 28) - .add(a, 38) - .add(Aspect.WEAPON, 20) + new AspectList().add(Aspect.MOTION, 40).add(Aspect.AURA, 28).add(a, 38).add(Aspect.WEAPON, 20) .add(Aspect.AIR, 36), famIn, FamiliarAugment.SHOCK, @@ -1093,11 +961,7 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_FIRE", 6, - new AspectList() - .add(Aspect.FIRE, 38) - .add(a, 24) - .add(Aspect.ENERGY, 32) - .add(Aspect.WEAPON, 18), + new AspectList().add(Aspect.FIRE, 38).add(a, 24).add(Aspect.ENERGY, 32).add(Aspect.WEAPON, 18), famIn, FamiliarAugment.FIRE, 1, @@ -1126,11 +990,7 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_FIRE", 9, - new AspectList() - .add(Aspect.FIRE, 48) - .add(a, 32) - .add(Aspect.ENERGY, 42) - .add(Aspect.WEAPON, 32) + new AspectList().add(Aspect.FIRE, 48).add(a, 32).add(Aspect.ENERGY, 42).add(Aspect.WEAPON, 32) .add(Aspect.AURA, 30), famIn, FamiliarAugment.FIRE, @@ -1163,11 +1023,7 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_POISON", 5, - new AspectList() - .add(Aspect.WATER, 16) - .add(a, 14) - .add(Aspect.POISON, 8) - .add(Aspect.ELDRITCH, 4), + new AspectList().add(Aspect.WATER, 16).add(a, 14).add(Aspect.POISON, 8).add(Aspect.ELDRITCH, 4), famIn, FamiliarAugment.POISON, 0, @@ -1194,11 +1050,7 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_POISON", 7, - new AspectList() - .add(a, 26) - .add(Aspect.POISON, 28) - .add(Aspect.ELDRITCH, 12) - .add(Aspect.WATER, 22) + new AspectList().add(a, 26).add(Aspect.POISON, 28).add(Aspect.ELDRITCH, 12).add(Aspect.WATER, 22) .add(Aspect.AURA, 8), famIn, FamiliarAugment.POISON, @@ -1227,11 +1079,7 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_POISON", 9, - new AspectList() - .add(a, 36) - .add(Aspect.POISON, 38) - .add(Aspect.ELDRITCH, 22) - .add(Aspect.WATER, 48) + new AspectList().add(a, 36).add(Aspect.POISON, 38).add(Aspect.ELDRITCH, 22).add(Aspect.WATER, 48) .add(Aspect.AURA, 36), famIn, FamiliarAugment.POISON, @@ -1264,11 +1112,7 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_WEAKNESS", 6, - new AspectList() - .add(a, 12) - .add(Aspect.DEATH, 18) - .add(Aspect.AURA, 6) - .add(Aspect.ELDRITCH, 18) + new AspectList().add(a, 12).add(Aspect.DEATH, 18).add(Aspect.AURA, 6).add(Aspect.ELDRITCH, 18) .add(Aspect.ENTROPY, 8), famIn, FamiliarAugment.WEAKNESS, @@ -1293,13 +1137,8 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_WEAKNESS", 8, - new AspectList() - .add(a, 30) - .add(Aspect.DEATH, 28) - .add(Aspect.AURA, 26) - .add(Aspect.ELDRITCH, 28) - .add(Aspect.ENTROPY, 48) - .add(Aspect.TRAP, 14), + new AspectList().add(a, 30).add(Aspect.DEATH, 28).add(Aspect.AURA, 26).add(Aspect.ELDRITCH, 28) + .add(Aspect.ENTROPY, 48).add(Aspect.TRAP, 14), famIn, FamiliarAugment.WEAKNESS, 1, @@ -1324,13 +1163,8 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_WEAKNESS", 10, - new AspectList() - .add(a, 46) - .add(Aspect.DEATH, 42) - .add(Aspect.AURA, 38) - .add(Aspect.ELDRITCH, 20) - .add(Aspect.ENTROPY, 56) - .add(Aspect.TRAP, 32), + new AspectList().add(a, 46).add(Aspect.DEATH, 42).add(Aspect.AURA, 38).add(Aspect.ELDRITCH, 20) + .add(Aspect.ENTROPY, 56).add(Aspect.TRAP, 32), famIn, FamiliarAugment.WEAKNESS, 2, @@ -1362,11 +1196,7 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_DAMAGE", 6, - new AspectList() - .add(a, 14) - .add(Aspect.WEAPON, 10) - .add(Aspect.ENERGY, 12) - .add(Aspect.FIRE, 16), + new AspectList().add(a, 14).add(Aspect.WEAPON, 10).add(Aspect.ENERGY, 12).add(Aspect.FIRE, 16), famIn, FamiliarAugment.DAMAGE_INCREASE, 0, @@ -1392,11 +1222,7 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_DAMAGE", 10, - new AspectList() - .add(a, 22) - .add(Aspect.WEAPON, 28) - .add(Aspect.ENERGY, 34) - .add(Aspect.FIRE, 30) + new AspectList().add(a, 22).add(Aspect.WEAPON, 28).add(Aspect.ENERGY, 34).add(Aspect.FIRE, 30) .add(Aspect.AURA, 14), famIn, FamiliarAugment.DAMAGE_INCREASE, @@ -1425,11 +1251,7 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_DAMAGE", 10, - new AspectList() - .add(a, 34) - .add(Aspect.WEAPON, 38) - .add(Aspect.ENERGY, 46) - .add(Aspect.FIRE, 58) + new AspectList().add(a, 34).add(Aspect.WEAPON, 38).add(Aspect.ENERGY, 46).add(Aspect.FIRE, 58) .add(Aspect.AURA, 38), famIn, FamiliarAugment.DAMAGE_INCREASE, @@ -1461,11 +1283,7 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_RANGE", 6, - new AspectList() - .add(a, 24) - .add(Aspect.AURA, 30) - .add(Aspect.ELDRITCH, 22) - .add(Aspect.WEAPON, 12), + new AspectList().add(a, 24).add(Aspect.AURA, 30).add(Aspect.ELDRITCH, 22).add(Aspect.WEAPON, 12), famIn, FamiliarAugment.RANGE_INCREASE, 0, @@ -1487,11 +1305,7 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_RANGE", 9, - new AspectList() - .add(a, 42) - .add(Aspect.AURA, 36) - .add(Aspect.ELDRITCH, 34) - .add(Aspect.WEAPON, 28) + new AspectList().add(a, 42).add(Aspect.AURA, 36).add(Aspect.ELDRITCH, 34).add(Aspect.WEAPON, 28) .add(Aspect.AIR, 40), famIn, FamiliarAugment.RANGE_INCREASE, @@ -1523,11 +1337,7 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_SPEED", 6, - new AspectList() - .add(a, 30) - .add(Aspect.AURA, 28) - .add(Aspect.MOTION, 38) - .add(Aspect.ELDRITCH, 20) + new AspectList().add(a, 30).add(Aspect.AURA, 28).add(Aspect.MOTION, 38).add(Aspect.ELDRITCH, 20) .add(Aspect.AIR, 36), famIn, FamiliarAugment.ATTACK_SPEED, @@ -1553,13 +1363,8 @@ public class RegisteredRecipes { infusion = new EtherealFamiliarUpgradeRecipe( modid + ".FAMILIAR_SPEED", 9, - new AspectList() - .add(a, 46) - .add(Aspect.AURA, 38) - .add(Aspect.MOTION, 52) - .add(Aspect.ELDRITCH, 38) - .add(Aspect.AIR, 48) - .add(Aspect.WEAPON, 28), + new AspectList().add(a, 46).add(Aspect.AURA, 38).add(Aspect.MOTION, 52).add(Aspect.ELDRITCH, 38) + .add(Aspect.AIR, 48).add(Aspect.WEAPON, 28), famIn, FamiliarAugment.ATTACK_SPEED, 1, @@ -1605,14 +1410,10 @@ public class RegisteredRecipes { 4, new AspectList().add(aspect, 10).add(Aspect.AURA, 12).add(Aspect.MAGIC, 18), new ItemStack(ConfigItems.itemAmuletRunic, 1, 0), - new ItemStack[] { - wispyEssence, - new ItemStack(ConfigItems.itemResource, 1, 14), - new ItemStack(ConfigItems.itemResource, 1, 1), - wispyEssence, - new ItemStack(ConfigItems.itemResource, 1, 14), - new ItemStack(ConfigItems.itemResource, 1, 1) - }); + new ItemStack[] { wispyEssence, new ItemStack(ConfigItems.itemResource, 1, 14), + new ItemStack(ConfigItems.itemResource, 1, 1), wispyEssence, + new ItemStack(ConfigItems.itemResource, 1, 14), + new ItemStack(ConfigItems.itemResource, 1, 1) }); } return recipes; } diff --git a/src/main/java/makeo/gadomancy/common/registration/RegisteredResearches.java b/src/main/java/makeo/gadomancy/common/registration/RegisteredResearches.java index 9d54e98..82959af 100644 --- a/src/main/java/makeo/gadomancy/common/registration/RegisteredResearches.java +++ b/src/main/java/makeo/gadomancy/common/registration/RegisteredResearches.java @@ -9,9 +9,11 @@ import makeo.gadomancy.common.items.ItemAuraCore; import makeo.gadomancy.common.items.baubles.ItemEtherealFamiliar; import makeo.gadomancy.common.research.*; import makeo.gadomancy.common.utils.SimpleResourceLocation; + import net.minecraft.enchantment.Enchantment; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; + import thaumcraft.api.ThaumcraftApi; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; @@ -23,14 +25,13 @@ import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.config.ConfigItems; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 14.06.2015 14:01 */ public class RegisteredResearches { + private RegisteredResearches() {} private static final ResourceLocation CATEGORY_BACKGROUND = new SimpleResourceLocation("/gui/gui_researchback.png"); @@ -85,513 +86,407 @@ public class RegisteredResearches { public static void init() { ResearchCategories.registerCategory( - Gadomancy.MODID, RegisteredResearches.CATEGORY_ICON, RegisteredResearches.CATEGORY_BACKGROUND); + Gadomancy.MODID, + RegisteredResearches.CATEGORY_ICON, + RegisteredResearches.CATEGORY_BACKGROUND); - ResearchItem researchTallowGolem = - PseudoResearchItem.create("GOLEMTALLOW", 0, -5).registerResearchItem(); + ResearchItem researchTallowGolem = PseudoResearchItem.create("GOLEMTALLOW", 0, -5).registerResearchItem(); RegisteredResearches.researchGolemSilverwood = new SimpleResearchItem( - "GOLEMSILVERWOOD", - 1, - -2, - 3, - (ItemStack) RegisteredRecipes.recipeGolemSilverwood.getRecipeOutput(), - new AspectList() - .add(Aspect.MOTION, 10) - .add(Aspect.TREE, 10) - .add(Aspect.MAGIC, 8) - .add(Aspect.ORDER, 8) - .add(Aspect.FLESH, 6) - .add(Aspect.EXCHANGE, 5)) - .setParents(researchTallowGolem.key) - .setConcealed() - .setPages( - new ResearchPage("gadomancy.research_page.GOLEMSILVERWOOD.1"), - new ResearchPage(RegisteredRecipes.recipeGolemSilverwood)) - .registerResearchItem(); + "GOLEMSILVERWOOD", + 1, + -2, + 3, + (ItemStack) RegisteredRecipes.recipeGolemSilverwood.getRecipeOutput(), + new AspectList().add(Aspect.MOTION, 10).add(Aspect.TREE, 10).add(Aspect.MAGIC, 8).add(Aspect.ORDER, 8) + .add(Aspect.FLESH, 6).add(Aspect.EXCHANGE, 5)).setParents(researchTallowGolem.key) + .setConcealed() + .setPages( + new ResearchPage("gadomancy.research_page.GOLEMSILVERWOOD.1"), + new ResearchPage(RegisteredRecipes.recipeGolemSilverwood)) + .registerResearchItem(); RegisteredResearches.researchGolemRunicShield = new SimpleResearchItem( - "GOLEMRUNICSHIELD", - 0, - 0, - 4, - new ItemStack(RegisteredItems.itemFakeGolemShield, 1, 32767), - new AspectList() - .add(Aspect.AURA, 16) - .add(Aspect.ARMOR, 6) - .add(Aspect.MAGIC, 4) - .add(Aspect.MOTION, 8)) - .setParents(RegisteredResearches.researchGolemSilverwood.key) - .setConcealed() - .setPages( - new ResearchPage("gadomancy.research_page.GOLEMRUNICSHIELD.1"), - new ResearchPage(RegisteredRecipes.recipesGolemRunicShield)) - .registerResearchItem(); + "GOLEMRUNICSHIELD", + 0, + 0, + 4, + new ItemStack(RegisteredItems.itemFakeGolemShield, 1, 32767), + new AspectList().add(Aspect.AURA, 16).add(Aspect.ARMOR, 6).add(Aspect.MAGIC, 4).add(Aspect.MOTION, 8)) + .setParents(RegisteredResearches.researchGolemSilverwood.key).setConcealed() + .setPages( + new ResearchPage("gadomancy.research_page.GOLEMRUNICSHIELD.1"), + new ResearchPage(RegisteredRecipes.recipesGolemRunicShield)) + .registerResearchItem(); - ResearchItem researchBellows = - PseudoResearchItem.create("BELLOWS", -2, -5).registerResearchItem(); + ResearchItem researchBellows = PseudoResearchItem.create("BELLOWS", -2, -5).registerResearchItem(); RegisteredResearches.researchArcaneDropper = new SimpleResearchItem( - "ARCANEDROPPER", - -1, - -3, - 2, - new ItemStack(RegisteredBlocks.blockArcaneDropper), - new AspectList() - .add(Aspect.ORDER, 4) - .add(Aspect.AIR, 6) - .add(Aspect.EARTH, 5) - .add(Aspect.SENSES, 5) - .add(Aspect.MECHANISM, 7)) - .setParents("DISTILESSENTIA", researchBellows.key) - .setConcealed() - .setPages( - new ResearchPage("gadomancy.research_page.ARCANEDROPPER.1"), - new ResearchPage(RegisteredRecipes.recipeArcaneDropper)) - .registerResearchItem(); + "ARCANEDROPPER", + -1, + -3, + 2, + new ItemStack(RegisteredBlocks.blockArcaneDropper), + new AspectList().add(Aspect.ORDER, 4).add(Aspect.AIR, 6).add(Aspect.EARTH, 5).add(Aspect.SENSES, 5) + .add(Aspect.MECHANISM, 7)) + .setParents("DISTILESSENTIA", researchBellows.key).setConcealed() + .setPages( + new ResearchPage("gadomancy.research_page.ARCANEDROPPER.1"), + new ResearchPage(RegisteredRecipes.recipeArcaneDropper)) + .registerResearchItem(); - ResearchItem researchHarvestGather = - PseudoResearchItem.create("COREHARVEST", 2, -6).registerResearchItem(); - ResearchItem researchCoreGuard = - PseudoResearchItem.create("COREGUARD", 4, -5).registerResearchItem(); + ResearchItem researchHarvestGather = PseudoResearchItem.create("COREHARVEST", 2, -6).registerResearchItem(); + ResearchItem researchCoreGuard = PseudoResearchItem.create("COREGUARD", 4, -5).registerResearchItem(); ResearchItem researchVEleToolAxe = new ResearchItem("ELEMENTALAXE", Gadomancy.MODID).registerResearchItem(); ResearchItem researchVEleToolPick = new ResearchItem("ELEMENTALPICK", Gadomancy.MODID).registerResearchItem(); - ResearchItem researchVEleToolShovel = - new ResearchItem("ELEMENTALSHOVEL", Gadomancy.MODID).registerResearchItem(); + ResearchItem researchVEleToolShovel = new ResearchItem("ELEMENTALSHOVEL", Gadomancy.MODID) + .registerResearchItem(); ResearchItem researchVEleSword = new ResearchItem("ELEMENTALSWORD", Gadomancy.MODID).registerResearchItem(); RegisteredResearches.researchGolemCoreBreak = new SimpleResearchItem( - "GOLEMCOREBREAK", - 3, - -3, - 3, - new ItemStack(RegisteredItems.itemGolemCoreBreak), - new AspectList() - .add(Aspect.TOOL, 8) - .add(Aspect.ENTROPY, 8) - .add(Aspect.MECHANISM, 8)) - .setParents( - researchHarvestGather.key, - researchVEleToolAxe.key, - researchVEleToolPick.key, - researchVEleToolShovel.key) - .setConcealed() - .setPages( - new ResearchPage("gadomancy.research_page.GOLEMCOREBREAK.1"), - new ResearchPage(RegisteredRecipes.recipeGolemCoreBreak)) - .registerResearchItem(); + "GOLEMCOREBREAK", + 3, + -3, + 3, + new ItemStack(RegisteredItems.itemGolemCoreBreak), + new AspectList().add(Aspect.TOOL, 8).add(Aspect.ENTROPY, 8).add(Aspect.MECHANISM, 8)) + .setParents( + researchHarvestGather.key, + researchVEleToolAxe.key, + researchVEleToolPick.key, + researchVEleToolShovel.key) + .setConcealed() + .setPages( + new ResearchPage("gadomancy.research_page.GOLEMCOREBREAK.1"), + new ResearchPage(RegisteredRecipes.recipeGolemCoreBreak)) + .registerResearchItem(); - ResearchItem researchVBootsTraveller = - new ResearchItem("BOOTSTRAVELLER", Gadomancy.MODID).registerResearchItem(); + ResearchItem researchVBootsTraveller = new ResearchItem("BOOTSTRAVELLER", Gadomancy.MODID) + .registerResearchItem(); RegisteredResearches.researchGolemCoreBodyguard = new SimpleResearchItem( - "GOLEMCOREBODYGUARD", - 5, - -3, - 2, - new ItemStack(RegisteredItems.itemGolemCoreBreak, 1, 1), - new AspectList() - .add(Aspect.TOOL, 8) - .add(Aspect.ORDER, 8) - .add(Aspect.MECHANISM, 10) - .add(Aspect.ARMOR, 8) - .add(Aspect.WEAPON, 8)) - .setParents(researchVBootsTraveller.key, researchVEleSword.key, researchCoreGuard.key) - .setConcealed() - .setPages( - new ResearchPage("gadomancy.research_page.GOLEMCOREBODYGUARD.1"), - new ResearchPage(RegisteredRecipes.recipeGolemCoreBodyguard)) - .registerResearchItem(); + "GOLEMCOREBODYGUARD", + 5, + -3, + 2, + new ItemStack(RegisteredItems.itemGolemCoreBreak, 1, 1), + new AspectList().add(Aspect.TOOL, 8).add(Aspect.ORDER, 8).add(Aspect.MECHANISM, 10).add(Aspect.ARMOR, 8) + .add(Aspect.WEAPON, 8)) + .setParents(researchVBootsTraveller.key, researchVEleSword.key, researchCoreGuard.key) + .setConcealed() + .setPages( + new ResearchPage("gadomancy.research_page.GOLEMCOREBODYGUARD.1"), + new ResearchPage(RegisteredRecipes.recipeGolemCoreBodyguard)) + .registerResearchItem(); ResearchItem researchVFocusPrimal = new ResearchItem("FOCUSPRIMAL", Gadomancy.MODID).registerResearchItem(); - ResearchItem researchItemVoidMetal = - PseudoResearchItem.create("VOIDMETAL", -8, -6).registerResearchItem(); - ResearchItem researchWandPedestal = - PseudoResearchItem.create("WANDPED", -9, -8).registerResearchItem(); + ResearchItem researchItemVoidMetal = PseudoResearchItem.create("VOIDMETAL", -8, -6).registerResearchItem(); + ResearchItem researchWandPedestal = PseudoResearchItem.create("WANDPED", -9, -8).registerResearchItem(); ResearchItem researchVWardingStone = new ResearchItem("PAVEWARD", Gadomancy.MODID).registerResearchItem(); ResearchItem researchVNodeStabilizer = new ResearchItem("WANDPEDFOC", Gadomancy.MODID).registerResearchItem(); ResearchItem researchVCoreUse = new ResearchItem("COREUSE", Gadomancy.MODID).registerResearchItem(); ResearchItem researchVRunicShielding = new ResearchItem("RUNICARMOR", Gadomancy.MODID).registerResearchItem(); - ResearchItem researchOculus = PseudoResearchItem.create("OCULUS", -11, -2) - .setRound() - .setSpecial() + ResearchItem researchOculus = PseudoResearchItem.create("OCULUS", -11, -2).setRound().setSpecial() .registerResearchItem(); RegisteredResearches.researchInfusionClaw = new SimpleResearchItem( - "INFUSIONCLAW", - -6, - -7, - 5, - new ItemStack(RegisteredBlocks.blockInfusionClaw), - new AspectList() - .add(Aspect.ELDRITCH, 8) - .add(Aspect.MECHANISM, 8) - .add(Aspect.MAGIC, 8) - .add(Aspect.ORDER, 8) - .add(Aspect.DARKNESS, 4)) - .setParents( - researchVFocusPrimal.key, - researchItemVoidMetal.key, - researchWandPedestal.key, - researchVCoreUse.key) - .setConcealed() - .setPages( - new ResearchPage("gadomancy.research_page.INFUSIONCLAW.1"), - new ResearchPage(RegisteredRecipes.recipeInfusionClaw), - new ResearchPage("gadomancy.research_page.INFUSIONCLAW.2")) - .registerResearchItem(); + "INFUSIONCLAW", + -6, + -7, + 5, + new ItemStack(RegisteredBlocks.blockInfusionClaw), + new AspectList().add(Aspect.ELDRITCH, 8).add(Aspect.MECHANISM, 8).add(Aspect.MAGIC, 8) + .add(Aspect.ORDER, 8).add(Aspect.DARKNESS, 4)) + .setParents( + researchVFocusPrimal.key, + researchItemVoidMetal.key, + researchWandPedestal.key, + researchVCoreUse.key) + .setConcealed() + .setPages( + new ResearchPage("gadomancy.research_page.INFUSIONCLAW.1"), + new ResearchPage(RegisteredRecipes.recipeInfusionClaw), + new ResearchPage("gadomancy.research_page.INFUSIONCLAW.2")) + .registerResearchItem(); RegisteredResearches.researchNodeManipulator = new SimpleResearchItem( - "NODE_MANIPULATOR", - -9, - -4, - 2, - new ItemStack(RegisteredBlocks.blockNodeManipulator, 1, 5), - new AspectList() - .add(Aspect.ELDRITCH, 8) - .add(Aspect.AURA, 6) - .add(Aspect.DARKNESS, 4) - .add(Aspect.MAGIC, 8) - .add(Aspect.GREED, 4) - .add(Aspect.VOID, 10) - .add(Aspect.MECHANISM, 6) - .add(Aspect.EXCHANGE, 4)) - .setConcealed() - .setSpecial() - .setParents( - researchItemVoidMetal.key, - researchVNodeStabilizer.key, - researchVWardingStone.key, - researchWandPedestal.key) - .setPages( - new ResearchPage("gadomancy.research_page.NODE_MANIPULATOR.1"), - new ResearchPage(RegisteredRecipes.recipeNodeManipulator), - new ResearchPage("gadomancy.research_page.NODE_MANIPULATOR.3"), - new ResearchPage(RegisteredRecipes.recipeRandomizationFocus), - new ResearchPage(RegisteredRecipes.multiblockNodeManipulator), - new ResearchPage("gadomancy.research_page.NODE_MANIPULATOR.6")) - .registerResearchItem(); + "NODE_MANIPULATOR", + -9, + -4, + 2, + new ItemStack(RegisteredBlocks.blockNodeManipulator, 1, 5), + new AspectList().add(Aspect.ELDRITCH, 8).add(Aspect.AURA, 6).add(Aspect.DARKNESS, 4) + .add(Aspect.MAGIC, 8).add(Aspect.GREED, 4).add(Aspect.VOID, 10).add(Aspect.MECHANISM, 6) + .add(Aspect.EXCHANGE, 4)) + .setConcealed().setSpecial() + .setParents( + researchItemVoidMetal.key, + researchVNodeStabilizer.key, + researchVWardingStone.key, + researchWandPedestal.key) + .setPages( + new ResearchPage("gadomancy.research_page.NODE_MANIPULATOR.1"), + new ResearchPage(RegisteredRecipes.recipeNodeManipulator), + new ResearchPage("gadomancy.research_page.NODE_MANIPULATOR.3"), + new ResearchPage(RegisteredRecipes.recipeRandomizationFocus), + new ResearchPage(RegisteredRecipes.multiblockNodeManipulator), + new ResearchPage("gadomancy.research_page.NODE_MANIPULATOR.6")) + .registerResearchItem(); RegisteredResearches.researchEldritchPortalCreator = new SimpleResearchItem( - "E_PORTAL_CREATOR", - -10, - 0, - 2, - new ItemStack(RegisteredBlocks.blockAdditionalEldrichPortal, 1, 0), - new AspectList() - .add(Aspect.ELDRITCH, 6) - .add(Aspect.DARKNESS, 10) - .add(Aspect.TRAVEL, 8) - .add(Aspect.AURA, 10) - .add(Aspect.VOID, 6) - .add(Aspect.MECHANISM, 4)) - .setConcealed() - .setSpecial() - .setParents(RegisteredResearches.researchNodeManipulator.key, researchOculus.key) - .setPages( - new ResearchPage("gadomancy.research_page.E_PORTAL_CREATOR.1"), - new ResearchPage(RegisteredRecipes.recipeAncientPedestal), - new ResearchPage("gadomancy.research_page.E_PORTAL_CREATOR.3"), - new ResearchPage("gadomancy.research_page.E_PORTAL_CREATOR.4"), - new ResearchPage(RegisteredRecipes.recipePortalFocus), - new ResearchPage("gadomancy.research_page.E_PORTAL_CREATOR.6"), - new ResearchPage(RegisteredRecipes.multiblockEldritchPortalCreator), - new ResearchPage("gadomancy.research_page.E_PORTAL_CREATOR.8")) - .registerResearchItem(); + "E_PORTAL_CREATOR", + -10, + 0, + 2, + new ItemStack(RegisteredBlocks.blockAdditionalEldrichPortal, 1, 0), + new AspectList().add(Aspect.ELDRITCH, 6).add(Aspect.DARKNESS, 10).add(Aspect.TRAVEL, 8) + .add(Aspect.AURA, 10).add(Aspect.VOID, 6).add(Aspect.MECHANISM, 4)).setConcealed().setSpecial() + .setParents(RegisteredResearches.researchNodeManipulator.key, researchOculus.key) + .setPages( + new ResearchPage("gadomancy.research_page.E_PORTAL_CREATOR.1"), + new ResearchPage(RegisteredRecipes.recipeAncientPedestal), + new ResearchPage("gadomancy.research_page.E_PORTAL_CREATOR.3"), + new ResearchPage("gadomancy.research_page.E_PORTAL_CREATOR.4"), + new ResearchPage(RegisteredRecipes.recipePortalFocus), + new ResearchPage("gadomancy.research_page.E_PORTAL_CREATOR.6"), + new ResearchPage(RegisteredRecipes.multiblockEldritchPortalCreator), + new ResearchPage("gadomancy.research_page.E_PORTAL_CREATOR.8")) + .registerResearchItem(); RegisteredResearches.researchBlockProtector = new SimpleResearchItem( - "BLOCK_PROTECTOR", - -6, - -2, - 2, - new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 2), - new AspectList() - .add(Aspect.ORDER, 10) - .add(Aspect.ARMOR, 8) - .add(Aspect.EARTH, 12) - .add(Aspect.LIGHT, 10) - .add(Aspect.AURA, 8)) - .setConcealed() - .setPages( - new ResearchPage("gadomancy.research_page.BLOCK_PROTECTOR.1"), - new ResearchPage(RegisteredRecipes.recipeBlockProtector), - new ResearchPage("gadomancy.research_page.BLOCK_PROTECTOR.3"), - new ResearchPage("gadomancy.research_page.BLOCK_PROTECTOR.4")) - .registerResearchItem(); + "BLOCK_PROTECTOR", + -6, + -2, + 2, + new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 2), + new AspectList().add(Aspect.ORDER, 10).add(Aspect.ARMOR, 8).add(Aspect.EARTH, 12).add(Aspect.LIGHT, 10) + .add(Aspect.AURA, 8)) + .setConcealed() + .setPages( + new ResearchPage("gadomancy.research_page.BLOCK_PROTECTOR.1"), + new ResearchPage(RegisteredRecipes.recipeBlockProtector), + new ResearchPage("gadomancy.research_page.BLOCK_PROTECTOR.3"), + new ResearchPage("gadomancy.research_page.BLOCK_PROTECTOR.4")) + .registerResearchItem(); ItemStack displayFamiliar = new ItemStack(RegisteredItems.itemEtherealFamiliar); ItemEtherealFamiliar.setFamiliarAspect(displayFamiliar, Aspect.MAGIC); RegisteredResearches.researchEtherealFamiliar = new SimpleResearchItem( - "ETHEREAL_FAMILIAR", - 5, - 1, - 2, - displayFamiliar, - new AspectList() - .add(Aspect.MAGIC, 8) - .add(Aspect.FIRE, 6) - .add(Aspect.AURA, 4)) - .setConcealed() - .setSpecial() - .setParents(researchVRunicShielding.key) - .setPages( - new ResearchPage("gadomancy.research_page.ETHEREAL_FAMILIAR.1"), - new ResearchPage(RegisteredRecipes.recipesFamiliar), - new ResearchPage("gadomancy.research_page.ETHEREAL_FAMILIAR.3")) - .registerResearchItem(); + "ETHEREAL_FAMILIAR", + 5, + 1, + 2, + displayFamiliar, + new AspectList().add(Aspect.MAGIC, 8).add(Aspect.FIRE, 6).add(Aspect.AURA, 4)).setConcealed() + .setSpecial().setParents(researchVRunicShielding.key) + .setPages( + new ResearchPage("gadomancy.research_page.ETHEREAL_FAMILIAR.1"), + new ResearchPage(RegisteredRecipes.recipesFamiliar), + new ResearchPage("gadomancy.research_page.ETHEREAL_FAMILIAR.3")) + .registerResearchItem(); RegisteredResearches.researchFamiliarElementLightning = new SimpleResearchItem( - "FAMILIAR_SHOCK", - 4, - -1, - 2, - new ResourceLocation("gadomancy", "textures/misc/Fam_Lightning.png"), - new AspectList() - .add(Aspect.WEATHER, 4) - .add(Aspect.WEAPON, 4) - .add(Aspect.AIR, 8)) - .setConcealed() - .setParents(RegisteredResearches.researchEtherealFamiliar.key) - .setPages( - new ResearchPage("gadomancy.research_page.FAMILIAR_SHOCK.1"), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[0]), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[1]), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[2])) - .registerResearchItem(); + "FAMILIAR_SHOCK", + 4, + -1, + 2, + new ResourceLocation("gadomancy", "textures/misc/Fam_Lightning.png"), + new AspectList().add(Aspect.WEATHER, 4).add(Aspect.WEAPON, 4).add(Aspect.AIR, 8)).setConcealed() + .setParents(RegisteredResearches.researchEtherealFamiliar.key) + .setPages( + new ResearchPage("gadomancy.research_page.FAMILIAR_SHOCK.1"), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[0]), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[1]), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[2])) + .registerResearchItem(); RegisteredResearches.researchFamiliarElementFire = new SimpleResearchItem( - "FAMILIAR_FIRE", - 6, - -1, - 2, - new ResourceLocation("gadomancy", "textures/misc/Fam_Fire.png"), - new AspectList() - .add(Aspect.FIRE, 8) - .add(Aspect.WEAPON, 4) - .add(Aspect.MAGIC, 4)) - .setConcealed() - .setParents(RegisteredResearches.researchEtherealFamiliar.key) - .setPages( - new ResearchPage("gadomancy.research_page.FAMILIAR_FIRE.1"), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[3]), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[4]), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[5])) - .registerResearchItem(); + "FAMILIAR_FIRE", + 6, + -1, + 2, + new ResourceLocation("gadomancy", "textures/misc/Fam_Fire.png"), + new AspectList().add(Aspect.FIRE, 8).add(Aspect.WEAPON, 4).add(Aspect.MAGIC, 4)).setConcealed() + .setParents(RegisteredResearches.researchEtherealFamiliar.key) + .setPages( + new ResearchPage("gadomancy.research_page.FAMILIAR_FIRE.1"), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[3]), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[4]), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[5])) + .registerResearchItem(); RegisteredResearches.researchFamiliarElementPoison = new SimpleResearchItem( - "FAMILIAR_POISON", - 3, - 2, - 2, - new ResourceLocation("gadomancy", "textures/misc/Fam_Poison.png"), - new AspectList() - .add(Aspect.POISON, 8) - .add(Aspect.WEAPON, 4) - .add(Aspect.ENTROPY, 4)) - .setConcealed() - .setParents(RegisteredResearches.researchEtherealFamiliar.key) - .setPages( - new ResearchPage("gadomancy.research_page.FAMILIAR_POISON.1"), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[6]), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[7]), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[8])) - .registerResearchItem(); + "FAMILIAR_POISON", + 3, + 2, + 2, + new ResourceLocation("gadomancy", "textures/misc/Fam_Poison.png"), + new AspectList().add(Aspect.POISON, 8).add(Aspect.WEAPON, 4).add(Aspect.ENTROPY, 4)).setConcealed() + .setParents(RegisteredResearches.researchEtherealFamiliar.key) + .setPages( + new ResearchPage("gadomancy.research_page.FAMILIAR_POISON.1"), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[6]), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[7]), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[8])) + .registerResearchItem(); RegisteredResearches.researchFamiliarElementWeakness = new SimpleResearchItem( - "FAMILIAR_WEAKNESS", - 2, - 0, - 2, - new ResourceLocation("gadomancy", "textures/misc/Fam_Enervation.png"), - new AspectList() - .add(Aspect.TRAP, 8) - .add(Aspect.WEAPON, 8) - .add(Aspect.TAINT, 6)) - .setConcealed() - .setParents(RegisteredResearches.researchEtherealFamiliar.key) - .setPages( - new ResearchPage("gadomancy.research_page.FAMILIAR_WEAKNESS.1"), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[9]), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[10]), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[11])) - .registerResearchItem(); + "FAMILIAR_WEAKNESS", + 2, + 0, + 2, + new ResourceLocation("gadomancy", "textures/misc/Fam_Enervation.png"), + new AspectList().add(Aspect.TRAP, 8).add(Aspect.WEAPON, 8).add(Aspect.TAINT, 6)).setConcealed() + .setParents(RegisteredResearches.researchEtherealFamiliar.key) + .setPages( + new ResearchPage("gadomancy.research_page.FAMILIAR_WEAKNESS.1"), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[9]), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[10]), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[11])) + .registerResearchItem(); RegisteredResearches.researchFamiliarAugmentDamage = new IfAnyParentResearchItem( - "FAMILIAR_DAMAGE", - 8, - 2, - 2, - new ResourceLocation("gadomancy", "textures/misc/Fam_Damage.png"), - new AspectList() - .add(Aspect.WEAPON, 8) - .add(Aspect.ENERGY, 8) - .add(Aspect.MAGIC, 4)) - .setAnyParents( - RegisteredResearches.researchFamiliarElementFire.key, - RegisteredResearches.researchFamiliarElementLightning.key, - RegisteredResearches.researchFamiliarElementPoison.key, - RegisteredResearches.researchFamiliarElementWeakness.key) - .setConcealed() - .setParents(RegisteredResearches.researchEtherealFamiliar.key, "VOIDMETAL") - .setPages( - new ResearchPage("gadomancy.research_page.FAMILIAR_DAMAGE.1"), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[12]), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[13]), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[14])) - .registerResearchItem(); + "FAMILIAR_DAMAGE", + 8, + 2, + 2, + new ResourceLocation("gadomancy", "textures/misc/Fam_Damage.png"), + new AspectList().add(Aspect.WEAPON, 8).add(Aspect.ENERGY, 8).add(Aspect.MAGIC, 4)) + .setAnyParents( + RegisteredResearches.researchFamiliarElementFire.key, + RegisteredResearches.researchFamiliarElementLightning.key, + RegisteredResearches.researchFamiliarElementPoison.key, + RegisteredResearches.researchFamiliarElementWeakness.key) + .setConcealed().setParents(RegisteredResearches.researchEtherealFamiliar.key, "VOIDMETAL") + .setPages( + new ResearchPage("gadomancy.research_page.FAMILIAR_DAMAGE.1"), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[12]), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[13]), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[14])) + .registerResearchItem(); RegisteredResearches.researchFamiliarAugmentRange = new IfAnyParentResearchItem( - "FAMILIAR_RANGE", - 6, - 4, - 2, - new ResourceLocation("gadomancy", "textures/misc/Fam_Range.png"), - new AspectList() - .add(Aspect.MAGIC, 8) - .add(Aspect.ELDRITCH, 8) - .add(Aspect.ORDER, 4)) - .setAnyParents( - RegisteredResearches.researchFamiliarElementFire.key, - RegisteredResearches.researchFamiliarElementLightning.key, - RegisteredResearches.researchFamiliarElementPoison.key, - RegisteredResearches.researchFamiliarElementWeakness.key) - .setConcealed() - .setParents(RegisteredResearches.researchEtherealFamiliar.key) - .setPages( - new ResearchPage("gadomancy.research_page.FAMILIAR_RANGE.1"), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[15]), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[16])) - .registerResearchItem(); + "FAMILIAR_RANGE", + 6, + 4, + 2, + new ResourceLocation("gadomancy", "textures/misc/Fam_Range.png"), + new AspectList().add(Aspect.MAGIC, 8).add(Aspect.ELDRITCH, 8).add(Aspect.ORDER, 4)) + .setAnyParents( + RegisteredResearches.researchFamiliarElementFire.key, + RegisteredResearches.researchFamiliarElementLightning.key, + RegisteredResearches.researchFamiliarElementPoison.key, + RegisteredResearches.researchFamiliarElementWeakness.key) + .setConcealed().setParents(RegisteredResearches.researchEtherealFamiliar.key) + .setPages( + new ResearchPage("gadomancy.research_page.FAMILIAR_RANGE.1"), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[15]), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[16])) + .registerResearchItem(); RegisteredResearches.researchFamiliarAugmentSpeed = new SimpleResearchItem( - "FAMILIAR_SPEED", - 8, - 5, - 2, - new ResourceLocation("gadomancy", "textures/misc/Fam_Speed.png"), - new AspectList() - .add(Aspect.MOTION, 10) - .add(Aspect.MAGIC, 4) - .add(Aspect.AURA, 4)) - .setConcealed() - .setParents( - RegisteredResearches.researchFamiliarAugmentDamage.key, - RegisteredResearches.researchFamiliarAugmentRange.key, - "PRIMPEARL") - .setPages( - new ResearchPage("gadomancy.research_page.FAMILIAR_SPEED.1"), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[17]), - new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[18])) - .registerResearchItem(); + "FAMILIAR_SPEED", + 8, + 5, + 2, + new ResourceLocation("gadomancy", "textures/misc/Fam_Speed.png"), + new AspectList().add(Aspect.MOTION, 10).add(Aspect.MAGIC, 4).add(Aspect.AURA, 4)) + .setConcealed() + .setParents( + RegisteredResearches.researchFamiliarAugmentDamage.key, + RegisteredResearches.researchFamiliarAugmentRange.key, + "PRIMPEARL") + .setPages( + new ResearchPage("gadomancy.research_page.FAMILIAR_SPEED.1"), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[17]), + new ResearchPage(RegisteredRecipes.recipesFamiliarAugmentation[18])) + .registerResearchItem(); if (ModConfig.enableAdditionalNodeTypes) { RegisteredResearches.researchGrowingNodes = new SimpleResearchItem( - "GROWING", - -8, - -1, - 5, - new ResourceLocation("thaumcraft", "textures/misc/r_nodes.png"), - new AspectList()) - .setSpecial() - .setLost() - .setConcealed() - .setParents(Gadomancy.MODID.toUpperCase() + ".NODE_MANIPULATOR") - .setPages( - new ResearchPage("gadomancy.research_page.GROWING.1"), - new ResearchPage("gadomancy.research_page.GROWING.2")) - .registerResearchItem(); + "GROWING", + -8, + -1, + 5, + new ResourceLocation("thaumcraft", "textures/misc/r_nodes.png"), + new AspectList()).setSpecial().setLost().setConcealed() + .setParents(Gadomancy.MODID.toUpperCase() + ".NODE_MANIPULATOR") + .setPages( + new ResearchPage("gadomancy.research_page.GROWING.1"), + new ResearchPage("gadomancy.research_page.GROWING.2")) + .registerResearchItem(); RegisteredResearches.researchGrowingNodeAgression = new SimpleResearchItem( - "GROWING_AGGRESSION", - -5, - 0, - 6, - new ItemStack(ConfigBlocks.blockAiry, 1, 5), - new AspectList()) - .setLost() - .setParents(Gadomancy.MODID.toUpperCase() + ".GROWING") - .setPages(new ResearchPage("gadomancy.research_page.GROWING_AGGRESSION.1")) - .registerResearchItem(); + "GROWING_AGGRESSION", + -5, + 0, + 6, + new ItemStack(ConfigBlocks.blockAiry, 1, 5), + new AspectList()).setLost().setParents(Gadomancy.MODID.toUpperCase() + ".GROWING") + .setPages(new ResearchPage("gadomancy.research_page.GROWING_AGGRESSION.1")) + .registerResearchItem(); RegisteredResearches.researchGrowingNodeGrowth = new SimpleResearchItem( - "GROWING_GROWTH", - -7, - 2, - 6, - new ResourceLocation("gadomancy", "textures/misc/r_node_star.png"), - new AspectList()) - .setLost() - .setParents(Gadomancy.MODID.toUpperCase() + ".GROWING") - .setPages( - new ResearchPage("gadomancy.research_page.GROWING_GROWTH.1"), - new ResearchPage("gadomancy.research_page.GROWING_GROWTH.2")) - .registerResearchItem(); + "GROWING_GROWTH", + -7, + 2, + 6, + new ResourceLocation("gadomancy", "textures/misc/r_node_star.png"), + new AspectList()) + .setLost().setParents(Gadomancy.MODID.toUpperCase() + ".GROWING") + .setPages( + new ResearchPage("gadomancy.research_page.GROWING_GROWTH.1"), + new ResearchPage("gadomancy.research_page.GROWING_GROWTH.2")) + .registerResearchItem(); RegisteredResearches.researchGrowingNodeAttackNodes = new SimpleResearchItem( - "GROWING_ATTACK", - -6, - 1, - 6, - new ResourceLocation("gadomancy", "textures/misc/r_node_dark.png"), - new AspectList()) - .setLost() - .setParents(Gadomancy.MODID.toUpperCase() + ".GROWING") - .setPages(new ResearchPage("gadomancy.research_page.GROWING_ATTACK.1")) - .registerResearchItem(); + "GROWING_ATTACK", + -6, + 1, + 6, + new ResourceLocation("gadomancy", "textures/misc/r_node_dark.png"), + new AspectList()).setLost().setParents(Gadomancy.MODID.toUpperCase() + ".GROWING") + .setPages(new ResearchPage("gadomancy.research_page.GROWING_ATTACK.1")) + .registerResearchItem(); RegisteredResearches.researchGrowingNodeGrowthClue = new SimpleResearchItem( - "GROWING_GROWTHCLUE", - -4, - 3, - 2, - new ItemStack(ConfigBlocks.blockAiry, 1, 5), - new AspectList() - .add(Aspect.AURA, 10) - .add(Aspect.MAGIC, 15) - .add(Aspect.ELDRITCH, 5) - .add(Aspect.VOID, 12) - .add(Aspect.ENERGY, 12) - .add(Aspect.ENTROPY, 8) - .add(Aspect.DEATH, 3) - .add(Aspect.GREED, 10) - .add(Aspect.HUNGER, 10) - .add(Aspect.MECHANISM, 12) - .add(Aspect.DARKNESS, 12)) - .setSpecial() - .setRound() - .setConcealed() - .setParents( - Gadomancy.MODID.toUpperCase() + ".GROWING_AGGRESSION", - Gadomancy.MODID.toUpperCase() + ".GROWING_GROWTH", - Gadomancy.MODID.toUpperCase() + ".GROWING_ATTACK") - .setPages( - new ResearchPage("gadomancy.research_page.GROWING_GROWTHCLUE.1"), - new ResearchPage("gadomancy.research_page.GROWING_GROWTHCLUE.2")) - .registerResearchItem(); + "GROWING_GROWTHCLUE", + -4, + 3, + 2, + new ItemStack(ConfigBlocks.blockAiry, 1, 5), + new AspectList().add(Aspect.AURA, 10).add(Aspect.MAGIC, 15).add(Aspect.ELDRITCH, 5) + .add(Aspect.VOID, 12).add(Aspect.ENERGY, 12).add(Aspect.ENTROPY, 8).add(Aspect.DEATH, 3) + .add(Aspect.GREED, 10).add(Aspect.HUNGER, 10).add(Aspect.MECHANISM, 12) + .add(Aspect.DARKNESS, 12)) + .setSpecial().setRound().setConcealed() + .setParents( + Gadomancy.MODID.toUpperCase() + ".GROWING_AGGRESSION", + Gadomancy.MODID.toUpperCase() + ".GROWING_GROWTH", + Gadomancy.MODID.toUpperCase() + ".GROWING_ATTACK") + .setPages( + new ResearchPage("gadomancy.research_page.GROWING_GROWTHCLUE.1"), + new ResearchPage("gadomancy.research_page.GROWING_GROWTHCLUE.2")) + .registerResearchItem(); } - if (ModConfig.ancientStoneRecipes) - RegisteredResearches.researchAncientStones = new AlternatingResearchItem( - "ANCIENT_STONES", - -12, - 1, - 3, - new AspectList() - .add(Aspect.ELDRITCH, 10) - .add(Aspect.EARTH, 8) - .add(Aspect.EXCHANGE, 6) - .add(Aspect.ENTROPY, 8), - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 11), - new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 15)) - .setConcealed() - .setParents(researchOculus.key) - .setPages( - new ResearchPage("gadomancy.research_page.ANCIENT_STONES.1"), - new ResearchPage(RegisteredRecipes.recipeAncientStone), - new ResearchPage(RegisteredRecipes.recipeAncientStonePedestal)) - .registerResearchItem(); + if (ModConfig.ancientStoneRecipes) RegisteredResearches.researchAncientStones = new AlternatingResearchItem( + "ANCIENT_STONES", + -12, + 1, + 3, + new AspectList().add(Aspect.ELDRITCH, 10).add(Aspect.EARTH, 8).add(Aspect.EXCHANGE, 6) + .add(Aspect.ENTROPY, 8), + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 11), + new ItemStack(ConfigBlocks.blockCosmeticSolid, 1, 15)) + .setConcealed().setParents(researchOculus.key) + .setPages( + new ResearchPage("gadomancy.research_page.ANCIENT_STONES.1"), + new ResearchPage(RegisteredRecipes.recipeAncientStone), + new ResearchPage(RegisteredRecipes.recipeAncientStonePedestal)) + .registerResearchItem(); ItemAuraCore.AuraCoreType[] coreTypes = ItemAuraCore.AuraCoreType.values(); ItemStack[] cores = new ItemStack[coreTypes.length]; @@ -603,215 +498,175 @@ public class RegisteredResearches { // Cores and stuff related to it. RegisteredResearches.researchAuraCore = new AlternatingResearchItem( - "AURA_CORE", - -1, - 6, - 2, - new AspectList() - .add(Aspect.AURA, 22) - .add(Aspect.MAGIC, 10) - .add(Aspect.AIR, 8) - .add(Aspect.WATER, 8) - .add(Aspect.EARTH, 8) - .add(Aspect.FIRE, 8) - .add(Aspect.ORDER, 8) - .add(Aspect.ENTROPY, 8), - cores) - .setConcealed() - .setSpecial() - .setParents("INFUSION", "THAUMIUM") - .setPages( - new ResearchPage("gadomancy.research_page.AURA_CORE.1"), - new ResearchPage(RegisteredRecipes.recipeAuraCore), - new ResearchPage("gadomancy.research_page.AURA_CORE.3"), - new MultiResearchPage(RegisteredRecipes.auraCoreRecipes)) - .registerResearchItem(); + "AURA_CORE", + -1, + 6, + 2, + new AspectList().add(Aspect.AURA, 22).add(Aspect.MAGIC, 10).add(Aspect.AIR, 8).add(Aspect.WATER, 8) + .add(Aspect.EARTH, 8).add(Aspect.FIRE, 8).add(Aspect.ORDER, 8).add(Aspect.ENTROPY, 8), + cores).setConcealed().setSpecial().setParents("INFUSION", "THAUMIUM") + .setPages( + new ResearchPage("gadomancy.research_page.AURA_CORE.1"), + new ResearchPage(RegisteredRecipes.recipeAuraCore), + new ResearchPage("gadomancy.research_page.AURA_CORE.3"), + new MultiResearchPage(RegisteredRecipes.auraCoreRecipes)) + .registerResearchItem(); RegisteredResearches.researchCleanAuraCore = new SimpleResearchItem( - "CLEAN_AURA_CORE", - 1, - 5, - 0, - new ItemStack(RegisteredItems.itemAuraCore), - new AspectList() - .add(Aspect.HEAL, 8) - .add(Aspect.AURA, 6) - .add(Aspect.MAGIC, 8) - .add(Aspect.WATER, 10)) - .setConcealed() - .setSecondary() - .setParents(RegisteredResearches.researchAuraCore.key) - .setPages( - new ResearchPage("gadomancy.research_page.CLEAN_AURA_CORE.1"), - new ResearchPage(RegisteredRecipes.recipesWashAuraCore), - new ResearchPage(RegisteredRecipes.recipesUndoAuraCore)) - .registerResearchItem(); + "CLEAN_AURA_CORE", + 1, + 5, + 0, + new ItemStack(RegisteredItems.itemAuraCore), + new AspectList().add(Aspect.HEAL, 8).add(Aspect.AURA, 6).add(Aspect.MAGIC, 8).add(Aspect.WATER, 10)) + .setConcealed().setSecondary().setParents(RegisteredResearches.researchAuraCore.key) + .setPages( + new ResearchPage("gadomancy.research_page.CLEAN_AURA_CORE.1"), + new ResearchPage(RegisteredRecipes.recipesWashAuraCore), + new ResearchPage(RegisteredRecipes.recipesUndoAuraCore)) + .registerResearchItem(); RegisteredResearches.researchAuraPylon = new SimpleResearchItem( - "AURA_PYLON", - 0, - 9, - 2, - new ItemStack(RegisteredBlocks.blockAuraPylon, 1, 1), - new AspectList() - .add(Aspect.ORDER, 12) - .add(Aspect.AURA, 20) - .add(Aspect.MAGIC, 12) - .add(Aspect.MECHANISM, 8)) - .setHidden() - .setParents(RegisteredResearches.researchAuraCore.key, "TUBEFILTER") - .setItemTriggers( - new ItemStack(RegisteredItems.itemAuraCore, 1, ItemAuraCore.AuraCoreType.FIRE.ordinal())) - .setPages( - new ResearchPage("gadomancy.research_page.AURA_PYLON.1"), - new ResearchPage(RegisteredRecipes.recipeAuraPylon), - new ResearchPage(RegisteredRecipes.recipeAuraPylonPeak), - new ResearchPage("gadomancy.research_page.AURA_PYLON.4"), - new ResearchPage(RegisteredRecipes.multiblockAuraPylon)) - .registerResearchItem(); + "AURA_PYLON", + 0, + 9, + 2, + new ItemStack(RegisteredBlocks.blockAuraPylon, 1, 1), + new AspectList().add(Aspect.ORDER, 12).add(Aspect.AURA, 20).add(Aspect.MAGIC, 12) + .add(Aspect.MECHANISM, 8)).setHidden() + .setParents(RegisteredResearches.researchAuraCore.key, "TUBEFILTER") + .setItemTriggers( + new ItemStack( + RegisteredItems.itemAuraCore, + 1, + ItemAuraCore.AuraCoreType.FIRE.ordinal())) + .setPages( + new ResearchPage("gadomancy.research_page.AURA_PYLON.1"), + new ResearchPage(RegisteredRecipes.recipeAuraPylon), + new ResearchPage(RegisteredRecipes.recipeAuraPylonPeak), + new ResearchPage("gadomancy.research_page.AURA_PYLON.4"), + new ResearchPage(RegisteredRecipes.multiblockAuraPylon)) + .registerResearchItem(); RegisteredResearches.researchAuraEffects = new SimpleResearchItem( - "AURA_EFFECTS", - 1, - 10, - 2, - new ResourceLocation("thaumcraft", "textures/misc/r_aspects.png"), - new AspectList() - .add(Aspect.AURA, 6) - .add(Aspect.MIND, 8) - .add(Aspect.MAGIC, 4) - .add(Aspect.ORDER, 4)) - .setConcealed() - .setSecondary() - .setParents(RegisteredResearches.researchAuraPylon.key) - .setPages(new ResearchPage("gadomancy.research_page.AURA_EFFECTS.1")) - .registerResearchItem(); + "AURA_EFFECTS", + 1, + 10, + 2, + new ResourceLocation("thaumcraft", "textures/misc/r_aspects.png"), + new AspectList().add(Aspect.AURA, 6).add(Aspect.MIND, 8).add(Aspect.MAGIC, 4).add(Aspect.ORDER, 4)) + .setConcealed().setSecondary().setParents(RegisteredResearches.researchAuraPylon.key) + .setPages(new ResearchPage("gadomancy.research_page.AURA_EFFECTS.1")).registerResearchItem(); RegisteredResearches.researchKnowledgeBook = new SimpleResearchItem( - "KNOWLEDGE_BOOK", - -2, - 8, - 2, - new ItemStack(RegisteredBlocks.blockKnowledgeBook), - new AspectList() - .add(Aspect.MIND, 12) - .add(Aspect.MAGIC, 8) - .add(Aspect.MOTION, 6) - .add(Aspect.ORDER, 10) - .add(Aspect.MECHANISM, 8) - .add(Aspect.CRAFT, 8)) - .setHidden() - .setParents(RegisteredResearches.researchAuraCore.key, "GOGGLES", "THAUMATORIUM") - .setItemTriggers( - new ItemStack(RegisteredItems.itemAuraCore, 1, ItemAuraCore.AuraCoreType.ORDER.ordinal())) - .setPages( - new ResearchPage("gadomancy.research_page.KNOWLEDGE_BOOK.1"), - new ResearchPage(RegisteredRecipes.recipeKnowledgeBook), - new ResearchPage("gadomancy.research_page.KNOWLEDGE_BOOK.3"), - new ResearchPage("gadomancy.research_page.KNOWLEDGE_BOOK.4")) - .registerResearchItem(); + "KNOWLEDGE_BOOK", + -2, + 8, + 2, + new ItemStack(RegisteredBlocks.blockKnowledgeBook), + new AspectList().add(Aspect.MIND, 12).add(Aspect.MAGIC, 8).add(Aspect.MOTION, 6).add(Aspect.ORDER, 10) + .add(Aspect.MECHANISM, 8).add(Aspect.CRAFT, 8)).setHidden() + .setParents(RegisteredResearches.researchAuraCore.key, "GOGGLES", "THAUMATORIUM") + .setItemTriggers( + new ItemStack( + RegisteredItems.itemAuraCore, + 1, + ItemAuraCore.AuraCoreType.ORDER.ordinal())) + .setPages( + new ResearchPage("gadomancy.research_page.KNOWLEDGE_BOOK.1"), + new ResearchPage(RegisteredRecipes.recipeKnowledgeBook), + new ResearchPage("gadomancy.research_page.KNOWLEDGE_BOOK.3"), + new ResearchPage("gadomancy.research_page.KNOWLEDGE_BOOK.4")) + .registerResearchItem(); - ResearchItem researchVReservoir = - PseudoResearchItem.create("ESSENTIARESERVOIR", -5, 9).registerResearchItem(); + ResearchItem researchVReservoir = PseudoResearchItem.create("ESSENTIARESERVOIR", -5, 9).registerResearchItem(); RegisteredResearches.researchEssentiaCompressor = new SimpleResearchItem( - "ESSENTIA_COMPRESSOR", - -4, - 7, - 2, - new ItemStack(RegisteredBlocks.blockEssentiaCompressor), - new AspectList() - .add(Aspect.VOID, 12) - .add(Aspect.WATER, 10) - .add(Aspect.ENTROPY, 12) - .add(Aspect.MAGIC, 6) - .add(Aspect.MECHANISM, 12)) - .setHidden() - .setParents(RegisteredResearches.researchAuraCore.key, researchVReservoir.key) - .setItemTriggers( - new ItemStack(RegisteredItems.itemAuraCore, 1, ItemAuraCore.AuraCoreType.WATER.ordinal())) - .setPages( - new ResearchPage("gadomancy.research_page.ESSENTIA_COMPRESSOR.1"), - new ResearchPage("gadomancy.research_page.ESSENTIA_COMPRESSOR.2"), - new ResearchPage(RegisteredRecipes.recipeElementVoid), - new ResearchPage("gadomancy.research_page.ESSENTIA_COMPRESSOR.4"), - new ResearchPage(RegisteredRecipes.recipeEssentiaCompressor), - new ResearchPage("gadomancy.research_page.ESSENTIA_COMPRESSOR.6"), - new ResearchPage(RegisteredRecipes.multiblockEssentiaCompressor), - new ResearchPage("gadomancy.research_page.ESSENTIA_COMPRESSOR.8"), - new ResearchPage("gadomancy.research_page.ESSENTIA_COMPRESSOR.9")) - .registerResearchItem(); + "ESSENTIA_COMPRESSOR", + -4, + 7, + 2, + new ItemStack(RegisteredBlocks.blockEssentiaCompressor), + new AspectList().add(Aspect.VOID, 12).add(Aspect.WATER, 10).add(Aspect.ENTROPY, 12).add(Aspect.MAGIC, 6) + .add(Aspect.MECHANISM, 12)).setHidden() + .setParents(RegisteredResearches.researchAuraCore.key, researchVReservoir.key) + .setItemTriggers( + new ItemStack( + RegisteredItems.itemAuraCore, + 1, + ItemAuraCore.AuraCoreType.WATER.ordinal())) + .setPages( + new ResearchPage("gadomancy.research_page.ESSENTIA_COMPRESSOR.1"), + new ResearchPage("gadomancy.research_page.ESSENTIA_COMPRESSOR.2"), + new ResearchPage(RegisteredRecipes.recipeElementVoid), + new ResearchPage("gadomancy.research_page.ESSENTIA_COMPRESSOR.4"), + new ResearchPage(RegisteredRecipes.recipeEssentiaCompressor), + new ResearchPage("gadomancy.research_page.ESSENTIA_COMPRESSOR.6"), + new ResearchPage(RegisteredRecipes.multiblockEssentiaCompressor), + new ResearchPage("gadomancy.research_page.ESSENTIA_COMPRESSOR.8"), + new ResearchPage("gadomancy.research_page.ESSENTIA_COMPRESSOR.9")) + .registerResearchItem(); - /*researchAiShutdown = new SimpleResearchItem("AI_SHUTDOWN", - -3, 5, 2, new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 5), - new AspectList().add(Aspect.MIND, 10).add(Aspect.ENTROPY, 20).add(Aspect.AURA, 12).add(Aspect.BEAST, 16).add(Aspect.MECHANISM, 12)) - .setHidden() - .setParents(researchAuraCore.key, "ROD_greatwood") - .setItemTriggers(new ItemStack(RegisteredItems.itemAuraCore, 1, ItemAuraCore.AuraCoreType.EARTH.ordinal())) - .setPages(new ResearchPage("gadomancy.research_page.AI_SHUTDOWN.1"), new ResearchPage(RegisteredRecipes.recipeAiShutdown)) - .registerResearchItem();*/ + /* + * researchAiShutdown = new SimpleResearchItem("AI_SHUTDOWN", -3, 5, 2, new + * ItemStack(RegisteredBlocks.blockStoneMachine, 1, 5), new AspectList().add(Aspect.MIND, + * 10).add(Aspect.ENTROPY, 20).add(Aspect.AURA, 12).add(Aspect.BEAST, 16).add(Aspect.MECHANISM, 12)) + * .setHidden() .setParents(researchAuraCore.key, "ROD_greatwood") .setItemTriggers(new + * ItemStack(RegisteredItems.itemAuraCore, 1, ItemAuraCore.AuraCoreType.EARTH.ordinal())) .setPages(new + * ResearchPage("gadomancy.research_page.AI_SHUTDOWN.1"), new ResearchPage(RegisteredRecipes.recipeAiShutdown)) + * .registerResearchItem(); + */ String[] packagerParents = Config.wardedStone - ? new String[] {RegisteredResearches.researchAuraCore.key, "WARDEDARCANA"} - : new String[] {RegisteredResearches.researchAuraCore.key}; + ? new String[] { RegisteredResearches.researchAuraCore.key, "WARDEDARCANA" } + : new String[] { RegisteredResearches.researchAuraCore.key }; RegisteredResearches.researchArcanePackager = new SimpleResearchItem( - "ARCANE_PACKAGER", - 2, - 7, - 2, - new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 4), - new AspectList() - .add(Aspect.AIR, 12) - .add(Aspect.MECHANISM, 16) - .add(Aspect.VOID, 10) - .add(Aspect.MAGIC, 10)) - .setHidden() - .setParents(packagerParents) - .setItemTriggers( - new ItemStack(RegisteredItems.itemAuraCore, 1, ItemAuraCore.AuraCoreType.AIR.ordinal())) - .setPages( - new ResearchPage("gadomancy.research_page.ARCANE_PACKAGER.1"), - new ResearchPage(RegisteredRecipes.recipeArcanePackager), - new ResearchPage("gadomancy.research_page.ARCANE_PACKAGER.3"), - new ResearchPage("gadomancy.research_page.ARCANE_PACKAGER.4")) - .registerResearchItem(); + "ARCANE_PACKAGER", + 2, + 7, + 2, + new ItemStack(RegisteredBlocks.blockStoneMachine, 1, 4), + new AspectList().add(Aspect.AIR, 12).add(Aspect.MECHANISM, 16).add(Aspect.VOID, 10) + .add(Aspect.MAGIC, 10)).setHidden().setParents(packagerParents).setItemTriggers( + new ItemStack(RegisteredItems.itemAuraCore, 1, ItemAuraCore.AuraCoreType.AIR.ordinal())) + .setPages( + new ResearchPage("gadomancy.research_page.ARCANE_PACKAGER.1"), + new ResearchPage(RegisteredRecipes.recipeArcanePackager), + new ResearchPage("gadomancy.research_page.ARCANE_PACKAGER.3"), + new ResearchPage("gadomancy.research_page.ARCANE_PACKAGER.4")) + .registerResearchItem(); - ResearchItem researchInfusionEnch = - PseudoResearchItem.create("INFUSIONENCHANTMENT", -1, 2).registerResearchItem(); + ResearchItem researchInfusionEnch = PseudoResearchItem.create("INFUSIONENCHANTMENT", -1, 2) + .registerResearchItem(); ItemStack goggles = new ItemStack(ConfigItems.itemGoggles); goggles.addEnchantment(Enchantment.protection, 1); RegisteredResearches.researchRevealer = new SimpleResearchItem( - "REVEALER", - 1, - 3, - 1, - goggles, - new AspectList().add(Aspect.SENSES, 4).add(Aspect.MAGIC, 4)) - .setParents(researchInfusionEnch.key, "GOGGLES") - .setConcealed() - .setPages( - new ResearchPage("gadomancy.research_page.REVEALER.1"), - new ResearchPage(RegisteredRecipes.recipeRevealer)) - .registerResearchItem(); + "REVEALER", + 1, + 3, + 1, + goggles, + new AspectList().add(Aspect.SENSES, 4).add(Aspect.MAGIC, 4)) + .setParents(researchInfusionEnch.key, "GOGGLES").setConcealed() + .setPages( + new ResearchPage("gadomancy.research_page.REVEALER.1"), + new ResearchPage(RegisteredRecipes.recipeRevealer)) + .registerResearchItem(); RegisteredResearches.researchArmorDisguise = new DisguiseResearchItem( - "ARMORDISGUISE", - -2, - 0, - 1, - new AspectList() - .add(Aspect.SLIME, 8) - .add(Aspect.MAGIC, 4) - .add(Aspect.ARMOR, 4)) - .setParents(researchInfusionEnch.key) - .setConcealed() - .setPages( - new ResearchPage("gadomancy.research_page.ARMORDISGUISE.1"), - new ResearchPage(new InfusionVisualDisguiseArmor(false)), - new ResearchPage(new InfusionVisualDisguiseArmor(true)), - new ResearchPage("gadomancy.research_page.ARMORDISGUISE.4")) - .registerResearchItem(); + "ARMORDISGUISE", + -2, + 0, + 1, + new AspectList().add(Aspect.SLIME, 8).add(Aspect.MAGIC, 4).add(Aspect.ARMOR, 4)) + .setParents(researchInfusionEnch.key).setConcealed() + .setPages( + new ResearchPage("gadomancy.research_page.ARMORDISGUISE.1"), + new ResearchPage(new InfusionVisualDisguiseArmor(false)), + new ResearchPage(new InfusionVisualDisguiseArmor(true)), + new ResearchPage("gadomancy.research_page.ARMORDISGUISE.4")) + .registerResearchItem(); // Warpy warpy ThaumcraftApi.addWarpToResearch(Gadomancy.MODID.toUpperCase() + ".NODE_MANIPULATOR", 4); @@ -828,40 +683,33 @@ public class RegisteredResearches { ResearchPage page = new ResearchPage(visualRecipe); RegisteredResearches.researchStickyJar = new StickyJarResearchItem( - "STICKYJAR", - -5, - -5, - 2, - new AspectList().add(Aspect.SLIME, 8).add(Aspect.EARTH, 8)) - .setParents(researchJar.key) - .setConcealed() - .setPages(new ResearchPage("gadomancy.research_page.STICKYJAR.1"), page) - .registerResearchItem(); + "STICKYJAR", + -5, + -5, + 2, + new AspectList().add(Aspect.SLIME, 8).add(Aspect.EARTH, 8)).setParents(researchJar.key).setConcealed() + .setPages(new ResearchPage("gadomancy.research_page.STICKYJAR.1"), page).registerResearchItem(); if (RegisteredResearches.researchBlockProtector != null) { RegisteredResearches.researchBlockProtector.setParents(RegisteredResearches.researchStickyJar.key); } - String[] parents = - Config.allowMirrors ? new String[] {researchJar.key, "MIRRORESSENTIA"} : new String[] {researchJar.key}; + String[] parents = Config.allowMirrors ? new String[] { researchJar.key, "MIRRORESSENTIA" } + : new String[] { researchJar.key }; RegisteredResearches.researchRemoteJar = new SimpleResearchItem( - "REMOTEJAR", - -4, - -3, - 3, - RegisteredRecipes.recipeRemoteJar.getRecipeOutput(), - new AspectList() - .add(Aspect.WATER, 4) - .add(Aspect.MECHANISM, 8) - .add(Aspect.EARTH, 4) - .add(Aspect.ORDER, 8)) - .setParents(parents) - .setConcealed() - .setPages( - new ResearchPage("gadomancy.research_page.REMOTEJAR.1"), - new ResearchPage(RegisteredRecipes.recipeRemoteJar), - new ResearchPage("gadomancy.research_page.REMOTEJAR.2")) - .registerResearchItem(); + "REMOTEJAR", + -4, + -3, + 3, + RegisteredRecipes.recipeRemoteJar.getRecipeOutput(), + new AspectList().add(Aspect.WATER, 4).add(Aspect.MECHANISM, 8).add(Aspect.EARTH, 4) + .add(Aspect.ORDER, 8)) + .setParents(parents).setConcealed() + .setPages( + new ResearchPage("gadomancy.research_page.REMOTEJAR.1"), + new ResearchPage(RegisteredRecipes.recipeRemoteJar), + new ResearchPage("gadomancy.research_page.REMOTEJAR.2")) + .registerResearchItem(); // Aura researches AuraResearchManager.registerAuraResearches(); diff --git a/src/main/java/makeo/gadomancy/common/registration/StickyJarInfo.java b/src/main/java/makeo/gadomancy/common/registration/StickyJarInfo.java index e16f360..1722725 100644 --- a/src/main/java/makeo/gadomancy/common/registration/StickyJarInfo.java +++ b/src/main/java/makeo/gadomancy/common/registration/StickyJarInfo.java @@ -3,14 +3,13 @@ package makeo.gadomancy.common.registration; import net.minecraft.block.Block; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 21.07.2015 02:31 */ public class StickyJarInfo { + private Block block; private int metadata; private boolean needsLabelHandling; diff --git a/src/main/java/makeo/gadomancy/common/research/AlternatingResearchItem.java b/src/main/java/makeo/gadomancy/common/research/AlternatingResearchItem.java index f7dc263..a0c5a1f 100644 --- a/src/main/java/makeo/gadomancy/common/research/AlternatingResearchItem.java +++ b/src/main/java/makeo/gadomancy/common/research/AlternatingResearchItem.java @@ -3,20 +3,22 @@ package makeo.gadomancy.common.research; import java.lang.reflect.Field; import java.util.Arrays; import java.util.List; + import makeo.gadomancy.common.utils.Injector; + import net.minecraft.item.ItemStack; + import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchItem; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 25.07.2015 19:28 */ public class AlternatingResearchItem extends SimpleResearchItem { + private static final Field ICON_FIELD = Injector.getField("icon_item", ResearchItem.class); private final Injector injector = new Injector(this, ResearchItem.class); diff --git a/src/main/java/makeo/gadomancy/common/research/DisguiseResearchItem.java b/src/main/java/makeo/gadomancy/common/research/DisguiseResearchItem.java index 75cbe4b..ea79f26 100644 --- a/src/main/java/makeo/gadomancy/common/research/DisguiseResearchItem.java +++ b/src/main/java/makeo/gadomancy/common/research/DisguiseResearchItem.java @@ -1,21 +1,22 @@ package makeo.gadomancy.common.research; import makeo.gadomancy.common.crafting.InfusionVisualDisguiseArmor; + import net.minecraft.init.Items; import net.minecraft.item.ItemStack; + import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchItem; import thaumcraft.api.research.ResearchPage; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 08.01.2016 22:48 */ public class DisguiseResearchItem extends AlternatingResearchItem { + public DisguiseResearchItem(String key, int col, int row, int complex, AspectList tags) { super(key, col, row, complex, tags, new ItemStack(Items.bread)); } diff --git a/src/main/java/makeo/gadomancy/common/research/IfAnyParentResearchItem.java b/src/main/java/makeo/gadomancy/common/research/IfAnyParentResearchItem.java index 6d848c6..f16d028 100644 --- a/src/main/java/makeo/gadomancy/common/research/IfAnyParentResearchItem.java +++ b/src/main/java/makeo/gadomancy/common/research/IfAnyParentResearchItem.java @@ -1,20 +1,19 @@ package makeo.gadomancy.common.research; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; + import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchCategories; import thaumcraft.api.research.ResearchItem; import thaumcraft.client.gui.GuiResearchBrowser; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 03.01.2016 14:35 */ @@ -43,8 +42,7 @@ public class IfAnyParentResearchItem extends SimpleResearchItem { if (ri != null) { doesAnyExist = true; if (GuiResearchBrowser.completedResearch - .get(Minecraft.getMinecraft().thePlayer.getCommandSenderName()) - .contains(ri.key)) { + .get(Minecraft.getMinecraft().thePlayer.getCommandSenderName()).contains(ri.key)) { hasFoundAny = true; } } diff --git a/src/main/java/makeo/gadomancy/common/research/MultiResearchPage.java b/src/main/java/makeo/gadomancy/common/research/MultiResearchPage.java index 23db5e5..481a724 100644 --- a/src/main/java/makeo/gadomancy/common/research/MultiResearchPage.java +++ b/src/main/java/makeo/gadomancy/common/research/MultiResearchPage.java @@ -2,23 +2,24 @@ package makeo.gadomancy.common.research; import java.util.ArrayList; import java.util.List; + import thaumcraft.api.research.ResearchPage; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 08.12.2015 12:28 */ public class MultiResearchPage extends ResearchPage { + public MultiResearchPage(List... recipes) { super(recipes[0]); this.recipe = new OverrideList(recipes); } private class OverrideList extends ArrayList { + private int recipeIndex = -1; private List[] recipes; diff --git a/src/main/java/makeo/gadomancy/common/research/PseudoResearchItem.java b/src/main/java/makeo/gadomancy/common/research/PseudoResearchItem.java index 11e0b6e..b478e77 100644 --- a/src/main/java/makeo/gadomancy/common/research/PseudoResearchItem.java +++ b/src/main/java/makeo/gadomancy/common/research/PseudoResearchItem.java @@ -1,33 +1,34 @@ package makeo.gadomancy.common.research; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Arrays; + import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; + import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchCategories; import thaumcraft.api.research.ResearchItem; import thaumcraft.api.research.ResearchPage; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 14.06.2015 14:57 */ public class PseudoResearchItem extends SimpleResearchItem { + private static final String PSEUDO_PREFIX = "PSEUDO."; private final ResearchItem original; - private PseudoResearchItem( - ResearchItem original, String key, int col, int row, ResourceLocation icon, boolean doubleThisPage) { + private PseudoResearchItem(ResearchItem original, String key, int col, int row, ResourceLocation icon, + boolean doubleThisPage) { super( PseudoResearchItem.PSEUDO_PREFIX + key + (doubleThisPage ? ".2" : ""), col, @@ -39,8 +40,8 @@ public class PseudoResearchItem extends SimpleResearchItem { this.setStub().setHidden(); } - private PseudoResearchItem( - ResearchItem original, String key, int col, int row, ItemStack icon, boolean doubleThisPage) { + private PseudoResearchItem(ResearchItem original, String key, int col, int row, ItemStack icon, + boolean doubleThisPage) { super( PseudoResearchItem.PSEUDO_PREFIX + key + (doubleThisPage ? ".2" : ""), col, @@ -97,7 +98,7 @@ public class PseudoResearchItem extends SimpleResearchItem { String[] siblings = item.siblings; if (siblings == null) { - siblings = new String[] {pseudo.key}; + siblings = new String[] { pseudo.key }; } else { siblings = Arrays.copyOf(siblings, siblings.length + 1); siblings[siblings.length - 1] = pseudo.key; diff --git a/src/main/java/makeo/gadomancy/common/research/SimpleResearchItem.java b/src/main/java/makeo/gadomancy/common/research/SimpleResearchItem.java index f0b01a3..e25ef90 100644 --- a/src/main/java/makeo/gadomancy/common/research/SimpleResearchItem.java +++ b/src/main/java/makeo/gadomancy/common/research/SimpleResearchItem.java @@ -1,16 +1,16 @@ package makeo.gadomancy.common.research; import makeo.gadomancy.common.Gadomancy; + import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; + import thaumcraft.api.aspects.AspectList; import thaumcraft.api.research.ResearchItem; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 15.06.2015 19:05 */ diff --git a/src/main/java/makeo/gadomancy/common/research/StickyJarResearchItem.java b/src/main/java/makeo/gadomancy/common/research/StickyJarResearchItem.java index bf1f10e..72614e1 100644 --- a/src/main/java/makeo/gadomancy/common/research/StickyJarResearchItem.java +++ b/src/main/java/makeo/gadomancy/common/research/StickyJarResearchItem.java @@ -1,24 +1,26 @@ package makeo.gadomancy.common.research; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.registration.RegisteredItems; + import net.minecraft.client.Minecraft; import net.minecraft.item.ItemStack; + import thaumcraft.api.aspects.AspectList; import thaumcraft.common.config.ConfigBlocks; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 20.12.2015 01:01 */ public class StickyJarResearchItem extends AlternatingResearchItem { + public StickyJarResearchItem(String key, int col, int row, int complex, AspectList tags) { super(key, col, row, complex, tags, new ItemStack(ConfigBlocks.blockJar)); } diff --git a/src/main/java/makeo/gadomancy/common/utils/ColorHelper.java b/src/main/java/makeo/gadomancy/common/utils/ColorHelper.java index f5c3262..499bd19 100644 --- a/src/main/java/makeo/gadomancy/common/utils/ColorHelper.java +++ b/src/main/java/makeo/gadomancy/common/utils/ColorHelper.java @@ -3,14 +3,13 @@ package makeo.gadomancy.common.utils; import java.awt.*; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 13.07.2015 03:50 */ public class ColorHelper { + public static final char COLOR_CHAR = '\u00a7'; private ColorHelper() {} diff --git a/src/main/java/makeo/gadomancy/common/utils/ExplosionHelper.java b/src/main/java/makeo/gadomancy/common/utils/ExplosionHelper.java index dda896e..b3486cd 100644 --- a/src/main/java/makeo/gadomancy/common/utils/ExplosionHelper.java +++ b/src/main/java/makeo/gadomancy/common/utils/ExplosionHelper.java @@ -1,14 +1,15 @@ package makeo.gadomancy.common.utils; -import cpw.mods.fml.common.network.NetworkRegistry; import java.util.ArrayList; import java.util.List; + import makeo.gadomancy.common.blocks.tiles.TileExtendedNode; import makeo.gadomancy.common.network.PacketHandler; import makeo.gadomancy.common.network.packets.PacketAnimationAbsorb; import makeo.gadomancy.common.network.packets.PacketStartAnimation; import makeo.gadomancy.common.network.packets.PacketTCNodeBolt; import makeo.gadomancy.common.registration.RegisteredBlocks; + import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -17,6 +18,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.DamageSource; import net.minecraft.util.Vec3; import net.minecraft.world.World; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; import thaumcraft.common.Thaumcraft; @@ -24,12 +26,11 @@ import thaumcraft.common.config.Config; import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.lib.utils.Utils; import thaumcraft.common.lib.world.ThaumcraftWorldGenerator; +import cpw.mods.fml.common.network.NetworkRegistry; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 25.10.2015 10:17 */ @@ -39,16 +40,8 @@ public class ExplosionHelper { ExplosionHelper.taintplosion(world, x, y, z, taintBiome, chanceToTaint, 3.0F, 10, 80); } - public static void taintplosion( - World world, - int x, - int y, - int z, - boolean taintBiome, - int chanceToTaint, - float str, - int size, - int blocksAffected) { + public static void taintplosion(World world, int x, int y, int z, boolean taintBiome, int chanceToTaint, float str, + int size, int blocksAffected) { if (chanceToTaint < 1) chanceToTaint = 1; world.createExplosion(null, x + 0.5D, y + 0.5D, z + 0.5D, str, false); for (int a = 0; a < blocksAffected; a++) { @@ -99,7 +92,8 @@ public class ExplosionHelper { EntityLivingBase livingEntity = (EntityLivingBase) e; if ((livingEntity.isEntityAlive()) && (!livingEntity.isEntityInvulnerable())) { if (livingEntity instanceof EntityPlayer - && ((EntityPlayer) livingEntity).capabilities.isCreativeMode) continue; + && ((EntityPlayer) livingEntity).capabilities.isCreativeMode) + continue; if (this.world.rand.nextInt(16) != 0) continue; livingEntity.attackEntityFrom(DamageSource.magic, 4F); PacketTCNodeBolt packet = new PacketTCNodeBolt( @@ -114,17 +108,28 @@ public class ExplosionHelper { PacketHandler.INSTANCE.sendToAllAround( packet, new NetworkRegistry.TargetPoint( - this.world.provider.dimensionId, this.x, this.y, this.z, 32.0D)); + this.world.provider.dimensionId, + this.x, + this.y, + this.z, + 32.0D)); } } } if (this.phase < 2 && this.world.rand.nextInt(this.phase == 0 ? 8 : 4) == 0) { - PacketStartAnimation packet = - new PacketStartAnimation(PacketStartAnimation.ID_BURST, this.x, this.y, this.z); + PacketStartAnimation packet = new PacketStartAnimation( + PacketStartAnimation.ID_BURST, + this.x, + this.y, + this.z); PacketHandler.INSTANCE.sendToAllAround( packet, new NetworkRegistry.TargetPoint( - this.world.provider.dimensionId, this.x, this.y, this.z, 32.0D)); + this.world.provider.dimensionId, + this.x, + this.y, + this.z, + 32.0D)); this.world.playSoundEffect(this.x + 0.5, this.y + 0.5, this.z + 0.5, "thaumcraft:ice", 0.8F, 1.0F); } switch (this.phase) { @@ -164,12 +169,22 @@ public class ExplosionHelper { Block b = this.world.getBlock(xx, yy, zz); float hardness = b.getBlockHardness(this.world, xx, yy, zz); if (b != Blocks.air && hardness > 0 && hardness <= 50 && b != RegisteredBlocks.blockNode) { - PacketAnimationAbsorb absorb = - new PacketAnimationAbsorb(this.x, this.y, this.z, xx, yy, zz, 7); + PacketAnimationAbsorb absorb = new PacketAnimationAbsorb( + this.x, + this.y, + this.z, + xx, + yy, + zz, + 7); PacketHandler.INSTANCE.sendToAllAround( absorb, new NetworkRegistry.TargetPoint( - this.world.provider.dimensionId, this.x, this.y, this.z, 32D)); + this.world.provider.dimensionId, + this.x, + this.y, + this.z, + 32D)); this.pastTickBlocks.add(Vec3.createVectorHelper(xx, yy, zz)); } cnt--; @@ -217,8 +232,12 @@ public class ExplosionHelper { private void sendRandomVortexLightningPacket(World world, int x, int y, int z) { PacketStartAnimation animationPacket = new PacketStartAnimation(PacketStartAnimation.ID_EX_VORTEX, x, y, z); - NetworkRegistry.TargetPoint point = - new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D); + NetworkRegistry.TargetPoint point = new NetworkRegistry.TargetPoint( + world.provider.dimensionId, + x, + y, + z, + 32.0D); PacketHandler.INSTANCE.sendToAllAround(animationPacket, point); } diff --git a/src/main/java/makeo/gadomancy/common/utils/GolemEnumHelper.java b/src/main/java/makeo/gadomancy/common/utils/GolemEnumHelper.java index 8cbb321..7ba5d31 100644 --- a/src/main/java/makeo/gadomancy/common/utils/GolemEnumHelper.java +++ b/src/main/java/makeo/gadomancy/common/utils/GolemEnumHelper.java @@ -1,27 +1,29 @@ package makeo.gadomancy.common.utils; -import cpw.mods.fml.relauncher.Side; import java.lang.reflect.Field; import java.util.Arrays; import java.util.HashMap; import java.util.Map; + import makeo.gadomancy.api.GadomancyApi; import makeo.gadomancy.api.golems.AdditionalGolemType; import makeo.gadomancy.client.events.ResourceReloadListener; import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.entities.golems.types.RemovedGolemType; + import net.minecraftforge.common.util.EnumHelper; + import thaumcraft.common.entities.golems.EnumGolemType; +import cpw.mods.fml.relauncher.Side; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 29.07.2015 01:07 */ public class GolemEnumHelper { + private static final RemovedGolemType REMOVED_GOLEM_TYPE = new RemovedGolemType(); private static final Injector INJECTOR = new Injector(EnumGolemType.class); private static final Injector ENUM_INJECTOR = new Injector(Enum.class); @@ -33,9 +35,8 @@ public class GolemEnumHelper { if (GolemEnumHelper.valuesField == null) { for (Field field : EnumGolemType.class.getDeclaredFields()) { String name = field.getName(); - if (name.equals("$VALUES") - || name.equals( - "ENUM$VALUES")) // Added 'ENUM$VALUES' because Eclipse's internal compiler doesn't + if (name.equals("$VALUES") || name.equals("ENUM$VALUES")) // Added 'ENUM$VALUES' because Eclipse's + // internal compiler doesn't // follow standards { GolemEnumHelper.valuesField = field; @@ -47,9 +48,8 @@ public class GolemEnumHelper { return GolemEnumHelper.valuesField; } - private static final Class[] ENUM_PARAMS = { - int.class, int.class, float.class, boolean.class, int.class, int.class, int.class, int.class - }; + private static final Class[] ENUM_PARAMS = { int.class, int.class, float.class, boolean.class, int.class, int.class, + int.class, int.class }; private static Field ordinalField; @@ -57,14 +57,13 @@ public class GolemEnumHelper { if (GolemEnumHelper.ordinalField == null) { try { GolemEnumHelper.ordinalField = Enum.class.getDeclaredField("ordinal"); - } catch (NoSuchFieldException ignored) { - } + } catch (NoSuchFieldException ignored) {} } return GolemEnumHelper.ordinalField; } - private static final Class[] MAKE_ENUM_PARAMS = {Class.class, String.class, int.class, Class[].class, Object[].class - }; + private static final Class[] MAKE_ENUM_PARAMS = { Class.class, String.class, int.class, Class[].class, + Object[].class }; private static EnumGolemType createEnum(String name, int ordinal, AdditionalGolemType type) { return GolemEnumHelper.HELPER_INJECTOR.invokeMethod( @@ -74,16 +73,8 @@ public class GolemEnumHelper { name, ordinal, GolemEnumHelper.ENUM_PARAMS, - new Object[] { - type.maxHealth, - type.armor, - type.movementSpeed, - type.fireResist, - type.upgradeAmount, - type.carryLimit, - type.regenDelay, - type.strength - }); + new Object[] { type.maxHealth, type.armor, type.movementSpeed, type.fireResist, type.upgradeAmount, + type.carryLimit, type.regenDelay, type.strength }); } private static void addEnum(int ordinal, EnumGolemType type) { @@ -116,8 +107,7 @@ public class GolemEnumHelper { private static void setValues(EnumGolemType[] values) { try { EnumHelper.setFailsafeFieldValue(GolemEnumHelper.getValuesField(), null, values); - } catch (Exception ignored) { - } + } catch (Exception ignored) {} } public static EnumGolemType addGolemType(String name, AdditionalGolemType type) { @@ -177,8 +167,8 @@ public class GolemEnumHelper { } private static void resetEnum() { - EnumGolemType[] newValues = - Arrays.copyOfRange(EnumGolemType.values(), 0, GolemEnumHelper.calcDefaultGolemCount()); + EnumGolemType[] newValues = Arrays + .copyOfRange(EnumGolemType.values(), 0, GolemEnumHelper.calcDefaultGolemCount()); GolemEnumHelper.setValues(newValues); } diff --git a/src/main/java/makeo/gadomancy/common/utils/Injector.java b/src/main/java/makeo/gadomancy/common/utils/Injector.java index 5bfcd70..783aafb 100644 --- a/src/main/java/makeo/gadomancy/common/utils/Injector.java +++ b/src/main/java/makeo/gadomancy/common/utils/Injector.java @@ -1,21 +1,21 @@ package makeo.gadomancy.common.utils; -import cpw.mods.fml.relauncher.ReflectionHelper; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Arrays; +import cpw.mods.fml.relauncher.ReflectionHelper; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 02.12.13 18:45 */ public class Injector { + Class clazz; Object object; @@ -67,7 +67,7 @@ public class Injector { } public T invokeConstructor(Class clazz, Object param) { - return this.invokeConstructor(new Class[] {clazz}, param); + return this.invokeConstructor(new Class[] { clazz }, param); } public T invokeConstructor(Class[] classes, Object... params) { @@ -87,7 +87,7 @@ public class Injector { } public T invokeMethod(String name, Class clazz, Object param) { - return this.invokeMethod(name, new Class[] {clazz}, param); + return this.invokeMethod(name, new Class[] { clazz }, param); } public T invokeMethod(String name, Class[] classes, Object... params) { @@ -173,8 +173,7 @@ public class Injector { public static Method findMethod(Class clazz, Class returnType, Class[] paramTypes) { for (Method m : clazz.getDeclaredMethods()) { - if (Arrays.equals(m.getParameterTypes(), paramTypes) - && m.getReturnType().equals(returnType)) { + if (Arrays.equals(m.getParameterTypes(), paramTypes) && m.getReturnType().equals(returnType)) { return m; } } diff --git a/src/main/java/makeo/gadomancy/common/utils/ItemUtils.java b/src/main/java/makeo/gadomancy/common/utils/ItemUtils.java index fe06e93..c860fe2 100644 --- a/src/main/java/makeo/gadomancy/common/utils/ItemUtils.java +++ b/src/main/java/makeo/gadomancy/common/utils/ItemUtils.java @@ -1,13 +1,12 @@ package makeo.gadomancy.common.utils; import java.util.Random; + import net.minecraft.entity.item.EntityItem; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 12.11.2015 23:13 */ diff --git a/src/main/java/makeo/gadomancy/common/utils/MiscUtils.java b/src/main/java/makeo/gadomancy/common/utils/MiscUtils.java index 8ff5f3b..f92768d 100644 --- a/src/main/java/makeo/gadomancy/common/utils/MiscUtils.java +++ b/src/main/java/makeo/gadomancy/common/utils/MiscUtils.java @@ -1,8 +1,8 @@ package makeo.gadomancy.common.utils; -import cpw.mods.fml.common.network.NetworkRegistry; import java.util.ArrayList; import java.util.List; + import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; @@ -13,11 +13,11 @@ import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import net.minecraftforge.common.util.FakePlayer; +import cpw.mods.fml.common.network.NetworkRegistry; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 17.11.2015 18:39 */ @@ -25,8 +25,8 @@ public final class MiscUtils { private MiscUtils() {} - private static final int[] R_NUMBERS = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1}; - private static final String[] R_CHARS = {"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"}; + private static final int[] R_NUMBERS = { 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1 }; + private static final String[] R_CHARS = { "M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I" }; public static String toRomanNumeral(int number) { if (number < 0 || number > 3999) { @@ -82,13 +82,17 @@ public final class MiscUtils { } public static NetworkRegistry.TargetPoint getTargetPoint(World world, TileEntity tileEntity, double range) { - return MiscUtils.getTargetPoint( - world, range, new Vector3(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord)); + return MiscUtils + .getTargetPoint(world, range, new Vector3(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord)); } public static NetworkRegistry.TargetPoint getTargetPoint(World world, double range, Vector3 target) { return new NetworkRegistry.TargetPoint( - world.provider.dimensionId, target.getX(), target.getY(), target.getZ(), range); + world.provider.dimensionId, + target.getX(), + target.getY(), + target.getZ(), + range); } // Nothing to see here. Please move on. @@ -130,10 +134,7 @@ public final class MiscUtils { return true; } if (MinecraftServer.getServer().getConfigurationManager().playerEntityList == null) return true; - return !MinecraftServer.getServer() - .getConfigurationManager() - .playerEntityList - .contains(player); + return !MinecraftServer.getServer().getConfigurationManager().playerEntityList.contains(player); } public static Vector3 getPositionVector(Entity e) { diff --git a/src/main/java/makeo/gadomancy/common/utils/MultiblockHelper.java b/src/main/java/makeo/gadomancy/common/utils/MultiblockHelper.java index 63717c8..e9c8a34 100644 --- a/src/main/java/makeo/gadomancy/common/utils/MultiblockHelper.java +++ b/src/main/java/makeo/gadomancy/common/utils/MultiblockHelper.java @@ -2,21 +2,20 @@ package makeo.gadomancy.common.utils; import java.util.LinkedHashMap; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.world.World; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 27.10.2015 13:56 */ public class MultiblockHelper { - public static boolean isAnyMultiblockPresent( - World world, int x, int y, int z, List patternList) { + public static boolean isAnyMultiblockPresent(World world, int x, int y, int z, + List patternList) { for (MultiblockPattern pattern : patternList) { if (MultiblockHelper.isMultiblockPresent(world, x, y, z, pattern)) return true; } @@ -39,8 +38,8 @@ public class MultiblockHelper { this.put(this.createIntVec3(0, 0, 0), new BlockInfo(originBlock, originMeta)); } - public MultiblockPattern addBlock( - int relativeX, int relativeY, int relativeZ, Block expectedBlock, int expectedMeta) { + public MultiblockPattern addBlock(int relativeX, int relativeY, int relativeZ, Block expectedBlock, + int expectedMeta) { this.put(this.createIntVec3(relativeX, relativeY, relativeZ), new BlockInfo(expectedBlock, expectedMeta)); return this; } @@ -51,6 +50,7 @@ public class MultiblockHelper { } public static class IntVec3 { + public int x, y, z; public IntVec3(int x, int y, int z) { @@ -77,6 +77,7 @@ public class MultiblockHelper { } public static class BlockInfo { + public Block block; public int meta; diff --git a/src/main/java/makeo/gadomancy/common/utils/NBTHelper.java b/src/main/java/makeo/gadomancy/common/utils/NBTHelper.java index df5912f..e1dd7eb 100644 --- a/src/main/java/makeo/gadomancy/common/utils/NBTHelper.java +++ b/src/main/java/makeo/gadomancy/common/utils/NBTHelper.java @@ -1,23 +1,25 @@ package makeo.gadomancy.common.utils; import java.util.UUID; + import makeo.gadomancy.common.Gadomancy; + import net.minecraft.entity.Entity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagCompound; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 05.07.2015 12:45 */ public class NBTHelper { + private NBTHelper() {} public static NBTTagCompound getPersistentData(Entity entity) { diff --git a/src/main/java/makeo/gadomancy/common/utils/PrimalAspectList.java b/src/main/java/makeo/gadomancy/common/utils/PrimalAspectList.java index bd0beab..4dd49c6 100644 --- a/src/main/java/makeo/gadomancy/common/utils/PrimalAspectList.java +++ b/src/main/java/makeo/gadomancy/common/utils/PrimalAspectList.java @@ -5,10 +5,8 @@ import thaumcraft.api.aspects.AspectList; import thaumcraft.common.lib.research.ResearchManager; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 03.12.2015 17:22 */ diff --git a/src/main/java/makeo/gadomancy/common/utils/RandomizedAspectList.java b/src/main/java/makeo/gadomancy/common/utils/RandomizedAspectList.java index 0888e61..852cb40 100644 --- a/src/main/java/makeo/gadomancy/common/utils/RandomizedAspectList.java +++ b/src/main/java/makeo/gadomancy/common/utils/RandomizedAspectList.java @@ -3,14 +3,13 @@ package makeo.gadomancy.common.utils; import java.util.HashMap; import java.util.Map; import java.util.Random; + import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 18.12.2015 13:58 */ diff --git a/src/main/java/makeo/gadomancy/common/utils/ResearchHelper.java b/src/main/java/makeo/gadomancy/common/utils/ResearchHelper.java index f4ce2dc..350388f 100644 --- a/src/main/java/makeo/gadomancy/common/utils/ResearchHelper.java +++ b/src/main/java/makeo/gadomancy/common/utils/ResearchHelper.java @@ -1,19 +1,19 @@ package makeo.gadomancy.common.utils; import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; + import thaumcraft.common.Thaumcraft; import thaumcraft.common.lib.network.playerdata.PacketResearchComplete; import thaumcraft.common.lib.research.ResearchManager; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 30.10.2015 21:23 */ @@ -27,8 +27,8 @@ public class ResearchHelper { EntityPlayer player = (EntityPlayer) pl; if (!ResearchManager.isResearchComplete(player.getCommandSenderName(), research) && ResearchManager.doesPlayerHaveRequisites(player.getCommandSenderName(), research)) { - thaumcraft.common.lib.network.PacketHandler.INSTANCE.sendTo( - new PacketResearchComplete(research), (EntityPlayerMP) player); + thaumcraft.common.lib.network.PacketHandler.INSTANCE + .sendTo(new PacketResearchComplete(research), (EntityPlayerMP) player); Thaumcraft.proxy.getResearchManager().completeResearch(player, research); } } diff --git a/src/main/java/makeo/gadomancy/common/utils/SimpleResourceLocation.java b/src/main/java/makeo/gadomancy/common/utils/SimpleResourceLocation.java index f473175..6a63a51 100644 --- a/src/main/java/makeo/gadomancy/common/utils/SimpleResourceLocation.java +++ b/src/main/java/makeo/gadomancy/common/utils/SimpleResourceLocation.java @@ -1,13 +1,12 @@ package makeo.gadomancy.common.utils; import makeo.gadomancy.common.Gadomancy; + import net.minecraft.util.ResourceLocation; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 21.05.2015 15:13 */ diff --git a/src/main/java/makeo/gadomancy/common/utils/StringHelper.java b/src/main/java/makeo/gadomancy/common/utils/StringHelper.java index 78e9286..822ba00 100644 --- a/src/main/java/makeo/gadomancy/common/utils/StringHelper.java +++ b/src/main/java/makeo/gadomancy/common/utils/StringHelper.java @@ -3,14 +3,13 @@ package makeo.gadomancy.common.utils; import io.netty.buffer.ByteBuf; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 27.07.2015 21:23 */ public class StringHelper { + private StringHelper() {} public static String firstToUpper(String input) { diff --git a/src/main/java/makeo/gadomancy/common/utils/Vector3.java b/src/main/java/makeo/gadomancy/common/utils/Vector3.java index af6ecbf..c3271fc 100644 --- a/src/main/java/makeo/gadomancy/common/utils/Vector3.java +++ b/src/main/java/makeo/gadomancy/common/utils/Vector3.java @@ -3,14 +3,13 @@ package makeo.gadomancy.common.utils; import java.util.Formatter; import java.util.Locale; import java.util.Random; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.Vec3; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 17.11.2015 18:40 */ @@ -243,8 +242,9 @@ public class Vector3 { public ChunkCoordinates getAsFloatCC() { return new ChunkCoordinates( - Float.floatToIntBits((float) this.x), Float.floatToIntBits((float) this.y), Float.floatToIntBits((float) - this.z)); + Float.floatToIntBits((float) this.x), + Float.floatToIntBits((float) this.y), + Float.floatToIntBits((float) this.z)); } public static Vector3 getFromFloatCC(ChunkCoordinates cc) { @@ -252,8 +252,7 @@ public class Vector3 { } public boolean isInAABB(Vector3 min, Vector3 max) { - return (this.x >= min.x) - && (this.x <= max.x) + return (this.x >= min.x) && (this.x <= max.x) && (this.y >= min.y) && (this.y <= max.y) && (this.z >= min.z) @@ -346,8 +345,7 @@ public class Vector3 { } Vector3 other = (Vector3) obj; - return (Math.abs(this.x - other.x) < 1.0E-006D) - && (Math.abs(this.y - other.y) < 1.0E-006D) + return (Math.abs(this.x - other.x) < 1.0E-006D) && (Math.abs(this.y - other.y) < 1.0E-006D) && (Math.abs(this.z - other.z) < 1.0E-006D) && (this.getClass().equals(obj.getClass())); } diff --git a/src/main/java/makeo/gadomancy/common/utils/WandHandler.java b/src/main/java/makeo/gadomancy/common/utils/WandHandler.java index 2fd85ed..e918d2c 100644 --- a/src/main/java/makeo/gadomancy/common/utils/WandHandler.java +++ b/src/main/java/makeo/gadomancy/common/utils/WandHandler.java @@ -1,8 +1,8 @@ package makeo.gadomancy.common.utils; -import cpw.mods.fml.common.network.NetworkRegistry; import java.util.Iterator; import java.util.List; + import makeo.gadomancy.common.Gadomancy; import makeo.gadomancy.common.blocks.tiles.TileExtendedNode; import makeo.gadomancy.common.blocks.tiles.TileExtendedNodeJar; @@ -15,6 +15,7 @@ import makeo.gadomancy.common.node.ExtendedNodeType; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.registration.RegisteredIntegrations; import makeo.gadomancy.common.registration.RegisteredRecipes; + import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; @@ -26,6 +27,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; + import thaumcraft.api.ThaumcraftApiHelper; import thaumcraft.api.aspects.Aspect; import thaumcraft.api.aspects.AspectList; @@ -38,12 +40,11 @@ import thaumcraft.common.lib.research.ResearchManager; import thaumcraft.common.tiles.TileJarNode; import thaumcraft.common.tiles.TileOwned; import thaumcraft.common.tiles.TileWarded; +import cpw.mods.fml.common.network.NetworkRegistry; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 24.10.2015 18:09 */ @@ -69,7 +70,8 @@ public class WandHandler { if (target.equals(ConfigBlocks.blockCrystal)) { if (ResearchManager.isResearchComplete( - entityPlayer.getCommandSenderName(), Gadomancy.MODID.toUpperCase() + ".AURA_CORE")) + entityPlayer.getCommandSenderName(), + Gadomancy.MODID.toUpperCase() + ".AURA_CORE")) WandHandler.tryAuraCoreCreation(i, entityPlayer, world, x, y, z); } } @@ -79,19 +81,17 @@ public class WandHandler { List items = world.getEntitiesWithinAABB( EntityItem.class, - AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1) - .expand( - EntityAuraCore.CLUSTER_RANGE, - EntityAuraCore.CLUSTER_RANGE, - EntityAuraCore.CLUSTER_RANGE)); + AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand( + EntityAuraCore.CLUSTER_RANGE, + EntityAuraCore.CLUSTER_RANGE, + EntityAuraCore.CLUSTER_RANGE)); Iterator it = items.iterator(); EntityItem itemAuraCore = null; while (itemAuraCore == null && it.hasNext()) { Object item = it.next(); if (item != null && item instanceof EntityItem && !((EntityItem) item).isDead) { EntityItem entityItem = (EntityItem) item; - if (entityItem.getEntityItem() != null - && entityItem.getEntityItem().getItem() != null + if (entityItem.getEntityItem() != null && entityItem.getEntityItem().getItem() != null && entityItem.getEntityItem().getItem() instanceof ItemAuraCore && !(item instanceof EntityAuraCore)) { if (((ItemAuraCore) entityItem.getEntityItem().getItem()).isBlank(entityItem.getEntityItem())) @@ -107,38 +107,42 @@ public class WandHandler { Aspect[] aspects; switch (meta) { case 0: - aspects = new Aspect[] {Aspect.AIR}; + aspects = new Aspect[] { Aspect.AIR }; break; case 1: - aspects = new Aspect[] {Aspect.FIRE}; + aspects = new Aspect[] { Aspect.FIRE }; break; case 2: - aspects = new Aspect[] {Aspect.WATER}; + aspects = new Aspect[] { Aspect.WATER }; break; case 3: - aspects = new Aspect[] {Aspect.EARTH}; + aspects = new Aspect[] { Aspect.EARTH }; break; case 4: - aspects = new Aspect[] {Aspect.ORDER}; + aspects = new Aspect[] { Aspect.ORDER }; break; case 5: - aspects = new Aspect[] {Aspect.ENTROPY}; + aspects = new Aspect[] { Aspect.ENTROPY }; break; case 6: - aspects = new Aspect[] { - Aspect.AIR, Aspect.FIRE, Aspect.EARTH, Aspect.WATER, Aspect.ORDER, Aspect.ENTROPY - }; + aspects = new Aspect[] { Aspect.AIR, Aspect.FIRE, Aspect.EARTH, Aspect.WATER, Aspect.ORDER, + Aspect.ENTROPY }; break; default: return; } if (!ThaumcraftApiHelper.consumeVisFromWandCrafting( - i, entityPlayer, (AspectList) RegisteredRecipes.auraCoreRecipes[meta].get(0), true)) return; + i, + entityPlayer, + (AspectList) RegisteredRecipes.auraCoreRecipes[meta].get(0), + true)) + return; PacketStartAnimation packet = new PacketStartAnimation(PacketStartAnimation.ID_BURST, x, y, z); PacketHandler.INSTANCE.sendToAllAround( - packet, new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D)); + packet, + new NetworkRegistry.TargetPoint(world.provider.dimensionId, x, y, z, 32.0D)); world.createExplosion(null, x + 0.5D, y + 0.5D, z + 0.5D, 1.5F, false); world.setBlockToAir(x, y, z); @@ -160,9 +164,10 @@ public class WandHandler { } } - private static void tryTCJarNodeCreation( - ItemStack wandStack, EntityPlayer player, World world, int x, int y, int z) { + private static void tryTCJarNodeCreation(ItemStack wandStack, EntityPlayer player, World world, int x, int y, + int z) { WandHandler.JarPieceEvaluationRunnable slabRunnable = new WandHandler.JarPieceEvaluationRunnable() { + @Override public boolean isValidPieceAt(World world, int absX, int absY, int absZ, EntityPlayer player) { Block block = world.getBlock(absX, absY, absZ); @@ -171,20 +176,22 @@ public class WandHandler { } }; WandHandler.JarPieceEvaluationRunnable glassRunnable = new WandHandler.JarPieceEvaluationRunnable() { + @Override public boolean isValidPieceAt(World world, int absX, int absY, int absZ, EntityPlayer player) { return world.getBlock(absX, absY, absZ) == Blocks.glass; } }; WandHandler.JarPieceEvaluationRunnable nodeRunnable = new WandHandler.JarPieceEvaluationRunnable() { + @Override public boolean isValidPieceAt(World world, int absX, int absY, int absZ, EntityPlayer player) { TileEntity tile = world.getTileEntity(absX, absY, absZ); return (tile != null) && (tile instanceof INode) && ((!(tile instanceof TileJarNode))); } }; - int[] result = WandHandler.evaluateIfValidJarIsPresent( - world, x, y, z, player, slabRunnable, glassRunnable, nodeRunnable); + int[] result = WandHandler + .evaluateIfValidJarIsPresent(world, x, y, z, player, slabRunnable, glassRunnable, nodeRunnable); if (result == null) { return; @@ -193,22 +200,19 @@ public class WandHandler { if (!ThaumcraftApiHelper.consumeVisFromWandCrafting( wandStack, player, - new AspectList() - .add(Aspect.FIRE, 70) - .add(Aspect.EARTH, 70) - .add(Aspect.ORDER, 70) - .add(Aspect.AIR, 70) - .add(Aspect.ENTROPY, 70) - .add(Aspect.WATER, 70), - true)) return; + new AspectList().add(Aspect.FIRE, 70).add(Aspect.EARTH, 70).add(Aspect.ORDER, 70).add(Aspect.AIR, 70) + .add(Aspect.ENTROPY, 70).add(Aspect.WATER, 70), + true)) + return; if (world.isRemote) return; WandHandler.replaceJar(world, result[0], result[1], result[2], true); } - private static void tryAutomagyJarNodeCreation( - ItemStack wandStack, EntityPlayer player, World world, int x, int y, int z) { + private static void tryAutomagyJarNodeCreation(ItemStack wandStack, EntityPlayer player, World world, int x, int y, + int z) { WandHandler.JarPieceEvaluationRunnable silverWoodRunnable = new WandHandler.JarPieceEvaluationRunnable() { + @Override public boolean isValidPieceAt(World world, int absX, int absY, int absZ, EntityPlayer player) { TileEntity te = world.getTileEntity(absX, absY, absZ); @@ -223,6 +227,7 @@ public class WandHandler { } }; WandHandler.JarPieceEvaluationRunnable glassRunnable = new WandHandler.JarPieceEvaluationRunnable() { + @Override public boolean isValidPieceAt(World world, int absX, int absY, int absZ, EntityPlayer player) { if ((world.getBlock(absX, absY, absZ) == ConfigBlocks.blockCosmeticOpaque) @@ -236,14 +241,15 @@ public class WandHandler { } }; WandHandler.JarPieceEvaluationRunnable nodeRunnable = new WandHandler.JarPieceEvaluationRunnable() { + @Override public boolean isValidPieceAt(World world, int absX, int absY, int absZ, EntityPlayer player) { TileEntity tile = world.getTileEntity(absX, absY, absZ); return (tile != null) && (tile instanceof INode) && ((!(tile instanceof TileJarNode))); } }; - int[] result = WandHandler.evaluateIfValidJarIsPresent( - world, x, y, z, player, silverWoodRunnable, glassRunnable, nodeRunnable); + int[] result = WandHandler + .evaluateIfValidJarIsPresent(world, x, y, z, player, silverWoodRunnable, glassRunnable, nodeRunnable); if (result == null) { return; @@ -267,21 +273,15 @@ public class WandHandler { return false; } - private static int[] evaluateIfValidJarIsPresent( - World world, - int x, - int y, - int z, - EntityPlayer player, - JarPieceEvaluationRunnable topRunnable, - JarPieceEvaluationRunnable glassRunnable, + private static int[] evaluateIfValidJarIsPresent(World world, int x, int y, int z, EntityPlayer player, + JarPieceEvaluationRunnable topRunnable, JarPieceEvaluationRunnable glassRunnable, JarPieceEvaluationRunnable centerRunnable) { for (int xx = x - 2; xx <= x; xx++) { for (int yy = y - 3; yy <= y; yy++) { for (int zz = z - 2; zz <= z; zz++) { - if (WandHandler.isValidJarAt( - world, xx, yy, zz, player, topRunnable, glassRunnable, centerRunnable)) { - return new int[] {xx, yy, zz}; + if (WandHandler + .isValidJarAt(world, xx, yy, zz, player, topRunnable, glassRunnable, centerRunnable)) { + return new int[] { xx, yy, zz }; } } } @@ -289,21 +289,11 @@ public class WandHandler { return null; } - private static boolean isValidJarAt( - World world, - int x, - int y, - int z, - EntityPlayer player, - JarPieceEvaluationRunnable topRunnable, - JarPieceEvaluationRunnable glassRunnable, + private static boolean isValidJarAt(World world, int x, int y, int z, EntityPlayer player, + JarPieceEvaluationRunnable topRunnable, JarPieceEvaluationRunnable glassRunnable, JarPieceEvaluationRunnable centerRunnable) { - int[][][] blueprint = { - {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}}, - {{2, 2, 2}, {2, 2, 2}, {2, 2, 2}}, - {{2, 2, 2}, {2, 3, 2}, {2, 2, 2}}, - {{2, 2, 2}, {2, 2, 2}, {2, 2, 2}} - }; + int[][][] blueprint = { { { 1, 1, 1 }, { 1, 1, 1 }, { 1, 1, 1 } }, { { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 } }, + { { 2, 2, 2 }, { 2, 3, 2 }, { 2, 2, 2 } }, { { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 } } }; for (int yy = 0; yy < 4; yy++) { for (int xx = 0; xx < 3; xx++) { for (int zz = 0; zz < 3; zz++) { @@ -324,12 +314,8 @@ public class WandHandler { } private static void replaceJar(World world, int x, int y, int z, boolean isThaumcraft) { - int[][][] blueprint = { - {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}}, - {{2, 2, 2}, {2, 2, 2}, {2, 2, 2}}, - {{2, 2, 2}, {2, 3, 2}, {2, 2, 2}}, - {{2, 2, 2}, {2, 2, 2}, {2, 2, 2}} - }; + int[][][] blueprint = { { { 1, 1, 1 }, { 1, 1, 1 }, { 1, 1, 1 } }, { { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 } }, + { { 2, 2, 2 }, { 2, 3, 2 }, { 2, 2, 2 } }, { { 2, 2, 2 }, { 2, 2, 2 }, { 2, 2, 2 } } }; for (int yy = 0; yy < 4; yy++) { for (int xx = 0; xx < 3; xx++) { for (int zz = 0; zz < 3; zz++) { diff --git a/src/main/java/makeo/gadomancy/common/utils/world/ChunkProviderTCOuter.java b/src/main/java/makeo/gadomancy/common/utils/world/ChunkProviderTCOuter.java index 2e7f8e7..a45138b 100644 --- a/src/main/java/makeo/gadomancy/common/utils/world/ChunkProviderTCOuter.java +++ b/src/main/java/makeo/gadomancy/common/utils/world/ChunkProviderTCOuter.java @@ -2,8 +2,10 @@ package makeo.gadomancy.common.utils.world; import java.util.Iterator; import java.util.List; + import makeo.gadomancy.common.blocks.tiles.TileOverrideEldritchLock; import makeo.gadomancy.common.utils.world.fake.FakeWorldTCGeneration; + import net.minecraft.block.Block; import net.minecraft.entity.EnumCreatureType; import net.minecraft.nbt.NBTTagCompound; @@ -19,6 +21,7 @@ import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.PopulateChunkEvent; + import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.entities.EntityPermanentItem; import thaumcraft.common.entities.monster.EntityEldritchGuardian; @@ -29,10 +32,8 @@ import thaumcraft.common.tiles.TileEldritchLock; import thaumcraft.common.tiles.TileEldritchNothing; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 06.11.2015 23:39 */ @@ -96,28 +97,48 @@ public class ChunkProviderTCOuter implements IChunkProvider { if (te.xCoord >> 4 != x || te.zCoord >> 4 != z) continue; ChunkPosition pos = new ChunkPosition(te.xCoord & 15, te.yCoord, te.zCoord & 15); if (!chunk.chunkTileEntityMap.containsKey(pos)) { - System.out.println("INVALID TE at: " + te.xCoord + ", " + te.yCoord + ", " + te.zCoord - + " --- Not found in its parent chunk " + chunk.xPosition + ", " + chunk.zPosition); + System.out.println( + "INVALID TE at: " + te.xCoord + + ", " + + te.yCoord + + ", " + + te.zCoord + + " --- Not found in its parent chunk " + + chunk.xPosition + + ", " + + chunk.zPosition); throw new IllegalStateException("INVALID TE"); } TileEntity correspondingTE = (TileEntity) chunk.chunkTileEntityMap.get(pos); if (te instanceof TileEntityMobSpawner) { if (!(correspondingTE instanceof TileEntityMobSpawner)) { - System.out.println("DATA INCONSISTENCY - TE at " + te.xCoord + ", " + te.yCoord + ", " - + te.zCoord + " EXPECTED: " + te.getClass().getSimpleName() + " GIVEN " - + correspondingTE.getClass().getSimpleName()); + System.out.println( + "DATA INCONSISTENCY - TE at " + te.xCoord + + ", " + + te.yCoord + + ", " + + te.zCoord + + " EXPECTED: " + + te.getClass().getSimpleName() + + " GIVEN " + + correspondingTE.getClass().getSimpleName()); throw new IllegalStateException(); } - ((TileEntityMobSpawner) correspondingTE) - .func_145881_a() - .setEntityName( - ((TileEntityMobSpawner) te).func_145881_a().getEntityNameToSpawn()); + ((TileEntityMobSpawner) correspondingTE).func_145881_a() + .setEntityName(((TileEntityMobSpawner) te).func_145881_a().getEntityNameToSpawn()); } else if (te instanceof TileEldritchLock) { if (!(correspondingTE instanceof TileEldritchLock)) { - System.out.println("DATA INCONSISTENCY - TE at " + te.xCoord + ", " + te.yCoord + ", " - + te.zCoord + " EXPECTED: " + te.getClass().getSimpleName() + " GIVEN " - + correspondingTE.getClass().getSimpleName()); + System.out.println( + "DATA INCONSISTENCY - TE at " + te.xCoord + + ", " + + te.yCoord + + ", " + + te.zCoord + + " EXPECTED: " + + te.getClass().getSimpleName() + + " GIVEN " + + correspondingTE.getClass().getSimpleName()); throw new IllegalStateException(); } @@ -127,18 +148,32 @@ public class ChunkProviderTCOuter implements IChunkProvider { ((TileEldritchLock) correspondingTE).readCustomNBT(compound); } else if (te instanceof TileCrystal) { if (!(correspondingTE instanceof TileCrystal)) { - System.out.println("DATA INCONSISTENCY - TE at " + te.xCoord + ", " + te.yCoord + ", " - + te.zCoord + " EXPECTED: " + te.getClass().getSimpleName() + " GIVEN " - + correspondingTE.getClass().getSimpleName()); + System.out.println( + "DATA INCONSISTENCY - TE at " + te.xCoord + + ", " + + te.yCoord + + ", " + + te.zCoord + + " EXPECTED: " + + te.getClass().getSimpleName() + + " GIVEN " + + correspondingTE.getClass().getSimpleName()); throw new IllegalStateException(); } ((TileCrystal) correspondingTE).orientation = ((TileCrystal) te).orientation; } else if (te instanceof TileEldritchCrabSpawner) { if (!(correspondingTE instanceof TileEldritchCrabSpawner)) { - System.out.println("DATA INCONSISTENCY - TE at " + te.xCoord + ", " + te.yCoord + ", " - + te.zCoord + " EXPECTED: " + te.getClass().getSimpleName() + " GIVEN " - + correspondingTE.getClass().getSimpleName()); + System.out.println( + "DATA INCONSISTENCY - TE at " + te.xCoord + + ", " + + te.yCoord + + ", " + + te.zCoord + + " EXPECTED: " + + te.getClass().getSimpleName() + + " GIVEN " + + correspondingTE.getClass().getSimpleName()); throw new IllegalStateException(); } @@ -147,9 +182,16 @@ public class ChunkProviderTCOuter implements IChunkProvider { ((TileEldritchCrabSpawner) correspondingTE).readCustomNBT(compound); } else if (te instanceof TileEldritchNothing) { if (!(correspondingTE instanceof TileEldritchNothing)) { - System.out.println("DATA INCONSISTENCY - TE at " + te.xCoord + ", " + te.yCoord + ", " - + te.zCoord + " EXPECTED: " + te.getClass().getSimpleName() + " GIVEN " - + correspondingTE.getClass().getSimpleName()); + System.out.println( + "DATA INCONSISTENCY - TE at " + te.xCoord + + ", " + + te.yCoord + + ", " + + te.zCoord + + " EXPECTED: " + + te.getClass().getSimpleName() + + " GIVEN " + + correspondingTE.getClass().getSimpleName()); throw new IllegalStateException(); } } else { @@ -218,16 +260,28 @@ public class ChunkProviderTCOuter implements IChunkProvider { public void populate(IChunkProvider p_73153_1_, int p_73153_2_, int p_73153_3_) { net.minecraft.block.BlockFalling.fallInstantly = true; - MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Pre( - p_73153_1_, this.worldObj, this.worldObj.rand, p_73153_2_, p_73153_3_, false)); + MinecraftForge.EVENT_BUS.post( + new PopulateChunkEvent.Pre( + p_73153_1_, + this.worldObj, + this.worldObj.rand, + p_73153_2_, + p_73153_3_, + false)); int k = p_73153_2_ * 16; int l = p_73153_3_ * 16; BiomeGenBase biomegenbase = this.worldObj.getBiomeGenForCoords(k + 16, l + 16); biomegenbase.decorate(this.worldObj, this.worldObj.rand, k, l); - MinecraftForge.EVENT_BUS.post(new PopulateChunkEvent.Post( - p_73153_1_, this.worldObj, this.worldObj.rand, p_73153_2_, p_73153_3_, false)); + MinecraftForge.EVENT_BUS.post( + new PopulateChunkEvent.Post( + p_73153_1_, + this.worldObj, + this.worldObj.rand, + p_73153_2_, + p_73153_3_, + false)); net.minecraft.block.BlockFalling.fallInstantly = false; } @@ -254,8 +308,8 @@ public class ChunkProviderTCOuter implements IChunkProvider { return biomegenbase.getSpawnableList(p_73155_1_); } - public ChunkPosition func_147416_a( - World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, int p_147416_5_) { + public ChunkPosition func_147416_a(World p_147416_1_, String p_147416_2_, int p_147416_3_, int p_147416_4_, + int p_147416_5_) { return null; } diff --git a/src/main/java/makeo/gadomancy/common/utils/world/TCMazeHandler.java b/src/main/java/makeo/gadomancy/common/utils/world/TCMazeHandler.java index 6127117..4a86cb2 100644 --- a/src/main/java/makeo/gadomancy/common/utils/world/TCMazeHandler.java +++ b/src/main/java/makeo/gadomancy/common/utils/world/TCMazeHandler.java @@ -2,10 +2,12 @@ package makeo.gadomancy.common.utils.world; import java.util.*; import java.util.concurrent.ConcurrentHashMap; + import makeo.gadomancy.common.blocks.tiles.TileAdditionalEldritchPortal; import makeo.gadomancy.common.data.config.ModConfig; import makeo.gadomancy.common.registration.RegisteredBlocks; import makeo.gadomancy.common.utils.world.fake.FakeWorldTCGeneration; + import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -14,6 +16,7 @@ import net.minecraft.util.*; import net.minecraft.world.EnumSkyBlock; import net.minecraft.world.WorldServer; import net.minecraftforge.common.DimensionManager; + import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.lib.world.dim.CellLoc; import thaumcraft.common.lib.world.dim.GenCommon; @@ -21,10 +24,8 @@ import thaumcraft.common.lib.world.dim.MazeHandler; import thaumcraft.common.lib.world.dim.MazeThread; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 05.11.2015 10:40 */ @@ -72,14 +73,13 @@ public class TCMazeHandler { player.setPositionAndUpdate(cc.posX + 0.5, y, cc.posZ + 0.5); } } - Iterator> it = - TCMazeHandler.runningSessions.entrySet().iterator(); + Iterator> it = TCMazeHandler.runningSessions.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = it.next(); EntityPlayer player = entry.getKey(); - if (player.worldObj.provider.dimensionId - != ModConfig - .dimOuterId) { // If the player left our dim, but he should still be in the session, ... + if (player.worldObj.provider.dimensionId != ModConfig.dimOuterId) { // If the player left our dim, but + // he should still be in the + // session, ... // We close the session. entry.getValue().closeSession(false); it.remove(); @@ -96,12 +96,15 @@ public class TCMazeHandler { world.setBlock(lX, 52, lZ, ConfigBlocks.blockEldritch, 3, 3); world.setBlock(lX, 53, lZ, RegisteredBlocks.blockAdditionalEldrichPortal); GenCommon.genObelisk(world, lX, 54, lZ); - session.player.addChatMessage(new ChatComponentText(EnumChatFormatting.ITALIC + "" + EnumChatFormatting.GRAY - + StatCollector.translateToLocal("gadomancy.eldritch.portalSpawned"))); + session.player.addChatMessage( + new ChatComponentText( + EnumChatFormatting.ITALIC + "" + + EnumChatFormatting.GRAY + + StatCollector.translateToLocal("gadomancy.eldritch.portalSpawned"))); } /* - * Coordinates wanted here are the absolute Portal coordinates. + * Coordinates wanted here are the absolute Portal coordinates. */ public static boolean createSessionWaitForTeleport(EntityPlayer player) { if (TCMazeHandler.hasOpenSession(player) || !TCMazeHandler.hasFreeSessionSpace()) return false; @@ -125,8 +128,8 @@ public class TCMazeHandler { private static Map calculateCellLocs(WorldServer world) { ConcurrentHashMap oldDat = MazeHandler.labyrinth; - ConcurrentHashMap bufferOld = - new ConcurrentHashMap(TCMazeHandler.labyrinthCopy); + ConcurrentHashMap bufferOld = new ConcurrentHashMap( + TCMazeHandler.labyrinthCopy); MazeHandler.labyrinth = TCMazeHandler.labyrinthCopy; int chX = TCMazeHandler.getHighestPossibleRandWH(); // To ensure we're always +x and +z int chZ = TCMazeHandler.getHighestPossibleRandWH(); @@ -144,8 +147,8 @@ public class TCMazeHandler { } private static Map calculateDifferences(ConcurrentHashMap bufferOld) { - ConcurrentHashMap newDat = - MazeHandler.labyrinth; // Only the new data has data, the old one doesn't have. + ConcurrentHashMap newDat = MazeHandler.labyrinth; // Only the new data has data, the old one + // doesn't have. Map newlyEvaluatedMaze = new HashMap(); for (CellLoc loc : newDat.keySet()) { if (!bufferOld.containsKey(loc)) { @@ -160,7 +163,7 @@ public class TCMazeHandler { } /* - Change getHighestPossibleRandWH accordingly if modifying this. + * Change getHighestPossibleRandWH accordingly if modifying this. */ private static int randWH(Random random) { return 17 + random.nextInt(2) * 2; @@ -211,10 +214,8 @@ public class TCMazeHandler { } if ((TCMazeHandler.tickCounter & 15) == 0) { - Iterator> iterator = - TCMazeHandler.watchedBosses.entrySet().iterator(); - labelWhile: - while (iterator.hasNext()) { + Iterator> iterator = TCMazeHandler.watchedBosses.entrySet().iterator(); + labelWhile: while (iterator.hasNext()) { Map.Entry entry = iterator.next(); TCMazeSession session = entry.getKey(); Entity[] bosses = entry.getValue(); @@ -246,8 +247,8 @@ public class TCMazeHandler { private final int originDimId; private final Vec3 originLocation; - public MazeBuilderThread( - EntityPlayerMP player, Map chunksAffected, int originDimId, Vec3 originLocation) { + public MazeBuilderThread(EntityPlayerMP player, Map chunksAffected, int originDimId, + Vec3 originLocation) { this.player = player; this.chunksAffected = chunksAffected; this.originDimId = originDimId; @@ -269,8 +270,8 @@ public class TCMazeHandler { for (int cX = 0; cX < 16; cX++) { for (int cY = 51; cY < 61; cY++) { for (int cZ = 0; cZ < 16; cZ++) { - TCMazeHandler.GEN.updateLightByType( - EnumSkyBlock.Block, (l.x << 4) + cX, cY, (l.z << 4) + cZ); + TCMazeHandler.GEN + .updateLightByType(EnumSkyBlock.Block, (l.x << 4) + cX, cY, (l.z << 4) + cZ); } } } @@ -282,8 +283,11 @@ public class TCMazeHandler { private void finishBuild() { TileAdditionalEldritchPortal.informSessionStart(this.player); - TCMazeSession session = - new TCMazeSession(this.player, this.chunksAffected, this.originDimId, this.originLocation); + TCMazeSession session = new TCMazeSession( + this.player, + this.chunksAffected, + this.originDimId, + this.originLocation); TCMazeHandler.flagSessionForStart(session); } } diff --git a/src/main/java/makeo/gadomancy/common/utils/world/TCMazeSession.java b/src/main/java/makeo/gadomancy/common/utils/world/TCMazeSession.java index 28db658..aa2a904 100644 --- a/src/main/java/makeo/gadomancy/common/utils/world/TCMazeSession.java +++ b/src/main/java/makeo/gadomancy/common/utils/world/TCMazeSession.java @@ -1,7 +1,9 @@ package makeo.gadomancy.common.utils.world; import java.util.Map; + import makeo.gadomancy.common.data.config.ModConfig; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.server.MinecraftServer; @@ -11,16 +13,16 @@ import net.minecraft.util.Vec3; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.WorldServer; import net.minecraft.world.chunk.Chunk; + import org.apache.logging.log4j.LogManager; + import thaumcraft.common.Thaumcraft; import thaumcraft.common.lib.world.dim.Cell; import thaumcraft.common.lib.world.dim.CellLoc; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 05.11.2015 14:12 */ @@ -65,7 +67,9 @@ public class TCMazeSession { if (teleport) { WorldUtil.tryTeleportBack(this.player, this.originDimId); this.player.setPositionAndUpdate( - this.originLocation.xCoord, this.originLocation.yCoord, this.originLocation.zCoord); + this.originLocation.xCoord, + this.originLocation.yCoord, + this.originLocation.zCoord); } } @@ -82,13 +86,14 @@ public class TCMazeSession { } if (this.portalCell == null) { - LogManager.getLogger() - .error( - "Thaumcraft didn't generate a portal! Stopping instance! PLEASE REPORT THIS ERROR!", - new IllegalStateException()); + LogManager.getLogger().error( + "Thaumcraft didn't generate a portal! Stopping instance! PLEASE REPORT THIS ERROR!", + new IllegalStateException()); this.closeSession(false); - this.player.addChatMessage(new ChatComponentText(EnumChatFormatting.RED - + "Thaumcraft didn't generate a portal in the Eldritch dimension. Sorry, we can't teleport you..")); + this.player.addChatMessage( + new ChatComponentText( + EnumChatFormatting.RED + + "Thaumcraft didn't generate a portal in the Eldritch dimension. Sorry, we can't teleport you..")); } else { WorldUtil.teleportToFakeOuter(this.player); int x = this.portalCell.x * 16 + 8; diff --git a/src/main/java/makeo/gadomancy/common/utils/world/TeleporterNothing.java b/src/main/java/makeo/gadomancy/common/utils/world/TeleporterNothing.java index d976183..9c53bdf 100644 --- a/src/main/java/makeo/gadomancy/common/utils/world/TeleporterNothing.java +++ b/src/main/java/makeo/gadomancy/common/utils/world/TeleporterNothing.java @@ -5,10 +5,8 @@ import net.minecraft.world.Teleporter; import net.minecraft.world.WorldServer; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 05.11.2015 13:57 */ @@ -22,12 +20,12 @@ public class TeleporterNothing extends Teleporter { public void removeStalePortalLocations(long p_85189_1_) {} @Override - public void placeInPortal( - Entity p_77185_1_, double p_77185_2_, double p_77185_4_, double p_77185_6_, float p_77185_8_) {} + public void placeInPortal(Entity p_77185_1_, double p_77185_2_, double p_77185_4_, double p_77185_6_, + float p_77185_8_) {} @Override - public boolean placeInExistingPortal( - Entity p_77184_1_, double p_77184_2_, double p_77184_4_, double p_77184_6_, float p_77184_8_) { + public boolean placeInExistingPortal(Entity p_77184_1_, double p_77184_2_, double p_77184_4_, double p_77184_6_, + float p_77184_8_) { return true; } diff --git a/src/main/java/makeo/gadomancy/common/utils/world/WorldProviderTCEldrich.java b/src/main/java/makeo/gadomancy/common/utils/world/WorldProviderTCEldrich.java index da305dd..2366c09 100644 --- a/src/main/java/makeo/gadomancy/common/utils/world/WorldProviderTCEldrich.java +++ b/src/main/java/makeo/gadomancy/common/utils/world/WorldProviderTCEldrich.java @@ -1,8 +1,7 @@ package makeo.gadomancy.common.utils.world; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import makeo.gadomancy.common.data.config.ModConfig; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.MathHelper; import net.minecraft.util.Vec3; @@ -10,13 +9,14 @@ import net.minecraft.world.WorldProvider; import net.minecraft.world.biome.WorldChunkManagerHell; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; + import thaumcraft.common.lib.world.ThaumcraftWorldGenerator; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by HellFirePvP @ 03.11.2015 19:02 */ diff --git a/src/main/java/makeo/gadomancy/common/utils/world/WorldUtil.java b/src/main/java/makeo/gadomancy/common/utils/world/WorldUtil.java index 7ba0d46..67589ba 100644 --- a/src/main/java/makeo/gadomancy/common/utils/world/WorldUtil.java +++ b/src/main/java/makeo/gadomancy/common/utils/world/WorldUtil.java @@ -1,15 +1,15 @@ package makeo.gadomancy.common.utils.world; -import cpw.mods.fml.common.FMLCommonHandler; import makeo.gadomancy.common.data.config.ModConfig; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.server.MinecraftServer; +import cpw.mods.fml.common.FMLCommonHandler; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 05.11.2015 14:01 */ @@ -21,11 +21,10 @@ public class WorldUtil { mServer.getConfigurationManager() .transferPlayerToDimension(player, 0, new TeleporterNothing(mServer.worldServerForDimension(0))); } - mServer.getConfigurationManager() - .transferPlayerToDimension( - player, - ModConfig.dimOuterId, - new TeleporterNothing(mServer.worldServerForDimension(ModConfig.dimOuterId))); + mServer.getConfigurationManager().transferPlayerToDimension( + player, + ModConfig.dimOuterId, + new TeleporterNothing(mServer.worldServerForDimension(ModConfig.dimOuterId))); } public static void tryTeleportBack(EntityPlayerMP player, int dim) { diff --git a/src/main/java/makeo/gadomancy/common/utils/world/fake/FakeWorld.java b/src/main/java/makeo/gadomancy/common/utils/world/fake/FakeWorld.java index b2635b7..3f11d40 100644 --- a/src/main/java/makeo/gadomancy/common/utils/world/fake/FakeWorld.java +++ b/src/main/java/makeo/gadomancy/common/utils/world/fake/FakeWorld.java @@ -1,6 +1,7 @@ package makeo.gadomancy.common.utils.world.fake; import java.io.File; + import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; @@ -14,10 +15,8 @@ import net.minecraft.world.storage.ISaveHandler; import net.minecraft.world.storage.WorldInfo; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by makeo @ 16.10.2015 22:15 */ @@ -65,10 +64,12 @@ public class FakeWorld extends World { } private static class FakeWorldInfo extends WorldInfo { + private static FakeWorldInfo instance = new FakeWorldInfo(); } private static class FakeWorldProvider extends WorldProvider { + private static FakeWorldProvider instance = new FakeWorldProvider(); @Override @@ -78,6 +79,7 @@ public class FakeWorld extends World { } private static class FakeSaveHandler implements ISaveHandler { + private static FakeSaveHandler instance = new FakeSaveHandler(); @Override diff --git a/src/main/java/makeo/gadomancy/common/utils/world/fake/FakeWorldTCGeneration.java b/src/main/java/makeo/gadomancy/common/utils/world/fake/FakeWorldTCGeneration.java index fdbf99c..ba4d360 100644 --- a/src/main/java/makeo/gadomancy/common/utils/world/fake/FakeWorldTCGeneration.java +++ b/src/main/java/makeo/gadomancy/common/utils/world/fake/FakeWorldTCGeneration.java @@ -4,7 +4,9 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; + import makeo.gadomancy.common.data.config.ModConfig; + import net.minecraft.block.Block; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; @@ -16,15 +18,14 @@ import net.minecraft.world.World; import net.minecraft.world.WorldProvider; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.util.ForgeDirection; + import thaumcraft.common.config.ConfigBlocks; import thaumcraft.common.entities.EntityPermanentItem; import thaumcraft.common.entities.monster.EntityEldritchGuardian; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file * * Created by HellFirePvP @ 08.11.2015 21:57 */ @@ -58,15 +59,13 @@ public class FakeWorldTCGeneration extends FakeWorld { this.gettedTE.remove(cc); } - /*if(block == ConfigBlocks.blockEldritchNothing) { - if(BlockUtils.isBlockExposed(this, x, y, z)) { - meta = 1; - } - }*/ + /* + * if(block == ConfigBlocks.blockEldritchNothing) { if(BlockUtils.isBlockExposed(this, x, y, z)) { meta = 1; } } + */ buf.blockData[key] = block; buf.metaBuffer[key] = (byte) meta; - if (block.hasTileEntity(meta)) buf.tiles.add(new Integer[] {x, y, z, key}); + if (block.hasTileEntity(meta)) buf.tiles.add(new Integer[] { x, y, z, key }); return true; } @@ -123,6 +122,7 @@ public class FakeWorldTCGeneration extends FakeWorld { } private static class FakeChunk extends Chunk { + private ChunkBuffer buf; public FakeChunk(World world, int x, int z, ChunkBuffer buf) { @@ -181,8 +181,8 @@ public class FakeWorldTCGeneration extends FakeWorld { } @Override - public void markTileEntityChunkModified( - int p_147476_1_, int p_147476_2_, int p_147476_3_, TileEntity p_147476_4_) {} + public void markTileEntityChunkModified(int p_147476_1_, int p_147476_2_, int p_147476_3_, + TileEntity p_147476_4_) {} @Override public void func_147453_f(int p_147453_1_, int p_147453_2_, int p_147453_3_, Block p_147453_4_) {} @@ -190,15 +190,20 @@ public class FakeWorldTCGeneration extends FakeWorld { @Override public boolean spawnEntityInWorld(Entity entity) { if (entity instanceof EntityPermanentItem) { - this.bufferedEntities.add(new EntityPermItem( - entity.posX, entity.posY, entity.posZ, ((EntityPermanentItem) entity).getEntityItem())); + this.bufferedEntities.add( + new EntityPermItem( + entity.posX, + entity.posY, + entity.posZ, + ((EntityPermanentItem) entity).getEntityItem())); } else if (entity instanceof EntityEldritchGuardian) { - this.bufferedEntities.add(new EntityGuardianBuf( - ((EntityEldritchGuardian) entity).getHomePosition(), - entity.posX, - entity.posY, - entity.posZ, - ((EntityEldritchGuardian) entity).func_110174_bM())); + this.bufferedEntities.add( + new EntityGuardianBuf( + ((EntityEldritchGuardian) entity).getHomePosition(), + entity.posX, + entity.posY, + entity.posZ, + ((EntityEldritchGuardian) entity).func_110174_bM())); } return true; } @@ -245,6 +250,7 @@ public class FakeWorldTCGeneration extends FakeWorld { } public static class ChunkBuffer { + private long key; public Block[] blockData = new Block[32768]; public byte[] metaBuffer = new byte[32768]; @@ -270,6 +276,7 @@ public class FakeWorldTCGeneration extends FakeWorld { } public static class ChunkMap extends HashMap { + @Override public ChunkBuffer get(Object key) { if (!this.containsKey(key)) { @@ -280,6 +287,7 @@ public class FakeWorldTCGeneration extends FakeWorld { } public static class TCFakeWorldProvider extends WorldProvider { + private static TCFakeWorldProvider instance; static { diff --git a/src/main/java/makeo/gadomancy/coremod/GadomancyCore.java b/src/main/java/makeo/gadomancy/coremod/GadomancyCore.java index 805466e..8c2a2e7 100644 --- a/src/main/java/makeo/gadomancy/coremod/GadomancyCore.java +++ b/src/main/java/makeo/gadomancy/coremod/GadomancyCore.java @@ -1,22 +1,22 @@ package makeo.gadomancy.coremod; +import java.util.Map; + import cpw.mods.fml.relauncher.IFMLCallHook; import cpw.mods.fml.relauncher.IFMLLoadingPlugin; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.MCVersion; import cpw.mods.fml.relauncher.IFMLLoadingPlugin.TransformerExclusions; -import java.util.Map; /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 07.12.2015 21:17 */ @TransformerExclusions("makeo.gadomancy.coremod") @MCVersion("1.7.10") public class GadomancyCore implements IFMLLoadingPlugin, IFMLCallHook { + @Override public Void call() throws Exception { return null; diff --git a/src/main/java/makeo/gadomancy/coremod/GadomancyTransformer.java b/src/main/java/makeo/gadomancy/coremod/GadomancyTransformer.java index dbed499..dee9492 100644 --- a/src/main/java/makeo/gadomancy/coremod/GadomancyTransformer.java +++ b/src/main/java/makeo/gadomancy/coremod/GadomancyTransformer.java @@ -1,18 +1,18 @@ package makeo.gadomancy.coremod; -import cpw.mods.fml.common.FMLLog; -import cpw.mods.fml.common.asm.transformers.AccessTransformer; import java.io.IOException; + import org.objectweb.asm.ClassReader; import org.objectweb.asm.ClassWriter; import org.objectweb.asm.Opcodes; import org.objectweb.asm.tree.*; +import cpw.mods.fml.common.FMLLog; +import cpw.mods.fml.common.asm.transformers.AccessTransformer; + /** - * This class is part of the Gadomancy Mod - * Gadomancy is Open Source and distributed under the - * GNU LESSER GENERAL PUBLIC LICENSE - * for more read the LICENSE file + * This class is part of the Gadomancy Mod Gadomancy is Open Source and distributed under the GNU LESSER GENERAL PUBLIC + * LICENSE for more read the LICENSE file *

* Created by makeo @ 07.12.2015 21:48 */ @@ -49,12 +49,13 @@ public class GadomancyTransformer extends AccessTransformer { mn.instructions = new InsnList(); mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 0)); - mn.instructions.add(new MethodInsnNode( - Opcodes.INVOKESTATIC, - "makeo/gadomancy/common/events/EventHandlerRedirect", - "getFortuneLevel", - "(Lnet/minecraft/entity/EntityLivingBase;)I", - false)); + mn.instructions.add( + new MethodInsnNode( + Opcodes.INVOKESTATIC, + "makeo/gadomancy/common/events/EventHandlerRedirect", + "getFortuneLevel", + "(Lnet/minecraft/entity/EntityLivingBase;)I", + false)); mn.instructions.add(new InsnNode(Opcodes.IRETURN)); } else if (mn.name.equals("getEnchantmentLevel") || mn.name.equals("func_77506_a")) { @@ -62,12 +63,13 @@ public class GadomancyTransformer extends AccessTransformer { mn.instructions.add(new VarInsnNode(Opcodes.ILOAD, 0)); mn.instructions.add(new VarInsnNode(Opcodes.ALOAD, 1)); - mn.instructions.add(new MethodInsnNode( - Opcodes.INVOKESTATIC, - "makeo/gadomancy/common/events/EventHandlerRedirect", - "onGetEnchantmentLevel", - "(ILnet/minecraft/item/ItemStack;)I", - false)); + mn.instructions.add( + new MethodInsnNode( + Opcodes.INVOKESTATIC, + "makeo/gadomancy/common/events/EventHandlerRedirect", + "onGetEnchantmentLevel", + "(ILnet/minecraft/item/ItemStack;)I", + false)); mn.instructions.add(new InsnNode(Opcodes.IRETURN)); } } @@ -79,12 +81,13 @@ public class GadomancyTransformer extends AccessTransformer { updateTotal.add(new VarInsnNode(Opcodes.ALOAD, 0)); updateTotal.add(new VarInsnNode(Opcodes.ALOAD, 1)); updateTotal.add(new VarInsnNode(Opcodes.ILOAD, 2)); - updateTotal.add(new MethodInsnNode( - Opcodes.INVOKESTATIC, - "makeo/gadomancy/common/events/EventHandlerRedirect", - "getAdditionalVisDiscount", - "(Lnet/minecraft/entity/player/EntityPlayer;Lthaumcraft/api/aspects/Aspect;I)I", - false)); + updateTotal.add( + new MethodInsnNode( + Opcodes.INVOKESTATIC, + "makeo/gadomancy/common/events/EventHandlerRedirect", + "getAdditionalVisDiscount", + "(Lnet/minecraft/entity/player/EntityPlayer;Lthaumcraft/api/aspects/Aspect;I)I", + false)); mn.instructions.insertBefore(mn.instructions.get(mn.instructions.size() - 5), updateTotal); } @@ -94,12 +97,13 @@ public class GadomancyTransformer extends AccessTransformer { if (mn.name.equals("renderTileEntityAt")) { InsnList setBefore = new InsnList(); setBefore.add(new VarInsnNode(Opcodes.ALOAD, 1)); - setBefore.add(new MethodInsnNode( - Opcodes.INVOKESTATIC, - "makeo/gadomancy/common/events/EventHandlerRedirect", - "preNodeRender", - "(Lnet/minecraft/tileentity/TileEntity;)V", - false)); + setBefore.add( + new MethodInsnNode( + Opcodes.INVOKESTATIC, + "makeo/gadomancy/common/events/EventHandlerRedirect", + "preNodeRender", + "(Lnet/minecraft/tileentity/TileEntity;)V", + false)); mn.instructions.insertBefore(mn.instructions.get(0), setBefore); @@ -111,12 +115,13 @@ public class GadomancyTransformer extends AccessTransformer { if (insnNode.getOpcode() == Opcodes.RETURN) { InsnList setAfter = new InsnList(); setAfter.add(new VarInsnNode(Opcodes.ALOAD, 1)); - setAfter.add(new MethodInsnNode( - Opcodes.INVOKESTATIC, - "makeo/gadomancy/common/events/EventHandlerRedirect", - "postNodeRender", - "(Lnet/minecraft/tileentity/TileEntity;)V", - false)); + setAfter.add( + new MethodInsnNode( + Opcodes.INVOKESTATIC, + "makeo/gadomancy/common/events/EventHandlerRedirect", + "postNodeRender", + "(Lnet/minecraft/tileentity/TileEntity;)V", + false)); mn.instructions.insertBefore(insnNode, setAfter); } } @@ -127,12 +132,13 @@ public class GadomancyTransformer extends AccessTransformer { if (mn.name.equals("blockHighlight")) { InsnList setBefore = new InsnList(); setBefore.add(new VarInsnNode(Opcodes.ALOAD, 1)); - setBefore.add(new MethodInsnNode( - Opcodes.INVOKESTATIC, - "makeo/gadomancy/common/events/EventHandlerRedirect", - "preBlockHighlight", - "(Lnet/minecraftforge/client/event/DrawBlockHighlightEvent;)V", - false)); + setBefore.add( + new MethodInsnNode( + Opcodes.INVOKESTATIC, + "makeo/gadomancy/common/events/EventHandlerRedirect", + "preBlockHighlight", + "(Lnet/minecraftforge/client/event/DrawBlockHighlightEvent;)V", + false)); mn.instructions.insertBefore(mn.instructions.get(0), setBefore); @@ -144,12 +150,13 @@ public class GadomancyTransformer extends AccessTransformer { if (insnNode.getOpcode() == Opcodes.RETURN) { InsnList setAfter = new InsnList(); setAfter.add(new VarInsnNode(Opcodes.ALOAD, 1)); - setAfter.add(new MethodInsnNode( - Opcodes.INVOKESTATIC, - "makeo/gadomancy/common/events/EventHandlerRedirect", - "postBlockHighlight", - "(Lnet/minecraftforge/client/event/DrawBlockHighlightEvent;)V", - false)); + setAfter.add( + new MethodInsnNode( + Opcodes.INVOKESTATIC, + "makeo/gadomancy/common/events/EventHandlerRedirect", + "postBlockHighlight", + "(Lnet/minecraftforge/client/event/DrawBlockHighlightEvent;)V", + false)); mn.instructions.insertBefore(insnNode, setAfter); } } @@ -160,12 +167,13 @@ public class GadomancyTransformer extends AccessTransformer { if (mn.name.equals("updateItemList")) { InsnList newInstructions = new InsnList(); newInstructions.add(new VarInsnNode(Opcodes.ALOAD, 0)); - newInstructions.add(new MethodInsnNode( - Opcodes.INVOKESTATIC, - "makeo/gadomancy/common/integration/IntegrationNEI", - "checkItems", - "(Ljava/util/ArrayList;)V", - false)); + newInstructions.add( + new MethodInsnNode( + Opcodes.INVOKESTATIC, + "makeo/gadomancy/common/integration/IntegrationNEI", + "checkItems", + "(Ljava/util/ArrayList;)V", + false)); newInstructions.add(mn.instructions); mn.instructions = newInstructions; }