Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laser Meteor Miner #3116

Open
wants to merge 101 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
d71a16c
Added Totto as author
zTotto Sep 4, 2024
c1f2400
Added initial Meteor Miner files
zTotto Sep 4, 2024
0227fb3
Added skeleton of Meteor Miner
zTotto Sep 4, 2024
2ed6724
Trying to make the multiblock form
zTotto Sep 4, 2024
843ed1e
Update
zTotto Sep 5, 2024
b8d17f8
Testing laser casing
zTotto Sep 5, 2024
7118984
Fixed wrong block
zTotto Sep 5, 2024
3783e5d
Added rotation checks and starting mining position
zTotto Sep 5, 2024
f53c0d5
Added initial working state
zTotto Sep 5, 2024
0b6dcfd
Fixed wrong direction detection and added initial mining function
zTotto Sep 5, 2024
b02426a
Added gui text
zTotto Sep 5, 2024
703dfa7
Added mining logic and initial drop logic
zTotto Sep 5, 2024
0b70e13
fixed output not clearing
zTotto Sep 6, 2024
7ad3cc2
Added optimization check (empty rows have 2 * radius - 1 less checks)
zTotto Sep 6, 2024
377d6a6
Added check for unbreakable blocks (warded glass)
zTotto Sep 6, 2024
9fd7536
Fixed output
zTotto Sep 6, 2024
b4be74f
Fixed drops
zTotto Sep 6, 2024
c71ace9
Fixed hardness check, merged drops to avoid GUI spam
zTotto Sep 6, 2024
f19098e
Fixed concurrent modification exception
zTotto Sep 6, 2024
5ecb8b3
Added radius optimization
zTotto Sep 6, 2024
1e86af3
Minor fix
zTotto Sep 6, 2024
7c0ac2b
Updated observing mode
zTotto Sep 6, 2024
06d811e
Fixed wait state
zTotto Sep 6, 2024
f86ca3d
Fixed radius loop and refactoring
zTotto Sep 6, 2024
c5d446d
Improved waiting state
zTotto Sep 6, 2024
7a149b4
Fixed wrong center being calculated
zTotto Sep 7, 2024
b7188d9
Added auto saving of state
zTotto Sep 7, 2024
c0594fa
Added restart + button
zTotto Sep 7, 2024
e54eefa
Improved reset and added more optimization
zTotto Sep 7, 2024
6257d6b
Removed debug prints
zTotto Sep 7, 2024
a67034d
Added laser emitting block and its renderer
zTotto Sep 7, 2024
fefdf31
Added laser rendering to Meteor Miner
zTotto Sep 7, 2024
25dac2d
improved laser beam
zTotto Sep 7, 2024
adcd16d
Made laser beam dynamic and switched coordinates for mining
zTotto Sep 8, 2024
383bd07
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 8, 2024
479b672
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 8, 2024
1cb7c88
Updated structure
zTotto Sep 8, 2024
db81dc0
Merge branch 'master' of https://github.com/GTNewHorizons/GT5-Unoffic…
zTotto Sep 8, 2024
346d869
Merge branch 'laserMeteorMiner' of https://github.com/zTotto/GT5-Unof…
zTotto Sep 8, 2024
e6f0cd9
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 9, 2024
a92e0d7
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 9, 2024
5462e8c
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 10, 2024
a82383f
Added recipes for miner and laser beacon
zTotto Sep 10, 2024
5192806
Added tier to fortune, todo: add something to determine fortune
zTotto Sep 10, 2024
9853934
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 10, 2024
ee52db5
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 10, 2024
daba56e
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 11, 2024
5fe366c
sa
Dream-Master Sep 11, 2024
5bb9a30
Added Fortune tiers
zTotto Sep 11, 2024
f7348be
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 11, 2024
31fe195
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 11, 2024
0c3dda6
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 11, 2024
52e478a
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 12, 2024
b911c1c
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 12, 2024
c9dfc5d
Added Meteor Miner schematics (no textures yet)
zTotto Sep 12, 2024
270dac4
Added tier 2 structure
zTotto Sep 12, 2024
379f6a4
Better rendering logic
zTotto Sep 12, 2024
94cc952
Made functioning Tier 2
zTotto Sep 12, 2024
fe4d7d1
Updated tooltip
zTotto Sep 12, 2024
2847c93
Tooltip fix
zTotto Sep 12, 2024
ae70d55
Added tier 2 parallelism
zTotto Sep 12, 2024
ff2ae69
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 12, 2024
f64795b
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 12, 2024
3b7d58e
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 12, 2024
45cfeeb
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 12, 2024
9f63728
Increased radius for bigger meteors
zTotto Sep 12, 2024
d29332f
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 13, 2024
09e1135
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 13, 2024
257cca4
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 13, 2024
9f2ddf9
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 13, 2024
6aabac0
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 14, 2024
8e16e9e
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 14, 2024
d35dec7
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 14, 2024
d37f7bb
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 15, 2024
1aef83c
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 15, 2024
327c849
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 15, 2024
9c606fe
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 17, 2024
1b58b19
Added waila tooltip text
zTotto Sep 17, 2024
215ec0e
Added waila text + minor fortune refactoring
zTotto Sep 17, 2024
7139a16
Fortune minor fix
zTotto Sep 17, 2024
c51e903
Fixed wrong fortune order
zTotto Sep 17, 2024
c7dca08
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 17, 2024
f642270
Improved output logic
zTotto Sep 18, 2024
2cfe251
Added T1 schematic texture
zTotto Sep 18, 2024
7ce1354
Fixed tooltip
zTotto Sep 18, 2024
7fa9057
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 18, 2024
cf38def
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 20, 2024
1b940bd
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 20, 2024
91d8653
removed craftings (moved to coremod)
zTotto Sep 20, 2024
037e1b6
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 21, 2024
0e9be05
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 21, 2024
497075a
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 21, 2024
9cf49b1
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 24, 2024
86f16c7
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 28, 2024
af413d0
Added Tier 2 Schematic Texture
zTotto Sep 30, 2024
d7344bb
Reworked outputs and speed
zTotto Sep 30, 2024
d4ddeed
Fixed start imports
zTotto Sep 30, 2024
4cb5bdb
Merge branch 'master' into laserMeteorMiner
Dream-Master Sep 30, 2024
352cfae
Added OC calculator
zTotto Sep 30, 2024
262a611
Fixed tooltip
zTotto Oct 7, 2024
c9b97e4
Spotless
zTotto Oct 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/main/java/gregtech/api/GregTechAPI.java
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ public class GregTechAPI {
public static Block sBlockGlass1;
public static Block sBlockTintedGlass;
public static Block sLaserRender;
public static Block sLaserBeaconRender;
public static Block sWormholeRender;
public static Block sBlackholeRender;
/**
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/gregtech/api/enums/GTValues.java
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,8 @@ public static final class NBT {
+ "Gold";
public static final String AuthorVolence = "Author: " + EnumChatFormatting.AQUA + "Volence";

public static final String AuthorTotto = "Author: " + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + "Totto";

public static final String AuthorEigenRaven = "Author: " + EnumChatFormatting.DARK_PURPLE
+ "Eigen"
+ EnumChatFormatting.BOLD
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/gregtech/api/enums/ItemList.java
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,8 @@ public enum ItemList implements IItemContainer {
Casing_Fluid_Solidifier,
Radiator_Fluid_Solidifier,

MeteorMiner,

Machine_Multi_IndustrialCompressor,
Machine_Multi_HIPCompressor,
Machine_Multi_NeutroniumCompressor,
Expand All @@ -1506,6 +1508,7 @@ public enum ItemList implements IItemContainer {

Machine_Multi_IndustrialLaserEngraver,
Laser_Plate,
Laser_Beacon,
Casing_Laser,

Machine_Multi_IndustrialExtractor,
Expand Down
1 change: 1 addition & 0 deletions src/main/java/gregtech/api/enums/MetaTileEntityIDs.java
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ public enum MetaTileEntityIDs {
BLACKHOLE_COMPRESSOR_CONTROLLER(3008),
HEAT_DETECTOR_HATCH(3009),
INDUSTRIAL_EXTRACTOR_CONTROLLER(3010),
METEOR_MINER_CONTROLLER(3011),
DraconicEvolutionFusionCrafterController(5001),
CHEST_BUFFER_ULV(9230),
CHEST_BUFFER_LV(9231),
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/gregtech/api/enums/Textures.java
Original file line number Diff line number Diff line change
Expand Up @@ -367,12 +367,18 @@ public enum BlockIcons implements IIconContainer, Runnable {
OVERLAY_FRONT_INDUSTRIAL_EXTRACTOR_GLOW,

LASER_PLATE,
LASER_BEACON,
MACHINE_CASING_LASER,
OVERLAY_FRONT_ENGRAVER,
OVERLAY_FRONT_ENGRAVER_ACTIVE,
OVERLAY_FRONT_ENGRAVER_ACTIVE_GLOW,
OVERLAY_FRONT_ENGRAVER_GLOW,

OVERLAY_FRONT_METEOR_MINER,
OVERLAY_FRONT_METEOR_MINER_ACTIVE,
OVERLAY_FRONT_METEOR_MINER_ACTIVE_GLOW,
OVERLAY_FRONT_METEOR_MINER_GLOW,

OVERLAY_FRONT_MULTI_LATHE,
OVERLAY_FRONT_MULTI_LATHE_ACTIVE,
OVERLAY_FRONT_MULTI_LATHE_ACTIVE_GLOW,
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/gregtech/common/GTClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
import gregtech.common.render.GTRendererBlock;
import gregtech.common.render.LaserRenderer;
import gregtech.common.render.MetaGeneratedToolRenderer;
import gregtech.common.render.MeteorMinerRenderer;
import gregtech.common.render.MultiTileRenderer;
import gregtech.common.render.PollutionRenderer;
import gregtech.common.render.WormholeRenderer;
Expand Down Expand Up @@ -632,6 +633,7 @@ public void onLoad() {
new MultiTileRenderer();
new DroneRender();
new LaserRenderer();
new MeteorMinerRenderer();
new WormholeRenderer();
new BlackholeRenderer();

Expand Down
106 changes: 106 additions & 0 deletions src/main/java/gregtech/common/blocks/BlockLaserBeacon.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
package gregtech.common.blocks;

import net.minecraft.block.Block;
import net.minecraft.block.ITileEntityProvider;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;

import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gregtech.api.GregTechAPI;
import gregtech.api.enums.ItemList;
import gregtech.api.enums.Textures;
import gregtech.api.util.GTLanguageManager;
import gregtech.common.tileentities.render.TileEntityLaserBeacon;

public class BlockLaserBeacon extends Block implements ITileEntityProvider {

protected IIcon topBlockIcon;
public static IIcon[] textures;

public BlockLaserBeacon() {
super(Material.iron);
setBlockName("LaserBeacon");
this.setCreativeTab(GregTechAPI.TAB_GREGTECH);
GTLanguageManager.addStringLocalization(getUnlocalizedName() + ".name", "Laser Inducing Beacon");
GregTechAPI.registerMachineBlock(this, -1);
GameRegistry.registerBlock(this, ItemBlockLaserBeacon.class, getUnlocalizedName());
ItemList.Laser_Beacon.set(new ItemStack(this, 1));
}

@Override
public void onBlockAdded(World aWorld, int aX, int aY, int aZ) {
if (GregTechAPI.isMachineBlock(this, aWorld.getBlockMetadata(aX, aY, aZ))) {
GregTechAPI.causeMachineUpdate(aWorld, aX, aY, aZ);
}
}

@Override
public void breakBlock(World aWorld, int aX, int aY, int aZ, Block aBlock, int aMetaData) {
if (GregTechAPI.isMachineBlock(this, aMetaData)) {
GregTechAPI.causeMachineUpdate(aWorld, aX, aY, aZ);
}
}

@Override
public String getHarvestTool(int aMeta) {
return "wrench";
}

@Override
public int getHarvestLevel(int aMeta) {
return 2;
}

@Override
public String getUnlocalizedName() {
return "gt.laserbeacon";
}

@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
blockIcon = Textures.BlockIcons.MACHINE_COIL_SUPERCONDUCTOR.getIcon();
topBlockIcon = Textures.BlockIcons.LASER_BEACON.getIcon();
}

@Override
public IIcon getIcon(int side, int meta) {
return side == 1 ? topBlockIcon : blockIcon;
}

@Override
public boolean renderAsNormalBlock() {
return false;
}

@Override
public float getBlockHardness(World world, int x, int y, int z) {
return 1.0f;
}

@Override
public int damageDropped(int meta) {
return meta;
}

@Override
public boolean isOpaqueCube() {
return false;
}

@Override
public boolean hasTileEntity(int metadata) {
return true;
}

@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityLaserBeacon();
}
}
25 changes: 25 additions & 0 deletions src/main/java/gregtech/common/blocks/ItemBlockLaserBeacon.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package gregtech.common.blocks;

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;

import gregtech.api.util.GTLanguageManager;

public class ItemBlockLaserBeacon extends ItemBlock {

public ItemBlockLaserBeacon(Block block) {
super(block);
}

@Override
public void addInformation(ItemStack stack, EntityPlayer player, List<String> tooltip, boolean f3_h) {
tooltip.add(
GTLanguageManager.addStringLocalization(
"gt.laserbeacontooltip",
"Produces a high precision laser from a powerful current"));
}
}
108 changes: 108 additions & 0 deletions src/main/java/gregtech/common/render/MeteorMinerRenderer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
package gregtech.common.render;

import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.tileentity.TileEntity;

import org.lwjgl.opengl.GL11;

import cpw.mods.fml.client.registry.ClientRegistry;
import gregtech.common.tileentities.render.TileEntityLaserBeacon;

public class MeteorMinerRenderer extends TileEntitySpecialRenderer {

final private double lineRadius = 0.25;

final private float lineOpacity = 0.7F;

public MeteorMinerRenderer() {
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityLaserBeacon.class, this);
}

private void renderFakeLine(TileEntityLaserBeacon laser, double x, double y1, double z, double y2) {
Tessellator tessellator = Tessellator.instance;
tessellator.setColorRGBA_F(laser.getRed(), laser.getGreen(), laser.getBlue(), lineOpacity);
double x1 = x - lineRadius;
double x2 = x + lineRadius;
double z1 = z - lineRadius;
double z2 = z + lineRadius;

// Bottom face
tessellator.startDrawingQuads();
tessellator.addVertex(x1, y1, z1);
tessellator.addVertex(x2, y1, z1);
tessellator.addVertex(x2, y1, z2);
tessellator.addVertex(x1, y1, z2);
tessellator.draw();

// Top face
tessellator.startDrawingQuads();
tessellator.addVertex(x1, y2, z1);
tessellator.addVertex(x2, y2, z1);
tessellator.addVertex(x2, y2, z2);
tessellator.addVertex(x1, y2, z2);
tessellator.draw();

// Side face 1
tessellator.startDrawingQuads();
tessellator.addVertex(x1, y1, z1);
tessellator.addVertex(x2, y1, z1);
tessellator.addVertex(x2, y2, z1);
tessellator.addVertex(x1, y2, z1);
tessellator.draw();

// Side face 2
tessellator.startDrawingQuads();
tessellator.addVertex(x2, y1, z1);
tessellator.addVertex(x2, y1, z2);
tessellator.addVertex(x2, y2, z2);
tessellator.addVertex(x2, y2, z1);
tessellator.draw();

// Side face 3
tessellator.startDrawingQuads();
tessellator.addVertex(x2, y1, z2);
tessellator.addVertex(x1, y1, z2);
tessellator.addVertex(x1, y2, z2);
tessellator.addVertex(x2, y2, z2);
tessellator.draw();

// Side face 4
tessellator.startDrawingQuads();
tessellator.addVertex(x1, y1, z2);
tessellator.addVertex(x1, y1, z1);
tessellator.addVertex(x1, y2, z1);
tessellator.addVertex(x1, y2, z2);
tessellator.draw();
}

@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float timeSinceLastTick) {
final TileEntityLaserBeacon ltile = (TileEntityLaserBeacon) tile;

if (ltile.getShouldRender()) {
// Push GL state
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);

GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_BLEND);

// Full brightness on this thing (Emits glow with shaders)
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.f, 240.f);

GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5);
GL11.glRotated(ltile.rotationAngle, ltile.rotAxisX, ltile.rotAxisY, ltile.rotAxisZ);
GL11.glTranslated(-x - 0.5, -y - 0.5, -z - 0.5);

double range = ltile.getRange();
renderFakeLine(ltile, x + 0.5, y + 35.5 + range, z + 0.5, y + 0.5);

GL11.glPopAttrib();
GL11.glPopMatrix();
}
}
}
Loading
Loading