Merge branch 'master' into NTMRUINS1

This commit is contained in:
HbmMods 2025-08-31 12:58:28 +02:00 committed by GitHub
commit 97866f1fb9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
34 changed files with 3174 additions and 120 deletions

View File

@ -1,5 +1,6 @@
## Changed
* Updated ukrainian and chinese localization, including QMAW
* Updated ukrainian, chinese and russian localization, including QMAW
* Some previously hardcoded lang strings are now affected by translations
* Due to severe issues with ticking order as well as a crash caused by certain tiles that uses threaded packets, Torcherino accelerator torches no longer affect NTM machines
* RBMK control rod colors and auto control rod settings are now copiable
* Murky wings no longer have slowfall, and using shift+space cancels the momentum

View File

@ -4,6 +4,7 @@ import com.hbm.blocks.ITooltipProvider;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.BlockPWR.TileEntityBlockPWR;
import com.hbm.handler.threading.PacketThreading;
import com.hbm.items.ModItems;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
import com.hbm.packet.toclient.AuxParticlePacketNT;
@ -55,7 +56,7 @@ public class MachinePWRController extends BlockContainer implements ITooltipProv
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
return metadata == 0 && side == 3 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon);
return metadata == 0 && side != 0 && side != 1 ? this.iconFront : (side == metadata ? this.iconFront : this.blockIcon);
}
@Override
@ -80,6 +81,7 @@ public class MachinePWRController extends BlockContainer implements ITooltipProv
if(!controller.assembled) {
assemble(world, x, y, z, player);
} else {
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.pwr_printer) return false;
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
}

View File

