diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000..d48bed8 --- /dev/null +++ b/.clang-format @@ -0,0 +1,130 @@ +--- +AccessModifierOffset: 0 +AlignAfterOpenBracket: BlockIndent +AlignArrayOfStructures: None +AlignConsecutiveAssignments: None +AlignConsecutiveMacros: None +AlignConsecutiveBitFields: None +AlignConsecutiveDeclarations: None +AlignEscapedNewlines: DontAlign +AlignOperands: DontAlign +AlignTrailingComments: false +AllowAllArgumentsOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: Empty +AllowShortCaseLabelsOnASingleLine: false +AllowShortEnumsOnASingleLine: false +AllowShortFunctionsOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: All +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: MultiLine +AttributeMacros: [] +BinPackArguments: false +BinPackParameters: false +BitFieldColonSpacing: After +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: Never + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + BeforeLambdaBody: false + BeforeWhile: false + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false +BreakAfterJavaFieldAnnotations: true +#BreakArrays: false +BreakBeforeBinaryOperators: All +BreakBeforeBraces: Custom +BreakBeforeConceptDeclarations: true +BreakBeforeTernaryOperators: true +BreakConstructorInitializers: AfterColon +BreakInheritanceList: AfterColon +BreakStringLiterals: true +ColumnLimit: 90 +CompactNamespaces: false +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: false +DeriveLineEnding: false +DerivePointerAlignment: false +DisableFormat: false # wtf +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: Always +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: false +ForEachMacros: ["BOOST_FOREACH"] +IfMacros: [] +IncludeBlocks: Regroup +IndentAccessModifiers: false +IndentCaseBlocks: false +IndentCaseLabels: true +IndentExternBlock: Indent +IndentGotoLabels: true +IndentPPDirectives: BeforeHash +#IndentRequiresClause: false +IndentWidth: 4 +IndentWrappedFunctionNames: false +#InsertBraces: false +InsertTrailingCommas: Wrapped +JavaImportGroups: ["java"] +JavaScriptQuotes: Double +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: false +LambdaBodyIndentation: OuterScope +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: All +PackConstructorInitializers: NextLine +PointerAlignment: Left +QualifierAlignment: Left +ReferenceAlignment: Left +ReflowComments: true +#RemoveSemicolon: true +#RequiresClausePosition: OwnLine +#RequiresExpressionIndentation: OuterScope +SeparateDefinitionBlocks: Always +SortIncludes: CaseInsensitive +SortJavaStaticImport: Before +SortUsingDeclarations: true +SpaceAfterCStyleCast: true +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: false +SpaceAroundPointerQualifiers: After +SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: false +SpaceBeforeInheritanceColon: false +SpaceBeforeParens: ControlStatementsExceptControlMacros +SpaceBeforeRangeBasedForLoopColon: true +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesInAngles: Never +SpacesInCStyleCastParentheses: false +SpacesInConditionalStatement: false +SpacesInContainerLiterals: false +SpacesInLineCommentPrefix: + Minimum: 0 + Maximum: -1 +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: c++20 +StatementAttributeLikeMacros: [] +StatementMacros: [] +TabWidth: 4 +TypenameMacros: [] +UseCRLF: false # wtf +UseTab: Never +WhitespaceSensitiveMacros: ["BOOST_PP_STRINGSIZE"] diff --git a/.gitignore b/.gitignore index 8d16946..bbc8ac8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +.project +.classpath +bin +.settings .gradle .idea build diff --git a/build.gradle b/build.gradle index 585fd0f..1a042a4 100644 --- a/build.gradle +++ b/build.gradle @@ -24,20 +24,26 @@ sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 version = "1.0" -group= "modgroup" -archivesBaseName = "modid" +group = "net.anvilcraft" +archivesBaseName = "arcaneseals" minecraft { version = "1.7.10-10.13.4.1614-1.7.10" runDir = "run" + + replaceIn "net/anvilcraft/arcaneseals/ArcaneSeals.java" + replace "@VERSION@", project.version } repositories { maven { url = "https://maven.tilera.xyz" } + maven { url = "https://jitpack.io" } } dependencies { - + implementation "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:deobf" + implementation "dev.tilera:auracore:1.0.0-SNAPSHOT:deobf" + implementation "com.github.tox1cozZ:mixin-booter-legacy:1.1.2" } processResources { @@ -85,4 +91,4 @@ publishing { mavenLocal() } } -} \ No newline at end of file +} diff --git a/src/main/java/net/anvilcraft/arcaneseals/ASBlocks.java b/src/main/java/net/anvilcraft/arcaneseals/ASBlocks.java new file mode 100644 index 0000000..0199257 --- /dev/null +++ b/src/main/java/net/anvilcraft/arcaneseals/ASBlocks.java @@ -0,0 +1,16 @@ +package net.anvilcraft.arcaneseals; + +import cpw.mods.fml.common.registry.GameRegistry; +import net.anvilcraft.arcaneseals.blocks.BlockSeal; +import net.anvilcraft.arcaneseals.items.ItemSeal; +import net.minecraft.block.Block; + +public class ASBlocks { + public static Block seal; + + static void init() { + seal = new BlockSeal(); + + GameRegistry.registerBlock(seal, ItemSeal.class, "seal"); + } +} diff --git a/src/main/java/net/anvilcraft/arcaneseals/ASItems.java b/src/main/java/net/anvilcraft/arcaneseals/ASItems.java new file mode 100644 index 0000000..dff1aea --- /dev/null +++ b/src/main/java/net/anvilcraft/arcaneseals/ASItems.java @@ -0,0 +1,15 @@ +package net.anvilcraft.arcaneseals; + +import cpw.mods.fml.common.registry.GameRegistry; +import net.anvilcraft.arcaneseals.items.ItemRunicEssence; +import net.minecraft.item.Item; + +public class ASItems { + public static Item runicEssence; + + static void init() { + runicEssence = new ItemRunicEssence(); + + GameRegistry.registerItem(runicEssence, "runicEssence"); + } +} diff --git a/src/main/java/net/anvilcraft/arcaneseals/ArcaneSeals.java b/src/main/java/net/anvilcraft/arcaneseals/ArcaneSeals.java new file mode 100644 index 0000000..9dd77f6 --- /dev/null +++ b/src/main/java/net/anvilcraft/arcaneseals/ArcaneSeals.java @@ -0,0 +1,28 @@ +package net.anvilcraft.arcaneseals; + +import cpw.mods.fml.common.Mod; +import cpw.mods.fml.common.SidedProxy; +import cpw.mods.fml.common.event.FMLPreInitializationEvent; + +@Mod( + modid = "arcaneseals", + name = "Arcane Seals", + version = "@VERSION@", + dependencies = "required-after:auracore;required-after:Thaumcraft" +) +public class ArcaneSeals { + @SidedProxy( + modId = "arcaneseals", + serverSide = "net.anvilcraft.arcaneseals.CommonProxy", + clientSide = "net.anvilcraft.arcaneseals.ClientProxy" + ) + public static CommonProxy proxy; + + @Mod.EventHandler + public void preInit(FMLPreInitializationEvent ev) { + ASBlocks.init(); + ASItems.init(); + + proxy.registerTileEntities(); + } +} diff --git a/src/main/java/net/anvilcraft/arcaneseals/ArcaneSealsTab.java b/src/main/java/net/anvilcraft/arcaneseals/ArcaneSealsTab.java new file mode 100644 index 0000000..24167a8 --- /dev/null +++ b/src/main/java/net/anvilcraft/arcaneseals/ArcaneSealsTab.java @@ -0,0 +1,17 @@ +package net.anvilcraft.arcaneseals; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; + +public class ArcaneSealsTab extends CreativeTabs { + public static final ArcaneSealsTab INSTANCE = new ArcaneSealsTab(); + + public ArcaneSealsTab() { + super("arcaneseals"); + } + + @Override + public Item getTabIconItem() { + return Item.getItemFromBlock(ASBlocks.seal); + } +} diff --git a/src/main/java/net/anvilcraft/arcaneseals/ClientProxy.java b/src/main/java/net/anvilcraft/arcaneseals/ClientProxy.java new file mode 100644 index 0000000..6ebfa2f --- /dev/null +++ b/src/main/java/net/anvilcraft/arcaneseals/ClientProxy.java @@ -0,0 +1,12 @@ +package net.anvilcraft.arcaneseals; + +import cpw.mods.fml.client.registry.ClientRegistry; +import net.anvilcraft.arcaneseals.render.TileSealRenderer; +import net.anvilcraft.arcaneseals.tiles.TileSeal; + +public class ClientProxy extends CommonProxy { + @Override + public void registerTileEntities() { + ClientRegistry.registerTileEntity(TileSeal.class, "seal", new TileSealRenderer()); + } +} diff --git a/src/main/java/net/anvilcraft/arcaneseals/CommonProxy.java b/src/main/java/net/anvilcraft/arcaneseals/CommonProxy.java new file mode 100644 index 0000000..c889aef --- /dev/null +++ b/src/main/java/net/anvilcraft/arcaneseals/CommonProxy.java @@ -0,0 +1,10 @@ +package net.anvilcraft.arcaneseals; + +import cpw.mods.fml.common.registry.GameRegistry; +import net.anvilcraft.arcaneseals.tiles.TileSeal; + +public class CommonProxy { + public void registerTileEntities() { + GameRegistry.registerTileEntity(TileSeal.class, "seal"); + } +} diff --git a/src/main/java/net/anvilcraft/arcaneseals/blocks/BlockSeal.java b/src/main/java/net/anvilcraft/arcaneseals/blocks/BlockSeal.java new file mode 100644 index 0000000..f7cccea --- /dev/null +++ b/src/main/java/net/anvilcraft/arcaneseals/blocks/BlockSeal.java @@ -0,0 +1,263 @@ +package net.anvilcraft.arcaneseals.blocks; + +import net.anvilcraft.arcaneseals.ArcaneSealsTab; +import net.anvilcraft.arcaneseals.tiles.TileSeal; +import net.minecraft.block.Block; +import net.minecraft.block.BlockContainer; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + +public class BlockSeal extends BlockContainer { + public BlockSeal() { + super(Material.rock); + this.setHardness(0.5F); + this.setResistance(15.0F); + this.setStepSound(Block.soundTypeStone); + this.setBlockName("arcaneseals:seal"); + this.setCreativeTab(ArcaneSealsTab.INSTANCE); + } + + @Override + public void registerBlockIcons(IIconRegister ir) { + // TODO: add texture for this + this.blockIcon = ir.registerIcon("arcaneseals:seal"); + } + + @Override + public boolean onBlockActivated( + World world, + int i, + int j, + int k, + EntityPlayer entityplayer, + // useless parameters + int alec1, + float alec2, + float alec3, + float alec4 + ) { + TileEntity te = world.getTileEntity(i, j, k); + if (te != null && ((TileSeal) te).runes[0] == 0 + && ((TileSeal) te).runes[1] == 1) { + ++((TileSeal) te).portalWindow; + world.playSoundEffect( + (double) i + 0.5, + (double) j + 0.5, + (double) k + 0.5, + "arcaneseals:pclose", + 0.2F, + 1.0F + world.rand.nextFloat() * 0.2F + ); + return true; + } + return false; + } + + @Override + public int getRenderType() { + return -1; + } + + @Override + public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) { + TileEntity te = world.getTileEntity(x, y, z); + int l = 1; + if (te != null && te instanceof TileSeal) { + l = ((TileSeal) te).orientation; + } + + float thickness = 0.0625F; + if (l == 0) { + this.setBlockBounds(0.3F, 1.0F - thickness, 0.3F, 0.7F, 1.0F, 0.7F); + } + + if (l == 1) { + this.setBlockBounds(0.3F, 0.0F, 0.3F, 0.7F, thickness, 0.7F); + } + + if (l == 2) { + this.setBlockBounds(0.3F, 0.3F, 1.0F - thickness, 0.7F, 0.7F, 1.0F); + } + + if (l == 3) { + this.setBlockBounds(0.3F, 0.3F, 0.0F, 0.7F, 0.7F, thickness); + } + + if (l == 4) { + this.setBlockBounds(1.0F - thickness, 0.3F, 0.3F, 1.0F, 0.7F, 0.7F); + } + + if (l == 5) { + this.setBlockBounds(0.0F, 0.3F, 0.3F, thickness, 0.7F, 0.7F); + } + } + + @Override + public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) { + return new TileSeal(); + } + + @Override + public TileEntity createTileEntity(World world, int metadata) { + return this.createNewTileEntity(world, metadata); + } + + @Override + public void setBlockBoundsForItemRender() { + this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); + } + + @Override + public boolean + isSideSolid(IBlockAccess world, int i, int j, int k, ForgeDirection side) { + //int md = world.getBlockMetadata(i, j, k); + //return md != 0 && md != 3 && md != 4 && md != 7; + return false; + } + + @Override + public boolean canPlaceBlockOnSide(World world, int i, int j, int k, int l) { + if (l == 0 && world.isSideSolid(i, j + 1, k, ForgeDirection.DOWN)) { + return true; + } else if (l == 1 && world.isSideSolid(i, j - 1, k, ForgeDirection.UP)) { + return true; + } else if (l == 2 && world.isSideSolid(i, j, k + 1, ForgeDirection.NORTH)) { + return true; + } else if (l == 3 && world.isSideSolid(i, j, k - 1, ForgeDirection.SOUTH)) { + return true; + } else if (l == 4 && world.isSideSolid(i + 1, j, k, ForgeDirection.EAST)) { + return true; + } else { + return l == 5 && world.isSideSolid(i - 1, j, k, ForgeDirection.WEST); + } + } + + @Override + public boolean canPlaceBlockAt(World world, int i, int j, int k) { + if (world.isSideSolid(i - 1, j, k, ForgeDirection.EAST)) { + return true; + } else if (world.isSideSolid(i + 1, j, k, ForgeDirection.WEST)) { + return true; + } else if (world.isSideSolid(i, j, k - 1, ForgeDirection.SOUTH)) { + return true; + } else if (world.isSideSolid(i, j, k + 1, ForgeDirection.NORTH)) { + return true; + } else { + return world.isSideSolid(i, j - 1, k, ForgeDirection.UP) + ? true + : world.isSideSolid(i, j + 1, k, ForgeDirection.DOWN); + } + } + + @Override + public void onPostBlockPlaced( + World world, + int x, + int y, + int z, + int l + ) { + int orientation = -1; + if (world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN)) { + orientation = 0; + } else if (world.isSideSolid(x, y - 1, z, ForgeDirection.UP)) { + orientation = 1; + } else if (world.isSideSolid(x, y, z + 1, ForgeDirection.NORTH)) { + orientation = 2; + } else if (world.isSideSolid(x, y, z - 1, ForgeDirection.SOUTH)) { + orientation = 3; + } else if (world.isSideSolid(x + 1, y, z, ForgeDirection.WEST)) { + orientation = 4; + } else if (world.isSideSolid(x - 1, y, z, ForgeDirection.EAST)) { + orientation = 5; + } + + TileSeal ts = (TileSeal) world.getTileEntity(x, y, z); + ts.orientation = (short) orientation; + } + + @Override + public boolean canProvidePower() { + return true; + } + + @Override + public int + isProvidingStrongPower(IBlockAccess iblockaccess, int i, int j, int k, int meta) { + TileSeal ts = (TileSeal) iblockaccess.getTileEntity(i, j, k); + if (ts != null) { + return ts.isPowering ? 15 : 0; + } + + return 0; + } + + @Override + public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int meta) { + return this.isProvidingStrongPower(world, x, y, z, meta); + } + + private boolean checkIfAttachedToBlock(World world, int i, int j, int k) { + if (!this.canPlaceBlockAt(world, i, j, k)) { + this.dropBlockAsItem(world, i, j, k, world.getBlockMetadata(i, j, k), 0); + world.setBlockToAir(i, j, k); + return false; + } else { + return true; + } + } + + @Override + public void onNeighborBlockChange(World world, int i, int j, int k, Block l) { + super.onNeighborBlockChange(world, i, j, k, l); + if (this.checkIfAttachedToBlock(world, i, j, k)) { + TileSeal tes = (TileSeal) world.getTileEntity(i, j, k); + if (tes != null) { + int i1 = tes.orientation; + boolean flag = false; + if (!world.isSideSolid(i - 1, j, k, ForgeDirection.EAST) && i1 == 5) { + flag = true; + } + + if (!world.isSideSolid(i + 1, j, k, ForgeDirection.WEST) && i1 == 4) { + flag = true; + } + + if (!world.isSideSolid(i, j, k - 1, ForgeDirection.SOUTH) && i1 == 3) { + flag = true; + } + + if (!world.isSideSolid(i, j, k + 1, ForgeDirection.NORTH) && i1 == 2) { + flag = true; + } + + if (!world.isSideSolid(i, j - 1, k, ForgeDirection.UP) && i1 == 1) { + flag = true; + } + + if (!world.isSideSolid(i, j + 1, k, ForgeDirection.DOWN) && i1 == 0) { + flag = true; + } + + if (flag) { + world.setBlockToAir(i, j, k); + } + } + } + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } +} diff --git a/src/main/java/net/anvilcraft/arcaneseals/items/ItemRunicEssence.java b/src/main/java/net/anvilcraft/arcaneseals/items/ItemRunicEssence.java new file mode 100644 index 0000000..7887f62 --- /dev/null +++ b/src/main/java/net/anvilcraft/arcaneseals/items/ItemRunicEssence.java @@ -0,0 +1,112 @@ +package net.anvilcraft.arcaneseals.items; + +import java.util.List; + +import net.anvilcraft.arcaneseals.ASBlocks; +import net.anvilcraft.arcaneseals.ArcaneSealsTab; +import net.anvilcraft.arcaneseals.tiles.TileSeal; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.texture.IIconRegister; +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; + +public class ItemRunicEssence extends Item { + private IIcon[] icons = new IIcon[6]; + + public ItemRunicEssence() { + super(); + super.maxStackSize = 16; + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setCreativeTab(ArcaneSealsTab.INSTANCE); + } + + @Override + public void registerIcons(IIconRegister reg) { + for (int i = 0; i < 6; i++) { + this.icons[i] = reg.registerIcon("arcaneseals:runic_essence_" + i); + } + } + + @Override + public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List l) { + for (int i = 0; i < 6; i++) { + l.add(new ItemStack(this, 1, i)); + } + } + + @Override + public IIcon getIconFromDamage(int meta) { + return this.icons[meta]; + } + + @Override + public IIcon getIcon(ItemStack stack, int pass) { + return this.getIconFromDamage(stack.getItemDamage()); + } + + @Override + public String getUnlocalizedName(ItemStack is) { + return "arcaneseals:runic_essence." + is.getItemDamage(); + } + + @Override + public boolean onItemUseFirst( + ItemStack itemstack, + EntityPlayer player, + World world, + int i, + int j, + int k, + int l, + // useless parameters + float alec1, + float alec2, + float alec3 + ) { + Block bi = world.getBlock(i, j, k); + if (itemstack.stackSize == 0) { + return false; + } else { + if (bi == ASBlocks.seal) { + TileSeal ts = (TileSeal) world.getTileEntity(i, j, k); + if (ts != null) { + boolean added = false; + int addPitch = 0; + + for (int q = 0; q < 3; ++q) { + if (ts.runes[q] == -1) { + ts.runes[q] = (byte) itemstack.getItemDamage(); + added = true; + addPitch = ts.runes[q]; + ts.delay = 60; + + break; + } + } + + if (added) { + world.playSoundEffect( + (double) ((float) i + 0.5F), + (double) ((float) j + 0.5F), + (double) ((float) k + 0.5F), + "thaumcraft:rune_set", + 0.5F, + 1.2F - (float) addPitch * 0.075F + ); + --itemstack.stackSize; + return true; + } + } + } + + return super.onItemUseFirst( + itemstack, player, world, i, j, k, l, alec1, alec2, alec3 + ); + } + } +} diff --git a/src/main/java/net/anvilcraft/arcaneseals/items/ItemSeal.java b/src/main/java/net/anvilcraft/arcaneseals/items/ItemSeal.java new file mode 100644 index 0000000..ee6acb1 --- /dev/null +++ b/src/main/java/net/anvilcraft/arcaneseals/items/ItemSeal.java @@ -0,0 +1,14 @@ +package net.anvilcraft.arcaneseals.items; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemBlock; + +public class ItemSeal extends ItemBlock { + public ItemSeal(Block b) { + super(b); + super.maxStackSize = 16; + this.setHasSubtypes(true); + this.setMaxDamage(0); + this.setUnlocalizedName("arcaneseals:seal"); + } +} diff --git a/src/main/java/net/anvilcraft/arcaneseals/render/TileSealRenderer.java b/src/main/java/net/anvilcraft/arcaneseals/render/TileSealRenderer.java new file mode 100644 index 0000000..6bbb2d5 --- /dev/null +++ b/src/main/java/net/anvilcraft/arcaneseals/render/TileSealRenderer.java @@ -0,0 +1,238 @@ +package net.anvilcraft.arcaneseals.render; + +import net.anvilcraft.arcaneseals.ASBlocks; +import net.anvilcraft.arcaneseals.tiles.TileSeal; +import net.anvilcraft.arcaneseals.utils.UtilsFX; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; + +public class TileSealRenderer extends TileEntitySpecialRenderer { + private float bob = 0.0F; + private int count = 0; + private static int[] colors + = new int[] { 13532671, 16777088, 8421631, 8454016, 16744576, 4194368 }; + + private void translateFromOrientation(double x, double y, double z, int orientation) { + GL11.glPushMatrix(); + if (orientation == 0) { + GL11.glTranslatef((float) x, (float) y + 1.0F, (float) z + 1.0F); + GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); + } else if (orientation == 1) { + GL11.glTranslatef((float) x, (float) y, (float) z); + GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + } else if (orientation == 2) { + GL11.glTranslatef((float) x, (float) y, (float) z + 1.0F); + } else if (orientation == 3) { + GL11.glTranslatef((float) x + 1.0F, (float) y, (float) z); + GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + } else if (orientation == 4) { + GL11.glTranslatef((float) x + 1.0F, (float) y, (float) z + 1.0F); + GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); + } else if (orientation == 5) { + GL11.glTranslatef((float) x, (float) y, (float) z); + GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); + } + } + + private void drawSeal(float angle, int level, int rune) { + Tessellator tessellator = Tessellator.instance; + GL11.glRotatef(90.0F, -1.0F, 0.0F, 0.0F); + GL11.glRotatef(angle, 0.0F, 1.0F, 0.0F); + GL11.glTranslatef(-0.5F, 0.0F, -0.5F); + GL11.glDepthMask(false); + GL11.glEnable(3042); + GL11.glBlendFunc(770, 1); + if (level != 2) { + Minecraft.getMinecraft().getTextureManager().bindTexture(new ResourceLocation( + "arcaneseals", "textures/misc/s_" + level + "_" + rune + ".png" + )); + } else { + Minecraft.getMinecraft().getTextureManager().bindTexture( + new ResourceLocation("arcaneseals", "textures/misc/seal5.png") + ); + } + + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + tessellator.startDrawingQuads(); + tessellator.setBrightness(220); + if (level == 2) { + tessellator.setColorRGBA_I(colors[rune], 255); + } + + tessellator.addVertexWithUV(0.0, 0.0, 1.0, 0.0, 1.0); + tessellator.addVertexWithUV(1.0, 0.0, 1.0, 1.0, 1.0); + tessellator.addVertexWithUV(1.0, 0.0, 0.0, 1.0, 0.0); + tessellator.addVertexWithUV(0.0, 0.0, 0.0, 0.0, 0.0); + tessellator.draw(); + GL11.glDisable(3042); + GL11.glDepthMask(true); + } + + // TODO: portal rendering + //private void drawPortal(TileSeal seal, float angle, double x, double y, double z) { + // Tessellator tessellator = Tessellator.instance; + // Minecraft mc = ModLoader.getMinecraftInstance(); + // GL11.glDisable(2896); + // if (Config.portalGfx && seal.txRender != null + // && PortalRenderer.renderRecursion < 2) { + // GL11.glPushMatrix(); + // GL11.glDisable(3553); + // GL11.glColor4f( + // ThaumCraftCore.fColorR(), + // ThaumCraftCore.fColorG(), + // ThaumCraftCore.fColorB(), + // 1.0F + // ); + // tessellator.setBrightness(220); + // GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + // GL11.glScaled( + // (double) (seal.pSize / 2.0F), + // (double) (seal.pSize / 2.0F), + // (double) (seal.pSize / 2.0F) + // ); + // GL11.glBegin(6); + // GL11.glVertex2f(0.0F, 0.0F); + + // for (int oh = 0; oh <= 10; ++oh) { + // double aa = 6.283185307179586 * (double) oh / 10.0; + // GL11.glVertex2f((float) Math.cos(aa), (float) Math.sin(aa)); + // } + + // GL11.glEnd(); + // GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + // GL11.glPopMatrix(); + // GL11.glEnable(3553); + // GL11.glPushMatrix(); + // GL11.glDisable(2896); + // GL11.glEnable(3042); + // GL11.glBlendFunc(770, 771); + // GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); + // GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); + // GL11.glTranslatef(-seal.pSize / 2.0F, -0.01F, -seal.pSize / 2.0F); + // GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + // GL11.glBindTexture(3553, seal.txRender.portalTexture); + // tessellator.startDrawingQuads(); + // tessellator.setBrightness(220); + // tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); + // tessellator.addVertexWithUV(0.0, 0.0, 0.0, 0.0, 0.0); + // tessellator.addVertexWithUV((double) seal.pSize, 0.0, 0.0, 1.0, 0.0); + // tessellator.addVertexWithUV( + // (double) seal.pSize, 0.0, (double) seal.pSize, 1.0, 1.0 + // ); + // tessellator.addVertexWithUV(0.0, 0.0, (double) seal.pSize, 0.0, 1.0); + // tessellator.draw(); + // GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + // GL11.glDisable(3042); + // GL11.glPopMatrix(); + // } + + // GL11.glPushMatrix(); + // GL11.glRotatef(90.0F, -1.0F, 0.0F, 0.0F); + // GL11.glRotatef(angle, 0.0F, 1.0F, 0.0F); + // GL11.glTranslatef(-seal.pSize, 0.02F, -seal.pSize); + // GL11.glDepthMask(false); + // GL11.glEnable(3042); + // GL11.glBlendFunc(770, 771); + // if (Config.portalGfx && seal.txRender != null) { + // MinecraftForgeClient.bindTexture("/thaumcraft/resources/portal2.png"); + // } else { + // MinecraftForgeClient.bindTexture("/thaumcraft/resources/portal.png"); + // } + + // tessellator.startDrawingQuads(); + // tessellator.setBrightness(220); + // tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); + // tessellator.addVertexWithUV(0.0, 0.0, (double) (seal.pSize * 2.0F), 0.0, 1.0); + // tessellator.addVertexWithUV( + // (double) (seal.pSize * 2.0F), 0.0, (double) (seal.pSize * 2.0F), 1.0, 1.0 + // ); + // tessellator.addVertexWithUV((double) (seal.pSize * 2.0F), 0.0, 0.0, 1.0, 0.0); + // tessellator.addVertexWithUV(0.0, 0.0, 0.0, 0.0, 0.0); + // tessellator.draw(); + // GL11.glDisable(3042); + // GL11.glDepthMask(true); + // GL11.glPopMatrix(); + // GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + // GL11.glEnable(2896); + // GL11.glPopMatrix(); + // GL11.glPopMatrix(); + //} + + public void renderEntityAt(TileSeal seal, double x, double y, double z, float fq) { + int a = this.count % 360; + Minecraft mc = Minecraft.getMinecraft(); + this.translateFromOrientation( + (double) ((float) x), + (double) ((float) y), + (double) ((float) z), + seal.orientation + ); + GL11.glTranslatef(0.33F, 0.33F, -0.01F); + GL11.glScalef(0.33f, 0.33f, 0.33f); + mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture); + IIcon icon = ASBlocks.seal.getIcon(0, 0); + UtilsFX.renderItemIn2D( + Tessellator.instance, + icon.getMaxU(), + icon.getMinV(), + icon.getMinU(), + icon.getMaxV(), + icon.getIconWidth(), + icon.getIconHeight(), + 0.0625f, + 128 + ); + GL11.glPopMatrix(); + this.translateFromOrientation( + (double) ((float) x), + (double) ((float) y), + (double) ((float) z), + seal.orientation + ); + if (seal.runes[0] != -1) { + GL11.glPushMatrix(); + GL11.glTranslatef(0.5F, 0.5F, -0.02f); + this.drawSeal(180.0F, 0, seal.runes[0]); + GL11.glPopMatrix(); + } + + if (seal.runes[1] != -1) { + GL11.glPushMatrix(); + GL11.glTranslatef(0.5F, 0.5F, -0.03f); + this.drawSeal((float) (-a), 1, seal.runes[1]); + GL11.glPopMatrix(); + } + + if (seal.runes[2] != -1) { + GL11.glPushMatrix(); + GL11.glTranslatef(0.5F, 0.5F, -0.03f - this.bob); + this.drawSeal((float) a, 2, seal.runes[2]); + GL11.glPopMatrix(); + } + + // TODO: portal rendering + //if (seal.runes[0] == 0 && seal.runes[1] == 1 && seal.pSize > 0.0F) { + // GL11.glPushMatrix(); + // GL11.glPushMatrix(); + // GL11.glTranslatef(0.5F, 0.5F, -seal.pSize / 5.0F); + // this.drawPortal(seal, (float) (-a * 4), x, y, z); + // nopush = false; + //} + + GL11.glPopMatrix(); + } + + public void + renderTileEntityAt(TileEntity tileentity, double d, double d1, double d2, float f) { + this.count = Minecraft.getMinecraft().thePlayer.ticksExisted; + this.bob = MathHelper.sin((float) this.count / 10.0F) * 0.025F + 0.03F; + this.renderEntityAt((TileSeal) tileentity, d, d1, d2, f); + } +} diff --git a/src/main/java/net/anvilcraft/arcaneseals/tiles/TileSeal.java b/src/main/java/net/anvilcraft/arcaneseals/tiles/TileSeal.java new file mode 100644 index 0000000..c5909dd --- /dev/null +++ b/src/main/java/net/anvilcraft/arcaneseals/tiles/TileSeal.java @@ -0,0 +1,2648 @@ +package net.anvilcraft.arcaneseals.tiles; + +import java.util.List; + +import dev.tilera.auracore.api.AuraNode; +import dev.tilera.auracore.aura.AuraManager; +import dev.tilera.auracore.client.FXSparkle; +import dev.tilera.auracore.helper.Utils; +import net.anvilcraft.arcaneseals.utils.HelperLocation; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.IProjectile; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.item.EntityXPOrb; +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.entity.monster.IMob; +import net.minecraft.entity.passive.EntityAnimal; +import net.minecraft.entity.passive.EntityTameable; +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.NetworkManager; +import net.minecraft.network.Packet; +import net.minecraft.network.play.server.S35PacketUpdateTileEntity; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.DamageSource; +import net.minecraft.util.MathHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import thaumcraft.client.fx.WRVector3; +import thaumcraft.client.fx.bolt.FXLightningBolt; +import thaumcraft.client.fx.particles.FXScorch; +import thaumcraft.client.fx.particles.FXWisp; + +public class TileSeal extends TileEntity { + public int delay = 0; + private int soundDelay = 0; + public int portalWindow = 0; + public boolean pOpen = false; + public float pSize = 0.0F; + //private int pDelay = 0; + public boolean worked; + public boolean isPowering = false; + public short orientation = -1; + public byte[] runes = new byte[] { -1, -1, -1 }; + + protected boolean gettingPower() { + return super.worldObj.isBlockIndirectlyGettingPowered( + super.xCoord, super.yCoord, super.zCoord + ) + || super.worldObj.isBlockIndirectlyGettingPowered( + super.xCoord, super.yCoord + 1, super.zCoord + ); + } + + @Override + public void updateEntity() { + if (this.delay <= 0) { + boolean oldPower = this.isPowering; + this.isPowering = false; + --this.soundDelay; + if (!this.worldObj.isRemote + && (!this.gettingPower() || this.runes[0] == 0 && this.runes[1] == 4)) { + switch (this.runes[0]) { + case 0: + this.magicSeal(); + break; + case 1: + this.airSeal(); + break; + case 2: + this.waterSeal(); + break; + case 3: + this.earthSeal(); + break; + case 4: + this.fireSeal(); + break; + case 5: + this.darkSeal(); + } + } + + if (oldPower != this.isPowering) { + HelperLocation loc = new HelperLocation(this, this.orientation); + + int xx; + int yy; + int zz; + for (xx = -1; xx <= 1; ++xx) { + for (yy = -1; yy <= 1; ++yy) { + for (zz = -1; zz <= 1; ++zz) { + super.worldObj.markBlockForUpdate( + (int) loc.x + xx, (int) loc.y + yy, (int) loc.z + zz + ); + } + } + } + + super.worldObj.notifyBlocksOfNeighborChange( + (int) loc.x, (int) loc.y, (int) loc.z, Blocks.air + ); + loc.moveBackwards(1.0); + + for (xx = -1; xx <= 1; ++xx) { + for (yy = -1; yy <= 1; ++yy) { + for (zz = -1; zz <= 1; ++zz) { + super.worldObj.markBlockForUpdate( + (int) loc.x + xx, (int) loc.y + yy, (int) loc.z + zz + ); + } + } + } + + super.worldObj.notifyBlocksOfNeighborChange( + (int) loc.x, (int) loc.y, (int) loc.z, Blocks.air + ); + } + } + + if (this.delay > 0) { + --this.delay; + } + + if (this.pOpen && (double) this.pSize < 1.4) { + this.pSize += 0.15F; + } + + if (!this.pOpen && this.pSize > 0.0F || this.delay > 0 && this.pSize > 0.0F) { + this.pSize -= 0.25F; + } + + if ((double) this.pSize > 1.4) { + this.pSize = 1.4F; + } + + if (this.pSize < 0.0F) { + this.pSize = 0.0F; + } + } + + @Override + public boolean canUpdate() { + return true; + } + + private void magicSeal() { + switch (this.runes[1]) { + case -1: + this.magicBoost(); + this.delay = 20; + break; + case 0: + switch (this.runes[2]) { + case -1: + this.magicBoost(); + this.delay = 15; + return; + case 0: + this.magicBoost(); + this.delay = 10; + return; + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 1: + // TODO: WTF + //SISpecialTile current + // = (SISpecialTile) mod_ThaumCraft.SpecialTileHM.get(Arrays.asList( + // super.xCoord, + // super.yCoord, + // super.zCoord, + // (byte) ModLoader.getMinecraftInstance().thePlayer.dimension, + // 0 + // )); + //if (current == null) { + // SISpecialTile pd = new SISpecialTile( + // super.xCoord, + // super.yCoord, + // super.zCoord, + // this.runes[2], + // (byte) ModLoader.getMinecraftInstance().thePlayer.dimension, + // (byte) 0 + // ); + // mod_ThaumCraft.AddSpecialTileToList(pd); + //} + + //this.handlePortals(); + break; + case 2: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 3: + switch (this.runes[2]) { + case -1: + if (this.worldObj.isRemote) { + FXSparkle ef = new FXSparkle( + super.worldObj, + (double) this.sealX(false), + (double) this.sealY(false), + (double) this.sealZ(false), + (double + ) ((float) super.xCoord + super.worldObj.rand.nextFloat() + ), + (double + ) ((float) super.yCoord + super.worldObj.rand.nextFloat() + ), + (double + ) ((float) super.zCoord + super.worldObj.rand.nextFloat() + ), + 1.0F, + super.worldObj.rand.nextBoolean() ? 0 : 3, + 4 + ); + Minecraft.getMinecraft().effectRenderer.addEffect(ef); + this.delay = 5; + } + return; + case 3: + FXSparkle ef2 = new FXSparkle( + super.worldObj, + (double) this.sealX(false), + (double) this.sealY(false), + (double) this.sealZ(false), + (double + ) ((float) super.xCoord + super.worldObj.rand.nextFloat()), + (double + ) ((float) super.yCoord + super.worldObj.rand.nextFloat()), + (double + ) ((float) super.zCoord + super.worldObj.rand.nextFloat()), + 1.0F, + super.worldObj.rand.nextBoolean() ? 0 : 3, + 4 + ); + Minecraft.getMinecraft().effectRenderer.addEffect(ef2); + this.delay = 5; + return; + default: + return; + } + case 4: + switch (this.runes[2]) { + case -1: + this.scan(3, true, true, true, true); + break; + case 0: + this.scan(6, false, true, false, false); + break; + case 1: + this.scan(9, true, true, true, true); + case 2: + default: + break; + case 3: + this.scan(6, false, false, true, false); + break; + case 4: + this.scan(6, true, false, false, false); + break; + case 5: + this.scan(6, false, false, false, true); + } + + this.delay = 5; + case 5: + } + } + + private void airSeal() { + switch (this.runes[1]) { + case -1: + this.pushEntity(false, true, true, 3, 0.03F); + this.delay = 2; + break; + case 0: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 1: + switch (this.runes[2]) { + case -1: + this.pushEntity(false, true, true, 5, 0.06F); + break; + case 0: + this.pushEntity(false, true, false, 7, 0.08F); + break; + case 1: + this.pushEntity(false, true, true, 7, 0.08F); + case 2: + case 4: + case 5: + default: + break; + case 3: + this.pushEntity(false, false, true, 7, 0.08F); + } + + this.delay = 2; + break; + case 2: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 3: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 4: + this.shock(); + this.delay = 8 + super.worldObj.rand.nextInt(3) - this.runeAmount(1) * 2; + break; + case 5: + label86: + switch (this.runes[2]) { + case -1: + this.pushEntity(true, true, true, 5, 0.06F); + break; + case 0: + this.pushEntity(true, true, false, 7, 0.08F); + break; + case 1: + this.pushEntity(true, true, true, 7, 0.08F); + case 2: + default: + break; + case 3: + this.pushEntity(true, false, true, 7, 0.08F); + break; + case 4: + this.pushEntity(true, true, true, 6, 0.07F); + List list = this.getEntities( + super.worldObj, 0.0F, this.orientation, false + ); + int a = 0; + + while (true) { + if (a >= list.size()) { + break label86; + } + + Entity entity = (Entity) list.get(a); + if (!(entity instanceof EntityPlayer) + /*&& !(entity instanceof EntityTravelingTrunk)*/) { + entity.attackEntityFrom(DamageSource.generic, 1); + // TODO: server or client side? + net.anvilcraft.arcaneseals.utils.UtilsFX.poof( + super.worldObj, + (float) entity.posX - 0.5F, + (float) entity.posY - 0.5F + entity.getEyeHeight(), + (float) entity.posZ - 0.5F + ); + super.worldObj.playSoundEffect( + (double) super.xCoord, + (double) super.yCoord, + (double) super.zCoord, + // TODO: 99% wrong sound ID + "random.fizz", + 0.5F, + 2.0F + super.worldObj.rand.nextFloat() * 0.4F + ); + } + + ++a; + } + case 5: + this.pushEntity(true, false, true, 6, 0.04F); + List list2 = this.getEntities( + super.worldObj, 0.2F, this.orientation, false + ); + + for (int b = 0; b < list2.size(); ++b) { + Entity entity = (Entity) list2.get(b); + if (entity instanceof EntityItem) { + this.attemptItemPickup((EntityItem) entity); + } + } + } + + this.delay = 2; + } + } + + private void waterSeal() { + switch (this.runes[1]) { + case -1: + this.hydrate(3); + this.delay = 20; + break; + case 0: + switch (this.runes[2]) { + case -1: + this.heal(3, true, true, true, false); + this.delay = 20; + return; + case 0: + this.heal(5, false, false, true, false); + this.delay = 20; + return; + case 1: + this.heal(5, true, true, true, false); + this.delay = 10; + return; + case 2: + this.heal(5, true, true, true, true); + this.delay = 20; + return; + case 3: + this.heal(5, false, true, false, false); + this.delay = 20; + return; + case 4: + this.heal(5, true, true, true, false); + this.delay = 20; + return; + case 5: + this.heal(5, true, false, false, false); + this.delay = 20; + return; + default: + return; + } + case 1: + switch (this.runes[2]) { + case -1: + this.freeze(6, true, true, false); + return; + case 0: + this.freeze(10, true, false, false); + return; + case 1: + this.freeze(10, true, true, false); + return; + case 2: + this.freeze(15, true, false, false); + return; + case 3: + this.freeze(10, false, true, false); + return; + case 4: + this.freeze(10, true, true, false); + return; + case 5: + this.freeze(10, false, false, true); + return; + default: + return; + } + case 2: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 3: + switch (this.runes[2]) { + case -1: + this.fertilize(3); + this.delay = 30; + return; + case 0: + case 2: + case 4: + case 5: + default: + return; + case 1: + this.fertilize(3); + this.delay = 15; + return; + case 3: + this.fertilize(6); + this.delay = 30; + return; + } + case 4: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 5: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + } + } + } + + private void earthSeal() { + switch (this.runes[1]) { + case -1: + this.till(3); + this.delay = 20; + break; + case 0: + switch (this.runes[2]) { + case -1: + //this.replant(6); + this.delay = 40; + return; + case 0: + case 2: + case 4: + case 5: + default: + return; + case 1: + //this.replant(6); + this.delay = 20; + return; + case 3: + //this.replant(12); + this.delay = 40; + return; + } + case 1: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 2: + switch (this.runes[2]) { + case -1: + this.harvest(3); + this.delay = 20; + return; + case 0: + case 2: + case 4: + case 5: + default: + return; + case 1: + this.harvest(3); + this.delay = 10; + return; + case 3: + this.harvest(6); + this.delay = 20; + return; + } + case 3: + switch (this.runes[2]) { + case -1: + this.till(3); + this.delay = 20; + return; + case 0: + case 2: + case 4: + case 5: + default: + return; + case 1: + this.till(3); + this.delay = 10; + return; + case 3: + this.till(6); + this.delay = 20; + return; + } + case 4: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 5: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + } + } + } + + private void fireSeal() { + switch (this.runes[1]) { + case -1: + this.scorch(4, 1, true, true, false); + break; + case 0: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 1: + switch (this.runes[2]) { + case -1: + this.beam(6, 1, true, false, true, false, 6.0F, 2.0F); + this.delay = 5; + return; + case 0: + case 2: + case 3: + case 5: + default: + return; + case 1: + this.beam(9, 2, true, true, true, false, 9.0F, 2.0F); + this.delay = 5; + return; + case 4: + this.beam(9, 3, true, false, true, true, 9.0F, 3.0F); + this.delay = 5; + return; + } + case 2: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 3: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 4: + switch (this.runes[2]) { + case -1: + this.scorch(5, 2, true, true, false); + return; + case 0: + this.scorch(7, 3, true, false, false); + return; + case 1: + this.scorch(8, 3, true, true, false); + return; + case 2: + this.scorch(6, 6, true, true, false); + return; + case 3: + this.scorch(7, 3, false, true, false); + return; + case 4: + this.scorch(7, 3, true, true, false); + return; + case 5: + this.scorch(7, 3, false, false, true); + return; + default: + return; + } + case 5: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + } + } + } + + private void darkSeal() { + switch (this.runes[1]) { + case -1: + default: + break; + case 0: + switch (this.runes[2]) { + case -1: + this.nullifyAura(); + this.delay = 100; + return; + case 0: + this.nullifyAura(); + this.delay = 80; + return; + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 1: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 2: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 3: + switch (this.runes[2]) { + case -1: + this.preventSpawn(6); + return; + case 0: + case 1: + case 2: + case 4: + case 5: + default: + return; + case 3: + this.preventSpawn(12); + return; + } + case 4: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + default: + return; + } + case 5: + switch (this.runes[2]) { + case -1: + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + } + } + } + + private void nullifyAura() { + if (super.worldObj.isRemote) + return; + + int nodeId = AuraManager.getClosestAuraWithinRange( + super.worldObj, super.xCoord, super.yCoord, super.zCoord, 512 + ); + + if (nodeId < 0) + return; + + AuraNode node = AuraManager.getNode(nodeId); + + if (node.level > 0 /* && node.taint > 0*/) { + AuraManager.addRandomFlux(super.worldObj, node, 1); + AuraManager.queueNodeChanges(nodeId, -1, 0, false, null, 0, 0, 0); + + FXSparkle ef = new FXSparkle( + super.worldObj, + (double) ((float) super.xCoord + super.worldObj.rand.nextFloat()), + (double) ((float) super.yCoord + super.worldObj.rand.nextFloat()), + (double) ((float) super.zCoord + super.worldObj.rand.nextFloat()), + 2.0F, + 5, + 5 + ); + Minecraft.getMinecraft().effectRenderer.addEffect(ef); + } + } + + private void preventSpawn(int range) { + List list + = this.getEntitiesSorted(super.worldObj, range, this.orientation, true); + + for (int a = 0; a < list.size(); ++a) { + Entity entity = (Entity) list.get(a); + if (entity instanceof EntityMob && ((EntityMob) entity).ticksExisted < 5) { + entity.setDead(); + } + } + } + + private boolean + scan(int range, boolean items, boolean mobs, boolean animals, boolean pvp) { + if (super.worldObj.isRemote) + return false; + + boolean foundsomething = false; + List list + = this.getEntitiesSorted(super.worldObj, range, this.orientation, true); + + int q; + for (q = 0; q < list.size(); ++q) { + Entity entity = (Entity) list.get(q); + if (items && entity instanceof EntityItem + || animals && entity instanceof EntityAnimal + || mobs && (entity instanceof EntityMob || entity instanceof IMob) + || pvp && entity instanceof EntityPlayer) { + this.worked = true; + foundsomething = true; + break; + } + } + + this.isPowering = foundsomething; + if (foundsomething) { + q = Minecraft.getMinecraft().gameSettings.fancyGraphics ? 6 : 3; + + for (int a = 0; a < q; ++a) { + FXWisp ef = new FXWisp( + super.worldObj, + (double) this.sealX(false), + (double) this.sealY(false), + (double) this.sealZ(false), + (double) ((float) super.xCoord + super.worldObj.rand.nextFloat()), + (double) ((float) super.yCoord + super.worldObj.rand.nextFloat()), + (double) ((float) super.zCoord + super.worldObj.rand.nextFloat()), + 0.1F, + 4 + ); + Minecraft.getMinecraft().effectRenderer.addEffect(ef); + } + } + + return false; + } + + private boolean freeze(int range, boolean mobs, boolean animals, boolean pvp) { + if (super.worldObj.isRemote) + return false; + + boolean didsomething = false; + List list + = this.getEntitiesSorted(super.worldObj, range, this.orientation, true); + + for (int a = 0; a < list.size(); ++a) { + Entity entity = (Entity) list.get(a); + if (entity instanceof EntityLivingBase + && (animals && entity instanceof EntityAnimal + + && !(entity instanceof EntityTameable) + || mobs && (entity instanceof EntityMob || entity instanceof IMob) + || pvp && entity instanceof EntityPlayer)) { + entity.motionX *= 0.05; + entity.motionY *= 0.05; + entity.motionZ *= 0.05; + if (this.runes[2] == 1) { + entity.motionY += 0.05999999865889549; + entity.onGround = false; + } + + // TODO: implement FXFreeze + //for (int repeat = 0; repeat < 3; ++repeat) { + // FXFreeze ef = new FXFreeze( + // super.worldObj, + // this.sealX(false), + // this.sealY(false), + // this.sealZ(false), + // entity + // ); + // ModLoader.getMinecraftInstance().effectRenderer.addEffect(ef); + //} + + this.worked = true; + didsomething = true; + if (this.runes[2] != 4) { + break; + } + } + } + + if (this.soundDelay <= 0 && didsomething) { + super.worldObj.playSoundEffect( + (double) ((float) super.xCoord + 0.5F), + (double) ((float) super.yCoord + 0.5F), + (double) ((float) super.zCoord + 0.5F), + "thaumcraft.wind", + 0.2F, + 0.9F + super.worldObj.rand.nextFloat() * 0.1F + ); + this.soundDelay = 25; + } + + return false; + } + + private boolean fertilize(int range) { + if (super.worldObj.isRemote) + return false; + + int xm = 0; + int xp = 0; + int ym = 0; + int yp = 0; + int zm = 0; + int zp = 0; + + if (this.orientation == 0) { + xm = zm = -range; + zp = range; + xp = range; + ym = -(range * 2); + } else if (this.orientation == 1) { + xm = zm = -range; + zp = range; + xp = range; + yp = range * 2; + } else if (this.orientation == 2) { + xm = ym = -range; + yp = range; + xp = range; + zm = -(range * 2); + } else if (this.orientation == 3) { + xm = ym = -range; + yp = range; + xp = range; + zp = range * 2; + } else if (this.orientation == 4) { + zm = ym = -range; + yp = range; + zp = range; + xm = -(range * 2); + } else if (this.orientation == 5) { + zm = ym = -range; + yp = range; + zp = range; + xp = range * 2; + } + + for (int x = xm; x <= xp; ++x) { + for (int y = ym; y <= yp; ++y) { + for (int z = zm; z <= zp; ++z) { + if (super.worldObj.getBlockLightValue( + super.xCoord + x, super.yCoord + y + 1, super.zCoord + z + ) >= 8 + && super.yCoord + y + 1 <= super.worldObj.getHeight() + && super.yCoord + y - 1 >= 0) { + if (Utils.useBonemealAtLoc( + super.worldObj, + super.xCoord + x, + super.yCoord + y, + super.zCoord + z + )) { + net.anvilcraft.arcaneseals.utils.UtilsFX.poofUpwards( + super.worldObj, + super.xCoord + x, + super.yCoord + y, + super.zCoord + z, + 3 + ); + } + } + } + } + } + + return false; + } + + private boolean harvest(int range) { + int xm = 0; + int xp = 0; + int ym = 0; + int yp = 0; + int zm = 0; + int zp = 0; + if (this.orientation == 0) { + xm = zm = -range; + zp = range; + xp = range; + ym = -(range * 2); + } else if (this.orientation == 1) { + xm = zm = -range; + zp = range; + xp = range; + yp = range * 2; + } else if (this.orientation == 2) { + xm = ym = -range; + yp = range; + xp = range; + zm = -(range * 2); + } else if (this.orientation == 3) { + xm = ym = -range; + yp = range; + xp = range; + zp = range * 2; + } else if (this.orientation == 4) { + zm = ym = -range; + yp = range; + zp = range; + xm = -(range * 2); + } else if (this.orientation == 5) { + zm = ym = -range; + yp = range; + zp = range; + xp = range * 2; + } + + for (int x = xm; x <= xp; ++x) { + for (int y = ym; y <= yp; ++y) { + for (int z = zm; z <= zp; ++z) { + if (super.yCoord + y + 1 <= super.worldObj.getHeight() + && super.yCoord + y - 1 >= 0) { + // TODO: alter ne + //int cbID = super.worldObj.getBlockId( + // super.xCoord + x, super.yCoord + y, super.zCoord + z + //); + //super.worldObj.getBlockId( + // super.xCoord + x, super.yCoord + y + 1, super.zCoord + z + //); + //int bbID = super.worldObj.getBlockId( + // super.xCoord + x, super.yCoord + y - 1, super.zCoord + z + //); + //TileEntity te = super.worldObj.getBlockTileEntity( + // super.xCoord + x, super.yCoord + y - 1, super.zCoord + z + //); + //if (super.worldObj.rand.nextInt(10) == 0) { + // if (cbID == Block.crops.blockID + // && super.worldObj.getBlockMetadata( + // super.xCoord + x, + // super.yCoord + y, + // super.zCoord + z + // ) == 7 + // || cbID == Block.melon.blockID + // || cbID == Block.tallGrass.blockID + // || cbID == Block.pumpkin.blockID + // || cbID == Block.plantYellow.blockID + // || cbID == Block.plantRed.blockID + // || cbID == flaxId + // && super.worldObj.getBlockMetadata( + // super.xCoord + x, + // super.yCoord + y, + // super.zCoord + z + // ) == 4 + // || cbID == Block.plantRed.blockID + // || cbID == Block.reed.blockID + // && bbID == Block.reed.blockID + // || cbID == Block.cactus.blockID + // && bbID == Block.cactus.blockID) { + // Block.blocksList[cbID].dropBlockAsItem( + // super.worldObj, + // super.xCoord + x, + // super.yCoord + y, + // super.zCoord + z, + // super.worldObj.getBlockMetadata( + // super.xCoord + x, + // super.yCoord + y, + // super.zCoord + z + // ), + // 0 + // ); + // super.worldObj.setBlockWithNotify( + // super.xCoord + x, + // super.yCoord + y, + // super.zCoord + z, + // 0 + // ); + // ThaumCraftCore.poof( + // super.worldObj, + // (float) (super.xCoord + x), + // (float) (super.yCoord + y), + // (float) (super.zCoord + z) + // ); + // this.worked = true; + // return true; + // } + + // if (te != null && te instanceof TECrop) { + // TECrop tec = (TECrop) te; + // if (tec.id != -1 && tec.harvest(false)) { + // ThaumCraftCore.poof( + // super.worldObj, + // (float) (super.xCoord + x), + // (float) (super.yCoord + y), + // (float) (super.zCoord + z) + // ); + // this.worked = true; + // return true; + // } + // } + //} + } + } + } + } + + return false; + } + + private boolean hydrate(int range) { + int xm = 0; + int xp = 0; + int ym = 0; + int yp = 0; + int zm = 0; + int zp = 0; + if (this.orientation == 0) { + xm = zm = -range; + zp = range; + xp = range; + ym = -(range * 2); + } else if (this.orientation == 1) { + xm = zm = -range; + zp = range; + xp = range; + yp = range * 2; + } else if (this.orientation == 2) { + xm = ym = -range; + yp = range; + xp = range; + zm = -(range * 2); + } else if (this.orientation == 3) { + xm = ym = -range; + yp = range; + xp = range; + zp = range * 2; + } else if (this.orientation == 4) { + zm = ym = -range; + yp = range; + zp = range; + xm = -(range * 2); + } else if (this.orientation == 5) { + zm = ym = -range; + yp = range; + zp = range; + xp = range * 2; + } + + for (int x = xm; x <= xp; ++x) { + for (int y = ym; y <= yp; ++y) { + for (int z = zm; z <= zp; ++z) { + if (super.yCoord + y <= super.worldObj.getHeight() + && super.yCoord + y >= 0) { + Block cbID = super.worldObj.getBlock( + super.xCoord + x, super.yCoord + y, super.zCoord + z + ); + int md = super.worldObj.getBlockMetadata( + super.xCoord + x, super.yCoord + y, super.zCoord + z + ); + if (cbID == Blocks.farmland && md != 7 + && super.worldObj.rand.nextInt(10) == 0) { + super.worldObj.setBlockMetadataWithNotify( + super.xCoord + x, super.yCoord + y, super.zCoord + z, 7, 3 + ); + net.anvilcraft.arcaneseals.utils.UtilsFX.sparkleDown( + super.worldObj, + super.xCoord + x, + super.yCoord + y + 1, + super.zCoord + z, + 2 + ); + this.worked = true; + return true; + } + } + } + } + } + + return false; + } + + // TODO: implement plant stuff + //private boolean replant(int range) { + // int xm = 0; + // int xp = 0; + // int ym = 0; + // int yp = 0; + // int zm = 0; + // int zp = 0; + // if (this.orientation == 0) { + // xm = zm = -range; + // zp = range; + // xp = range; + // ym = -(range * 2); + // } else if (this.orientation == 1) { + // xm = zm = -range; + // zp = range; + // xp = range; + // yp = range * 2; + // } else if (this.orientation == 2) { + // xm = ym = -range; + // yp = range; + // xp = range; + // zm = -(range * 2); + // } else if (this.orientation == 3) { + // xm = ym = -range; + // yp = range; + // xp = range; + // zp = range * 2; + // } else if (this.orientation == 4) { + // zm = ym = -range; + // yp = range; + // zp = range; + // xm = -(range * 2); + // } else if (this.orientation == 5) { + // zm = ym = -range; + // yp = range; + // zp = range; + // xp = range * 2; + // } + + // for (int x = xm; x <= xp; ++x) { + // for (int y = ym; y <= yp; ++y) { + // for (int z = zm; z <= zp; ++z) { + // if (super.yCoord + y + 1 <= super.worldObj.getHeight() + // && super.yCoord + y >= 0) { + // Block cbID = super.worldObj.getBlock( + // super.xCoord + x, super.yCoord + y, super.zCoord + z + // ); + // super.worldObj.getBlockMetadata( + // super.xCoord + x, super.yCoord + y, super.zCoord + z + // ); + // if (cbID == Blocks.farmland + // && super.worldObj.isAirBlock( + // super.xCoord + x, super.yCoord + y + 1, super.zCoord + z + // ) + // && super.worldObj.rand.nextInt(10) == 0 && this.fetchSeed()) + // { super.worldObj.setBlockAndMetadataWithNotify( + // super.xCoord + x, + // super.yCoord + y + 1, + // super.zCoord + z, + // Blocks.crops.blockID, + // 0 + // ); + // ThaumCraftCore.poofUpwards( + // super.worldObj, + // super.xCoord + x, + // super.yCoord + y + 1, + // super.zCoord + z, + // 0 + // ); + // this.worked = true; + // return true; + // } + // } + // } + // } + // } + + // return false; + //} + + //private boolean fetchSeed() { + // for (int x = -2; x <= 2; ++x) { + // for (int y = -2; y <= 2; ++y) { + // for (int z = -2; z <= 2; ++z) { + // if ((x != 0 || y != 0 || z != 0) && super.yCoord + y >= 0) { + // TileEntity block = super.worldObj.getBlockTileEntity( + // super.xCoord + x, super.yCoord + y, super.zCoord + z + // ); + // if (block instanceof IInventory) { + // IInventory chest = (IInventory) block; + + // for (int a = 0; a < chest.getSizeInventory(); ++a) { + // if (chest.getStackInSlot(a) != null + // && chest.getStackInSlot(a).getItem().shiftedIndex + // == Item.seeds.shiftedIndex) { + // chest.decrStackSize(a, 1); + // ThaumCraftCore.poofGood( + // super.worldObj, + // (float) block.xCoord, + // (float) block.yCoord, + // (float) block.zCoord + // ); + // return true; + // } + // } + // } + // } + // } + // } + // } + + // return false; + //} + + private boolean till(int range) { + int xm = 0; + int xp = 0; + int ym = 0; + int yp = 0; + int zm = 0; + int zp = 0; + if (this.orientation == 0) { + xm = zm = -range; + zp = range; + xp = range; + ym = -(range * 2); + } else if (this.orientation == 1) { + xm = zm = -range; + zp = range; + xp = range; + yp = range * 2; + } else if (this.orientation == 2) { + xm = ym = -range; + yp = range; + xp = range; + zm = -(range * 2); + } else if (this.orientation == 3) { + xm = ym = -range; + yp = range; + xp = range; + zp = range * 2; + } else if (this.orientation == 4) { + zm = ym = -range; + yp = range; + zp = range; + xm = -(range * 2); + } else if (this.orientation == 5) { + zm = ym = -range; + yp = range; + zp = range; + xp = range * 2; + } + + for (int x = xm; x <= xp; ++x) { + for (int y = ym; y <= yp; ++y) { + for (int z = zm; z <= zp; ++z) { + if (super.yCoord + y <= super.worldObj.getHeight() + && super.yCoord + y >= 0) { + Block cbID = super.worldObj.getBlock( + super.xCoord + x, super.yCoord + y, super.zCoord + z + ); + Block tbID = super.worldObj.getBlock( + super.xCoord + x, super.yCoord + y + 1, super.zCoord + z + ); + if ((cbID == Blocks.dirt || cbID == Blocks.grass) + && tbID == Blocks.air + && super.worldObj.rand.nextInt(10) == 0) { + super.worldObj.setBlock( + super.xCoord + x, + super.yCoord + y, + super.zCoord + z, + Blocks.farmland, + 0, + 3 + ); + net.anvilcraft.arcaneseals.utils.UtilsFX.sparkleUp( + super.worldObj, + super.xCoord + x, + super.yCoord + y + 1, + super.zCoord + z, + 3 + ); + this.worked = true; + return true; + } + } + } + } + } + + return false; + } + + private void magicBoost() { + int auraId = AuraManager.getClosestAuraWithinRange( + super.worldObj, super.xCoord, super.yCoord, super.zCoord, 512 + ); + + if (auraId < 0) + return; + + // TODO: WTF + //int auraX = super.xCoord >> 4; + //int auraZ = super.zCoord >> 4; + //SIAuraChunk ac = (SIAuraChunk) mod_ThaumCraft.AuraHM.get( + // Arrays.asList(auraX, auraZ, ThaumCraftCore.getDimension(super.worldObj)) + //); + //if (ac != null && ac.boost < 100) { + // this.worked = true; + // ++ac.boost; + // FXWisp ef = new FXWisp( + // super.worldObj, + // (double) this.sealX(false), + // (double) this.sealY(false), + // (double) this.sealZ(false), + // (double) ((float) super.xCoord + super.worldObj.rand.nextFloat()), + // (double) ((float) super.yCoord + super.worldObj.rand.nextFloat()), + // (double) ((float) super.zCoord + super.worldObj.rand.nextFloat()), + // 0.1F, + // super.worldObj.rand.nextInt(5) + // ); + // ModLoader.getMinecraftInstance().effectRenderer.addEffect(ef); + //} + } + + // TODO: portals + //private void handlePortals() { + // List list = this.getEntitiesSorted(super.worldObj, 1, this.orientation, false); + // boolean p = false; + + // int q; + // for (q = 0; q < list.size(); ++q) { + // if (list.get(q) instanceof EntityPlayer) { + // p = true; + // break; + // } + // } + + // if (list.size() > 0) { + // Collection pp = mod_ThaumCraft.SpecialTileHM.values(); + // boolean fs = false; + // Iterator i$ = pp.iterator(); + + // label74: { + // SISpecialTile pd; + // do { + // do { + // do { + // do { + // if (!i$.hasNext()) { + // break label74; + // } + + // pd = (SISpecialTile) i$.next(); + // } while (pd.type != 0); + // } while (pd.dimension + // != ModLoader.getMinecraftInstance().thePlayer.dimension); + // } while (pd.rune != this.runes[2]); + // } while (pd.x == super.xCoord && pd.y == super.yCoord && pd.z == + // super.zCoord + // ); + + // if (!(super.worldObj.getBlockTileEntity(pd.x, pd.y, pd.z) instanceof + // TileSeal + // )) { + // mod_ThaumCraft.DeleteSpecialTileFromList(pd); + // this.portalWindow = 0; + // } else { + // if (!this.pOpen && p) { + // super.worldObj.playSoundEffect( + // (double) super.xCoord + 0.5, + // (double) super.yCoord + 0.5, + // (double) super.zCoord + 0.5, + // "thaumcraft.popen", + // 0.4F, + // 1.0F + super.worldObj.rand.nextFloat() * 0.2F + // ); + // } + + // if (this.pDelay <= 0 && p) { + // this.renderTeleportDest(); + // this.pDelay = 3; + // } + + // --this.pDelay; + // this.pOpen = true; + // fs = true; + // } + // } + + // if (!fs && this.pOpen) { + // this.pOpen = false; + // } + // } else { + // if (this.pOpen) { + // list = ThaumCraftCore.getEntitiesSorted( + // super.worldObj, this, 2, this.orientation, false + // ); + + // for (q = 0; q < list.size(); ++q) { + // if (list.get(q) instanceof EntityPlayer) { + // super.worldObj.playSoundEffect( + // (double) super.xCoord + 0.5, + // (double) super.yCoord + 0.5, + // (double) super.zCoord + 0.5, + // "thaumcraft.pclose", + // 0.4F, + // 1.0F + super.worldObj.rand.nextFloat() * 0.2F + // ); + // break; + // } + // } + // } + + // this.pOpen = false; + // } + + // this.teleport(); + //} + + // TODO: implement portal rendering with looking glass + //private void renderTeleportDest() { + // if (this.txRender == null) { + // this.txRender = new PortalRenderer(); + // } + + // new ArrayList(); + // Collection p = mod_ThaumCraft.SpecialTileHM.values(); + // int count = -1; + // boolean skipped = true; + // boolean playsound = false; + // Iterator i$ = p.iterator(); + + // while (i$.hasNext()) { + // SISpecialTile pd = (SISpecialTile) i$.next(); + // if (pd.type == 0 + // && pd.dimension == ModLoader.getMinecraftInstance().thePlayer.dimension + // && pd.rune == this.runes[2] + // && (pd.x != super.xCoord || pd.y != super.yCoord || pd.z != super.zCoord + // )) { + // if (!(super.worldObj.getBlockTileEntity(pd.x, pd.y, pd.z) + // instanceof TileSeal)) { + // mod_ThaumCraft.DeleteSpecialTileFromList(pd); + // break; + // } + + // ++count; + // if (count >= this.portalWindow) { + // skipped = false; + // TileEntity ts = super.worldObj.getBlockTileEntity(pd.x, pd.y, pd.z); + // if (ts != null && ts instanceof TileSeal) { + // PortalRenderer.createPortalView( + // this.txRender, this, (TileSeal) ts + // ); + // break; + // } + // } + // } + // } + + // if (skipped) { + // this.portalWindow = 0; + // } + //} + + // TODO: portals + //public boolean teleport() { + // if (this.delay > 0) { + // return false; + // } else { + // List list = super.worldObj.getEntitiesWithinAABB( + // Entity.class, + // AxisAlignedBB.getBoundingBoxFromPool( + // (double) super.xCoord, + // (double) super.yCoord, + // (double) super.zCoord, + // (double) (super.xCoord + 1), + // (double) (super.yCoord + 1), + // (double) (super.zCoord + 1) + // ) + // ); + // if (list.size() == 0) { + // return false; + // } else { + // Entity entity = (Entity) list.get(0); + // if (entity instanceof EntityFX) { + // return false; + // } else { + // ArrayList rd = new ArrayList(); + // Collection p = mod_ThaumCraft.SpecialTileHM.values(); + // int count = -1; + // Iterator i$ = p.iterator(); + + // while (i$.hasNext()) { + // SISpecialTile pd = (SISpecialTile) i$.next(); + // if (pd.type == 0 + // && pd.dimension + // == ModLoader.getMinecraftInstance().thePlayer.dimension + // && pd.rune == this.runes[2] + // && (pd.x != super.xCoord || pd.y != super.yCoord + // || pd.z != super.zCoord)) { + // ++count; + // if (count >= this.portalWindow) { + // rd.add(pd); + // break; + // } + // } + // } + + // if (rd.size() < 1) { + // return false; + // } else { + // SISpecialTile targetDest = (SISpecialTile) rd.get(0); + // if (targetDest == null) { + // return false; + // } else { + // ThaumCraftCore.loadChunk( + // super.worldObj, targetDest.x, targetDest.z + // ); + // TileEntity ts = super.worldObj.getBlockTileEntity( + // targetDest.x, targetDest.y, targetDest.z + // ); + // if (ts != null && ts instanceof TileSeal) { + // TileSeal target = (TileSeal) ts; + // if (target.runes[0] == 0 && target.runes[1] == 1) { + // target.delay = 40; + // float tYaw = entity.rotationYaw; + // switch (target.orientation) { + // case 2: + // tYaw = 180.0F; + // break; + // case 3: + // tYaw = 0.0F; + // break; + // case 4: + // tYaw = 90.0F; + // break; + // case 5: + // tYaw = 270.0F; + // } + + // int diff = this.orientation - target.orientation; + // double t; + // if (diff == -3 || diff == 2 + // || diff == -1 + // && this.orientation + target.orientation != + // 5 + // && this.orientation + target.orientation + // != 9) { + // t = entity.motionX; + // entity.motionX = entity.motionZ; + // entity.motionZ = -t; + // if (entity.ridingEntity != null) { + // entity.ridingEntity.motionX + // = entity.ridingEntity.motionZ; + // entity.ridingEntity.motionZ = -t; + // } + // } else if (diff == -2 || diff == 3 || diff == 1 && + // this.orientation + target.orientation != 5 && + // this.orientation + target.orientation != 9) { + // t = entity.motionX; + // entity.motionX = -entity.motionZ; + // entity.motionZ = t; + // if (entity.ridingEntity != null) { + // entity.ridingEntity.motionX + // = -entity.ridingEntity.motionZ; + // entity.ridingEntity.motionZ = t; + // } + // } else if (diff == 0) { + // entity.motionX = -entity.motionX; + // entity.motionZ = -entity.motionZ; + // if (entity.ridingEntity != null) { + // entity.ridingEntity.motionX + // = -entity.ridingEntity.motionX; + // entity.ridingEntity.motionZ + // = -entity.ridingEntity.motionZ; + // } + // } + + // if (diff == 0 + // && (this.orientation == 1 || this.orientation == + // 0 + // )) { + // entity.motionY = -entity.motionY; + // if (entity.ridingEntity != null) { + // entity.ridingEntity.motionY + // = -entity.ridingEntity.motionY; + // } + // } + + // ThaumCraftCore.poof( + // super.worldObj, + // (float) entity.posX - 0.5F, + // (float) entity.posY - 0.5F, + // (float) entity.posZ - 0.5F + // ); + // super.worldObj.playSoundEffect( + // entity.posX, + // entity.posY, + // entity.posZ, + // "mob.endermen.portal", + // 1.0F, + // 1.0F + // ); + // int xm = 0; + // int zm = 0; + // int ym = 0; + // switch (target.orientation) { + // case 0: + // ym = -1; + // break; + // case 1: + // ym = 1; + // break; + // case 2: + // zm = -1; + // break; + // case 3: + // zm = 1; + // break; + // case 4: + // xm = -1; + // break; + // case 5: + // xm = 1; + // } + + // if (target.orientation > 1 + // && super.worldObj.isAirBlock( + // target.xCoord + xm, + // target.yCoord + ym - 1, + // target.zCoord + zm + // )) { + // --ym; + // } + + // entity.setLocationAndAngles( + // (double) target.xCoord + 0.5 + (double) xm, + // (double) target.yCoord + 0.5 + (double) ym, + // (double) target.zCoord + 0.5 + (double) zm, + // tYaw, + // entity.rotationPitch + // ); + // if (entity.ridingEntity != null) { + // entity.ridingEntity.setLocationAndAngles( + // (double) target.xCoord + 0.5 + (double) xm, + // (double) target.yCoord + 0.5 + (double) ym, + // (double) target.zCoord + 0.5 + (double) zm, + // tYaw, + // entity.ridingEntity.rotationPitch + // ); + // } + + // ThaumCraftCore.poof( + // super.worldObj, + // (float) entity.posX - 0.5F, + // (float) entity.posY - 0.5F, + // (float) entity.posZ - 0.5F + // ); + // super.worldObj.playSoundEffect( + // entity.posX, + // entity.posY, + // entity.posZ, + // "mob.endermen.portal", + // 1.0F, + // 1.0F + // ); + // int auraX = super.xCoord >> 4; + // int auraZ = super.zCoord >> 4; + // SIAuraChunk ac + // = (SIAuraChunk) mod_ThaumCraft.AuraHM.get( + // Arrays.asList( + // auraX, + // auraZ, + // ThaumCraftCore.getDimension(super.worldObj + // ) + // ) + // ); + // if (ac != null) { + // if (entity instanceof EntityItem) { + // ++ac.badVibes; + // } else { + // ac.badVibes = (short) (ac.badVibes + 4); + // } + // } + + // auraX = target.xCoord >> 4; + // auraZ = target.zCoord >> 4; + // ac = (SIAuraChunk) mod_ThaumCraft.AuraHM.get( + // Arrays.asList( + // auraX, + // auraZ, + // ThaumCraftCore.getDimension(super.worldObj) + // ) + // ); + // if (ac != null) { + // if (entity instanceof EntityItem) { + // ++ac.badVibes; + // } else { + // ac.badVibes = (short) (ac.badVibes + 4); + // } + // } + + // this.worked = true; + // return true; + // } else { + // return false; + // } + // } else { + // return false; + // } + // } + // } + // } + // } + // } + //} + + private void beam( + int range, + int damage, + boolean push, + boolean homing, + boolean motes, + boolean core, + float speed1, + float speed2 + ) { + List list + = this.getEntitiesSorted(super.worldObj, range, this.orientation, true); + + for (int a = 0; a < list.size(); ++a) { + Entity entity = (Entity) list.get(a); + if (entity instanceof EntityLivingBase && !(entity instanceof EntityPlayer) + && !(entity instanceof EntityTameable)) { + //FXBeam ef = new FXBeam( + // super.worldObj, + // (double) this.sealX(false), + // (double) this.sealY(false), + // (double) this.sealZ(false), + // entity, + // damage + //); + //ef.drawCore = core; + //ef.drawMotes = motes; + //ef.push = push; + //ef.speed = speed2; + //ef.moteSpeed = speed1; + //ef.homing = homing; + //ModLoader.getMinecraftInstance().effectRenderer.addEffect(ef); + //if (this.soundDelay <= 0) { + // super.worldObj.playSoundEffect( + // (double) super.xCoord + 0.5, + // (double) super.yCoord + 0.5, + // (double) super.zCoord + 0.5, + // "arcaneseals:beamloop", + // 0.6F, + // 1.0F + // ); + // this.soundDelay = 5; + //} + + //this.worked = true; + //break; + } + } + } + + private void + heal(int range, boolean mobs, boolean animals, boolean player, boolean buff) { + List list + = this.getEntitiesSorted(super.worldObj, range, this.orientation, true); + + for (int a = list.size() - 1; a >= 0; --a) { + Entity entity = (Entity) list.get(a); + if (entity instanceof EntityLivingBase + && (animals + && (entity instanceof EntityAnimal + || entity instanceof EntityVillager) + || mobs && (entity instanceof EntityMob || entity instanceof IMob) + || player + && (entity instanceof EntityPlayer + || entity instanceof EntityTameable))) { + if (!(entity instanceof EntityPlayer) + && ((EntityLivingBase) entity).getActivePotionEffect(Potion.hunger) + != null) { + break; + } + + if (((EntityLivingBase) entity).getHealth() + != ((EntityLivingBase) entity).getMaxHealth()) { + ((EntityLivingBase) entity).heal(1); + if (buff) { + ((EntityLivingBase) entity) + .addPotionEffect( + new PotionEffect(Potion.regeneration.id, 60, 1) + ); + } + + super.worldObj.playSoundAtEntity( + entity, "thaumcraft.heal", 1.0F, 1.0F + ); + + for (int qq = 0; qq < 5; ++qq) { + FXWisp ef = new FXWisp( + super.worldObj, + (double) this.sealX(false), + (double) this.sealY(false), + (double) this.sealZ(false), + entity.posX + + (double + ) ((super.worldObj.rand.nextFloat() + - super.worldObj.rand.nextFloat()) + * 0.5F), + entity.boundingBox.minY + (double) (entity.height / 2.0F) + + (double + ) ((super.worldObj.rand.nextFloat() + - super.worldObj.rand.nextFloat()) + * 0.5F), + entity.posZ + + (double + ) ((super.worldObj.rand.nextFloat() + - super.worldObj.rand.nextFloat()) + * 0.5F), + 0.2F, + super.worldObj.rand.nextBoolean() ? 0 : 2 + ); + Minecraft.getMinecraft().effectRenderer.addEffect(ef); + } + + this.worked = true; + if (this.runes[2] != 4) { + break; + } + } + } + } + } + + private void + scorch(int range, int damage, boolean mobs, boolean animals, boolean pvp) { + List list + = this.getEntitiesSorted(super.worldObj, range, this.orientation, true); + + for (int a = list.size() - 1; a >= 0; --a) { + Entity entity = (Entity) list.get(a); + if (entity instanceof EntityLivingBase + && (animals && entity instanceof EntityAnimal + && !(entity instanceof EntityTameable) + || mobs && (entity instanceof EntityMob || entity instanceof IMob) + || pvp && entity instanceof EntityPlayer)) { + for (int q = 0; q < damage; ++q) { + entity.attackEntityFrom(DamageSource.onFire, damage); + FXScorch ef = new FXScorch( + super.worldObj, + (double) this.sealX(false), + (double) this.sealY(false), + (double) this.sealZ(false), + Vec3.createVectorHelper( + entity.posX - this.sealX(false), + entity.posY - this.sealY(false), + entity.posZ - this.sealZ(false) + ), + (float) damage * 0.5F, + this.runeAmount(1) > 0 + ); + ef.mobs = mobs; + ef.pvp = pvp; + ef.animals = animals; + Minecraft.getMinecraft().effectRenderer.addEffect(ef); + } + + if (this.soundDelay <= 0) { + super.worldObj.playSoundEffect( + (double) super.xCoord + 0.5, + (double) super.yCoord + 0.5, + (double) super.zCoord + 0.5, + "thaumcraft:fireloop", + 0.33F, + 1.0F + ); + this.soundDelay = 20; + } + + this.worked = true; + break; + } + } + } + + private boolean shock() { + int range = 6 + this.runeAmount(1) * 2; + boolean shocked = false; + boolean mobs = this.runeAmount(3) == 0; + boolean animals = this.runeAmount(0) == 0; + boolean pvp = this.runeAmount(5) > 0; + if (pvp) { + mobs = false; + animals = false; + } + + List list + = this.getEntitiesSorted(super.worldObj, range, this.orientation, true); + + for (int a = 0; a < list.size(); ++a) { + if (list.get(a) instanceof EntityLivingBase + && this.canEntityBeSeen((Entity) list.get(a))) { + EntityLivingBase entity = (EntityLivingBase) list.get(a); + if (animals && entity instanceof EntityAnimal + && !(entity instanceof EntityTameable) + || mobs && (entity instanceof EntityMob || entity instanceof IMob) + || pvp && entity instanceof EntityPlayer) { + shocked = true; + FXLightningBolt bolt = new FXLightningBolt( + super.worldObj, + this.sealPos(false), + new WRVector3(entity), + super.worldObj.rand.nextLong() + ); + bolt.defaultFractal(); + bolt.setType(2); + bolt.finalizeBolt(); + entity.attackEntityFrom(DamageSource.magic, 3); + entity.addPotionEffect(new PotionEffect( + Potion.moveSlowdown.id, 100, this.runeAmount(2) * 4 + )); + this.worked = true; + if (this.runeAmount(4) < 2) { + break; + } + } + } + } + + if (shocked) { + super.worldObj.playSoundEffect( + (double) super.xCoord + 0.5, + (double) super.yCoord + 0.5, + (double) super.zCoord + 0.5, + "thaumcraft:shock", + 0.33F, + 1.0F + ); + } + + return false; + } + + private void pushEntity( + boolean pull, boolean creatures, boolean items, int range, float strength + ) { + boolean pushed = false; + List list + = this.getEntities(super.worldObj, (float) range, this.orientation, false); + + for (int a = 0; a < list.size(); ++a) { + Entity entity = (Entity) list.get(a); + if (!(entity instanceof IProjectile) && !(entity instanceof EntityXPOrb) + && !(entity instanceof EntityPlayer) + && !(entity instanceof EntityTameable) + && (creatures || !(entity instanceof EntityLivingBase)) + && (items || !(entity instanceof EntityItem))) { + double d6 = entity.posX - (double) this.sealX(false); + double d8 = entity.posY - (double) this.sealY(false); + double d10 = entity.posZ - (double) this.sealZ(false); + double d11 + = (double) MathHelper.sqrt_double(d6 * d6 + d8 * d8 + d10 * d10); + d6 /= d11; + d8 /= d11; + d10 /= d11; + if (pull) { + entity.motionX -= d6 * (double) strength * 2.0; + if (this.orientation <= 1 || this.runes[2] == 4 + || this.runes[2] == 5) { + entity.motionY -= d8 * (double) strength * 3.0; + } + + entity.motionZ -= d10 * (double) strength * 2.0; + } else { + float power = entity.onGround ? strength * 2.0F : strength; + entity.motionX += d6 * (double) power; + entity.motionZ += d10 * (double) power; + if (this.orientation <= 1) { + entity.motionY += d8 * (double) strength * 3.0; + } + } + + pushed = true; + } + } + + if (pushed) { + this.worked = true; + if (this.soundDelay <= 0) { + if (pull) { + super.worldObj.playSoundEffect( + (double) ((float) super.xCoord + 0.5F), + (double) ((float) super.yCoord + 0.5F), + (double) ((float) super.zCoord + 0.5F), + "thaumcraft.suck", + 0.1F, + strength * 3.0F + 0.9F + super.worldObj.rand.nextFloat() * 0.1F + ); + this.soundDelay = 30; + } else { + super.worldObj.playSoundEffect( + (double) ((float) super.xCoord + 0.5F), + (double) ((float) super.yCoord + 0.5F), + (double) ((float) super.zCoord + 0.5F), + "thaumcraft.wind", + 0.1F, + strength * 3.0F + 0.9F + super.worldObj.rand.nextFloat() * 0.1F + ); + this.soundDelay = 25; + } + } + + float q = 0.0F; + float w = 0.0F; + float e = 0.0F; + switch (this.orientation) { + case 0: + w = -1.0F; + q = super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat(); + e = super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat(); + break; + case 1: + w = 1.0F; + q = super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat(); + e = super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat(); + break; + case 2: + e = -1.0F; + q = super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat(); + w = super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat(); + break; + case 3: + e = 1.0F; + q = super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat(); + w = super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat(); + break; + case 4: + q = -1.0F; + w = super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat(); + e = super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat(); + break; + case 5: + q = 1.0F; + w = super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat(); + e = super.worldObj.rand.nextFloat() - super.worldObj.rand.nextFloat(); + } + + // TODO: more effects! + //FXWind ef = new FXWind( + // super.worldObj, + // (double) this.sealX(false), + // (double) this.sealY(false), + // (double) this.sealZ(false), + // (double) (this.sealX(false) + q), + // (double) (this.sealY(false) + w), + // (double) (this.sealZ(false) + e), + // pull + //); + //ModLoader.getMinecraftInstance().effectRenderer.addEffect(ef); + } + } + + protected void attemptItemPickup(EntityItem entity) { + ItemStack items = entity.getEntityItem(); + + for (int x = -2; x <= 2; ++x) { + for (int y = -2; y <= 2; ++y) { + for (int z = -2; z <= 2; ++z) { + if ((x != 0 || y != 0 || z != 0) && super.yCoord + y >= 0) { + TileEntity block = super.worldObj.getTileEntity( + super.xCoord + x, super.yCoord + y, super.zCoord + z + ); + if (block instanceof IInventory) { + IInventory chest = (IInventory) block; + + for (int a = 0; a < chest.getSizeInventory(); ++a) { + int j; + FXSparkle ef1; + FXSparkle ef2; + if (chest.getStackInSlot(a) == null) { + chest.setInventorySlotContents(a, items); + entity.setDead(); + super.worldObj.playSoundAtEntity( + entity, + "random.pop", + 0.15F, + 2.0F + super.worldObj.rand.nextFloat() * 0.45F + ); + + for (j = 0; j < 5; ++j) { + ef1 = new FXSparkle( + super.worldObj, + entity.posX, + entity.posY, + entity.posZ, + entity.posX + + (double + ) ((super.worldObj.rand.nextFloat() + - super.worldObj.rand.nextFloat()) + * 0.5F), + entity.posY + + (double + ) ((super.worldObj.rand.nextFloat() + - super.worldObj.rand.nextFloat()) + * 0.5F), + entity.posZ + + (double + ) ((super.worldObj.rand.nextFloat() + - super.worldObj.rand.nextFloat()) + * 0.5F), + 2.0F, + 1, + 3 + ); + Minecraft.getMinecraft().effectRenderer.addEffect( + ef1 + ); + ef2 = new FXSparkle( + super.worldObj, + entity.posX + + (double + ) ((super.worldObj.rand.nextFloat() + - super.worldObj.rand.nextFloat()) + * 0.2F), + entity.posY + + (double + ) ((super.worldObj.rand.nextFloat() + - super.worldObj.rand.nextFloat()) + * 0.2F), + entity.posZ + + (double + ) ((super.worldObj.rand.nextFloat() + - super.worldObj.rand.nextFloat()) + * 0.2F), + (double) ((float) block.xCoord + 0.5F), + (double) ((float) block.yCoord + 0.5F), + (double) ((float) block.zCoord + 0.5F), + 1.0F, + 1, + 3 + ); + Minecraft.getMinecraft().effectRenderer.addEffect( + ef2 + ); + } + + return; + } + + if (chest.getStackInSlot(a).isItemEqual(items) + && chest.getStackInSlot(a).stackSize + items.stackSize + <= items.getMaxStackSize()) { + items.stackSize += chest.getStackInSlot(a).stackSize; + chest.setInventorySlotContents(a, items); + entity.setDead(); + super.worldObj.playSoundAtEntity( + entity, + "random.pop", + 0.15F, + 2.0F + super.worldObj.rand.nextFloat() * 0.45F + ); + + for (j = 0; j < 5; ++j) { + ef1 = new FXSparkle( + super.worldObj, + entity.posX, + entity.posY, + entity.posZ, + entity.posX + + (double + ) ((super.worldObj.rand.nextFloat() + - super.worldObj.rand.nextFloat()) + * 0.5F), + entity.posY + + (double + ) ((super.worldObj.rand.nextFloat() + - super.worldObj.rand.nextFloat()) + * 0.5F), + entity.posZ + + (double + ) ((super.worldObj.rand.nextFloat() + - super.worldObj.rand.nextFloat()) + * 0.5F), + 2.0F, + 1, + 3 + ); + Minecraft.getMinecraft().effectRenderer.addEffect( + ef1 + ); + ef2 = new FXSparkle( + super.worldObj, + entity.posX + + (double + ) ((super.worldObj.rand.nextFloat() + - super.worldObj.rand.nextFloat()) + * 0.2F), + entity.posY + + (double + ) ((super.worldObj.rand.nextFloat() + - super.worldObj.rand.nextFloat()) + * 0.2F), + entity.posZ + + (double + ) ((super.worldObj.rand.nextFloat() + - super.worldObj.rand.nextFloat()) + * 0.2F), + (double) ((float) block.xCoord + 0.5F), + (double) ((float) block.yCoord + 0.5F), + (double) ((float) block.zCoord + 0.5F), + 1.0F, + 1, + 3 + ); + Minecraft.getMinecraft().effectRenderer.addEffect( + ef2 + ); + } + + return; + } + } + } + } + } + } + } + } + + private float sealX(boolean reverse) { + float calc = (float) super.xCoord; + switch (this.orientation) { + case 0: + calc += 0.5F; + break; + case 1: + calc += 0.5F; + break; + case 2: + calc += 0.5F; + break; + case 3: + calc += 0.5F; + break; + case 4: + calc += reverse ? 0.0F : 1.0F; + break; + case 5: + calc += reverse ? 1.0F : 0.0F; + } + + return calc; + } + + private float sealY(boolean reverse) { + float calc = (float) super.yCoord; + switch (this.orientation) { + case 0: + calc += reverse ? 0.0F : 1.0F; + break; + case 1: + calc += reverse ? 1.0F : 0.0F; + break; + case 2: + case 3: + case 4: + case 5: + calc += 0.5F; + } + + return calc; + } + + private float sealZ(boolean reverse) { + float calc = (float) super.zCoord; + switch (this.orientation) { + case 0: + calc += 0.5F; + break; + case 1: + calc += 0.5F; + break; + case 2: + calc += reverse ? 0.0F : 1.0F; + break; + case 3: + calc += reverse ? 1.0F : 0.0F; + break; + case 4: + calc += 0.5F; + break; + case 5: + calc += 0.5F; + } + + return calc; + } + + private WRVector3 sealPos(boolean reverse) { + return new WRVector3( + this.sealX(reverse), this.sealY(reverse), this.sealZ(reverse) + ); + } + + public int runeAmount(int type) { + int count = 0; + if (this.runes[1] == type) { + ++count; + } + + if (this.runes[2] == type) { + ++count; + } + + return count; + } + + public int runeCount() { + int count = 0; + if (this.runes[0] != -1) { + ++count; + } + + if (this.runes[1] != -1) { + ++count; + } + + if (this.runes[2] != -1) { + ++count; + } + + return count; + } + + @Override + public void readFromNBT(NBTTagCompound nbttagcompound) { + super.readFromNBT(nbttagcompound); + this.orientation = nbttagcompound.getShort("orientation"); + this.runes = nbttagcompound.getByteArray("runes"); + this.portalWindow = nbttagcompound.getInteger("window"); + } + + @Override + public void writeToNBT(NBTTagCompound nbttagcompound) { + super.writeToNBT(nbttagcompound); + nbttagcompound.setShort("orientation", this.orientation); + nbttagcompound.setByteArray("runes", this.runes); + nbttagcompound.setInteger("window", this.portalWindow); + } + + @Override + public Packet getDescriptionPacket() { + NBTTagCompound nbt = new NBTTagCompound(); + + nbt.setShort("orientation", this.orientation); + nbt.setByteArray("runes", this.runes); + nbt.setInteger("window", this.portalWindow); + + return new S35PacketUpdateTileEntity( + this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), nbt + ); + } + + @Override + public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) { + NBTTagCompound nbt = pkt.func_148857_g(); + + this.orientation = nbt.getShort("orientation"); + this.runes = nbt.getByteArray("runes"); + this.portalWindow = nbt.getInteger("window"); + } + + public List + getEntities(World world, float range, int orientation, boolean visibleonly) { + double xm = 0.0; + double xp = 0.0; + double ym = 0.0; + double yp = 0.0; + double zm = 0.0; + double zp = 0.0; + if (orientation == 0) { + xm = zm = (double) (-range); + xp = zp = (double) range; + ym = (double) (-(range * 2.0F)); + } else if (orientation == 1) { + xm = zm = (double) (-range); + xp = zp = (double) range; + yp = (double) (range * 2.0F); + } else if (orientation == 2) { + xm = ym = (double) (-range); + xp = yp = (double) range; + zm = (double) (-(range * 2.0F)); + } else if (orientation == 3) { + xm = ym = (double) (-range); + xp = yp = (double) range; + zp = (double) (range * 2.0F); + } else if (orientation == 4) { + zm = ym = (double) (-range); + zp = yp = (double) range; + xm = (double) (-(range * 2.0F)); + } else if (orientation == 5) { + zm = ym = (double) (-range); + zp = yp = (double) range; + xp = (double) (range * 2.0F); + } + + List list = world.getEntitiesWithinAABB( + Entity.class, + AxisAlignedBB.getBoundingBox( + (double) this.xCoord + xm, + (double) this.yCoord + ym, + (double) this.zCoord + zm, + (double) this.xCoord + 1.0 + xp, + (double) this.yCoord + 1.0 + yp, + (double) this.zCoord + 1.0 + zp + ) + ); + if (visibleonly) { + for (int q = 0; q < list.size(); ++q) { + if (!this.canEntityBeSeen((Entity) list.get(q))) { + list.remove(q); + --q; + } + } + } + + return list; + } + + public boolean canEntityBeSeen(Entity entity) { + return this.worldObj.rayTraceBlocks( + Vec3.createVectorHelper( + (double) this.xCoord + 0.5, + (double) this.yCoord + 0.5, + (double) this.zCoord + 0.5 + ), + Vec3.createVectorHelper( + entity.posX, + entity.posY + (double) entity.getEyeHeight(), + entity.posZ + ), + true + ) + == null; + } + + public List + getEntitiesSorted(World world, int range, int orientation, boolean visibleonly) { + List ws + = this.getEntities(world, (float) range, orientation, visibleonly); + boolean didSort = false; + + do { + didSort = false; + + for (int a = 0; a < ws.size() - 1; ++a) { + Entity entity = (Entity) ws.get(a); + double dist = this.getDistanceFrom(entity.posX, entity.posY, entity.posZ); + Entity entity2 = (Entity) ws.get(a + 1); + double dist2 + = this.getDistanceFrom(entity2.posX, entity2.posY, entity2.posZ); + if (dist > dist2) { + ws.remove(a); + ws.add(entity); + didSort = true; + break; + } + } + } while (didSort); + + return ws; + } +} diff --git a/src/main/java/net/anvilcraft/arcaneseals/utils/HelperFacing.java b/src/main/java/net/anvilcraft/arcaneseals/utils/HelperFacing.java new file mode 100644 index 0000000..5213b1a --- /dev/null +++ b/src/main/java/net/anvilcraft/arcaneseals/utils/HelperFacing.java @@ -0,0 +1,90 @@ +package net.anvilcraft.arcaneseals.utils; + +public enum HelperFacing { + NEGY, + POSY, + NEGZ, + POSZ, + NEGX, + POSX, + UNKNOWN; + + public HelperFacing turnAround() { + switch (this) { + case POSY: { + return HelperFacing.NEGY; + } + + case NEGY: { + return HelperFacing.POSY; + } + case POSZ: { + return HelperFacing.NEGZ; + } + case NEGZ: { + return HelperFacing.POSZ; + } + case POSX: { + return HelperFacing.NEGX; + } + case NEGX: { + return HelperFacing.POSX; + } + default: { + return HelperFacing.UNKNOWN; + } + } + } + + public HelperFacing turnLeft() { + switch (this) { + case POSY: { + return HelperFacing.POSY; + } + case NEGY: { + return HelperFacing.NEGY; + } + case POSZ: { + return HelperFacing.POSX; + } + case NEGZ: { + return HelperFacing.NEGX; + } + case POSX: { + return HelperFacing.NEGZ; + } + case NEGX: { + return HelperFacing.POSZ; + } + default: { + return HelperFacing.UNKNOWN; + } + } + } + + public HelperFacing turnRight() { + switch (this) { + case POSY: { + return HelperFacing.POSY; + } + case NEGY: { + return HelperFacing.NEGY; + } + case POSZ: { + return HelperFacing.NEGX; + } + case NEGZ: { + return HelperFacing.POSX; + } + case POSX: { + return HelperFacing.POSZ; + } + case NEGX: { + return HelperFacing.NEGZ; + } + default: { + return HelperFacing.UNKNOWN; + } + } + } +} diff --git a/src/main/java/net/anvilcraft/arcaneseals/utils/HelperLocation.java b/src/main/java/net/anvilcraft/arcaneseals/utils/HelperLocation.java new file mode 100644 index 0000000..55b4176 --- /dev/null +++ b/src/main/java/net/anvilcraft/arcaneseals/utils/HelperLocation.java @@ -0,0 +1,253 @@ +package net.anvilcraft.arcaneseals.utils; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class HelperLocation { + public double x; + public double y; + public double z; + public HelperFacing facing; + + public HelperLocation(final TileEntity tile) { + this.x = tile.xCoord; + this.y = tile.yCoord; + this.z = tile.zCoord; + this.facing = HelperFacing.UNKNOWN; + } + + public HelperLocation(final double x, final double y, final double z) { + this.x = x; + this.y = y; + this.z = z; + this.facing = HelperFacing.UNKNOWN; + } + + public HelperLocation( + final double x, final double y, final double z, final HelperFacing facing + ) { + this.x = x; + this.y = y; + this.z = z; + this.facing = facing; + } + + public HelperLocation(final TileEntity te, final HelperFacing facing) { + this.x = te.xCoord; + this.y = te.yCoord; + this.z = te.zCoord; + this.facing = facing; + } + + public HelperLocation(final TileEntity te, final int facing) { + this.x = te.xCoord; + this.y = te.yCoord; + this.z = te.zCoord; + switch (facing) { + case 0: { + this.facing = HelperFacing.NEGY; + break; + } + case 1: { + this.facing = HelperFacing.POSY; + break; + } + case 2: { + this.facing = HelperFacing.NEGZ; + break; + } + case 3: { + this.facing = HelperFacing.POSZ; + break; + } + case 4: { + this.facing = HelperFacing.NEGX; + break; + } + case 5: { + this.facing = HelperFacing.POSX; + break; + } + } + } + + public HelperLocation(final HelperLocation l) { + this.x = l.x; + this.y = l.y; + this.z = l.z; + this.facing = l.facing; + } + + public void moveUp(final double amount) { + switch (this.facing) { + case POSZ: + case NEGZ: + case POSX: + case NEGX: { + this.y += amount; + break; + } + default: + break; + } + } + + public void moveDown(final double amount) { + switch (this.facing) { + case POSZ: + case NEGZ: + case POSX: + case NEGX: { + this.y -= amount; + break; + } + default: + break; + } + } + + public void moveRight(final double amount) { + switch (this.facing) { + case POSZ: { + this.x -= amount; + break; + } + case NEGZ: { + this.x += amount; + break; + } + case POSX: { + this.z += amount; + break; + } + case NEGX: { + this.z -= amount; + break; + } + default: + break; + } + } + + public void moveLeft(final double amount) { + switch (this.facing) { + case POSZ: { + this.x += amount; + break; + } + case NEGZ: { + this.x -= amount; + break; + } + case POSX: { + this.z -= amount; + break; + } + case NEGX: { + this.z += amount; + break; + } + default: + break; + } + } + + public void moveForwards(final double amount) { + switch (this.facing) { + case POSY: { + this.y += amount; + break; + } + case NEGY: { + this.y -= amount; + break; + } + case POSZ: { + this.z += amount; + break; + } + case NEGZ: { + this.z -= amount; + break; + } + case POSX: { + this.x += amount; + break; + } + case NEGX: { + this.x -= amount; + break; + } + default: + break; + } + } + + public void moveBackwards(final double amount) { + switch (this.facing) { + case POSY: { + this.y -= amount; + break; + } + case NEGY: { + this.y += amount; + break; + } + case POSZ: { + this.z -= amount; + break; + } + case NEGZ: { + this.z += amount; + break; + } + case POSX: { + this.x -= amount; + break; + } + case NEGX: { + this.x += amount; + break; + } + default: + break; + } + } + + // TODO: waiting on auracore update + //public TileEntity getConnectableTile(final World w) { + // this.moveForwards(1.0); + // final TileEntity te + // = w.getTileEntity((int) this.x, (int) this.y, (int) this.z); + // if (te instanceof IConnection + // && ((IConnection) te).getConnectable(this.facing.turnAround())) { + // return te; + // } + // return null; + //} + + public TileEntity getFacingTile(final World w) { + this.moveForwards(1.0); + final TileEntity te + = w.getTileEntity((int) this.x, (int) this.y, (int) this.z); + if (te != null) { + return te; + } + return null; + } + + //public TileEntity getConnectableTile(final IBlockAccess ibc) { + // this.moveForwards(1.0); + // final TileEntity te + // = ibc.getTileEntity((int) this.x, (int) this.y, (int) this.z); + // if (te instanceof IConnection + // && ((IConnection) te).getConnectable(this.facing.turnAround())) { + // return te; + // } + // return null; + //} + + public boolean equals(final HelperLocation loc) { + return this.x == loc.x && this.y == loc.y && this.z == loc.z; + } +} diff --git a/src/main/java/net/anvilcraft/arcaneseals/utils/UtilsFX.java b/src/main/java/net/anvilcraft/arcaneseals/utils/UtilsFX.java new file mode 100644 index 0000000..b21cd96 --- /dev/null +++ b/src/main/java/net/anvilcraft/arcaneseals/utils/UtilsFX.java @@ -0,0 +1,275 @@ +package net.anvilcraft.arcaneseals.utils; + +import dev.tilera.auracore.client.FXSparkle; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.world.World; +import thaumcraft.client.fx.particles.FXWisp; + +public class UtilsFX { + public static void poof(World worldObj, float x, float y, float z) { + int puffs = 6; + + for (int a = 0; a < puffs; ++a) { + worldObj.spawnParticle( + "explode", + (double) (x + worldObj.rand.nextFloat()), + (double) (y + worldObj.rand.nextFloat()), + (double) (z + worldObj.rand.nextFloat()), + -0.0, + -0.0, + -0.0 + ); + } + } + + public static void poofUpwards(World w, int x, int y, int z, int color) { + int puffs = 10; + + for (int a = 0; a < puffs; ++a) { + float xx = (float) x + w.rand.nextFloat(); + float zz = (float) z + w.rand.nextFloat(); + FXWisp ef = new FXWisp( + w, + (double) xx, + (double) y, + (double) zz, + (double) xx, + (double) ((float) y + 0.5F + w.rand.nextFloat()), + (double) zz, + 0.3F, + color + ); + ef.tinkle = false; + ef.shrink = true; + Minecraft.getMinecraft().effectRenderer.addEffect(ef); + } + } + + public static void sparkleDown(World w, int x, int y, int z, int color) { + int puffs = 16; + + for (int a = 0; a < puffs; ++a) { + float xx = (float) x + w.rand.nextFloat(); + float zz = (float) z + w.rand.nextFloat(); + FXSparkle ef = new FXSparkle( + w, + (double) xx, + (double) ((float) y + w.rand.nextFloat() * 0.5F), + (double) zz, + (double) xx, + (double) y, + (double) zz, + 2.0F, + color, + 5 + ); + ef.tinkle = true; + Minecraft.getMinecraft().effectRenderer.addEffect(ef); + } + } + + public static void sparkleUp(World w, int x, int y, int z, int color) { + int puffs = 16; + + for (int a = 0; a < puffs; ++a) { + float xx = (float) x + w.rand.nextFloat(); + float zz = (float) z + w.rand.nextFloat(); + FXSparkle ef = new FXSparkle( + w, + (double) xx, + (double) y, + (double) zz, + (double) xx, + (double) ((float) y + w.rand.nextFloat() * 0.5F), + (double) zz, + 2.0F, + color, + 5 + ); + ef.tinkle = true; + Minecraft.getMinecraft().effectRenderer.addEffect(ef); + } + } + + public static void renderItemIn2D( + Tessellator tes, + float p_78439_1_, + float p_78439_2_, + float p_78439_3_, + float p_78439_4_, + int p_78439_5_, + int p_78439_6_, + float p_78439_7_, + int brightness + ) { + tes.startDrawingQuads(); + tes.setBrightness(brightness); + tes.setNormal(0.0F, 0.0F, 1.0F); + tes.addVertexWithUV(0.0D, 0.0D, 0.0D, (double) p_78439_1_, (double) p_78439_4_); + tes.addVertexWithUV(1.0D, 0.0D, 0.0D, (double) p_78439_3_, (double) p_78439_4_); + tes.addVertexWithUV(1.0D, 1.0D, 0.0D, (double) p_78439_3_, (double) p_78439_2_); + tes.addVertexWithUV(0.0D, 1.0D, 0.0D, (double) p_78439_1_, (double) p_78439_2_); + tes.draw(); + tes.startDrawingQuads(); + tes.setBrightness(brightness); + tes.setNormal(0.0F, 0.0F, -1.0F); + tes.addVertexWithUV( + 0.0D, + 1.0D, + (double) (0.0F - p_78439_7_), + (double) p_78439_1_, + (double) p_78439_2_ + ); + tes.addVertexWithUV( + 1.0D, + 1.0D, + (double) (0.0F - p_78439_7_), + (double) p_78439_3_, + (double) p_78439_2_ + ); + tes.addVertexWithUV( + 1.0D, + 0.0D, + (double) (0.0F - p_78439_7_), + (double) p_78439_3_, + (double) p_78439_4_ + ); + tes.addVertexWithUV( + 0.0D, + 0.0D, + (double) (0.0F - p_78439_7_), + (double) p_78439_1_, + (double) p_78439_4_ + ); + tes.draw(); + float f5 = 0.5F * (p_78439_1_ - p_78439_3_) / (float) p_78439_5_; + float f6 = 0.5F * (p_78439_4_ - p_78439_2_) / (float) p_78439_6_; + tes.startDrawingQuads(); + tes.setBrightness(brightness); + tes.setNormal(-1.0F, 0.0F, 0.0F); + int k; + float f7; + float f8; + + for (k = 0; k < p_78439_5_; ++k) { + f7 = (float) k / (float) p_78439_5_; + f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5; + tes.addVertexWithUV( + (double) f7, + 0.0D, + (double) (0.0F - p_78439_7_), + (double) f8, + (double) p_78439_4_ + ); + tes.addVertexWithUV( + (double) f7, 0.0D, 0.0D, (double) f8, (double) p_78439_4_ + ); + tes.addVertexWithUV( + (double) f7, 1.0D, 0.0D, (double) f8, (double) p_78439_2_ + ); + tes.addVertexWithUV( + (double) f7, + 1.0D, + (double) (0.0F - p_78439_7_), + (double) f8, + (double) p_78439_2_ + ); + } + + tes.draw(); + tes.startDrawingQuads(); + tes.setBrightness(brightness); + tes.setNormal(1.0F, 0.0F, 0.0F); + float f9; + + for (k = 0; k < p_78439_5_; ++k) { + f7 = (float) k / (float) p_78439_5_; + f8 = p_78439_1_ + (p_78439_3_ - p_78439_1_) * f7 - f5; + f9 = f7 + 1.0F / (float) p_78439_5_; + tes.addVertexWithUV( + (double) f9, + 1.0D, + (double) (0.0F - p_78439_7_), + (double) f8, + (double) p_78439_2_ + ); + tes.addVertexWithUV( + (double) f9, 1.0D, 0.0D, (double) f8, (double) p_78439_2_ + ); + tes.addVertexWithUV( + (double) f9, 0.0D, 0.0D, (double) f8, (double) p_78439_4_ + ); + tes.addVertexWithUV( + (double) f9, + 0.0D, + (double) (0.0F - p_78439_7_), + (double) f8, + (double) p_78439_4_ + ); + } + + tes.draw(); + tes.startDrawingQuads(); + tes.setBrightness(brightness); + tes.setNormal(0.0F, 1.0F, 0.0F); + + for (k = 0; k < p_78439_6_; ++k) { + f7 = (float) k / (float) p_78439_6_; + f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6; + f9 = f7 + 1.0F / (float) p_78439_6_; + tes.addVertexWithUV( + 0.0D, (double) f9, 0.0D, (double) p_78439_1_, (double) f8 + ); + tes.addVertexWithUV( + 1.0D, (double) f9, 0.0D, (double) p_78439_3_, (double) f8 + ); + tes.addVertexWithUV( + 1.0D, + (double) f9, + (double) (0.0F - p_78439_7_), + (double) p_78439_3_, + (double) f8 + ); + tes.addVertexWithUV( + 0.0D, + (double) f9, + (double) (0.0F - p_78439_7_), + (double) p_78439_1_, + (double) f8 + ); + } + + tes.draw(); + tes.startDrawingQuads(); + tes.setBrightness(brightness); + tes.setNormal(0.0F, -1.0F, 0.0F); + + for (k = 0; k < p_78439_6_; ++k) { + f7 = (float) k / (float) p_78439_6_; + f8 = p_78439_4_ + (p_78439_2_ - p_78439_4_) * f7 - f6; + tes.addVertexWithUV( + 1.0D, (double) f7, 0.0D, (double) p_78439_3_, (double) f8 + ); + tes.addVertexWithUV( + 0.0D, (double) f7, 0.0D, (double) p_78439_1_, (double) f8 + ); + tes.addVertexWithUV( + 0.0D, + (double) f7, + (double) (0.0F - p_78439_7_), + (double) p_78439_1_, + (double) f8 + ); + tes.addVertexWithUV( + 1.0D, + (double) f7, + (double) (0.0F - p_78439_7_), + (double) p_78439_3_, + (double) f8 + ); + } + + tes.draw(); + } +} diff --git a/src/main/resources/assets/arcaneseals/lang/en_US.lang b/src/main/resources/assets/arcaneseals/lang/en_US.lang new file mode 100644 index 0000000..05c96e7 --- /dev/null +++ b/src/main/resources/assets/arcaneseals/lang/en_US.lang @@ -0,0 +1,14 @@ +itemGroup.arcaneseals=Arcane Seals + +# ==== BLOCKS ==== + +tile.arcaneseals:seal.name=Arcane Seal + +# ==== ITEMS ==== + +arcaneseals:runic_essence.0.name=Runic Essence: Magic +arcaneseals:runic_essence.1.name=Runic Essence: Air +arcaneseals:runic_essence.2.name=Runic Essence: Water +arcaneseals:runic_essence.3.name=Runic Essence: Earth +arcaneseals:runic_essence.4.name=Runic Essence: Fire +arcaneseals:runic_essence.5.name=Runic Essence: Dark diff --git a/src/main/resources/assets/arcaneseals/textures/blocks/seal.png b/src/main/resources/assets/arcaneseals/textures/blocks/seal.png new file mode 100644 index 0000000..079f5f7 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/blocks/seal.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/items/runic_essence_0.png b/src/main/resources/assets/arcaneseals/textures/items/runic_essence_0.png new file mode 100644 index 0000000..e867006 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/items/runic_essence_0.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/items/runic_essence_1.png b/src/main/resources/assets/arcaneseals/textures/items/runic_essence_1.png new file mode 100644 index 0000000..28d4b84 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/items/runic_essence_1.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/items/runic_essence_2.png b/src/main/resources/assets/arcaneseals/textures/items/runic_essence_2.png new file mode 100644 index 0000000..5889934 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/items/runic_essence_2.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/items/runic_essence_3.png b/src/main/resources/assets/arcaneseals/textures/items/runic_essence_3.png new file mode 100644 index 0000000..793059f Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/items/runic_essence_3.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/items/runic_essence_4.png b/src/main/resources/assets/arcaneseals/textures/items/runic_essence_4.png new file mode 100644 index 0000000..1764fa4 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/items/runic_essence_4.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/items/runic_essence_5.png b/src/main/resources/assets/arcaneseals/textures/items/runic_essence_5.png new file mode 100644 index 0000000..d65a9b6 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/items/runic_essence_5.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/misc/portal.png b/src/main/resources/assets/arcaneseals/textures/misc/portal.png new file mode 100644 index 0000000..d7a434c Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/misc/portal.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/misc/portal2.png b/src/main/resources/assets/arcaneseals/textures/misc/portal2.png new file mode 100644 index 0000000..562ab3c Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/misc/portal2.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/misc/s_0_0.png b/src/main/resources/assets/arcaneseals/textures/misc/s_0_0.png new file mode 100644 index 0000000..2747efc Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/misc/s_0_0.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/misc/s_0_1.png b/src/main/resources/assets/arcaneseals/textures/misc/s_0_1.png new file mode 100644 index 0000000..40bc8a1 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/misc/s_0_1.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/misc/s_0_2.png b/src/main/resources/assets/arcaneseals/textures/misc/s_0_2.png new file mode 100644 index 0000000..efe948e Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/misc/s_0_2.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/misc/s_0_3.png b/src/main/resources/assets/arcaneseals/textures/misc/s_0_3.png new file mode 100644 index 0000000..f69cdf9 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/misc/s_0_3.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/misc/s_0_4.png b/src/main/resources/assets/arcaneseals/textures/misc/s_0_4.png new file mode 100644 index 0000000..6a083e1 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/misc/s_0_4.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/misc/s_0_5.png b/src/main/resources/assets/arcaneseals/textures/misc/s_0_5.png new file mode 100644 index 0000000..d657713 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/misc/s_0_5.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/misc/s_1_0.png b/src/main/resources/assets/arcaneseals/textures/misc/s_1_0.png new file mode 100644 index 0000000..981fb59 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/misc/s_1_0.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/misc/s_1_1.png b/src/main/resources/assets/arcaneseals/textures/misc/s_1_1.png new file mode 100644 index 0000000..2c3b8a9 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/misc/s_1_1.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/misc/s_1_2.png b/src/main/resources/assets/arcaneseals/textures/misc/s_1_2.png new file mode 100644 index 0000000..b27c09e Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/misc/s_1_2.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/misc/s_1_3.png b/src/main/resources/assets/arcaneseals/textures/misc/s_1_3.png new file mode 100644 index 0000000..f26adf3 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/misc/s_1_3.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/misc/s_1_4.png b/src/main/resources/assets/arcaneseals/textures/misc/s_1_4.png new file mode 100644 index 0000000..5f05b81 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/misc/s_1_4.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/misc/s_1_5.png b/src/main/resources/assets/arcaneseals/textures/misc/s_1_5.png new file mode 100644 index 0000000..c67e2a0 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/misc/s_1_5.png differ diff --git a/src/main/resources/assets/arcaneseals/textures/misc/seal5.png b/src/main/resources/assets/arcaneseals/textures/misc/seal5.png new file mode 100644 index 0000000..8f561e1 Binary files /dev/null and b/src/main/resources/assets/arcaneseals/textures/misc/seal5.png differ