Skip to content

Commit

Permalink
Version 1.9.3-c Release
Browse files Browse the repository at this point in the history
Added Digamma Diagnostic Gui
Added Digamma to Digamma Ash

Fixed Digamma RBMK Radiation
  • Loading branch information
Alcatergit committed Apr 12, 2023
1 parent 565d1f6 commit ba6d11d
Show file tree
Hide file tree
Showing 10 changed files with 110 additions and 127 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = '1.9.3-b'
version = '1.9.3-c'
group = 'com.hbm' // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = 'NTM-Extended-1.12.2'

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ org.gradle.daemon=true
org.gradle.configureondemand=true
org.gradle.parallel=true
jei_version=4.16.1.302
version=1.9.3-b
version=1.9.3-c
mc_version=1.12.2
3 changes: 1 addition & 2 deletions src/main/java/com/hbm/blocks/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import com.hbm.blocks.generic.BarbedWire;
import com.hbm.blocks.generic.BlockAbsorber;
import com.hbm.blocks.generic.BlockAmmoCrate;
import com.hbm.blocks.generic.BlockAshes;
import com.hbm.blocks.generic.BlockBallsSpawner;
import com.hbm.blocks.generic.BlockBeaconable;
import com.hbm.blocks.generic.BlockBedrockOre;
Expand Down Expand Up @@ -837,7 +836,7 @@ public SoundEvent getBreakSound() {


// A lot of stuff with uses no one knows
public static final Block ash_digamma = new BlockAshes(Material.SAND, "ash_digamma").setSoundType(SoundType.SAND).setCreativeTab(MainRegistry.resourceTab).setHardness(0.5F).setResistance(150.0F);
public static final Block ash_digamma = new BlockHazardFalling(Material.SAND, "ash_digamma", SoundType.SAND).addDigamma(0.001F).toBlock().setCreativeTab(MainRegistry.resourceTab).setHardness(0.5F).setResistance(150.0F);
public static final Block sand_boron = new BlockFallingBase(Material.SAND, "sand_boron", SoundType.SAND).setCreativeTab(MainRegistry.resourceTab).setHardness(0.5F);
public static final Block sand_lead = new BlockFallingBase(Material.SAND, "sand_lead", SoundType.SAND).setCreativeTab(MainRegistry.resourceTab).setHardness(0.5F);
public static final Block sand_uranium = new BlockHazardFalling(Material.SAND, "sand_uranium", SoundType.SAND).addRadiation(ItemHazard.u * ItemHazard.nugget).toBlock().setCreativeTab(MainRegistry.resourceTab).setHardness(0.5F);
Expand Down
58 changes: 0 additions & 58 deletions src/main/java/com/hbm/blocks/generic/BlockAshes.java

This file was deleted.

46 changes: 3 additions & 43 deletions src/main/java/com/hbm/blocks/machine/rbmk/RBMKDebrisDigamma.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,12 @@

import com.hbm.blocks.ModBlocks;
import com.hbm.lib.ForgeDirection;
import com.hbm.render.amlfrom1710.Vec3;
import com.hbm.util.ContaminationUtil;
import com.hbm.util.ContaminationUtil.ContaminationType;
import com.hbm.util.ContaminationUtil.HazardType;
import net.minecraft.entity.EntityLivingBase;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.DamageSource;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.world.World;

public class RBMKDebrisDigamma extends RBMKDebris {
Expand All @@ -28,55 +23,20 @@ public RBMKDebrisDigamma(String s){
public void updateTick(World world, BlockPos pos, IBlockState state, Random rand){
if(!world.isRemote) {

digamma(world, pos.getX(), pos.getY(), pos.getZ());
ContaminationUtil.radiate(world, pos.getX(), pos.getY(), pos.getZ(), 32, 0, 200F, 0F);
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
Block b = world.getBlockState(new BlockPos(pos.getX() + dir.offsetX, pos.getY() + dir.offsetY, pos.getZ() + dir.offsetZ)).getBlock();
if((b instanceof RBMKDebris && b != this) || b == ModBlocks.corium_block || b == ModBlocks.block_corium)
world.setBlockState(new BlockPos(pos.getX() + dir.offsetX, pos.getY() + dir.offsetY, pos.getZ() + dir.offsetZ), this.getDefaultState());
}
}
}

@SuppressWarnings("deprecation")
private void digamma(World world, int x, int y, int z) {

float rads = 1000F;
double range = 100D;

List<EntityLivingBase> entities = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(x + 0.5, y + 0.5, z + 0.5, x + 0.5, y + 0.5, z + 0.5).grow(range, range, range));

for(EntityLivingBase e : entities) {

Vec3 vec = Vec3.createVectorHelper(e.posX - (x + 0.5), (e.posY + e.getEyeHeight()) - (y + 0.5), e.posZ - (z + 0.5));
double len = vec.lengthVector();
vec = vec.normalize();

float res = 0;

for(int i = 1; i < len; i++) {

int ix = (int)Math.floor(x + 0.5 + vec.xCoord * i);
int iy = (int)Math.floor(y + 0.5 + vec.yCoord * i);
int iz = (int)Math.floor(z + 0.5 + vec.zCoord * i);

res += world.getBlockState(new BlockPos(ix, iy, iz)).getBlock().getExplosionResistance(null);
}

if(res < 1)
res = 1;

float eRads = rads;
eRads /= (float)res;
eRads /= (float)(len * len);

ContaminationUtil.contaminate(e, HazardType.DIGAMMA, ContaminationType.DIGAMMA, eRads);
world.scheduleUpdate(pos, this, this.tickRate(world));
}
}

@Override
public void onBlockAdded(World worldIn, BlockPos pos, IBlockState state){
super.onBlockAdded(worldIn, pos, state);
worldIn.scheduleUpdate(pos, this, 2);
worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn));
}

