feat: initial implementation

This commit is contained in:
LordMZTE 2022-11-21 00:29:42 +01:00
parent b23b573291
commit 42320de0b0
Signed by: LordMZTE
GPG Key ID: B64802DC33A64FF6
40 changed files with 4149 additions and 4 deletions

130
.clang-format Normal file
View File

@ -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"]

4
.gitignore vendored
View File

@ -1,3 +1,7 @@
.project
.classpath
bin
.settings
.gradle
.idea
build

View File

@ -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()
}
}
}
}

View File

@ -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");
}
}

View File

@ -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");
}
}

View File

@ -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();
}
}

View File

@ -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);
}
}

View File

@ -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());
}
}

View File

@ -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");
}
}

View File

@ -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;
}
}

View File

@ -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
);
}
}
}

View File

@ -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");
}
}

View File

@ -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);
}
}

File diff suppressed because it is too large Load Diff

View File

@ -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;
}
}
}
}

View File

@ -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;
}
}

View File

@ -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();
}
}

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 797 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 352 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB