mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
ore density scanner HUD fix
This commit is contained in:
parent
b75e0a383c
commit
85e3e50d54
@ -4,7 +4,9 @@
|
||||
* Capacitors have also been nerfed but they are twice as fast as battery blocks, 5 seconds for charging and 15 seconds for discharging
|
||||
* Removed forgotten bricks
|
||||
* Updated CMB brick texture
|
||||
* The ICF machine block now renders with its 3d model in the creative inventory
|
||||
|
||||
## Fixed
|
||||
* Fixed pumpjack gauges not syncing properly
|
||||
* Fixed some concrete variants not being revertable into uncolored concrete
|
||||
* Fixed some concrete variants not being revertable into uncolored concrete
|
||||
* Fixed the ore density scanner not using proper translations for the HUD
|
||||
@ -1004,6 +1004,7 @@ public class ModBlocks {
|
||||
|
||||
public static Block machine_turbofan;
|
||||
public static Block machine_turbinegas;
|
||||
public static Block machine_lpw2;
|
||||
|
||||
public static Block press_preheater;
|
||||
public static Block machine_press;
|
||||
@ -2182,6 +2183,7 @@ public class ModBlocks {
|
||||
machine_orbus = new MachineOrbus(Material.iron).setBlockName("machine_orbus").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_turbofan = new MachineTurbofan(Material.iron).setBlockName("machine_turbofan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_turbofan");
|
||||
machine_turbinegas = new MachineTurbineGas(Material.iron).setBlockName("machine_turbinegas").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
machine_lpw2 = new MachineLPW2().setBlockName("machine_lpw2").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||
press_preheater = new BlockBase(Material.iron).setBlockName("press_preheater").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":press_preheater");
|
||||
machine_press = new MachinePress(Material.iron).setBlockName("machine_press").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_press");
|
||||
machine_epress = new MachineEPress(Material.iron).setBlockName("machine_epress").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_epress");
|
||||
@ -3235,6 +3237,7 @@ public class ModBlocks {
|
||||
register(barricade);
|
||||
register(machine_turbofan);
|
||||
register(machine_turbinegas);
|
||||
register(machine_lpw2);
|
||||
GameRegistry.registerBlock(machine_schrabidium_transmutator, machine_schrabidium_transmutator.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_teleporter, machine_teleporter.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(teleanchor, teleanchor.getUnlocalizedName());
|
||||
|
||||
31
src/main/java/com/hbm/blocks/machine/MachineLPW2.java
Normal file
31
src/main/java/com/hbm/blocks/machine/MachineLPW2.java
Normal file
@ -0,0 +1,31 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineLPW2;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class MachineLPW2 extends BlockDummyable {
|
||||
|
||||
public MachineLPW2() {
|
||||
super(Material.iron);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityMachineLPW2();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getDimensions() {
|
||||
return new int[] {6, 0, 3, 3, 9, 10};
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOffset() {
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
@ -4,13 +4,13 @@ import com.hbm.items.special.ItemBedrockOreBase;
|
||||
import com.hbm.items.special.ItemBedrockOreNew.BedrockOreType;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.PlayerInformPacket;
|
||||
import com.hbm.util.ChatBuilder;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemOreDensityScanner extends Item {
|
||||
@ -25,18 +25,31 @@ public class ItemOreDensityScanner extends Item {
|
||||
for(BedrockOreType type : BedrockOreType.values()) {
|
||||
double level = ItemBedrockOreBase.getOreLevel((int) Math.floor(player.posX), (int) Math.floor(player.posZ), type);
|
||||
PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(
|
||||
StatCollector.translateToLocalFormatted("item.bedrock_ore.type." + type.suffix + ".name") + ": " + ((int) (level * 100) / 100D) + " (" + translateDensity(level) + EnumChatFormatting.RESET + ")",
|
||||
ChatBuilder.startTranslation("item.bedrock_ore.type." + type.suffix + ".name")
|
||||
.next(": " + ((int) (level * 100) / 100D) + " (")
|
||||
.nextTranslation(translateDensity(level)).color(getColor(level))
|
||||
.next(")").color(EnumChatFormatting.RESET).flush(),
|
||||
777 + type.ordinal(), 4000), player);
|
||||
}
|
||||
}
|
||||
|
||||
public static String translateDensity(double density) {
|
||||
if(density <= 0.1) return EnumChatFormatting.DARK_RED + "Very poor";
|
||||
if(density <= 0.35) return EnumChatFormatting.RED + "Poor";
|
||||
if(density <= 0.75) return EnumChatFormatting.GOLD + "Low";
|
||||
if(density >= 1.9) return EnumChatFormatting.AQUA + "Excellent";
|
||||
if(density >= 1.65) return EnumChatFormatting.BLUE + "Very high";
|
||||
if(density >= 1.25) return EnumChatFormatting.GREEN + "High";
|
||||
return EnumChatFormatting.YELLOW + "Moderate";
|
||||
if(density <= 0.1) return "item.ore_density_scanner.verypoor";
|
||||
if(density <= 0.35) return "item.ore_density_scanner.poor";
|
||||
if(density <= 0.75) return "item.ore_density_scanner.low";
|
||||
if(density >= 1.9) return "item.ore_density_scanner.excellent";
|
||||
if(density >= 1.65) return "item.ore_density_scanner.veryhigh";
|
||||
if(density >= 1.25) return "item.ore_density_scanner.high";
|
||||
return "item.ore_density_scanner.moderate";
|
||||
}
|
||||
|
||||
public static EnumChatFormatting getColor(double density) {
|
||||
if(density <= 0.1) return EnumChatFormatting.DARK_RED;
|
||||
if(density <= 0.35) return EnumChatFormatting.RED;
|
||||
if(density <= 0.75) return EnumChatFormatting.GOLD;
|
||||
if(density >= 1.9) return EnumChatFormatting.AQUA;
|
||||
if(density >= 1.65) return EnumChatFormatting.BLUE;
|
||||
if(density >= 1.25) return EnumChatFormatting.GREEN;
|
||||
return EnumChatFormatting.YELLOW;
|
||||
}
|
||||
}
|
||||
|
||||
@ -257,6 +257,7 @@ public class ClientProxy extends ServerProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineFrackingTower.class, new RenderFrackingTower());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineTurbofan.class, new RenderTurbofan());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineTurbineGas.class, new RenderTurbineGas());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineLPW2.class, new RenderLPW2());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachinePress.class, new RenderPress());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineEPress.class, new RenderEPress());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileEntityMachineRadGen.class, new RenderRadGen());
|
||||
|
||||
@ -233,6 +233,9 @@ public class ResourceManager {
|
||||
//ICF
|
||||
public static final IModelCustom icf = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/reactors/icf.obj")).asVBO();
|
||||
|
||||
//ICF
|
||||
public static final IModelCustom lpw2 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/lpw2.obj")).asVBO();
|
||||
|
||||
//Watz
|
||||
public static final IModelCustom watz = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/reactors/watz.obj")).asVBO();
|
||||
public static final IModelCustom watz_pump = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/machines/watz_pump.obj")).asVBO();
|
||||
@ -648,6 +651,11 @@ public class ResourceManager {
|
||||
//ICF
|
||||
public static final ResourceLocation icf_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/icf.png");
|
||||
|
||||
//Fat Fuck
|
||||
public static final ResourceLocation lpw2_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/lpw2.png");
|
||||
public static final ResourceLocation lpw2_term_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/lpw2_term.png");
|
||||
public static final ResourceLocation lpw2_error_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/lpw2_term_error.png");
|
||||
|
||||
//Watz
|
||||
public static final ResourceLocation watz_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/watz.png");
|
||||
public static final ResourceLocation watz_pump_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/watz_pump.png");
|
||||
|
||||
@ -3,12 +3,16 @@ package com.hbm.render.tileentity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderICF extends TileEntitySpecialRenderer {
|
||||
public class RenderICF extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
|
||||
@ -34,4 +38,26 @@ public class RenderICF extends TileEntitySpecialRenderer {
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.icf);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase() {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -1.5, 0);
|
||||
double scale = 2.125;
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glScaled(0.5, 0.5, 0.5);
|
||||
GL11.glRotatef(90, 0F, 1F, 0F);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.icf_tex); ResourceManager.icf.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
69
src/main/java/com/hbm/render/tileentity/RenderLPW2.java
Normal file
69
src/main/java/com/hbm/render/tileentity/RenderLPW2.java
Normal file
@ -0,0 +1,69 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.main.ResourceManager;
|
||||
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class RenderLPW2 extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float interp) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5, y, z + 0.5);
|
||||
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
switch(te.getBlockMetadata() - BlockDummyable.offset) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
double timer = ((te.getWorldObj().getTotalWorldTime() + interp) / 3D) % (Math.PI * 4);
|
||||
//double sway = Math.sin(timer) + Math.sin(timer * 2) + 1.76017D;
|
||||
double sway = Math.sin(timer) + Math.sin(timer * 2) + Math.sin(timer * 4) + 2.23255D;
|
||||
GL11.glTranslated(0, 0, -sway * 0.125);
|
||||
|
||||
bindTexture(ResourceManager.lpw2_tex);
|
||||
ResourceManager.lpw2.renderAll();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
public static void renderMainAssembly(double sway) {
|
||||
//main assembly
|
||||
//turbine rotors
|
||||
//pump rotor
|
||||
//pump piston
|
||||
//engine bell
|
||||
//suspension
|
||||
}
|
||||
|
||||
public static void renderBell(double h, double v) {
|
||||
//bell with rotations
|
||||
}
|
||||
|
||||
public static void renderShroud(double h, double v) {
|
||||
//shrouds
|
||||
//flaps
|
||||
//suspension
|
||||
}
|
||||
|
||||
public static void renderGamingRig() {
|
||||
//screen
|
||||
//absolute fucking chaos
|
||||
}
|
||||
|
||||
public static void renderScreen() {
|
||||
//screen (term/error)
|
||||
}
|
||||
}
|
||||
@ -95,6 +95,7 @@ public class TileMappings {
|
||||
put(TileEntityMachineFluidTank.class, "tileentity_fluid_tank");
|
||||
put(TileEntityMachineTurbofan.class, "tileentity_machine_turbofan");
|
||||
put(TileEntityMachineTurbineGas.class, "tileentity_machine_gasturbine");
|
||||
put(TileEntityMachineLPW2.class, "tileentity_machine_lpw2");
|
||||
put(TileEntityCrateTemplate.class, "tileentity_crate_template");
|
||||
put(TileEntityCrateIron.class, "tileentity_crate_iron");
|
||||
put(TileEntityCrateSteel.class, "tileentity_crate_steel");
|
||||
|
||||
@ -0,0 +1,7 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityMachineLPW2 extends TileEntity {
|
||||
|
||||
}
|
||||
@ -26,8 +26,8 @@ public class ChatBuilder {
|
||||
return builder;
|
||||
}
|
||||
|
||||
public static ChatBuilder startTranslation(String text) {
|
||||
ChatBuilder builder = new ChatBuilder("").nextTranslation(text);
|
||||
public static ChatBuilder startTranslation(String text, Object... o) {
|
||||
ChatBuilder builder = new ChatBuilder("").nextTranslation(text, o);
|
||||
return builder;
|
||||
}
|
||||
|
||||
@ -38,8 +38,8 @@ public class ChatBuilder {
|
||||
return this;
|
||||
}
|
||||
|
||||
public ChatBuilder nextTranslation(String text) {
|
||||
ChatComponentTranslation append = new ChatComponentTranslation(text);
|
||||
public ChatBuilder nextTranslation(String text, Object... o) {
|
||||
ChatComponentTranslation append = new ChatComponentTranslation(text, o);
|
||||
this.last.appendSibling(append);
|
||||
this.last = append;
|
||||
return this;
|
||||
|
||||
@ -3570,6 +3570,13 @@ item.ore_centrifuged.name=Centrifuged %s Ore
|
||||
item.ore_cleaned.name=Cleaned %s Ore
|
||||
item.ore_deepcleaned.name=Deep Cleaned %s Ore
|
||||
item.ore_density_scanner.name=Bedrock Ore Density Scanner
|
||||
item.ore_density_scanner.excellent=Excellent
|
||||
item.ore_density_scanner.high=High
|
||||
item.ore_density_scanner.low=Low
|
||||
item.ore_density_scanner.moderate=Moderate
|
||||
item.ore_density_scanner.poor=Poor
|
||||
item.ore_density_scanner.veryhigh=Very High
|
||||
item.ore_density_scanner.verypoor=Very Poor
|
||||
item.ore_enriched.name=Enriched %s Ore
|
||||
item.ore_nitrated.name=Nitrated %s Ore
|
||||
item.ore_nitrocrystalline.name=Nitrocrystalline %s Ore
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user