@Override
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/hbm/lib/RefStrings.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
public class RefStrings {
public static final String MODID = "hbm";
public static final String NAME = "Hbm's Nuclear Tech - Extended Edition";
public static final String VERSION = "NTM-Extended-1.12.2-1.9.3-b";
public static final String CHANGELOG = "§8§lAdvancement update$§2Added an entire NTM Tech Tree for Advancements$§2Added Toxic/Cryogenic hazards$§2Added 2 more Geiger sounds$§2Added useful tooltips to fallout conversions$§3Changed Upgrade textures$§3Changed DFC Emitter to have a filter$§3Changed Mining ship tektite yield$§6Fixed Concrete Chemplant recipe$§6Fixed Pumpjack animation and stats$§6Fixed Geiger crash$§6Fixed molten Meteor cooling$§6Fixed BlockPorous missing textures$§6Fixed Crackoil not being boiled$§6Fixed Fracking tower energy$§6Fixed Thorium fuel rod textures$§6Fixed Chemplant Concrete crafting";
public static final String VERSION = "NTM-Extended-1.12.2-1.9.3-c";
public static final String CHANGELOG = "§8§lPotion and Contamination update$§2Added Inventory contamination$§2Added WasteSand and WasteGravel$§2Added Potions with NTM Effects$§2Added Digamma Diagnostic Gui$§2Added Tooltip info to armor mods$§2Added Clay recipe$§2Added Suger, Gunpowder, Redstone, Glowstone textures$§2Added Waterbreathing to Armors$§3Changed Rad values of debris$§3Changed Gluon Gun to double dmg every 2s on target$§3Changed size of rbmk blowup effect particle$§3Changed paa recipes and textures$§3Changed hazmat stats$§3Changed Mirvs to split at the highest point and split less extreme$§aUpdated the Teleporter$§aUpdated Tab Icons like in 1.7.10$§6Fixed Jetpacks ignoring keybings$§6Fixed some Gas block lagg$§6Fixed Digamma Debris ticking$§6Fixed nuke flash$§6Fixed geiger counter sounds$§6Fixed polish translation by Taboret$§6Fixed Fallout to be like snow$§6Fixed Chemplant Wood OreDict Recipe$§6Fixed Fracking Solution Drain$§6Fixed Corium in Meteor Dungeon";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/com/hbm/main/ModEventHandlerClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -1625,6 +1625,12 @@ public void onOverlayRender(RenderGameOverlayEvent.Pre event) {
RenderScreenOverlay.renderRadCounter(event.getResolution(), rads, Minecraft.getMinecraft().ingameGUI);
}
}
if(Library.hasInventoryItem(player.inventory, ModItems.digamma_diagnostic)) {

float digamma = (float)Library.getEntRadCap(player).getDigamma();

RenderScreenOverlay.renderDigCounter(event.getResolution(), digamma, Minecraft.getMinecraft().ingameGUI);
}
if(JetpackHandler.hasJetpack(player)){
JetpackHandler.renderHUD(player, event.getResolution());
}
Expand Down
91 changes: 78 additions & 13 deletions src/main/java/com/hbm/render/misc/RenderScreenOverlay.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,13 @@ public class RenderScreenOverlay {
private static final ResourceLocation misc = new ResourceLocation(RefStrings.MODID + ":textures/misc/overlay_misc.png");
private static final RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();

private static long lastSurvey;
private static float prevResult;
private static float lastResult;
private static long lastRadSurvey;
private static float prevRadResult;
private static float lastRadResult;

private static long lastDigSurvey;
private static float prevDigResult;
private static float lastDigResult;

public static void renderRadCounter(ScaledResolution resolution, float in, Gui gui) {
GL11.glPushMatrix();
Expand All @@ -40,12 +44,12 @@ public static void renderRadCounter(ScaledResolution resolution, float in, Gui g

float radiation = 0;

radiation = lastResult - prevResult;
radiation = lastRadResult - prevRadResult;

if(System.currentTimeMillis() >= lastSurvey + 1000) {
lastSurvey = System.currentTimeMillis();
prevResult = lastResult;
lastResult = in;
if(System.currentTimeMillis() >= lastRadSurvey + 1000) {
lastRadSurvey = System.currentTimeMillis();
prevRadResult = lastRadResult;
lastRadResult = in;
}

int length = 74;
Expand All @@ -64,22 +68,83 @@ public static void renderRadCounter(ScaledResolution resolution, float in, Gui g
gui.drawTexturedModalRect(posX + 1, posY + 1, 1, 19, bar, 16);

if(radiation >= 25) {
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 36, 36, 18, 18);
gui.drawTexturedModalRect(posX + length + 2 + 18, posY, 36, 36, 18, 18);

} else if(radiation >= 10) {
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 18, 36, 18, 18);
gui.drawTexturedModalRect(posX + length + 2 + 18, posY, 18, 36, 18, 18);

} else if(radiation >= 2.5) {
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 0, 36, 18, 18);
gui.drawTexturedModalRect(posX + length + 2 + 18, posY, 0, 36, 18, 18);

}

if(radiation > 1000) {
Minecraft.getMinecraft().fontRenderer.drawString(">1000 RAD/s", posX, posY - 8, 0xFF0000);
Minecraft.getMinecraft().fontRenderer.drawString(">1000 RAD/s", posX, posY - 8, 0x00FF00);
} else if(radiation >= 1) {
Minecraft.getMinecraft().fontRenderer.drawString(((int)Math.round(radiation)) + " RAD/s", posX, posY - 8, 0xFF0000);
} else if(radiation > 0) {
Minecraft.getMinecraft().fontRenderer.drawString("<1 RAD/s", posX, posY - 8, 0xFF0000);
Minecraft.getMinecraft().fontRenderer.drawString("<1 RAD/s", posX, posY - 8, 0x00FF00);
}

GlStateManager.enableDepth();
GlStateManager.depthMask(true);
GL11.glPopMatrix();
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.ICONS);
}


