Skip to content

Commit

Permalink
holy shit so many spots
Browse files Browse the repository at this point in the history
  • Loading branch information
Tictim committed Dec 21, 2023
1 parent 5abe237 commit b5047f3
Show file tree
Hide file tree
Showing 19 changed files with 201 additions and 126 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import gregtech.api.recipes.RecipeMap;
import gregtech.api.util.GTUtility;
import gregtech.common.ConfigHolder;

import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.PacketBuffer;
import net.minecraft.util.EnumFacing;
Expand Down Expand Up @@ -114,7 +115,7 @@ public void receiveInitialSyncData(@NotNull PacketBuffer buf) {
public void tryDoVenting() {
if (GTUtility.tryVenting(metaTileEntity.getWorld(), metaTileEntity.getPos(), getVentingSide(),
this.isHighPressure ? 12 : 6, true,
ConfigHolder.machines.machineSounds && !this.metaTileEntity.isMuffled()) ) {
ConfigHolder.machines.machineSounds && !this.metaTileEntity.isMuffled())) {
setNeedsVenting(false);
} else {
setVentingStuck(true);
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/gregtech/api/gui/GuiTextures.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ public class GuiTextures {
public static final TextureArea BUTTON_NO_FLEX = TextureArea.fullImage("textures/gui/widget/button_no_flex.png");
public static final TextureArea BUTTON_MULTI_MAP = TextureArea
.fullImage("textures/gui/widget/button_multi_map.png");
public static final TextureArea BUTTON_MINER_AREA_PREVIEW = TextureArea.fullImage("textures/gui/widget/button_miner_area_preview.png");
public static final TextureArea BUTTON_MINER_AREA_PREVIEW = TextureArea
.fullImage("textures/gui/widget/button_miner_area_preview.png");
public static final TextureArea BUTTON_MINER_CONFIG_MODE = TextureArea
.fullImage("textures/gui/widget/button_miner_config_mode.png");
public static final TextureArea BUTTON_THROTTLE_MINUS = TextureArea
Expand Down Expand Up @@ -409,7 +410,8 @@ public class GuiTextures {
.fullImage("textures/gui/progress_bar/progress_bar_turbine_rotor_durability.png");
public static final TextureArea PROGRESS_BAR_FLUID_RIG_DEPLETION = TextureArea
.fullImage("textures/gui/progress_bar/progress_bar_fluid_rig_depletion.png");
public static final TextureArea PROGRESS_BAR_MINER_DRILLING_FLUID = TextureArea.fullImage("textures/gui/progress_bar/progress_bar_miner_drilling_fluid.png");
public static final TextureArea PROGRESS_BAR_MINER_DRILLING_FLUID = TextureArea
.fullImage("textures/gui/progress_bar/progress_bar_miner_drilling_fluid.png");

// Fusion reactor diagram progress bar parts
public static final TextureArea PROGRESS_BAR_FUSION_REACTOR_DIAGRAM_BL = TextureArea
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ public ItemAndMetadata toWildcard() {

@Override
public boolean equals(Object o) {
return this == o || o instanceof ItemAndMetadata that && itemDamage == that.itemDamage && item.equals(that.item);
return this == o ||
o instanceof ItemAndMetadata that && itemDamage == that.itemDamage && item.equals(that.item);
}

@Override
Expand Down
13 changes: 5 additions & 8 deletions src/main/java/gregtech/api/util/BlockUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,18 @@
import gregtech.api.unification.OreDictUnifier;
import gregtech.api.unification.ore.OrePrefix;

import it.unimi.dsi.fastutil.objects.Object2BooleanMap;
import it.unimi.dsi.fastutil.objects.Object2BooleanOpenHashMap;

import it.unimi.dsi.fastutil.objects.Object2DoubleMap;

import it.unimi.dsi.fastutil.objects.Object2DoubleMaps;
import it.unimi.dsi.fastutil.objects.Object2DoubleOpenHashMap;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;

import it.unimi.dsi.fastutil.objects.Object2BooleanMap;
import it.unimi.dsi.fastutil.objects.Object2BooleanOpenHashMap;
import it.unimi.dsi.fastutil.objects.Object2DoubleMap;
import it.unimi.dsi.fastutil.objects.Object2DoubleMaps;
import it.unimi.dsi.fastutil.objects.Object2DoubleOpenHashMap;
import org.jetbrains.annotations.NotNull;

import java.util.Objects;
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/gregtech/api/util/GTUtility.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import gregtech.api.unification.OreDictUnifier;
import gregtech.api.unification.ore.OrePrefix;
import gregtech.core.advancement.AdvancementTriggers;
import it.unimi.dsi.fastutil.objects.ObjectOpenCustomHashSet;

import net.minecraft.block.Block;
import net.minecraft.block.BlockRedstoneWire;
import net.minecraft.block.BlockSnow;
Expand Down Expand Up @@ -811,7 +811,8 @@ public static boolean tryVenting(@NotNull World world, @NotNull BlockPos machine
ventingSide.getZOffset() / 2.0, 0.1);
}
if (playSound) {
world.playSound(null, posX, posY, posZ, SoundEvents.BLOCK_LAVA_EXTINGUISH, SoundCategory.BLOCKS, 1.0f, 1.0f);
world.playSound(null, posX, posY, posZ, SoundEvents.BLOCK_LAVA_EXTINGUISH, SoundCategory.BLOCKS, 1.0f,
1.0f);
}
return true;
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/gregtech/client/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import gregtech.api.util.ModCompatibility;
import gregtech.client.model.customtexture.CustomTextureModelHandler;
import gregtech.client.model.customtexture.MetadataSectionCTM;
import gregtech.client.model.miningpipe.MiningPipeModels;
import gregtech.client.renderer.handler.FacadeRenderer;
import gregtech.client.renderer.handler.MetaTileEntityRenderer;
import gregtech.client.renderer.pipe.*;
Expand All @@ -25,7 +26,7 @@
import gregtech.common.blocks.MetaBlocks;
import gregtech.common.items.MetaItems;
import gregtech.common.items.ToolItems;
import gregtech.client.model.miningpipe.MiningPipeModels;

import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.client.resources.I18n;
Expand Down
92 changes: 61 additions & 31 deletions src/main/java/gregtech/client/renderer/texture/Textures.java
Original file line number Diff line number Diff line change
Expand Up @@ -252,11 +252,16 @@ public class Textures {
"machines/mass_fabricator");
public static final OrientedOverlayRenderer REPLICATOR_OVERLAY = new OrientedOverlayRenderer("machines/replicator");
public static final OrientedOverlayRenderer SCANNER_OVERLAY = new OrientedOverlayRenderer("machines/scanner");
public static final OrientedOverlayRenderer COMBUSTION_GENERATOR_OVERLAY = new OrientedOverlayRenderer("generators/combustion");
public static final OrientedOverlayRenderer GAS_TURBINE_OVERLAY = new OrientedOverlayRenderer("generators/gas_turbine");
public static final OrientedOverlayRenderer STEAM_TURBINE_OVERLAY = new OrientedOverlayRenderer("generators/steam_turbine");
public static final OrientedOverlayRenderer WORLD_ACCELERATOR_OVERLAY = new OrientedOverlayRenderer("machines/world_accelerator");
public static final OrientedOverlayRenderer WORLD_ACCELERATOR_TE_OVERLAY = new OrientedOverlayRenderer("machines/world_accelerator_te");
public static final OrientedOverlayRenderer COMBUSTION_GENERATOR_OVERLAY = new OrientedOverlayRenderer(
"generators/combustion");
public static final OrientedOverlayRenderer GAS_TURBINE_OVERLAY = new OrientedOverlayRenderer(
"generators/gas_turbine");
public static final OrientedOverlayRenderer STEAM_TURBINE_OVERLAY = new OrientedOverlayRenderer(
"generators/steam_turbine");
public static final OrientedOverlayRenderer WORLD_ACCELERATOR_OVERLAY = new OrientedOverlayRenderer(
"machines/world_accelerator");
public static final OrientedOverlayRenderer WORLD_ACCELERATOR_TE_OVERLAY = new OrientedOverlayRenderer(
"machines/world_accelerator_te");
public static final OrientedOverlayRenderer MINER_OVERLAY = new OrientedOverlayRenderer("machines/miner");

// Simple Overlay Renderers
Expand Down Expand Up @@ -414,31 +419,56 @@ public class Textures {
"overlay/machine/overlay_maintenance_cleaning");
public static final SimpleOverlayRenderer MUFFLER_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/overlay_muffler");
public static final SimpleOverlayRenderer BLANK_SCREEN = new SimpleOverlayRenderer("overlay/machine/overlay_blank_screen");
public static final SimpleOverlayRenderer DATA_ACCESS_HATCH = new SimpleOverlayRenderer("overlay/machine/overlay_data_hatch");
public static final SimpleOverlayRenderer CREATIVE_DATA_ACCESS_HATCH = new SimpleOverlayRenderer("overlay/machine/overlay_data_hatch_creative");
public static final SimpleOverlayRenderer OPTICAL_DATA_ACCESS_HATCH = new SimpleOverlayRenderer("overlay/machine/overlay_data_hatch_optical");
public static final SimpleOverlayRenderer LASER_SOURCE = new SimpleOverlayRenderer("overlay/machine/overlay_laser_source");
public static final SimpleOverlayRenderer LASER_TARGET = new SimpleOverlayRenderer("overlay/machine/overlay_laser_target");
public static final SimpleOverlayRenderer OBJECT_HOLDER_OVERLAY = new SimpleOverlayRenderer("overlay/machine/overlay_object_holder");
public static final SimpleOverlayRenderer OBJECT_HOLDER_ACTIVE_OVERLAY = new SimpleOverlayRenderer("overlay/machine/overlay_object_holder_active");
public static final SimpleOverlayRenderer HPCA_ACTIVE_COOLER_OVERLAY = new SimpleOverlayRenderer("overlay/machine/hpca/active_cooler");
public static final SimpleOverlayRenderer HPCA_ACTIVE_COOLER_ACTIVE_OVERLAY = new SimpleOverlayRenderer("overlay/machine/hpca/active_cooler_active");
public static final SimpleOverlayRenderer HPCA_BRIDGE_OVERLAY = new SimpleOverlayRenderer("overlay/machine/hpca/bridge");
public static final SimpleOverlayRenderer HPCA_BRIDGE_ACTIVE_OVERLAY = new SimpleOverlayRenderer("overlay/machine/hpca/bridge_active");
public static final SimpleOverlayRenderer HPCA_COMPUTATION_OVERLAY = new SimpleOverlayRenderer("overlay/machine/hpca/computation");
public static final SimpleOverlayRenderer HPCA_COMPUTATION_ACTIVE_OVERLAY = new SimpleOverlayRenderer("overlay/machine/hpca/computation_active");
public static final SimpleOverlayRenderer HPCA_ADVANCED_COMPUTATION_OVERLAY = new SimpleOverlayRenderer("overlay/machine/hpca/computation_advanced");
public static final SimpleOverlayRenderer HPCA_ADVANCED_COMPUTATION_ACTIVE_OVERLAY = new SimpleOverlayRenderer("overlay/machine/hpca/computation_advanced_active");
public static final SimpleOverlayRenderer HPCA_DAMAGED_OVERLAY = new SimpleOverlayRenderer("overlay/machine/hpca/damaged");
public static final SimpleOverlayRenderer HPCA_DAMAGED_ACTIVE_OVERLAY = new SimpleOverlayRenderer("overlay/machine/hpca/damaged_active");
public static final SimpleOverlayRenderer HPCA_ADVANCED_DAMAGED_OVERLAY = new SimpleOverlayRenderer("overlay/machine/hpca/damaged_advanced");
public static final SimpleOverlayRenderer HPCA_ADVANCED_DAMAGED_ACTIVE_OVERLAY = new SimpleOverlayRenderer("overlay/machine/hpca/damaged_advanced_active");
public static final SimpleOverlayRenderer HPCA_EMPTY_OVERLAY = new SimpleOverlayRenderer("overlay/machine/hpca/empty");
public static final SimpleOverlayRenderer HPCA_HEAT_SINK_OVERLAY = new SimpleOverlayRenderer("overlay/machine/hpca/heat_sink");
public static final SimpleOverlayRenderer ALARM_OVERLAY = new SimpleOverlayRenderer("overlay/machine/overlay_alarm");
public static final SimpleOverlayRenderer ALARM_OVERLAY_ACTIVE = new SimpleOverlayRenderer("overlay/machine/overlay_alarm_active");
public static final SimpleOverlayRenderer TAPED_OVERLAY = new SimpleOverlayRenderer("overlay/machine/overlay_ducttape");
public static final SimpleOverlayRenderer BLANK_SCREEN = new SimpleOverlayRenderer(
"overlay/machine/overlay_blank_screen");
public static final SimpleOverlayRenderer DATA_ACCESS_HATCH = new SimpleOverlayRenderer(
"overlay/machine/overlay_data_hatch");
public static final SimpleOverlayRenderer CREATIVE_DATA_ACCESS_HATCH = new SimpleOverlayRenderer(
"overlay/machine/overlay_data_hatch_creative");
public static final SimpleOverlayRenderer OPTICAL_DATA_ACCESS_HATCH = new SimpleOverlayRenderer(
"overlay/machine/overlay_data_hatch_optical");
public static final SimpleOverlayRenderer LASER_SOURCE = new SimpleOverlayRenderer(
"overlay/machine/overlay_laser_source");
public static final SimpleOverlayRenderer LASER_TARGET = new SimpleOverlayRenderer(
"overlay/machine/overlay_laser_target");
public static final SimpleOverlayRenderer OBJECT_HOLDER_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/overlay_object_holder");
public static final SimpleOverlayRenderer OBJECT_HOLDER_ACTIVE_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/overlay_object_holder_active");
public static final SimpleOverlayRenderer HPCA_ACTIVE_COOLER_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/hpca/active_cooler");
public static final SimpleOverlayRenderer HPCA_ACTIVE_COOLER_ACTIVE_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/hpca/active_cooler_active");
public static final SimpleOverlayRenderer HPCA_BRIDGE_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/hpca/bridge");
public static final SimpleOverlayRenderer HPCA_BRIDGE_ACTIVE_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/hpca/bridge_active");
public static final SimpleOverlayRenderer HPCA_COMPUTATION_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/hpca/computation");
public static final SimpleOverlayRenderer HPCA_COMPUTATION_ACTIVE_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/hpca/computation_active");
public static final SimpleOverlayRenderer HPCA_ADVANCED_COMPUTATION_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/hpca/computation_advanced");
public static final SimpleOverlayRenderer HPCA_ADVANCED_COMPUTATION_ACTIVE_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/hpca/computation_advanced_active");
public static final SimpleOverlayRenderer HPCA_DAMAGED_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/hpca/damaged");
public static final SimpleOverlayRenderer HPCA_DAMAGED_ACTIVE_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/hpca/damaged_active");
public static final SimpleOverlayRenderer HPCA_ADVANCED_DAMAGED_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/hpca/damaged_advanced");
public static final SimpleOverlayRenderer HPCA_ADVANCED_DAMAGED_ACTIVE_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/hpca/damaged_advanced_active");
public static final SimpleOverlayRenderer HPCA_EMPTY_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/hpca/empty");
public static final SimpleOverlayRenderer HPCA_HEAT_SINK_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/hpca/heat_sink");
public static final SimpleOverlayRenderer ALARM_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/overlay_alarm");
public static final SimpleOverlayRenderer ALARM_OVERLAY_ACTIVE = new SimpleOverlayRenderer(
"overlay/machine/overlay_alarm_active");
public static final SimpleOverlayRenderer TAPED_OVERLAY = new SimpleOverlayRenderer(
"overlay/machine/overlay_ducttape");

public static final SimpleOverlayRenderer COVER_INTERFACE_FLUID = new SimpleOverlayRenderer(
"cover/cover_interface_fluid");
Expand Down Expand Up @@ -468,7 +498,7 @@ public class Textures {
"overlay/appeng/me_input_hatch");
public static final SimpleOverlayRenderer ME_OUTPUT_BUS = new SimpleOverlayRenderer("overlay/appeng/me_output_bus");
public static final SimpleOverlayRenderer ME_INPUT_BUS = new SimpleOverlayRenderer("overlay/appeng/me_input_bus");
public static final ResourceLocation ACE_CAPE_TEXTURE = gregtechId("textures/capes/acecape.png");
public static final ResourceLocation ACE_CAPE_TEXTURE = gregtechId("textures/capes/acecape.png");
public static final ResourceLocation AGENDER_CAPE_TEXTURE = gregtechId("textures/capes/agendercape.png");
public static final ResourceLocation AROMANTIC_CAPE_TEXTURE = gregtechId("textures/capes/aromanticcape.png");
public static final ResourceLocation BI_CAPE_TEXTURE = gregtechId("textures/capes/bicape.png");
Expand Down
22 changes: 3 additions & 19 deletions src/main/java/gregtech/client/utils/MinerRenderHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ public static void renderAreaPreview(@NotNull AxisAlignedBB box, @NotNull BlockP
boolean isBoxClippingThroughCamera = isBoxClippingThroughCamera(minX, maxX, minY, maxY, minZ, maxZ);

// texture UVs
double texOffset =
(System.nanoTime() % TEXTURE_WRAP_INTERVAL_NANOSECONDS) / (double) (TEXTURE_WRAP_INTERVAL_NANOSECONDS);
double texOffset = (System.nanoTime() % TEXTURE_WRAP_INTERVAL_NANOSECONDS) /
(double) (TEXTURE_WRAP_INTERVAL_NANOSECONDS);

double dx = (box.maxX - box.minX);
double dy = (box.maxY - Math.max(0, box.minY));
Expand All @@ -144,7 +144,7 @@ public static void renderAreaPreview(@NotNull AxisAlignedBB box, @NotNull BlockP
Tessellator tessellator = Tessellator.getInstance();
BufferBuilder buffer = tessellator.getBuffer();

for (boolean looped = false; ; looped = true) {
for (boolean looped = false;; looped = true) {
int alpha = looped ? 70 : 200;

if (looped) {
Expand Down Expand Up @@ -359,22 +359,6 @@ private static void swapRow(int r1, int r2) {
System.arraycopy(mat, 12, mat, r2 * 4, 4);
}

/* for debug
private static String matrixToString() {
StringBuilder stb = new StringBuilder();
for (int r = 0; r < 3; r++) {
if (r != 0) stb.append('\n');
for (int c = 0; c < 4; c++) {
if (c != 0) stb.append('\t');
float v = getMatrixValue(c, r);
if (v >= 0) stb.append(" ");
stb.append(String.format("%.4f", v));
}
}
return stb.toString();
}
*/

private static final class SATTestResult {

private float min, max;
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/gregtech/common/MetaEntities.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ public static void init() {
GregTechAPI.instance, 64, 5, true);
EntityRegistry.registerModEntity(GTUtility.gregtechId("gtboat"), GTBoatEntity.class, "GTBoat", 3,
GregTechAPI.instance, 64, 2, true);
EntityRegistry.registerModEntity(GTUtility.gregtechId("mining_pipe"), MiningPipeEntity.class, "MiningPipe", 4, GregTechAPI.instance, 0, 2, false);
EntityRegistry.registerModEntity(GTUtility.gregtechId("mining_pipe"), MiningPipeEntity.class, "MiningPipe", 4,
GregTechAPI.instance, 0, 2, false);
}

@SideOnly(Side.CLIENT)
Expand Down
Loading

0 comments on commit b5047f3

Please sign in to comment.