diff options
| author | GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> | 2023-01-29 04:54:48 +0000 |
|---|---|---|
| committer | GTNH-Colen <54497873+GTNH-Colen@users.noreply.github.com> | 2023-01-29 04:54:48 +0000 |
| commit | 2b53fbfa9edcff6a5f6f24eb5ab3b5e4c22223a6 (patch) | |
| tree | f6847b66abba832ebef3c2434daef9a3bd20bf4c /src/main/java | |
| parent | 4a2d7a9de3dc2ba2e854fc054c686eb84fb6b0ff (diff) | |
| download | GT5-Unofficial-2b53fbfa9edcff6a5f6f24eb5ab3b5e4c22223a6.tar.gz GT5-Unofficial-2b53fbfa9edcff6a5f6f24eb5ab3b5e4c22223a6.tar.bz2 GT5-Unofficial-2b53fbfa9edcff6a5f6f24eb5ab3b5e4c22223a6.zip | |
?
Diffstat (limited to 'src/main/java')
3 files changed, 2829 insertions, 0 deletions
diff --git a/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffBlock.java b/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffBlock.java new file mode 100644 index 0000000000..2717a95425 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffBlock.java @@ -0,0 +1,107 @@ +package com.github.technus.tectech.thing.block; + +import static com.github.technus.tectech.Reference.MODID; + +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import eu.usrv.yamcore.blocks.BlockBase; +import java.util.ArrayList; +import java.util.Random; +import net.minecraft.block.material.Material; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + +/** + * Created by danie_000 on 17.12.2016. + */ +public final class QuantumStuffBlock extends BlockBase { + public static IIcon stuff; + public static int renderID; + public static QuantumStuffBlock INSTANCE; + + public QuantumStuffBlock() { + super(Material.iron); + setBlockBounds(0, 0, 0, 1, 1, 1); + setBlockName("quantumStuff"); + setHarvestLevel("wrench", 0); + setHardness(500); + setResistance(1); + setLightOpacity(0); + setBlockTextureName(MODID + ":blockQuantumStuff"); + } + + @Override + public boolean isBeaconBase(IBlockAccess worldObj, int x, int y, int z, int beaconX, int beaconY, int beaconZ) { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public void registerBlockIcons(IIconRegister p_149651_1_) { + super.registerBlockIcons(p_149651_1_); + stuff = blockIcon; + } + + @Override + public boolean isOpaqueCube() { + return false; + } + + @Override + public boolean getCanBlockGrass() { + return false; + } + + // @Override + // public boolean canRenderInPass(int pass) { + // return true; + // } + + @Override + public boolean canBeReplacedByLeaves(IBlockAccess world, int x, int y, int z) { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public int getRenderBlockPass() { + return 1; + } + + @Override + public boolean renderAsNormalBlock() { + return false; + } + + @Override + @SideOnly(Side.CLIENT) + public boolean shouldSideBeRendered( + IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) { + return false; + } + + @Override + public int getRenderType() { + return renderID; + } + + public static void run() { + INSTANCE = new QuantumStuffBlock(); + GameRegistry.registerBlock(INSTANCE, INSTANCE.getUnlocalizedName()); + } + + @Override + public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) { + return new ArrayList<>(); + } + + @Override + public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { + return null; + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffRender.java b/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffRender.java new file mode 100644 index 0000000000..1c974a1510 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/block/QuantumStuffRender.java @@ -0,0 +1,111 @@ +package com.github.technus.tectech.thing.block; + +import com.github.technus.tectech.TecTech; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; +import net.minecraft.util.Vec3; +import net.minecraft.world.IBlockAccess; +import org.lwjgl.opengl.GL11; + +/** + * Created by danie_000 on 19.12.2016. + */ +public final class QuantumStuffRender implements ISimpleBlockRenderingHandler { + private static Tessellator tes = Tessellator.instance; + + @Override + public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { + GL11.glTranslatef(-0.5F, -0.5F, -0.5F); + GL11.glPushMatrix(); + // Get icons from custom register (useful for renderers and fluids) + IIcon side = QuantumStuffBlock.stuff; + tes.startDrawingQuads(); + tes.setNormal(0.0F, -1.0F, 0.0F); + renderer.renderFaceYNeg(block, 0.0D, 0.0D, 0.0D, side); + tes.draw(); + tes.startDrawingQuads(); + tes.setNormal(0.0F, 0.0F, -1.0F); + renderer.renderFaceZNeg(block, 0.0D, 0.0D, 0.0D, side); + tes.draw(); + tes.startDrawingQuads(); + tes.setNormal(0.0F, 0.0F, 1.0F); + renderer.renderFaceZPos(block, 0.0D, 0.0D, 0.0D, side); + tes.draw(); + tes.startDrawingQuads(); + tes.setNormal(-1.0F, 0.0F, 0.0F); + renderer.renderFaceXNeg(block, 0.0D, 0.0D, 0.0D, side); + tes.draw(); + tes.startDrawingQuads(); + tes.setNormal(1.0F, 0.0F, 0.0F); + renderer.renderFaceXPos(block, 0.0D, 0.0D, 0.0D, side); + tes.draw(); + tes.startDrawingQuads(); + tes.setNormal(0.0F, 1.0F, 0.0F); + renderer.renderFaceYPos(block, 0.0D, 0.0D, 0.0D, side); + tes.draw(); + GL11.glTranslatef(0.5F, 0.5F, 0.5F); + GL11.glPopMatrix(); + } + + @Override + public boolean renderWorldBlock( + IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + // renderer.renderStandardBlock(block, x, y, z); + GL11.glPushMatrix(); + tes.setNormal(0F, 1F, 0F); + tes.setBrightness(15728880); + IIcon side = QuantumStuffBlock.stuff; + for (int i = 0; i < 6; i++) { + float f = 1 - TecTech.RANDOM.nextFloat() / 4f, + g = f - TecTech.RANDOM.nextFloat() / 4f, + r = g - TecTech.RANDOM.nextFloat() / 4f - 0.25f; + tes.setColorOpaque_F(r, g, f); + float rotX = TecTech.RANDOM.nextFloat() * 2 * (float) Math.PI, + rotY = TecTech.RANDOM.nextFloat() * 2 * (float) Math.PI, + rotZ = TecTech.RANDOM.nextFloat() * 2 * (float) Math.PI; + tesAbuse(x, y, z, -1.425f, -1.425f, .1f, rotX, rotY, rotZ, side.getMinU(), side.getMaxV()); + tesAbuse(x, y, z, -1.425f, 1.425f, .1f, rotX, rotY, rotZ, side.getMinU(), side.getMinV()); + tesAbuse(x, y, z, 1.425f, 1.425f, .1f, rotX, rotY, rotZ, side.getMaxU(), side.getMinV()); + tesAbuse(x, y, z, 1.425f, -1.425f, .1f, rotX, rotY, rotZ, side.getMaxU(), side.getMaxV()); + + tesAbuse(x, y, z, 1.425f, -1.425f, -.1f, rotX, rotY, rotZ, side.getMaxU(), side.getMaxV()); + tesAbuse(x, y, z, 1.425f, 1.425f, -.1f, rotX, rotY, rotZ, side.getMaxU(), side.getMinV()); + tesAbuse(x, y, z, -1.425f, 1.425f, -.1f, rotX, rotY, rotZ, side.getMinU(), side.getMinV()); + tesAbuse(x, y, z, -1.425f, -1.425f, -.1f, rotX, rotY, rotZ, side.getMinU(), side.getMaxV()); + } + GL11.glPopMatrix(); + return true; + } + + private void tesAbuse( + int x, + int y, + int z, + float sx, + float sy, + float sz, + float rotX, + float rotY, + float rotZ, + float sideU, + float sideV) { + Vec3 pos = Vec3.createVectorHelper(sx, sy, sz); + pos.rotateAroundX(rotX); + pos.rotateAroundY(rotY); + pos.rotateAroundZ(rotZ); + tes.addVertexWithUV(pos.xCoord + x + .5f, pos.yCoord + y + .5f, pos.zCoord + z + .5f, sideU, sideV); + } + + @Override + public boolean shouldRender3DInInventory(int modelId) { + return true; + } + + @Override + public int getRenderId() { + return QuantumStuffBlock.renderID; + } +} diff --git a/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java new file mode 100644 index 0000000000..9d595339d0 --- /dev/null +++ b/src/main/java/com/github/technus/tectech/thing/metaTileEntity/multi/GT_MetaTileEntity_EM_bhg.java @@ -0,0 +1,2611 @@ +package com.github.technus.tectech.thing.metaTileEntity.multi; + +import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.textureOffset; +import static com.github.technus.tectech.thing.casing.GT_Block_CasingsTT.texturePage; +import static com.github.technus.tectech.thing.casing.TT_Container_Casings.sBlockCasingsTT; +import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_decay.URANIUM_INGOT_MASS_DIFF; +import static com.github.technus.tectech.thing.metaTileEntity.multi.GT_MetaTileEntity_EM_decay.URANIUM_MASS_TO_EU_INSTANT; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.ofBlock; +import static com.gtnewhorizon.structurelib.structure.StructureUtility.transpose; +import static gregtech.api.util.GT_StructureUtility.ofHatchAdderOptional; +import static net.minecraft.util.StatCollector.translateToLocal; + +import com.github.technus.tectech.thing.block.QuantumGlassBlock; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.GT_MetaTileEntity_MultiblockBase_EM; +import com.github.technus.tectech.thing.metaTileEntity.multi.base.render.TT_RenderedExtendedFacingTexture; +import com.github.technus.tectech.util.CommonValues; +import com.gtnewhorizon.structurelib.alignment.constructable.IConstructable; +import com.gtnewhorizon.structurelib.structure.IStructureDefinition; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import gregtech.api.enums.Textures; +import gregtech.api.interfaces.ITexture; +import gregtech.api.interfaces.metatileentity.IMetaTileEntity; +import gregtech.api.interfaces.tileentity.IGregTechTileEntity; +import gregtech.api.util.GT_Multiblock_Tooltip_Builder; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; + +/** + * Created by danie_000 on 17.12.2016. + */ +public class GT_MetaTileEntity_EM_bhg extends GT_MetaTileEntity_MultiblockBase_EM implements IConstructable { + // region variables + private static Textures.BlockIcons.CustomIcon ScreenOFF; + private static Textures.BlockIcons.CustomIcon ScreenON; + + // todo CHECK VALUES + private static final double NEUTRONIUM_BLOCK_MASS = 4.1E17; + private static final double NEUTRONIUM_BLOCK_ATOM_COUNT = 2.4478671E44; + private static final double NEUTRONIUM_BLOCK_TO_EU_INSTANT = URANIUM_MASS_TO_EU_INSTANT + * NEUTRONIUM_BLOCK_MASS + / (URANIUM_INGOT_MASS_DIFF * 1.78266191e-36); // ~ 5.314e40 + private static final double NEUTRON_TO_EU_INSTANT = + NEUTRONIUM_BLOCK_TO_EU_INSTANT / NEUTRONIUM_BLOCK_ATOM_COUNT; // ~ 0.00021708694 + + public boolean glassDome = false; + // endregion + + // Time dillatation - to slow down the explosion thing but REALLY REDUCE POWER OUTPUT + // Startcodes to startup + // per dim disable thingies + + // region structure actual + private static final IStructureDefinition<GT_MetaTileEntity_EM_bhg> STRUCTURE_DEFINITION = + IStructureDefinition.<GT_MetaTileEntity_EM_bhg>builder() + .addShape("main_t1", transpose(new String[][] { + { + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " C C ", + " C C ", + " C C ", + " CCCCCCCCC ", + " C C ", + " CCCCCCCCC ", + " C C ", + " C C ", + " C C ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " " + }, + { + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " C C ", + " C C ", + " C C ", + " C C ", + " DDDDD ", + " DDCDCDD ", + " CCCCDCCDCCDCCCC ", + " DDDDDDD ", + " CCCCDCCDCCDCCCC ", + " DDCDCDD ", + " DDDDD ", + " C C ", + " C C ", + " C C ", + " C C ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " " + }, + { + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " C C ", + " C C ", + " C C ", + " D ", + " D ", + " DDDDDDD ", + " DD DD ", + " D EEE D ", + " CCC D EAAAE D CCC ", + " DDD EAAAE DDD ", + " CCC D EAAAE D CCC ", + " D EEE D ", + " DD DD ", + " DDDDDDD ", + " D ", + " D ", + " C C ", + " C C ", + " C C ", + " ", + " ", + " ", + " ", + " ", + " ", + " " + }, + { + " ", + " ", + " ", + " ", + " ", + " ", + " C C ", + " C C ", + " D ", + " D ", + " ", + " ", + " ", + " ", + " ", + " CC CC ", + " DD DD ", + " CC CC ", + " ", + " ", + " ", + " ", + " ", + " D ", + " D ", + " C C ", + " C C ", + " ", + " ", + " ", + " ", + " ", + " " + }, + { + " ", + " ", + " ", + " ", + " ", + " C C ", + " CCCCC ", + " D ", + " B ", + " B ", + " ", + " ", + " ", + " ", + " C C ", + " CC CC ", + " CDBB BBDC ", + " CC CC ", + " C C ", + " ", + " ", + " ", + " ", + " B ", + " B ", + " D ", + " CCCCC ", + " C C ", + " ", + " ", + " ", + " ", + " " + }, + { + " ", + " ", + " ", + " ", + " C C ", + " C C ", + " D ", + " EEEBEEE ", + " ", + " ", + " ", + " ", + " ", + " E E ", + " E E ", + " CC E E CC ", + " DB BD ", + " CC E E CC ", + " E E ", + " E E ", + " ", + " ", + " ", + " ", + " ", + " EEEBEEE ", + " D ", + " C C ", + " C C ", + " ", + " ", + " ", + " " + }, + { + " ", + " ", + " ", + " C C ", + " CCCCC ", + " D ", + " B ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " C C ", + " CC CC ", + " CDB BDC ", + " CC CC ", + " C C ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " B ", + " D ", + " CCCCC ", + " C C ", + " ", + " ", + " " + }, + { + " ", + " ", + " C C ", + " C C ", + " D ", + " EEEBEEE ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " E E ", + " E E ", + " CC E E CC ", + " DB BD ", + " CC E E CC ", + " E E ", + " E E ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " EEEBEEE ", + " D ", + " C C ", + " C C ", + " ", + " " + }, + { + " ", + " ", + " C C ", + " D ", + " B ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " C C ", + " DB BD ", + " C C ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " B ", + " D ", + " C C ", + " ", + " " + }, + { + " ", + " C C ", + " C C ", + " D ", + " B ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " CC CC ", + " DB BD ", + " CC CC ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " B ", + " D ", + " C C ", + " C C ", + " " + }, + { + " ", + " C C ", + " D ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " C C ", + " D D ", + " C C ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " D ", + " C C ", + " " + }, + { + " ", + " C C ", + " D ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " C C ", + " D D ", + " C C ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " D ", + " C C ", + " " + }, + { + " CCCCCCC ", + " C C ", + " DDDDDDD ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " D D ", + " D D ", + "CCD DCC", + " D D ", + "CCD DCC", + " D D ", + " D D ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", |