public static void renderDigCounter(ScaledResolution resolution, float in, Gui gui) {
GL11.glPushMatrix();

GlStateManager.enableBlend();
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.tryBlendFuncSeparate(SourceFactor.SRC_ALPHA, DestFactor.ONE_MINUS_SRC_ALPHA, SourceFactor.ONE, DestFactor.ZERO);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableAlpha();

float digamma = 0;

digamma = lastDigResult - prevDigResult;

if(System.currentTimeMillis() >= lastDigSurvey + 1000) {
lastDigSurvey = System.currentTimeMillis();
prevDigResult = lastDigResult;
lastDigResult = in;
}

int length = 74;
int maxDig = 10;

int bar = getScaled(in, maxDig, 74);

//if(radiation >= 1 && radiation <= 999)
// bar -= (1 + Minecraft.getMinecraft().theWorld.rand.nextInt(3));

int posX = 16;
int posY = resolution.getScaledHeight() - 36 - 2;

Minecraft.getMinecraft().renderEngine.bindTexture(misc);
gui.drawTexturedModalRect(posX, posY, 0, 218, 94, 18);
gui.drawTexturedModalRect(posX + 1, posY + 1, 1, 237, bar, 16);

if(digamma >= 0.25) {
gui.drawTexturedModalRect(posX + length + 2 + 18, posY, 108, 72, 18, 18);

} else if(digamma >= 0.1) {
gui.drawTexturedModalRect(posX + length + 2 + 18, posY, 90, 72, 18, 18);

} else if(digamma >= 0.025) {
gui.drawTexturedModalRect(posX + length + 2 + 18, posY, 72, 72, 18, 18);

}

if(digamma > 0.1) {
Minecraft.getMinecraft().fontRenderer.drawString(">100 mDRX/s", posX, posY - 8, 0xFF0000);
} else if(digamma >= 0.01) {
Minecraft.getMinecraft().fontRenderer.drawString(((int)Math.round(digamma*1000D)) + " mDRX/s", posX, posY - 8, 0xFF0000);
} else if(digamma > 0) {
Minecraft.getMinecraft().fontRenderer.drawString("<10 mDRX/s", posX, posY - 8, 0xFF0000);
}

GlStateManager.enableDepth();
Expand Down
25 changes: 18 additions & 7 deletions src/main/java/com/hbm/util/ContaminationUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,12 @@ public static float getDigamma(Entity e) {
EntityLivingBase entity = (EntityLivingBase)e;
return HbmLivingProps.getDigamma(entity);
}
public static void radiate(World world, int x, int y, int z, double range, float rad3d, float fire3d) {
radiate(world, x, y, z, range, rad3d, 0, fire3d);
}


public static void radiate(World world, int x, int y, int z, double range, float rad3d, float fire3d) {
public static void radiate(World world, int x, int y, int z, double range, float rad3d, float dig3d, float fire3d) {

List<EntityLivingBase> entities = world.getEntitiesWithinAABB(EntityLivingBase.class, new AxisAlignedBB(x + 0.5, y + 0.5, z + 0.5, x + 0.5, y + 0.5, z + 0.5).grow(range, range, range));

Expand All @@ -484,12 +487,20 @@ public static void radiate(World world, int x, int y, int z, double range, float

if(res < 1)
res = 1;

float eRads = rad3d;
eRads /= (float)res;
eRads /= (float)(len * len);

contaminate(e, HazardType.RADIATION, ContaminationType.CREATIVE, eRads);
if(rad3d > 0){
float eRads = rad3d;
eRads /= (float)res;
eRads /= (float)(len * len);

contaminate(e, HazardType.RADIATION, ContaminationType.CREATIVE, eRads);
}
if(dig3d > 0){
float eDig = dig3d;
eDig /= (float)res;
eDig /= (float)(len * len);

contaminate(e, HazardType.DIGAMMA, ContaminationType.DIGAMMA, eDig);
}

if(len < 15 && fire3d > 0) {
float fireDmg = fire3d;
Expand Down
Binary file modified src/main/resources/assets/hbm/textures/misc/overlay_misc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ba6d11d

Please sign in to comment.