@ -81,7 +81,7 @@ public class WorldConfig {
public static boolean enableSulfurCave = true;
public static boolean enableAsbestosCave = true;
public static int radioStructure = 500;
// public static int radioStructure = 500;
public static int antennaStructure = 250;
public static int atomStructure = 500;
public static int dungeonStructure = 64;
@ -204,7 +204,7 @@ public class WorldConfig {
enableAsbestosCave = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.C01_enableAsbestosCave", "Toggles asbestos caves", true);
final String CATEGORY_DUNGEON = CommonConfig.CATEGORY_DUNGEONS;
radioStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.00_radioSpawn", "Spawn radio station on every nTH chunk", 500);
// radioStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.00_radioSpawn", "Spawn radio station on every nTH chunk", 500);
antennaStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.01_antennaSpawn", "Spawn antenna on every nTH chunk", 250);
atomStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.02_atomSpawn", "Spawn power plant on every nTH chunk", 500);
dungeonStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.04_dungeonSpawn", "Spawn library dungeon on every nTH chunk", 64);
@ -245,7 +245,7 @@ public class WorldConfig {
craterBiomeOuterRad = (float) CommonConfig.createConfigDouble(config, CATEGORY_BIOMES, "17.R02_craterBiomeOuterRad", "RAD/s for the outer crater biome", 0.5D);
craterBiomeWaterMult = (float) CommonConfig.createConfigDouble(config, CATEGORY_BIOMES, "17.R03_craterBiomeWaterMult", "Multiplier for RAD/s in crater biomes when in water", 5D);
radioStructure = CommonConfig.setDefZero(radioStructure, 1000);
// radioStructure = CommonConfig.setDefZero(radioStructure, 1000);
antennaStructure = CommonConfig.setDefZero(antennaStructure, 1000);
atomStructure = CommonConfig.setDefZero(atomStructure, 1000);
dungeonStructure = CommonConfig.setDefZero(dungeonStructure, 1000);

View File

@ -205,6 +205,7 @@ public class EntityMappings {
addEntity(EntityFallingBlockNT.class, "entity_falling_block_nt", 1000);
addEntity(EntityBoatRubber.class, "entity_rubber_boat", 250, false);
addEntity(EntityMissileStealth.class, "entity_missile_stealth", 1000);
addEntity(EntityCoin.class, "entity_coin", 1000);
addEntity(EntityItemWaste.class, "entity_item_waste", 100);
addEntity(EntityItemBuoyant.class, "entity_item_buoyant", 100);

View File

@ -2,14 +2,19 @@ package com.hbm.entity.projectile;
import java.util.List;
import com.hbm.handler.threading.PacketThreading;
import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.packet.toclient.AuxParticlePacketNT;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.common.registry.IEntityAdditionalSpawnData;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
@ -144,9 +149,30 @@ public class EntityBulletBeamBase extends Entity implements IEntityAdditionalSpa
if(!this.worldObj.isRemote && this.doesImpactEntities()) {
Entity hitEntity = null;
List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.headingX, this.headingY, this.headingZ).expand(1.0D, 1.0D, 1.0D));
List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.boundingBox.addCoord(this.headingX, this.headingY, this.headingZ).expand(1.0D, 1.0D, 1.0D));
double nearest = 0.0D;
MovingObjectPosition nonPenImpact = null;
MovingObjectPosition coinHit = null;
double closestCoin = 0;
EntityCoin hitCoin = null;
for(Entity entity : list) {
if(entity.isDead) continue;
if(entity instanceof EntityCoin) {
double hitbox = 0.3F;
AxisAlignedBB aabb = entity.boundingBox.expand(hitbox, hitbox, hitbox);
MovingObjectPosition hitMop = aabb.calculateIntercept(pos, nextPos);
if(hitMop != null) {
double dist = pos.distanceTo(hitMop.hitVec);
if(closestCoin == 0 || dist < closestCoin) {
closestCoin = dist;
hitCoin = (EntityCoin) entity;
coinHit = hitMop;
}
}
}
}
for(int j = 0; j < list.size(); ++j) {
Entity entity = (Entity) list.get(j);
@ -158,13 +184,14 @@ public class EntityBulletBeamBase extends Entity implements IEntityAdditionalSpa
if(hitMop != null) {
// if penetration is enabled, run impact for all intersecting entities
if(this.doesPenetrate()) {
this.onImpact(new MovingObjectPosition(entity, hitMop.hitVec));
} else {
double dist = pos.distanceTo(hitMop.hitVec);
// if penetration is enabled, run impact for all intersecting entities
if(this.doesPenetrate()) {
if(hitCoin == null || dist < closestCoin) {
this.onImpact(new MovingObjectPosition(entity, hitMop.hitVec));
}
} else {
if(dist < nearest || nearest == 0.0D) {
hitEntity = entity;
nearest = dist;
@ -179,6 +206,86 @@ public class EntityBulletBeamBase extends Entity implements IEntityAdditionalSpa
if(!this.doesPenetrate() && hitEntity != null) {
mop = new MovingObjectPosition(hitEntity, nonPenImpact.hitVec);
}
if(hitCoin != null) {
Vec3 vec = Vec3.createVectorHelper(coinHit.hitVec.xCoord - posX, coinHit.hitVec.yCoord - posY, coinHit.hitVec.zCoord - posZ);
this.beamLength = vec.lengthVector();
double range = 50;
List<Entity> targets = worldObj.getEntitiesWithinAABB(Entity.class, AxisAlignedBB.getBoundingBox(coinHit.hitVec.xCoord, coinHit.hitVec.yCoord, coinHit.hitVec.zCoord, coinHit.hitVec.xCoord, coinHit.hitVec.yCoord, coinHit.hitVec.zCoord).expand(range, range, range));
Entity nearestCoin = null;
Entity nearestPlayer = null;
Entity nearestMob = null;
Entity nearestOther = null;
double coinDist = 0;
double playerDist = 0;
double mobDist = 0;
double otherDist = 0;
hitCoin.setDead();
// well i mean we could just uuse a single var for all variants and then overwrite stuff
// when we run into things with higher priority. however i can't be assed fuck off
for(Entity entity : targets) {
if(entity == this.getThrower()) continue;
if(entity.isDead) continue;
double dist = entity.getDistanceToEntity(hitCoin);
if(dist > range) continue;
if(entity instanceof EntityCoin) {
if(coinDist == 0 || dist < coinDist) {
coinDist = dist;
nearestCoin = entity;
}
} else if(entity instanceof EntityPlayer) {
if(playerDist == 0 || dist < playerDist) {
playerDist = dist;
nearestPlayer = entity;
}
} else if(entity instanceof EntityMob) {
if(mobDist == 0 || dist < mobDist) {
mobDist = dist;
nearestMob = entity;
}
} else if(entity instanceof EntityLivingBase) {
if(otherDist == 0 || dist < otherDist) {
otherDist = dist;
nearestOther = entity;
}
}
}
// ternary of shame
Entity target = nearestCoin != null ? nearestCoin :
nearestPlayer != null ? nearestPlayer :
nearestMob != null ? nearestMob :
nearestOther != null ? nearestOther : null;
if(target != null) {
EntityBulletBeamBase newBeam = new EntityBulletBeamBase(hitCoin.getThrower() != null ? hitCoin.getThrower() : this.thrower, this.config, this.damage * 1.25F);
newBeam.setPosition(coinHit.hitVec.xCoord, coinHit.hitVec.yCoord, coinHit.hitVec.zCoord);
Vec3 delta = Vec3.createVectorHelper(target.posX - newBeam.posX, (target.posY + target.height / 2D) - newBeam.posY, target.posZ - newBeam.posZ);
newBeam.setRotationsFromVector(delta);
newBeam.performHitscanExternal(delta.lengthVector());
worldObj.spawnEntityInWorld(newBeam);
} else {
EntityBulletBeamBase newBeam = new EntityBulletBeamBase(hitCoin.getThrower() != null ? hitCoin.getThrower() : this.thrower, this.config, this.damage * 1.25F);
newBeam.setPosition(coinHit.hitVec.xCoord, coinHit.hitVec.yCoord, coinHit.hitVec.zCoord);
newBeam.setRotationsFromVector(Vec3.createVectorHelper(rand.nextGaussian() * 0.5, -1, rand.nextGaussian() * 0.5));
newBeam.performHitscanExternal(100);
worldObj.spawnEntityInWorld(newBeam);
}
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "vanillaExt");
data.setString("mode", "largeexplode");
data.setFloat("size", 1.5F);
data.setByte("count", (byte)1);
PacketThreading.createAllAroundThreadedPacket(new AuxParticlePacketNT(data, coinHit.hitVec.xCoord, coinHit.hitVec.yCoord, coinHit.hitVec.zCoord), new TargetPoint(worldObj.provider.dimensionId, coinHit.hitVec.xCoord, coinHit.hitVec.yCoord, coinHit.hitVec.zCoord, 100));
return;
}
}
if(mop != null) {

View File

@ -0,0 +1,51 @@
package com.hbm.entity.projectile;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
public class EntityCoin extends EntityThrowableInterp {
public EntityCoin(World world) {
super(world);
this.setSize(1F, 1F);
this.yOffset = 0.5F;
}
@Override
public void onUpdate() {
super.onUpdate();
}
public void setPosition(double x, double y, double z) {
this.posX = x;
this.posY = y;
this.posZ = z;
float f = this.width / 2.0F;
this.boundingBox.setBounds(x - f, y - this.yOffset + this.ySize, z - f, x + f, y - this.yOffset + this.ySize + this.height, z + f);
}
@Override
protected void onImpact(MovingObjectPosition mop) {
if(mop.typeOfHit == mop.typeOfHit.BLOCK) this.setDead();
}
@Override
protected float getAirDrag() {
return 1F;
}
@Override
public double getGravityVelocity() {
return 0.02D;
}
@Override
public boolean canBeCollidedWith() {
return true;
}
@Override
public boolean canAttackWithItem() {
return true;
}
}

View File

@ -1,7 +1,6 @@
package com.hbm.handler.ae2;
import com.hbm.tileentity.machine.TileEntityMachineArcFurnaceLarge;
import com.hbm.tileentity.TileEntityProxyCombo;
import cpw.mods.fml.common.Optional;
@ -14,7 +13,7 @@ import appeng.api.storage.data.IAEItemStack;
import appeng.api.storage.data.IItemList;
import net.minecraft.item.ItemStack;
@Optional.InterfaceList({@Optional.Interface(iface = "appeng.api.storage.IMEInventory", modid = "appliedenergistics2")})
@Optional.InterfaceList({ @Optional.Interface(iface = "appeng.api.storage.IMEInventory", modid = "appliedenergistics2") })
public class ArcFurnaceLargeMEInventory implements IMEInventory<IAEItemStack> {
private TileEntityMachineArcFurnaceLarge afl;
@ -46,7 +45,8 @@ public class ArcFurnaceLargeMEInventory implements IMEInventory<IAEItemStack> {
ItemStack is;
for(int i = 0; i < 25; i++) {
is = afl.getAvailableItemFromSlot(i);
if(is != null) out.add(AEApi.instance().storage().createItemStack(is));
if(is != null)
out.add(AEApi.instance().storage().createItemStack(is));
}
return out;
@ -56,5 +56,4 @@ public class ArcFurnaceLargeMEInventory implements IMEInventory<IAEItemStack> {
public StorageChannel getChannel() {
return StorageChannel.ITEMS;
}
}

View File

@ -0,0 +1,144 @@
package com.hbm.inventory.gui;
import java.io.File;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.machine.BlockPWR;
import com.hbm.blocks.machine.BlockPWR.TileEntityBlockPWR;
import net.minecraft.block.Block;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraftforge.common.util.ForgeDirection;
public class GUIScreenSlicePrinter extends GuiScreen {
private final int x1, y1, z1;
private final int x2, y2, z2;
private final int sizeX, sizeY, sizeZ;
private final ForgeDirection dir;
private HashSet<Block> whitelist;
private int yIndex;
private RenderBlocks renderer;
private String dirname;
private static final DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd_HH.mm.ss");
public GUIScreenSlicePrinter(int x1, int y1, int z1, int x2, int y2, int z2, ForgeDirection dir) {
this.x1 = Math.min(x1, x2);
this.y1 = Math.min(y1, y2);
this.z1 = Math.min(z1, z2);
this.x2 = Math.max(x1, x2);
this.y2 = Math.max(y1, y2);
this.z2 = Math.max(z1, z2);
this.dir = dir;
this.sizeX = this.x2 - this.x1 + 1;
this.sizeY = this.y2 - this.y1 + 1;
this.sizeZ = this.z2 - this.z1 + 1;
dirname = dateFormat.format(new Date()).toString();
}
public GUIScreenSlicePrinter(int x1, int y1, int z1, int x2, int y2, int z2, ForgeDirection dir, HashSet<Block> whitelist) {
this(x1, y1, z1, x2, y2, z2, dir);
this.whitelist = whitelist;
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
if(renderer == null) {
this.renderer = new RenderBlocks(mc.theWorld);
}
GuiScreen.drawRect(0, 0, width, height, 0xFFFF00FF);
// Once we've reached the top slice, close the GUI
if(yIndex >= sizeY) {
mc.thePlayer.addChatMessage(new ChatComponentText("Slices saved to: .minecraft/printer/" + dirname));
mc.thePlayer.closeScreen();
return;
}
GL11.glPushMatrix();
{
setupRotation();
mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
GL11.glShadeModel(GL11.GL_SMOOTH);
Tessellator.instance.startDrawingQuads();
for(int x = 0; x < sizeX; x++) {
for(int z = 0; z < sizeZ; z++) {
Block block = mc.theWorld.getBlock(x1 + x, y1 + yIndex, z1 + z);
if(whitelist != null && !whitelist.contains(block)) continue;
// Revert PWR blocks to originals for slice rendering
if(block instanceof BlockPWR) {
TileEntity tile = mc.theWorld.getTileEntity(x1 + x, y1 + yIndex, z1 + z);
if(tile instanceof TileEntityBlockPWR) {
TileEntityBlockPWR pwr = (TileEntityBlockPWR) tile;
if(pwr.block != null) {
block = pwr.block;
}
}
}
renderer.renderBlockByRenderType(block, x, 0, z);
}
}
Tessellator.instance.draw();
GL11.glShadeModel(GL11.GL_FLAT);
}
GL11.glPopMatrix();
File printerDir = new File(mc.mcDataDir, "printer");
printerDir.mkdir();
GUIScreenWikiRender.saveScreenshot(printerDir, dirname, "slice_" + yIndex + ".png", 0, 0, mc.displayWidth, mc.displayHeight, 0xFFFF00FF);
yIndex++;
}
private void setupRotation() {
double scale = -24;
GL11.glTranslated(width / 2, height / 2 - 36, 400);
GL11.glScaled(scale, scale, scale);
GL11.glScaled(1, 1, 0.5); //incredible flattening power
GL11.glRotated(-30, 1, 0, 0);
GL11.glRotated(-45, 0, 1, 0);
if(dir == ForgeDirection.WEST) {
GL11.glRotated(180, 0, 1, 0);
} else if(dir == ForgeDirection.NORTH) {
GL11.glRotated(-90, 0, 1, 0);
} else if(dir == ForgeDirection.SOUTH) {
GL11.glRotated(90, 0, 1, 0);
}
if(dir == ForgeDirection.WEST || dir == ForgeDirection.EAST) {
GL11.glTranslated(sizeX / -2D, -sizeY / 2D, sizeZ / -2D);
} else {
GL11.glTranslated(sizeZ / -2D, -sizeY / 2D, sizeX / -2D);
}
}
}

View File

@ -19,7 +19,6 @@ import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.ScaledResolution;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.TextureUtil;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
@ -54,11 +53,7 @@ public class GUIScreenWikiRender extends GuiScreen {
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
if(this.mc.theWorld != null) {
GuiScreen.drawRect(0, 0, this.width, this.height, 0xFFC6C6C6);
} else {
this.drawBackground(0);
}
GuiScreen.drawRect(0, 0, this.width, this.height, 0xFFFF00FF);
// Once we've reached the end of the array, immedaitely close this GUI
if(index >= preview.length) {
@ -66,7 +61,6 @@ public class GUIScreenWikiRender extends GuiScreen {
return;
}
this.drawGuiContainerBackgroundLayer();
GL11.glDisable(GL11.GL_LIGHTING);
this.drawGuiContainerForegroundLayer(preview[index]);
GL11.glEnable(GL11.GL_LIGHTING);
@ -77,7 +71,7 @@ public class GUIScreenWikiRender extends GuiScreen {
try {
String slotName = getStackName.apply(preview[index]).replaceAll("§.", "").replaceAll("[^\\w ().-]+", "");
if(!slotName.endsWith(".name")) {
saveScreenshot(Minecraft.getMinecraft().mcDataDir, saveLocation, prefix + slotName + ".png", zoom, zoom, zoom * 16, zoom * 16, 0xFF8B8B8B);
saveScreenshot(Minecraft.getMinecraft().mcDataDir, saveLocation, prefix + slotName + ".png", zoom, zoom, zoom * 16, zoom * 16, 0xFFFF00FF);
}
} catch (Exception ex) {
// Just skip any failures caused by display name or rendering
@ -86,28 +80,6 @@ public class GUIScreenWikiRender extends GuiScreen {
index++;
}
protected void drawGuiContainerBackgroundLayer() {
GL11.glPushMatrix();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.mc.getTextureManager().bindTexture(texture);
ScaledResolution res = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
GL11.glScaled(scale, scale, scale);
this.drawTexturedModalRect(0, res.getScaledHeight_double() / scale - 18D, 5, 87, 18, 18);
GL11.glPopMatrix();
}
public void drawTexturedModalRect(double x, double y, int sourceX, int sourceY, int sizeX, int sizeY) {
double f = 0.00390625D;
double f1 = 0.00390625D;
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
tessellator.addVertexWithUV((double) (x + 0), (double) (y + sizeY), (double) this.zLevel, (double) ((float) (sourceX + 0) * f), (double) ((float) (sourceY + sizeY) * f1));
tessellator.addVertexWithUV((double) (x + sizeX), (double) (y + sizeY), (double) this.zLevel, (double) ((float) (sourceX + sizeX) * f), (double) ((float) (sourceY + sizeY) * f1));
tessellator.addVertexWithUV((double) (x + sizeX), (double) (y + 0), (double) this.zLevel, (double) ((float) (sourceX + sizeX) * f), (double) ((float) (sourceY + 0) * f1));
tessellator.addVertexWithUV((double) (x + 0), (double) (y + 0), (double) this.zLevel, (double) ((float) (sourceX + 0) * f), (double) ((float) (sourceY + 0) * f1));
tessellator.draw();
}
protected void drawGuiContainerForegroundLayer(ItemStack preview) {
if(preview == null) return;
@ -144,7 +116,7 @@ public class GUIScreenWikiRender extends GuiScreen {
// This implementation is based directly on ScreenShotHelper.saveScreenshot()
// But allows for defining a rect where you want to sample pixels from
private static void saveScreenshot(File dataDir, String ssDir, String fileName, int x, int y, int width, int height, int transparentColor) {
public static void saveScreenshot(File dataDir, String ssDir, String fileName, int x, int y, int width, int height, int transparentColor) {
try {
File screenshotDirectory = new File(dataDir, ssDir);
screenshotDirectory.mkdir();

View File

@ -1035,6 +1035,7 @@ public class ModItems {
public static Item pwr_fuel;
public static Item pwr_fuel_hot;
public static Item pwr_fuel_depleted;
public static Item pwr_printer;
public static Item rbmk_lid;
public static Item rbmk_lid_glass;
@ -1476,8 +1477,7 @@ public class ModItems {
public static Item gun_aberrator_eott;
public static Item gun_double_barrel;
public static Item gun_double_barrel_sacred_dragon;
public static Item gun_n_i_4_n_i; // we GET THERE when we GET THERE
public static Item gun_n_i_4_n_i;
public static Item gun_charge_thrower;
public static Item ammo_standard;
@ -3182,6 +3182,7 @@ public class ModItems {
pwr_fuel = new ItemPWRFuel().setUnlocalizedName("pwr_fuel").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pwr_fuel");
pwr_fuel_hot = new ItemEnumMulti(EnumPWRFuel.class, true, false).setUnlocalizedName("pwr_fuel_hot").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pwr_fuel_hot");
pwr_fuel_depleted = new ItemEnumMulti(EnumPWRFuel.class, true, false).setUnlocalizedName("pwr_fuel_depleted").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pwr_fuel_depleted");
pwr_printer = new ItemPWRPrinter().setUnlocalizedName("pwr_printer").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pwr_printer");
rbmk_lid = new ItemRBMKLid().setUnlocalizedName("rbmk_lid").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rbmk_lid");
rbmk_lid_glass = new ItemRBMKLid().setUnlocalizedName("rbmk_lid_glass").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rbmk_lid_glass");
@ -5995,6 +5996,7 @@ public class ModItems {
GameRegistry.registerItem(pwr_fuel, pwr_fuel.getUnlocalizedName());
GameRegistry.registerItem(pwr_fuel_hot, pwr_fuel_hot.getUnlocalizedName());
GameRegistry.registerItem(pwr_fuel_depleted, pwr_fuel_depleted.getUnlocalizedName());
GameRegistry.registerItem(pwr_printer, pwr_printer.getUnlocalizedName());
//RBMK parts
GameRegistry.registerItem(rbmk_lid, rbmk_lid.getUnlocalizedName());
@ -6400,6 +6402,7 @@ public class ModItems {
GameRegistry.registerItem(gun_aberrator_eott, gun_aberrator_eott.getUnlocalizedName());
GameRegistry.registerItem(gun_double_barrel, gun_double_barrel.getUnlocalizedName());
GameRegistry.registerItem(gun_double_barrel_sacred_dragon, gun_double_barrel_sacred_dragon.getUnlocalizedName());
GameRegistry.registerItem(gun_n_i_4_n_i, gun_n_i_4_n_i.getUnlocalizedName());
GameRegistry.registerItem(gun_fireext, gun_fireext.getUnlocalizedName());
GameRegistry.registerItem(gun_charge_thrower, gun_charge_thrower.getUnlocalizedName());

View File

@ -0,0 +1,176 @@
package com.hbm.items.machine;
import java.util.HashSet;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.machine.BlockPWR;
import com.hbm.blocks.machine.BlockPWR.TileEntityBlockPWR;
import com.hbm.inventory.gui.GUIScreenSlicePrinter;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.machine.TileEntityPWRController;
import com.hbm.util.fauxpointtwelve.BlockPos;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import io.netty.buffer.ByteBuf;
import net.minecraft.block.Block;
import net.minecraft.client.Minecraft;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class ItemPWRPrinter extends Item implements IGUIProvider {
private static int x1, y1, z1;
private static int x2, y2, z2;
private static Block[] blockSync;
private static ForgeDirection dir;
private HashSet<BlockPos> fill = new HashSet<>();
private static HashSet<Block> whitelist = new HashSet<Block>() {{
add(ModBlocks.pwr_block);
add(ModBlocks.pwr_controller);
}};
// Piggybacking functions using the bytebuf TE sync
public static void serialize(World world, ByteBuf buf) {
buf.writeInt(x1);
buf.writeInt(y1);
buf.writeInt(z1);
buf.writeInt(x2);
buf.writeInt(y2);
buf.writeInt(z2);
buf.writeInt(dir.ordinal());
for(Block block : blockSync) {
buf.writeInt(Block.getIdFromBlock(block));
}
blockSync = null;
}
public static void deserialize(World world, ByteBuf buf) {
x1 = buf.readInt();
y1 = buf.readInt();
z1 = buf.readInt();
x2 = buf.readInt();
y2 = buf.readInt();
z2 = buf.readInt();
dir = ForgeDirection.values()[buf.readInt()];
for(int x = x1; x <= x2; x++) {
for(int y = y1; y <= y2; y++) {
for(int z = z1; z <= z2; z++) {
Block block = Block.getBlockById(buf.readInt());
TileEntity tile = world.getTileEntity(x, y, z);
if(!(tile instanceof TileEntityBlockPWR)) continue;
((TileEntityBlockPWR) tile).block = block;
}
}
}
System.out.println("oh wow it synced and attempted to GUI!");
// Open the printer GUI on any client players holding the printer
// yeah it's a shit hack yay weee wooo
EntityPlayer player = Minecraft.getMinecraft().thePlayer;
if(player != null && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof ItemPWRPrinter) {
FMLNetworkHandler.openGui(Minecraft.getMinecraft().thePlayer, MainRegistry.instance, 0, world, 0, 0, 0);
}
}
@Override
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int i, float f0, float f1, float f2) {
TileEntity tile = world.getTileEntity(x, y, z);
if(!(tile instanceof TileEntityPWRController)) return false;
if(world.isRemote) return true;
TileEntityPWRController pwr = (TileEntityPWRController) tile;
syncAndScreenshot(world, pwr);
return true;
}
public void syncAndScreenshot(World world, TileEntityPWRController pwr) {
findBounds(world, pwr);
int sizeX = x2 - x1 + 1;
int sizeY = y2 - y1 + 1;
int sizeZ = z2 - z1 + 1;
blockSync = new Block[sizeX * sizeY * sizeZ];
int i = 0;
for(int x = x1; x <= x2; x++) {
for(int y = y1; y <= y2; y++) {
for(int z = z1; z <= z2; z++) {
TileEntity tile = world.getTileEntity(x, y, z);
if(tile instanceof TileEntityBlockPWR) {
blockSync[i] = ((TileEntityBlockPWR) tile).block;
}
i++;
}
}
}
pwr.isPrinting = true;
}
public void findBounds(World world, TileEntityPWRController pwr) {
dir = ForgeDirection.getOrientation(world.getBlockMetadata(pwr.xCoord, pwr.yCoord, pwr.zCoord)).getOpposite();
fill.clear();
fill.add(new BlockPos(pwr.xCoord, pwr.yCoord, pwr.zCoord));
x1 = x2 = pwr.xCoord;
y1 = y2 = pwr.yCoord;
z1 = z2 = pwr.zCoord;
floodFill(world, pwr.xCoord + dir.offsetX, pwr.yCoord, pwr.zCoord + dir.offsetZ);
}
public void floodFill(World world, int x, int y, int z) {
BlockPos pos = new BlockPos(x, y, z);
if(fill.contains(pos)) return;
if(world.getBlock(x, y, z) instanceof BlockPWR) {
fill.add(pos);
x1 = Math.min(x1, x);
y1 = Math.min(y1, y);
z1 = Math.min(z1, z);
x2 = Math.max(x2, x);
y2 = Math.max(y2, y);
z2 = Math.max(z2, z);
floodFill(world, x + 1, y, z);
floodFill(world, x - 1, y, z);
floodFill(world, x, y + 1, z);
floodFill(world, x, y - 1, z);
floodFill(world, x, y, z + 1);
floodFill(world, x, y, z - 1);
}
}
@Override
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
return null;
}
@Override
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new GUIScreenSlicePrinter(x1, y1, z1, x2, y2, z2, dir, whitelist);
}
@SuppressWarnings({ "unchecked", "rawtypes" })
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
list.add("Use on a constructed PWR controller to generate construction diagrams");
}
}

View File

@ -19,6 +19,7 @@ import com.hbm.items.IKeybindReceiver;
import com.hbm.items.armor.ArmorTrenchmaster;
import com.hbm.items.weapon.sedna.hud.IHUDComponent;
import com.hbm.items.weapon.sedna.mags.IMagazine;
import com.hbm.items.weapon.sedna.mags.MagazineInfinite;
import com.hbm.items.weapon.sedna.mods.WeaponModManager;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
@ -173,7 +174,9 @@ public class ItemGunBaseNT extends Item implements IKeybindReceiver, IItemHUD, I
GunConfig config = getConfig(stack, i);
for(Receiver rec : config.getReceivers(stack)) {
IMagazine mag = rec.getMagazine(stack);
if(!(mag instanceof MagazineInfinite)) {
list.add(I18nUtil.resolveKey("gui.weapon.ammo") + ": " + mag.getIconForHUD(stack, player).getDisplayName() + " " + mag.reportAmmoStateForHUD(stack, player));
}
float dmg = rec.getBaseDamage(stack);
list.add(I18nUtil.resolveKey("gui.weapon.baseDamage") + ": " + FORMAT_DMG.format(dmg));
if(mag.getType(stack, player.inventory) instanceof BulletConfig) {

View File

@ -101,6 +101,7 @@ public class GunFactoryClient {
MinecraftForgeClient.registerItemRenderer(ModItems.gun_double_barrel, new ItemRenderDoubleBarrel(ResourceManager.double_barrel_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_double_barrel_sacred_dragon, new ItemRenderDoubleBarrel(ResourceManager.double_barrel_sacred_dragon_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_charge_thrower, new ItemRenderChargeThrower());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_n_i_4_n_i, new ItemRenderNI4NI());
//PROJECTILES
ammo_debug.setRenderer(LegoClient.RENDER_STANDARD_BULLET);
@ -227,6 +228,8 @@ public class GunFactoryClient {
p35800.setRendererBeam(LegoClient.RENDER_CRACKLE);
p35800_bl.setRendererBeam(LegoClient.RENDER_BLACK_LIGHTNING);
ni4ni_arc.setRendererBeam(LegoClient.RENDER_NI4NI_BOLT);
ct_hook.setRenderer(LegoClient.RENDER_CT_HOOK);
ct_mortar.setRenderer(LegoClient.RENDER_CT_MORTAR);
ct_mortar_charge.setRenderer(LegoClient.RENDER_CT_MORTAR_CHARGE);

View File

@ -398,6 +398,25 @@ public class LegoClient {
RenderArcFurnace.fullbright(false);
};
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_NI4NI_BOLT = (bullet, interp) -> {
RenderArcFurnace.fullbright(true);
double age = MathHelper.clamp_double(1D - ((double) bullet.ticksExisted - 2 + interp) / (double) bullet.getBulletConfig().expires, 0, 1);
GL11.glPushMatrix();
GL11.glRotatef(180 - bullet.rotationYaw, 0, 1F, 0);
GL11.glRotatef(-bullet.rotationPitch - 90, 1F, 0, 0);
double scale = 5D;
GL11.glScaled(age * scale, 1, age * scale);
GL11.glTranslated(0, bullet.beamLength, 0);
GL11.glRotatef(-90, 0, 0, 1);
renderBulletStandard(Tessellator.instance, 0xAAD2E5, 0xffffff, bullet.beamLength, true);
GL11.glPopMatrix();
RenderArcFurnace.fullbright(false);
};
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_LASER_RED = (bullet, interp) -> {
renderStandardLaser(bullet, interp, 0x80, 0x15, 0x15);
};

View File

@ -5,6 +5,7 @@ import java.util.function.BiFunction;
import java.util.function.Consumer;
import com.hbm.entity.projectile.EntityBulletBeamBase;
import com.hbm.entity.projectile.EntityCoin;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.items.weapon.sedna.Crosshair;
@ -14,7 +15,9 @@ import com.hbm.items.weapon.sedna.Receiver;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
import com.hbm.items.weapon.sedna.ItemGunBaseNT.WeaponQuality;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
import com.hbm.items.weapon.sedna.impl.ItemGunNI4NI;
import com.hbm.items.weapon.sedna.mags.MagazineBelt;
import com.hbm.items.weapon.sedna.mags.MagazineInfinite;
import com.hbm.items.weapon.sedna.mags.MagazineSingleReload;
import com.hbm.main.MainRegistry;
import com.hbm.render.anim.BusAnimation;
@ -22,11 +25,13 @@ import com.hbm.render.anim.BusAnimationSequence;
import com.hbm.render.anim.BusAnimationKeyframe.IType;
import com.hbm.render.anim.HbmAnimations.AnimType;
import com.hbm.util.DamageResistanceHandler.DamageClass;
import com.hbm.util.Vec3NT;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Vec3;
@ -41,6 +46,8 @@ public class XFactoryAccelerator {
public static BulletConfig coil_tungsten;
public static BulletConfig coil_ferrouranium;
public static BulletConfig ni4ni_arc;
public static Consumer<Entity> LAMBDA_UPDATE_TUNGSTEN = (entity) -> {breakInPath(entity, 1.25F); };
public static Consumer<Entity> LAMBDA_UPDATE_FERRO = (entity) -> { breakInPath(entity, 2.5F); };
@ -90,6 +97,9 @@ public class XFactoryAccelerator {
coil_ferrouranium = new BulletConfig().setItem(EnumAmmo.COIL_FERROURANIUM).setVel(7.5F).setLife(50).setDoesPenetrate(true).setDamageFalloffByPen(false).setSpectral(true)
.setOnUpdate(LAMBDA_UPDATE_FERRO);
ni4ni_arc = new BulletConfig().setupDamageClass(DamageClass.PHYSICAL).setBeam().setLife(5).setThresholdNegation(10F).setArmorPiercing(0.2F).setRenderRotations(false).setDoesPenetrate(false)
.setOnBeamImpact(BulletConfig.LAMBDA_BEAM_HIT);
tauChargeMag.addConfigs(tau_uranium_charge);
ModItems.gun_tau = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
@ -118,6 +128,18 @@ public class XFactoryAccelerator {
.setupStandardConfiguration()
.anim(LAMBDA_COILGUN_ANIMS).orchestra(Orchestras.ORCHESTRA_COILGUN)
).setUnlocalizedName("gun_coilgun");
ModItems.gun_n_i_4_n_i = new ItemGunNI4NI(WeaponQuality.SPECIAL, new GunConfig()
.dura(0).draw(5).inspect(39).crosshair(Crosshair.CIRCLE)
.rec(new Receiver(0)
.dmg(35F).delay(10).sound("hbm:weapon.coilgunShoot", 1.0F, 1.0F)
.mag(new MagazineInfinite(ni4ni_arc))
.offset(0.75, -0.0625, -0.1875D)
.setupStandardFire().fire(Lego.LAMBDA_NOWEAR_FIRE))
.setupStandardConfiguration()
.ps(LAMBDA_NI4NI_SECONDARY_PRESS)
.anim(LAMBDA_NI4NI_ANIMS).orchestra(Orchestras.ORCHESTRA_COILGUN)
).setUnlocalizedName("gun_n_i_4_n_i");
}
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_TAU_PRIMARY_RELEASE = (stack, ctx) -> {
@ -163,6 +185,27 @@ public class XFactoryAccelerator {
}
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_NI4NI_SECONDARY_PRESS = (stack, ctx) -> {
if(ctx.getPlayer() == null) return;
EntityPlayer player = ctx.getPlayer();
if(ItemGunNI4NI.getCoinCount(stack) > 0) {
Vec3NT vec = new Vec3NT(player.getLookVec()).multiply(0.8D);
EntityCoin coin = new EntityCoin(player.worldObj);
coin.setPosition(player.posX, player.posY + player.getEyeHeight() - coin.yOffset - 0.125, player.posZ);
coin.motionX = vec.xCoord;
coin.motionY = vec.yCoord + 0.5;
coin.motionZ = vec.zCoord;
coin.rotationYaw = player.rotationYaw;
coin.setThrower(player);
player.worldObj.spawnEntityInWorld(coin);
player.worldObj.playSoundAtEntity(player, "random.orb", 1.0F, 1F + player.getRNG().nextFloat() * 0.25F);
ItemGunNI4NI.setCoinCount(stack, ItemGunNI4NI.getCoinCount(stack) - 1);
}
};
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_TAU = (stack, ctx) -> { };
public static BiConsumer<ItemStack, LambdaContext> LAMBDA_RECOIL_COILGUN = (stack, ctx) -> {
@ -196,4 +239,20 @@ public class XFactoryAccelerator {
if(type == AnimType.RELOAD) return new BusAnimation().addBus("RELOAD", new BusAnimationSequence().addPos(1, 0, 0, 250).addPos(1, 0, 0, 500).addPos(0, 0, 0, 250));
return null;
};
@SuppressWarnings("incomplete-switch") public static BiFunction<ItemStack, AnimType, BusAnimation> LAMBDA_NI4NI_ANIMS = (stack, type) -> {
switch(type) {
case EQUIP: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(-360 * 2, 0, 0, 500));
case CYCLE:
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
return new BusAnimation()
.addBus("RECOIL", new BusAnimationSequence().addPos(aiming ? -5 : -30, 0, 0, 100, IType.SIN_DOWN).addPos(0, 0, 0, 150, IType.SIN_FULL))
.addBus("DRUM", new BusAnimationSequence().hold(50).addPos(0, 0, 120, 300, IType.SIN_FULL));
case INSPECT: return new BusAnimation()
.addBus("EQUIP", new BusAnimationSequence().addPos(-360 * 3, 0, 0, 750).hold(100).addPos(0, 0, 0, 750));
}
return null;
};
}

View File

@ -0,0 +1,110 @@
package com.hbm.items.weapon.sedna.impl;
import java.util.List;
import com.hbm.items.ICustomizable;
import com.hbm.items.weapon.sedna.GunConfig;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.util.ChatBuilder;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.world.World;
public class ItemGunNI4NI extends ItemGunBaseNT implements ICustomizable {
public ItemGunNI4NI(WeaponQuality quality, GunConfig... cfg) {
super(quality, cfg);
}
@Override
public void onUpdate(ItemStack stack, World world, Entity entity, int slot, boolean isHeld) {
super.onUpdate(stack, world, entity, slot, isHeld);
if(!world.isRemote) {
if(this.getCoinCount(stack) < 4) {
this.setCoinCharge(stack, this.getCoinCharge(stack) + 1);
if(this.getCoinCharge(stack) >= 80) {
this.setCoinCharge(stack, 0);
int newCount = this.getCoinCount(stack) + 1;
this.setCoinCount(stack, newCount);
if(isHeld) {
world.playSoundAtEntity(entity, "hbm:item.techBoop", 1.0F, 1.25F + newCount * 0.125F);
}
}
}
}
}
@SideOnly(Side.CLIENT)
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
list.add("Now, don't get the wrong idea.");
list.add("I " + EnumChatFormatting.RED + "fucking hate " + EnumChatFormatting.GRAY + "this game.");
list.add("I didn't do this for you, I did it for sea.");
super.addInformation(stack, player, list, ext);
}
@Override
public void customize(EntityPlayer player, ItemStack stack, String... args) {
if(args.length == 0) {
resetColors(stack);
player.addChatComponentMessage(ChatBuilder.start("Colors reset!").color(EnumChatFormatting.GREEN).flush());
return;
}
if(args.length != 3) {
resetColors(stack);
player.addChatComponentMessage(ChatBuilder.start("Requires three hexadecimal colors!").color(EnumChatFormatting.RED).flush());
return;
}
try {
int dark = Integer.parseInt(args[0], 16);
int light = Integer.parseInt(args[1], 16);
int grip = Integer.parseInt(args[2], 16);
if(dark < 0 || dark > 0xffffff || light < 0 || light > 0xffffff || grip < 0 || grip > 0xffffff) {
player.addChatComponentMessage(ChatBuilder.start("Colors must range from 0 to FFFFFF!").color(EnumChatFormatting.RED).flush());
return;
}
setColors(stack, dark, light, grip);
player.addChatComponentMessage(ChatBuilder.start("Colors set!").color(EnumChatFormatting.GREEN).flush());
} catch(Throwable ex) {
player.addChatComponentMessage(ChatBuilder.start(ex.getLocalizedMessage()).color(EnumChatFormatting.RED).flush());
}
}
public static void resetColors(ItemStack stack) {
if(!stack.hasTagCompound()) return;
stack.stackTagCompound.removeTag("colors");
}
public static void setColors(ItemStack stack, int dark, int light, int grip) {
if(!stack.hasTagCompound()) stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setIntArray("colors", new int[] {dark, light, grip});
}
public static int[] getColors(ItemStack stack) {
if(!stack.hasTagCompound() || !stack.stackTagCompound.hasKey("colors")) return null;
int[] colors = stack.stackTagCompound.getIntArray("colors");
if(colors.length != 3) return null;
return colors;
}
public static final String KEY_COIN_COUNT = "coincount";
public static final String KEY_COIN_CHARGE = "coincharge";
public static int getCoinCount(ItemStack stack) { return getValueInt(stack, KEY_COIN_COUNT); }
public static void setCoinCount(ItemStack stack, int value) { setValueInt(stack, KEY_COIN_COUNT, value); }
public static int getCoinCharge(ItemStack stack) { return getValueInt(stack, KEY_COIN_CHARGE); }
public static void setCoinCharge(ItemStack stack, int value) { setValueInt(stack, KEY_COIN_CHARGE, value); }
}

View File

@ -0,0 +1,39 @@
package com.hbm.items.weapon.sedna.mags;
import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.particle.SpentCasing;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
public class MagazineInfinite implements IMagazine {
public BulletConfig type;
public MagazineInfinite(BulletConfig type) {
this.type = type;
}
@Override
public Object getType(ItemStack stack, IInventory inventory) {
return this.type;
}
@Override public void setType(ItemStack stack, Object type) { }
@Override public int getCapacity(ItemStack stack) { return 9999; }
@Override public int getAmount(ItemStack stack, IInventory inventory) { return 9999; }
@Override public void setAmount(ItemStack stack, int amount) { }
@Override public void useUpAmmo(ItemStack stack, IInventory inventory, int amount) { }
@Override public boolean canReload(ItemStack stack, IInventory inventory) { return false; }
@Override public void initNewType(ItemStack stack, IInventory inventory) { }
@Override public void reloadAction(ItemStack stack, IInventory inventory) { }
@Override public ItemStack getIconForHUD(ItemStack stack, EntityPlayer player) { return new ItemStack(ModItems.nothing); }
@Override public String reportAmmoStateForHUD(ItemStack stack, EntityPlayer player) { return ""; }
@Override public SpentCasing getCasing(ItemStack stack, IInventory inventory) { return this.type.casing; }
@Override public void setAmountBeforeReload(ItemStack stack, int amount) { }
@Override public int getAmountBeforeReload(ItemStack stack) { return 9999; }
@Override public void setAmountAfterReload(ItemStack stack, int amount) { }
@Override public int getAmountAfterReload(ItemStack stack) { return 9999; }
}

View File

@ -223,17 +223,17 @@ public class HbmWorldGen implements IWorldGenerator {
}
}
if(biome == BiomeGenBase.plains || biome == BiomeGenBase.desert) {
if(WorldConfig.radioStructure > 0 && rand.nextInt(WorldConfig.radioStructure) == 0) {
for(int a = 0; a < 1; a++) {
int x = i + rand.nextInt(16);
int z = j + rand.nextInt(16);
int y = world.getHeightValue(x, z);
new Radio01().generate(world, rand, x, y, z);
}
}
}
// if(biome == BiomeGenBase.plains || biome == BiomeGenBase.desert) {
// if(WorldConfig.radioStructure > 0 && rand.nextInt(WorldConfig.radioStructure) == 0) {
// for(int a = 0; a < 1; a++) {
// int x = i + rand.nextInt(16);
// int z = j + rand.nextInt(16);
// int y = world.getHeightValue(x, z);
//
// new Radio01().generate(world, rand, x, y, z);
// }
// }
// }
if(biome.temperature >= 0.4F && biome.rainfall <= 0.6F) {
if(WorldConfig.antennaStructure > 0 && rand.nextInt(WorldConfig.antennaStructure) == 0) {

View File

@ -619,6 +619,7 @@ public class ClientProxy extends ServerProxy {
RenderingRegistry.registerEntityRenderingHandler(EntityArtilleryRocket.class, new RenderArtilleryRocket());
RenderingRegistry.registerEntityRenderingHandler(EntityCog.class, new RenderCog());
RenderingRegistry.registerEntityRenderingHandler(EntitySawblade.class, new RenderSawblade());
RenderingRegistry.registerEntityRenderingHandler(EntityCoin.class, new RenderCoin());
RenderingRegistry.registerEntityRenderingHandler(EntityChemical.class, new RenderChemical());
RenderingRegistry.registerEntityRenderingHandler(EntityMist.class, new RenderMist());
RenderingRegistry.registerEntityRenderingHandler(EntityFireLingering.class, new RenderMist());

View File

@ -907,6 +907,7 @@ public class ResourceManager {
public static final IModelCustom aberrator = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/aberrator.obj")).asVBO();
public static final IModelCustom mas36 = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/mas36.obj")).asVBO();
public static final IModelCustom charge_thrower = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/charge_thrower.obj")).asVBO();
public static final IModelCustom n_i_4_n_i = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/weapons/n_i_4_n_i.obj")).asVBO();
public static final HashMap<String, BusAnimation> spas_12_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/spas12.json"));
public static final HashMap<String, BusAnimation> congolake_anim = AnimationLoader.load(new ResourceLocation(RefStrings.MODID, "models/weapons/animations/congolake.json"));
@ -1044,6 +1045,8 @@ public class ResourceManager {
public static final ResourceLocation charge_thrower_hook_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/charge_thrower_hook.png");
public static final ResourceLocation charge_thrower_mortar_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/charge_thrower_mortar.png");
public static final ResourceLocation charge_thrower_rocket_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/charge_thrower_rocket.png");
public static final ResourceLocation n_i_4_n_i_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/n_i_4_n_i.png");
public static final ResourceLocation n_i_4_n_i_greyscale_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/n_i_4_n_i_greyscale.png");
public static final ResourceLocation lance_tex = new ResourceLocation(RefStrings.MODID, "textures/models/weapons/lance.png");

View File

@ -53,7 +53,6 @@ public class StructureManager {
public static final NBTStructure vertibird = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/vertibird.nbt"));
public static final NBTStructure crashed_vertibird = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/crashed-vertibird.nbt"));
public static final NBTStructure aircraft_carrier = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/aircraft_carrier.nbt"));
@ -61,6 +60,7 @@ public class StructureManager {
public static final NBTStructure beached_patrol = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/beached_patrol.nbt"));
public static final NBTStructure lighthouse = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/lighthouse.nbt"));
public static final NBTStructure dish = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/dish.nbt"));
public static final NBTStructure radio_house = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/radio_house.nbt"));
public static final NBTStructure ntmruinsA = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/ntmruinsA.nbt"));
public static final NBTStructure ntmruinsB = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/ntmruinsB.nbt"));

View File

@ -0,0 +1,39 @@
package com.hbm.render.entity.projectile;
import org.lwjgl.opengl.GL11;
import com.hbm.lib.RefStrings;
import com.hbm.render.loader.HFRWavefrontObject;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.IModelCustom;
public class RenderCoin extends Render {
public static final IModelCustom coin = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/trinkets/chip.obj")).asVBO();
public static final ResourceLocation coin_tex = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/chip_gold.png");
@Override
public void doRender(Entity coin, double x, double y, double z, float f0, float f1) {
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glRotatef(coin.prevRotationYaw + (coin.rotationYaw - coin.prevRotationYaw) * f1 - 90.0F, 0.0F, -1.0F, 0.0F);
GL11.glRotated((coin.ticksExisted + f1) * 45, 0, 0, 1);
double scale = 0.125D;
GL11.glScaled(scale, scale, scale);
this.bindEntityTexture(coin);
this.coin.renderAll();
GL11.glPopMatrix();
}
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return coin_tex;
}
}

View File

@ -0,0 +1,189 @@
package com.hbm.render.item.weapon.sedna;
import org.lwjgl.opengl.GL11;
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.impl.ItemGunNI4NI;
import com.hbm.main.ResourceManager;
import com.hbm.render.anim.HbmAnimations;
import com.hbm.render.tileentity.RenderArcFurnace;
import com.hbm.util.ColorUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.item.ItemStack;
public class ItemRenderNI4NI extends ItemRenderWeaponBase {
@Override
protected float getTurnMagnitude(ItemStack stack) { return ItemGunBaseNT.getIsAiming(stack) ? 2.5F : -0.25F; }
@Override
public float getViewFOV(ItemStack stack, float fov) {
float aimingProgress = ItemGunBaseNT.prevAimingProgress + (ItemGunBaseNT.aimingProgress - ItemGunBaseNT.prevAimingProgress) * interp;
return fov * (1 - aimingProgress * 0.33F);
}
@Override
public void setupFirstPerson(ItemStack stack) {
GL11.glTranslated(0, 0, 1);
float offset = 0.8F;
standardAimingTransform(stack,
-1.0F * offset, -1F * offset, 1F * offset,
0, -5 / 8D, 0.125);
}
@Override
public void renderFirstPerson(ItemStack stack) {
ItemGunBaseNT gun = (ItemGunBaseNT) stack.getItem();
int[] color = ItemGunNI4NI.getColors(stack);
int dark = 0xffffff;
int light = 0xffffff;
int grip = 0xffffff;
if(color != null) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.n_i_4_n_i_greyscale_tex);
dark = color[0];
light = color[1];
grip = color[2];
} else {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.n_i_4_n_i_tex);
}
double scale = 0.3125D;
GL11.glScaled(scale, scale, scale);
double[] equip = HbmAnimations.getRelevantTransformation("EQUIP");
double[] recoil = HbmAnimations.getRelevantTransformation("RECOIL");
double[] drum = HbmAnimations.getRelevantTransformation("DRUM");
GL11.glTranslated(0, 0, -2.25);
GL11.glRotated(equip[0], 1, 0, 0);
GL11.glTranslated(0, 0, 2.25);
GL11.glTranslated(0, -1, -6);
GL11.glRotated(recoil[0], 1, 0, 0);
GL11.glTranslated(0, 1, 6);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glPushMatrix();
GL11.glColor3f(ColorUtil.fr(dark), ColorUtil.fg(dark), ColorUtil.fb(dark));
ResourceManager.n_i_4_n_i.renderPart("FrameDark");
GL11.glColor3f(ColorUtil.fr(grip), ColorUtil.fg(grip), ColorUtil.fb(grip));
ResourceManager.n_i_4_n_i.renderPart("Grip");
GL11.glColor3f(ColorUtil.fr(light), ColorUtil.fg(light), ColorUtil.fb(light));
ResourceManager.n_i_4_n_i.renderPart("FrameLight");
GL11.glPushMatrix();
GL11.glTranslated(0, 1.1875D, 0);
GL11.glRotated(drum[2], 0, 0, 1);
GL11.glTranslated(0, -1.1875D, 0);
ResourceManager.n_i_4_n_i.renderPart("Cylinder");
RenderArcFurnace.fullbright(true);
GL11.glColor3f(1F, 1F, 1F);
ResourceManager.n_i_4_n_i.renderPart("CylinderHighlights");
RenderArcFurnace.fullbright(false);
GL11.glPopMatrix();
RenderArcFurnace.fullbright(true);
ResourceManager.n_i_4_n_i.renderPart("Barrel");
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glColor3f(0F, 1F, 0F);
int coinCount = ItemGunNI4NI.getCoinCount(stack);
if(coinCount > 3) ResourceManager.n_i_4_n_i.renderPart("Coin1");
if(coinCount > 2) ResourceManager.n_i_4_n_i.renderPart("Coin2");
if(coinCount > 1) ResourceManager.n_i_4_n_i.renderPart("Coin3");
if(coinCount > 0) ResourceManager.n_i_4_n_i.renderPart("Coin4");
GL11.glEnable(GL11.GL_TEXTURE_2D);
RenderArcFurnace.fullbright(false);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glPushMatrix();
GL11.glTranslated(0, 0.75, 4);
GL11.glRotated(90, 0, 1, 0);
GL11.glRotated(90 * gun.shotRand, 1, 0, 0);
GL11.glScaled(0.125, 0.125, 0.125);
this.renderLaserFlash(gun.lastShot[0], 75, 7.5, 0xFFFFFF);
GL11.glPopMatrix();
GL11.glPopMatrix();
}
@Override
public void setupThirdPerson(ItemStack stack) {
super.setupThirdPerson(stack);
GL11.glTranslated(0, 0.25, 3);
double scale = 1.5D;
GL11.glScaled(scale, scale, scale);
}
@Override
public void setupInv(ItemStack stack) {
super.setupInv(stack);
double scale = 2.5D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(25, 1, 0, 0);
GL11.glRotated(45, 0, 1, 0);
GL11.glTranslated(0, 0, 0);
}
@Override
public void setupModTable(ItemStack stack) {
double scale = -15D;
GL11.glScaled(scale, scale, scale);
GL11.glRotated(90, 0, 1, 0);
GL11.glTranslated(0, -0.5, 0);
}
@Override
public void renderOther(ItemStack stack, ItemRenderType type) {
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glAlphaFunc(GL11.GL_GREATER, 0F);
GL11.glEnable(GL11.GL_ALPHA_TEST);
int[] color = ItemGunNI4NI.getColors(stack);
int dark = 0xffffff;
int light = 0xffffff;
int grip = 0xffffff;
if(color != null) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.n_i_4_n_i_greyscale_tex);
dark = color[0];
light = color[1];
grip = color[2];
} else {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.n_i_4_n_i_tex);
}
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glColor3f(ColorUtil.fr(light), ColorUtil.fg(light), ColorUtil.fb(light));
ResourceManager.n_i_4_n_i.renderPart("FrameLight");
ResourceManager.n_i_4_n_i.renderPart("Cylinder");
GL11.glColor3f(ColorUtil.fr(grip), ColorUtil.fg(grip), ColorUtil.fb(grip));
ResourceManager.n_i_4_n_i.renderPart("Grip");
GL11.glColor3f(ColorUtil.fr(dark), ColorUtil.fg(dark), ColorUtil.fb(dark));
ResourceManager.n_i_4_n_i.renderPart("FrameDark");
GL11.glColor3f(1F, 1F, 1F);
RenderArcFurnace.fullbright(true);
ResourceManager.n_i_4_n_i.renderPart("CylinderHighlights");
ResourceManager.n_i_4_n_i.renderPart("Barrel");
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glColor3f(0F, 1F, 0F);
ResourceManager.n_i_4_n_i.renderPart("Coin1");
ResourceManager.n_i_4_n_i.renderPart("Coin2");
ResourceManager.n_i_4_n_i.renderPart("Coin3");
ResourceManager.n_i_4_n_i.renderPart("Coin4");
GL11.glColor3f(1F, 1F, 1F);
GL11.glEnable(GL11.GL_TEXTURE_2D);
RenderArcFurnace.fullbright(false);
GL11.glShadeModel(GL11.GL_FLAT);
}
}

View File

@ -12,12 +12,13 @@ import com.hbm.inventory.container.ContainerPWR;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.fluid.trait.FT_Heatable;
import com.hbm.inventory.fluid.trait.FT_PWRModerator;
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingStep;
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingType;
import com.hbm.inventory.fluid.trait.FT_PWRModerator;
import com.hbm.inventory.gui.GUIPWR;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemPWRFuel.EnumPWRFuel;
import com.hbm.items.machine.ItemPWRPrinter;
import com.hbm.main.MainRegistry;
import com.hbm.sound.AudioWrapper;
import com.hbm.tileentity.IGUIProvider;
@ -375,8 +376,17 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
return this.rodCount + (int) Math.ceil(this.heatsinkCount / 4D);
}
public boolean isPrinting;
@Override
public void serialize(ByteBuf buf) {
buf.writeBoolean(isPrinting);
if(isPrinting) {
ItemPWRPrinter.serialize(worldObj, buf);
isPrinting = false;
return;
}
super.serialize(buf);
buf.writeInt(this.rodCount);
buf.writeLong(this.coreHeat);
@ -395,6 +405,14 @@ public class TileEntityPWRController extends TileEntityMachineBase implements IG
@Override
public void deserialize(ByteBuf buf) {
if(buf.readBoolean()) {
// piggybacking off of this packet so that we don't have to sync EVERY PWR
// block continuously to the client for one tiny screenshot tool
ItemPWRPrinter.deserialize(worldObj, buf);
return;
}
super.deserialize(buf);
this.rodCount = buf.readInt();
this.coreHeat = buf.readLong();

View File

@ -71,6 +71,30 @@ public class ColorUtil {
}
}
public static int ir(int color) {
return (color & 0xff0000) >> 16;
}
public static int ig(int color) {
return (color & 0x00ff00) >> 8;
}
public static int ib(int color) {
return (color & 0x0000ff) >> 0;
}
public static float fr(int color) {
return ir(color) / 255F;
}
public static float fg(int color) {
return ig(color) / 255F;
}
public static float fb(int color) {
return ib(color) / 255F;
}
@SideOnly(Side.CLIENT)
public static int getMedianBrightnessColorFromStack(ItemStack stack) {

View File

@ -40,6 +40,7 @@ public class NTMWorldGenerator implements IWorldGenerator {
final List<BiomeGenBase> oceanBiomes = Arrays.asList(new BiomeGenBase[] { BiomeGenBase.ocean, BiomeGenBase.deepOcean });
final List<BiomeGenBase> beachBiomes = Arrays.asList(new BiomeGenBase[] { BiomeGenBase.beach, BiomeGenBase.stoneBeach, BiomeGenBase.coldBeach });
final List<BiomeGenBase> lighthouseBiomes = Arrays.asList(new BiomeGenBase[] { BiomeGenBase.ocean, BiomeGenBase.deepOcean, BiomeGenBase.beach, BiomeGenBase.stoneBeach, BiomeGenBase.coldBeach });
final List<BiomeGenBase> flatbiomes = Arrays.asList(new BiomeGenBase[] { BiomeGenBase.plains, BiomeGenBase.icePlains, BiomeGenBase.desert });
/// SPIRE ///
NBTStructure.registerStructure(0, new SpawnCondition("spire") {{
@ -163,6 +164,11 @@ public class NTMWorldGenerator implements IWorldGenerator {
structure = new JigsawPiece("NTMRuinsJ", StructureManager.ntmruinsJ, -1) {{conformToTerrain = true;}};
spawnWeight = 35;
}});
NBTStructure.registerStructure(0, new SpawnCondition("radio") {{
canSpawn = flatbiomes::contains;
structure = new JigsawPiece("radio_house", StructureManager.radio_house, -6);
spawnWeight = 30;
}});
NBTStructure.registerNullWeight(0, 2, biome -> biome == BiomeGenBase.plains);
NBTStructure.registerNullWeight(0, 2, oceanBiomes::contains);

View File

@ -2167,6 +2167,7 @@ item.gun_minigun.name=Minigun
item.gun_minigun_dual.name=Doppelete Miniguns
item.gun_minigun_lacunae.name=Lacunae
item.gun_missile_launcher.name=Raketenwerfer
item.gun_n_i_4_n_i.name=N I 4 N I
item.gun_pepperbox.name=Bündelrevolver
item.gun_panzerschreck.name=Panzerschreck
item.gun_quadro.name=Vierfachraketenwerfer

View File

@ -3009,6 +3009,7 @@ item.gun_minigun.name=Minigun
item.gun_minigun_dual.name=Dual Miniguns
item.gun_minigun_lacunae.name=Lacunae
item.gun_missile_launcher.name=Missile Launcher
item.gun_n_i_4_n_i.name=N I 4 N I
item.gun_pepperbox.name=Pepperbox
item.gun_panzerschreck.name=Panzerschreck
item.gun_quadro.name=Quad Rocket Launcher
@ -4108,6 +4109,7 @@ item.pwr_fuel_hot.men.name=Hot MEN PWR Fuel Rod
item.pwr_fuel_hot.mep.name=Hot MEP PWR Fuel Rod
item.pwr_fuel_hot.meu.name=Hot MEU PWR Fuel Rod
item.pwr_fuel_hot.mox.name=Hot MOX PWR Fuel Rod
item.pwr_printer.name=PWR Printer
item.quartz_plutonium.name=Plutonic Quartz
item.radar_linker.name=Radar Linker
item.radaway.name=RadAway

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 433 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB