Skip to content

Commit

Permalink
Version 1.9.3-d Release: FENSU Style
Browse files Browse the repository at this point in the history
Added Colorable FEnSU

Changed Crystalizer texture
Changed Vortex Gun texture

Fixed Sellaline Flood
Fixed Geiger Sounds
  • Loading branch information
Alcatergit committed Apr 14, 2023
1 parent ba6d11d commit 84f8db4
Show file tree
Hide file tree
Showing 35 changed files with 155 additions and 102 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -24,7 +24,7 @@ apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'

version = '1.9.3-c'
version = '1.9.3-d'
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
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-c
version=1.9.3-d
mc_version=1.12.2
8 changes: 0 additions & 8 deletions src/main/java/com/hbm/blocks/fluid/ToxicBlock.java
@@ -1,7 +1,5 @@
package com.hbm.blocks.fluid;

import java.util.Random;

import com.hbm.blocks.ModBlocks;
import com.hbm.util.ContaminationUtil;
import com.hbm.util.ContaminationUtil.ContaminationType;
Expand Down Expand Up @@ -90,10 +88,4 @@ public boolean reactToBlocks(World world, BlockPos pos) {
public int tickRate(World world) {
return 15;
}

@Override
public boolean isReplaceable(IBlockAccess worldIn, BlockPos pos){
Random rand = new Random();
return rand.nextInt(64) == 0;
}
}
2 changes: 1 addition & 1 deletion src/main/java/com/hbm/blocks/machine/BlockSpinnyLight.java
Expand Up @@ -76,7 +76,7 @@ public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state,
ent.color = color;
ent.markDirty();
worldIn.notifyBlockUpdate(pos, state, state, 2 | 4);
//if(!playerIn.isCreative())
if(!playerIn.isCreative())
playerIn.getHeldItem(hand).shrink(1);
return true;
} catch(IllegalArgumentException e){}
Expand Down
32 changes: 29 additions & 3 deletions src/main/java/com/hbm/blocks/machine/MachineFENSU.java
Expand Up @@ -17,12 +17,14 @@
import net.minecraft.tileentity.TileEntity;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.EnumDyeColor;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Item;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.fml.common.network.internal.FMLNetworkHandler;

