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

Miner #2170

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open

Miner #2170

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c6a3a02
Small refactor
Tictim Sep 24, 2023
6b1b652
Smaller Refactor
Tictim Oct 6, 2023
1df0cdc
Smallest Refactor
Tictim Oct 31, 2023
6199a55
Actually small this time
Tictim Nov 5, 2023
48c0d1d
Smallester miner retexture
Tictim Nov 8, 2023
55d55ee
Smallestest refactor
Tictim Nov 8, 2023
22b82eb
They really should stop doing "Haha small refactor" joke on commit me…
Tictim Nov 12, 2023
fad4158
Medium sized refactor
Tictim Nov 13, 2023
ba9b816
Merge branch 'master' into miner
Tictim Nov 13, 2023
87f39b9
Suspiciously sized refactor
Tictim Nov 16, 2023
4f8cd7d
Recipe tweak (first actually helpful commit message, this is shocking)
Tictim Nov 16, 2023
302193d
Rest in piss steam miner 😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭😭…
Tictim Nov 16, 2023
f028a3e
Relocate mining pipe model classes to client package
Tictim Nov 16, 2023
6747b3b
Relocate miner render helper class to client package
Tictim Nov 16, 2023
51db077
Fuck
Tictim Nov 16, 2023
0270073
?
Tictim Nov 16, 2023
783bb40
Don't lie
Tictim Nov 16, 2023
a73ff6a
Fuck
Tictim Nov 16, 2023
01c5058
Lang cleanup
Tictim Nov 16, 2023
2b0350c
More GUI shenanigans
Tictim Nov 19, 2023
427c106
oops
Tictim Nov 19, 2023
297c073
Merge branch 'master' into miner
Tictim Nov 23, 2023
e7cac6d
me and my boys merging
Tictim Nov 23, 2023
7fe538c
review
Tictim Nov 23, 2023
a536012
Merge branch 'master' into HEAD
Tictim Nov 28, 2023
8af6d50
Merge branch 'master' into miner
Tictim Nov 30, 2023
336ecc9
change annotations
Tictim Dec 1, 2023
528d5d7
Merge branch 'master' into miner
Tictim Dec 2, 2023
94221d6
Merge branch 'master' into miner
Tictim Dec 7, 2023
d5293b5
amo
Tictim Dec 7, 2023
6de4916
fix button
Tictim Dec 7, 2023
5abe237
Merge branch 'master' into miner
Tictim Dec 21, 2023
b5047f3
holy shit so many spots
Tictim Dec 21, 2023
f31f2d1
Fuck you spotless
Tictim Dec 21, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,11 @@ public static int assignId() {
public static final int INIT_CLIPBOARD_NBT = assignId();

public static final int UPDATE_UI = assignId(); // 10-36
// Pump
// Pump, Miner
public static final int PUMP_HEAD_LEVEL = assignId();
// Miner
public static final int MINER_UPDATE_PREVIEW = assignId();
public static final int MINER_UPDATE_ACTIVE = assignId();

// Item Collector, Magic Energy Absorber, Large Boiler, Steam Oven
public static final int IS_WORKING = assignId();
Expand Down
22 changes: 0 additions & 22 deletions src/main/java/gregtech/api/capability/IMiner.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,15 @@
import gregtech.api.GTValues;
import gregtech.api.capability.GregtechDataCodes;
import gregtech.api.capability.IVentable;
import gregtech.api.damagesources.DamageSources;
import gregtech.api.metatileentity.MetaTileEntity;
import gregtech.api.recipes.Recipe;
import gregtech.api.recipes.RecipeMap;
import gregtech.api.util.GTUtility;
import gregtech.common.ConfigHolder;
import gregtech.core.advancement.AdvancementTriggers;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.init.SoundEvents;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.EntitySelectors;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.WorldServer;
import net.minecraftforge.fluids.IFluidTank;

import org.jetbrains.annotations.NotNull;
Expand Down Expand Up @@ -126,46 +113,15 @@ public void receiveInitialSyncData(@NotNull PacketBuffer buf) {

@Override
public void tryDoVenting() {
BlockPos machinePos = metaTileEntity.getPos();
EnumFacing ventingSide = getVentingSide();
BlockPos ventingBlockPos = machinePos.offset(ventingSide);
IBlockState blockOnPos = metaTileEntity.getWorld().getBlockState(ventingBlockPos);
if (blockOnPos.getCollisionBoundingBox(metaTileEntity.getWorld(), ventingBlockPos) == Block.NULL_AABB) {
performVentingAnimation(ventingBlockPos, machinePos);
} else if (GTUtility.tryBreakSnow(metaTileEntity.getWorld(), ventingBlockPos, blockOnPos, false)) {
performVentingAnimation(ventingBlockPos, machinePos);
} else if (!ventingStuck) {
if (GTUtility.tryVenting(metaTileEntity.getWorld(), metaTileEntity.getPos(), getVentingSide(),
this.isHighPressure ? 12 : 6, true,
ConfigHolder.machines.machineSounds && !this.metaTileEntity.isMuffled())) {
setNeedsVenting(false);
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this setVentingStuck here still first check !ventingStuck?

setVentingStuck(true);
}
}

private void performVentingAnimation(BlockPos ventingBlockPos, BlockPos machinePos) {
metaTileEntity.getWorld()
.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(ventingBlockPos),
EntitySelectors.CAN_AI_TARGET)
.forEach(entity -> {
entity.attackEntityFrom(DamageSources.getHeatDamage(), this.isHighPressure ? 12.0f : 6.0f);
if (entity instanceof EntityPlayerMP) {
AdvancementTriggers.STEAM_VENT_DEATH.trigger((EntityPlayerMP) entity);
}
});
WorldServer world = (WorldServer) metaTileEntity.getWorld();
double posX = machinePos.getX() + 0.5 + ventingSide.getXOffset() * 0.6;
double posY = machinePos.getY() + 0.5 + ventingSide.getYOffset() * 0.6;
double posZ = machinePos.getZ() + 0.5 + ventingSide.getZOffset() * 0.6;

world.spawnParticle(EnumParticleTypes.CLOUD, posX, posY, posZ,
7 + world.rand.nextInt(3),
ventingSide.getXOffset() / 2.0,
ventingSide.getYOffset() / 2.0,
ventingSide.getZOffset() / 2.0, 0.1);
if (ConfigHolder.machines.machineSounds && !metaTileEntity.isMuffled()) {
world.playSound(null, posX, posY, posZ, SoundEvents.BLOCK_LAVA_EXTINGUISH, SoundCategory.BLOCKS, 1.0f,
1.0f);
}
setNeedsVenting(false);
}

@Override
public void update() {
if (getMetaTileEntity().getWorld().isRemote)
Expand Down
Loading