public class MachineFENSU extends BlockDummyableMBB {
Expand Down Expand Up @@ -92,9 +94,32 @@ public boolean onBlockActivated(World world, BlockPos pos1, IBlockState state, E
if(pos == null)
return false;

TileEntityMachineFENSU entity = (TileEntityMachineFENSU) world.getTileEntity(new BlockPos(pos[0], pos[1], pos[2]));
if(entity != null)
{
BlockPos corePos = new BlockPos(pos[0], pos[1], pos[2]);
TileEntityMachineFENSU entity = (TileEntityMachineFENSU) world.getTileEntity(corePos);
if(entity != null) {
if(!player.getHeldItem(hand).isEmpty()){

int[] ores = OreDictionary.getOreIDs(player.getHeldItem(hand));
for(int ore : ores){
String name = OreDictionary.getOreName(ore);
//Why are these ones named differently
if(name.equals("dyeLightBlue"))
name = "dyeLight_Blue";
if(name.equals("dyeLightGray"))
name = "dyeSilver";
if(name.length() > 3 && name.startsWith("dye")){
try {
EnumDyeColor color = EnumDyeColor.valueOf(name.substring(3, name.length()).toUpperCase());
entity.color = color;
entity.markDirty();
world.notifyBlockUpdate(corePos, state, state, 2 | 4);
if(!player.isCreative())
player.getHeldItem(hand).shrink(1);
return true;
} catch(IllegalArgumentException e){}
}
}
}
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_battery, world, pos[0], pos[1], pos[2]);
}
return true;
Expand Down Expand Up @@ -163,6 +188,7 @@ public int getComparatorInputOverride(IBlockState blockState, World worldIn, Blo
@Override
public void addInformation(ItemStack stack, World worldIn, List<String> list, ITooltipFlag flagIn) {
super.addInformation(stack, worldIn, list, flagIn);
list.add("Change color using dyes");
long charge = 0L;
if(stack.hasTagCompound()){
NBTTagCompound nbt = stack.getTagCompound();
Expand Down
97 changes: 45 additions & 52 deletions src/main/java/com/hbm/handler/RadiationWorldHandler.java
Expand Up @@ -91,8 +91,6 @@ public static void handleWorldDestruction(World world) {
} else if(bblock instanceof BlockLeaves) {
world.setBlockToAir(pos);
world.scheduleBlockUpdate(pos, world.getBlockState(pos).getBlock(), 0, 2);
} else if(bblock == Blocks.BEDROCK){
world.setBlockState(pos.add(0, 1, 0), ModBlocks.toxic_block.getDefaultState());
}
}
}
Expand All @@ -119,62 +117,57 @@ public static void handleWorldDestruction(World world) {

ChunkPos coords = randEnt.getKey();

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

if(randEnt == null || randEnt.getValue().radiation < threshold)
return;

if(randEnt == null || randEnt.getValue().radiation < threshold)
continue;

if(provider.chunkExists(coords.x, coords.z)) {

for(int a = 0; a < 16; a ++) {
for(int b = 0; b < 16; b ++) {
if(provider.chunkExists(coords.x, coords.z)) {

for(int a = 0; a < 16; a ++) {
for(int b = 0; b < 16; b ++) {

if(world.rand.nextInt(3) != 0)
continue;

int x = coords.getXStart() + a;
int z = coords.getZStart() + b;
int y = world.getHeight(x, z) - world.rand.nextInt(2);
BlockPos pos = new BlockPos(x, y, z);
IBlockState c = world.getBlockState(pos);
Block bblock = c.getBlock();

if(!world.isAirBlock(pos)){
if(bblock == Blocks.GRASS) {
world.setBlockState(pos, ModBlocks.waste_earth.getDefaultState());

} else if(bblock == Blocks.DIRT) {
world.setBlockState(pos, ModBlocks.waste_dirt.getDefaultState());

} else if(bblock == Blocks.SAND) {
BlockSand.EnumType meta = c.getValue(BlockSand.VARIANT);
if(world.rand.nextInt(60) == 0) {
world.setBlockState(pos, meta == BlockSand.EnumType.SAND ? ModBlocks.waste_trinitite.getDefaultState() : ModBlocks.waste_trinitite_red.getDefaultState());
} else {
world.setBlockState(pos, meta == BlockSand.EnumType.SAND ? ModBlocks.waste_sand.getDefaultState() : ModBlocks.waste_sand_red.getDefaultState());
}
} else if(bblock == Blocks.GRAVEL) {
world.setBlockState(pos, ModBlocks.waste_gravel.getDefaultState());

if(world.rand.nextInt(3) != 0)
continue;
} else if(bblock == Blocks.MYCELIUM) {
world.setBlockState(pos, ModBlocks.waste_mycelium.getDefaultState());

int x = coords.getXStart() + a;
int z = coords.getZStart() + b;
int y = world.getHeight(x, z) - world.rand.nextInt(2);
BlockPos pos = new BlockPos(x, y, z);
IBlockState c = world.getBlockState(pos);
Block bblock = c.getBlock();
} else if(bblock == Blocks.SNOW_LAYER) {
world.setBlockState(pos, ModBlocks.fallout.getDefaultState());

if(!world.isAirBlock(pos)){
if(bblock == Blocks.GRASS) {
world.setBlockState(pos, ModBlocks.waste_earth.getDefaultState());

} else if(bblock == Blocks.DIRT) {
world.setBlockState(pos, ModBlocks.waste_dirt.getDefaultState());
} else if(bblock == Blocks.SNOW) {
world.setBlockState(pos, ModBlocks.block_fallout.getDefaultState());

} else if(bblock == Blocks.SAND) {
BlockSand.EnumType meta = c.getValue(BlockSand.VARIANT);
if(world.rand.nextInt(60) == 0) {
world.setBlockState(pos, meta == BlockSand.EnumType.SAND ? ModBlocks.waste_trinitite.getDefaultState() : ModBlocks.waste_trinitite_red.getDefaultState());
} else {
world.setBlockState(pos, meta == BlockSand.EnumType.SAND ? ModBlocks.waste_sand.getDefaultState() : ModBlocks.waste_sand_red.getDefaultState());
}
} else if(bblock == Blocks.GRAVEL) {
world.setBlockState(pos, ModBlocks.waste_gravel.getDefaultState());

} else if(bblock == Blocks.MYCELIUM) {
world.setBlockState(pos, ModBlocks.waste_mycelium.getDefaultState());

} else if(bblock == Blocks.SNOW_LAYER) {
world.setBlockState(pos, ModBlocks.fallout.getDefaultState());

} else if(bblock == Blocks.SNOW) {
world.setBlockState(pos, ModBlocks.block_fallout.getDefaultState());

} else if(bblock instanceof BlockBush) {
world.setBlockState(pos, ModBlocks.waste_grass_tall.getDefaultState());

} else if(bblock instanceof BlockLeaves) {
world.setBlockToAir(pos);
world.scheduleBlockUpdate(pos, world.getBlockState(pos).getBlock(), 0, 2);
} else if(bblock == Blocks.BEDROCK){
world.setBlockState(pos.add(0, 1, 0), ModBlocks.toxic_block.getDefaultState());
}
} else if(bblock instanceof BlockBush) {
world.setBlockState(pos, ModBlocks.waste_grass_tall.getDefaultState());

} else if(bblock instanceof BlockLeaves) {
world.setBlockToAir(pos);
world.scheduleBlockUpdate(pos, world.getBlockState(pos).getBlock(), 0, 2);
}
}
}
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/com/hbm/items/tool/ItemGeigerCounter.java
Expand Up @@ -54,7 +54,7 @@ public void onUpdate(ItemStack stack, World world, Entity entity, int itemSlot,
double x = ContaminationUtil.getActualPlayerRads((EntityPlayer)entity);

if(world.getTotalWorldTime() % 5 == 0) {

if(x > 0.001) {
List<Integer> list = new ArrayList<Integer>();

Expand Down Expand Up @@ -84,17 +84,18 @@ public void onUpdate(ItemStack stack, World world, Entity entity, int itemSlot,
}
if(240 < x && x < 640){
list.add(7);
} else {
}
if(480 < x){
list.add(8);
}

if(list.size() > 0){
int r = list.get(rand.nextInt(list.size()));

if(r > 0)
if(r > 0){
world.playSound(null, entity.posX, entity.posY, entity.posZ, HBMSoundHandler.geigerSounds[r-1], SoundCategory.PLAYERS, 1.0F, 1.0F);
}
}
} else if(rand.nextInt(50) == 0) {
} else if(rand.nextInt(100) == 0) {
world.playSound(null, entity.posX, entity.posY, entity.posZ, HBMSoundHandler.geigerSounds[(rand.nextInt(1))], SoundCategory.PLAYERS, 1.0F, 1.0F);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/hbm/lib/RefStrings.java
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-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";
public static final String VERSION = "NTM-Extended-1.12.2-1.9.3-d";
public static final String CHANGELOG = "$§2Added Colorable FEnSU$§3Changed Crystalizer texture$§3Changed Vortex Gun texture$§6Fixed Sellaline Bedrock Flood$§6Fixed Geiger Sounds";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version
Expand Down
19 changes: 18 additions & 1 deletion src/main/java/com/hbm/main/ResourceManager.java
Expand Up @@ -473,7 +473,24 @@ public class ResourceManager {
public static final ResourceLocation iter_torus_vaporwave = new ResourceLocation(RefStrings.MODID, "textures/models/iter/torus_vaporwave.png");

//FENSU
public static final ResourceLocation fensu_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensu.png");
public static final ResourceLocation[] fensu_tex = new ResourceLocation[] {
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_white.png"),
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_orange.png"),
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_magenta.png"),
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_light_blue.png"),
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_yellow.png"),
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_lime.png"),
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_pink.png"),
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_gray.png"),
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_light_gray.png"),
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_cyan.png"),
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_purple.png"),
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_blue.png"),
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_brown.png"),
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_green.png"),
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_red.png"),
new ResourceLocation(RefStrings.MODID, "textures/models/machines/fensus/fensu_black.png")
};

public static final ResourceLocation jshotgun_tex = new ResourceLocation(RefStrings.MODID, "textures/models/jade_shotgun.png");
public static final ResourceLocation jshotgun_lmap = new ResourceLocation(RefStrings.MODID, "textures/models/jade_shotgun_lmap.png");
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/com/hbm/render/item/ItemRenderLibrary.java
Expand Up @@ -228,7 +228,9 @@ public void renderInventory() {
}
public void renderCommon() {
GlStateManager.shadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.fensu_tex); ResourceManager.fensu.renderPart("Base"); ResourceManager.fensu.renderPart("Disc");
bindTexture(ResourceManager.fensu_tex[3]);
ResourceManager.fensu.renderPart("Base");
ResourceManager.fensu.renderPart("Disc");
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
GL11.glDisable(GL11.GL_LIGHTING);
GlStateManager.disableCull();
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/hbm/render/misc/RenderScreenOverlay.java
Expand Up @@ -81,7 +81,7 @@ public static void renderRadCounter(ScaledResolution resolution, float in, Gui g
if(radiation > 1000) {
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);
Minecraft.getMinecraft().fontRenderer.drawString(((int)Math.round(radiation)) + " RAD/s", posX, posY - 8, 0xFFFF00);
} else if(radiation > 0) {
Minecraft.getMinecraft().fontRenderer.drawString("<1 RAD/s", posX, posY - 8, 0x00FF00);
}
Expand Down Expand Up @@ -140,11 +140,11 @@ public static void renderDigCounter(ScaledResolution resolution, float in, Gui g
}

if(digamma > 0.1) {
Minecraft.getMinecraft().fontRenderer.drawString(">100 mDRX/s", posX, posY - 8, 0xFF0000);
Minecraft.getMinecraft().fontRenderer.drawString(">100 mDRX/s", posX, posY - 8, 0xCC0000);
} 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);
Minecraft.getMinecraft().fontRenderer.drawString("<10 mDRX/s", posX, posY - 8, 0xFF3232);
}

GlStateManager.enableDepth();
Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/hbm/render/tileentity/RenderFENSU.java
Expand Up @@ -29,10 +29,11 @@ public void render(TileEntityMachineFENSU te, double x, double y, double z, floa
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
}

bindTexture(ResourceManager.fensu_tex);
ResourceManager.fensu.renderPart("Base");


TileEntityMachineFENSU fensu = (TileEntityMachineFENSU)te;
bindTexture(ResourceManager.fensu_tex[fensu.color.getMetadata()]);
ResourceManager.fensu.renderPart("Base");
float rot = fensu.prevRotation + (fensu.rotation - fensu.prevRotation) * partialTicks;

GL11.glTranslated(0, 2.5, 0);
Expand Down
36 changes: 18 additions & 18 deletions src/main/java/com/hbm/render/tileentity/RenderSpinnyLight.java
Expand Up @@ -116,23 +116,23 @@ private static int generateConeMesh(float length, float radius, int sides, float
vertices[(i+1)*3+2] = (float) vertex.zCoord+oZ;
}

Tessellator tes = Tessellator.getInstance();
BufferBuilder buf = tes.getBuffer();
buf.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR);
float alpha = 0.65F;
for(int m = -1; m <= 1; m += 2){
for(int i = 2; i <= sides; i ++){
buf.pos(vertices[0], vertices[1], vertices[2]).color(r, g, b, alpha).endVertex();
buf.pos(vertices[(i-1)*3]*m, vertices[(i-1)*3+1], vertices[(i-1)*3+2]).color(r, g, b, 0).endVertex();
buf.pos(vertices[i*3]*m, vertices[i*3+1], vertices[i*3+2]).color(r, g, b, 0).endVertex();
}
buf.pos(vertices[0], vertices[1], vertices[2]).color(r, g, b, alpha).endVertex();
buf.pos(vertices[sides*3]*m, vertices[sides*3+1], vertices[sides*3+2]).color(r, g, b, 0).endVertex();
buf.pos(vertices[1*3]*m, vertices[1*3+1], vertices[1*3+2]).color(r, g, b, 0).endVertex();
}
tes.draw();

GL11.glEndList();
return list;
Tessellator tes = Tessellator.getInstance();
BufferBuilder buf = tes.getBuffer();
buf.begin(GL11.GL_TRIANGLES, DefaultVertexFormats.POSITION_COLOR);
float alpha = 0.65F;
for(int m = -1; m <= 1; m += 2){
for(int i = 2; i <= sides; i ++){
buf.pos(vertices[0], vertices[1], vertices[2]).color(r, g, b, alpha).endVertex();
buf.pos(vertices[(i-1)*3]*m, vertices[(i-1)*3+1], vertices[(i-1)*3+2]).color(r, g, b, 0).endVertex();
buf.pos(vertices[i*3]*m, vertices[i*3+1], vertices[i*3+2]).color(r, g, b, 0).endVertex();
}
buf.pos(vertices[0], vertices[1], vertices[2]).color(r, g, b, alpha).endVertex();
buf.pos(vertices[sides*3]*m, vertices[sides*3+1], vertices[sides*3+2]).color(r, g, b, 0).endVertex();
buf.pos(vertices[1*3]*m, vertices[1*3+1], vertices[1*3+2]).color(r, g, b, 0).endVertex();
}
tes.draw();
GL11.glEndList();
return list;
}
}
Expand Up @@ -28,7 +28,7 @@ public class TileEntityGeysir extends TileEntity implements ITickable {

@Override
public void update() {
if (!this.world.isRemote && world.getBlockState(pos.up()).getBlock() == Blocks.AIR) {
if (!this.world.isRemote && world.isAirBlock(pos.up())) {
timer--;

IBlockState state = world.getBlockState(pos);
Expand Down

0 comments on commit 84f8db4

Please sign in to comment.