mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge branch 'master' into fixfordesert
This commit is contained in:
commit
bb453ce45b
@ -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
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import com.hbm.tileentity.machine.TileEntityCharger;
|
||||
import com.hbm.world.gen.INBTTransformable;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -12,8 +13,8 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class Charger extends BlockContainer {
|
||||
|
||||
public class Charger extends BlockContainer implements INBTTransformable {
|
||||
|
||||
public Charger(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
@ -22,17 +23,17 @@ public class Charger extends BlockContainer {
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityCharger();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
@ -40,9 +41,9 @@ public class Charger extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||
|
||||
|
||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||
|
||||
|
||||
if(i == 0) {
|
||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||
}
|
||||
@ -60,13 +61,13 @@ public class Charger extends BlockContainer {
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
|
||||
float f = 0.0625F;
|
||||
|
||||
|
||||
switch(world.getBlockMetadata(x, y, z)) {
|
||||
case 2: this.setBlockBounds(5 * f, 0.25F, 12 * f, 11 * f, 0.75F, 1F); break;
|
||||
case 3: this.setBlockBounds(5 * f, 0.25F, 0F, 11 * f, 0.75F, 4 * f); break;
|
||||
case 4: this.setBlockBounds(12 * f, 0.25F, 5 * f, 1F, 0.75F, 11 * f); break;
|
||||
case 5: this.setBlockBounds(0F, 0.25F, 5 * f, 4 * f, 0.75F, 11 * f); break;
|
||||
default: this.setBlockBounds(5 * f, 0.25F, 5 * f, 11 * f, 0.75F, 11 * f); break;
|
||||
case 2: this.setBlockBounds(5 * f, 0.25F, 12 * f, 11 * f, 0.75F, 1F); break;
|
||||
case 3: this.setBlockBounds(5 * f, 0.25F, 0F, 11 * f, 0.75F, 4 * f); break;
|
||||
case 4: this.setBlockBounds(12 * f, 0.25F, 5 * f, 1F, 0.75F, 11 * f); break;
|
||||
case 5: this.setBlockBounds(0F, 0.25F, 5 * f, 4 * f, 0.75F, 11 * f); break;
|
||||
default: this.setBlockBounds(5 * f, 0.25F, 5 * f, 11 * f, 0.75F, 11 * f); break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,4 +76,9 @@ public class Charger extends BlockContainer {
|
||||
this.setBlockBoundsBasedOnState(world, x, y, z);
|
||||
return AxisAlignedBB.getBoundingBox(x + this.minX, y + this.minY, z + this.minZ, x + this.maxX, y + this.maxY, z + this.maxZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int transformMeta(int meta, int coordBaseMode) {
|
||||
return INBTTransformable.transformMetaDeco(meta, coordBaseMode);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
@ -10,8 +10,8 @@ public class StructureConfig {
|
||||
|
||||
public static int enableStructures = 2;
|
||||
|
||||
public static int structureMinChunks = 8;
|
||||
public static int structureMaxChunks = 24;
|
||||
public static int structureMinChunks = 4;
|
||||
public static int structureMaxChunks = 12;
|
||||
|
||||
public static double lootAmountFactor = 1D;
|
||||
|
||||
@ -25,15 +25,15 @@ public class StructureConfig {
|
||||
|
||||
enableStructures = CommonConfig.parseStructureFlag(unparsedStructureFlag);
|
||||
|
||||
structureMinChunks = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.01_structureMinChunks", "Minimum non-zero distance between structures in chunks (Settings lower than 8 may be problematic).", 8);
|
||||
structureMaxChunks = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.02_structureMaxChunks", "Maximum non-zero distance between structures in chunks.", 24);
|
||||
structureMinChunks = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.01_structureMinChunks", "Minimum non-zero distance between structures in chunks (Settings lower than 8 may be problematic).", 4);
|
||||
structureMaxChunks = CommonConfig.createConfigInt(config, CATEGORY_STRUCTURES, "5.02_structureMaxChunks", "Maximum non-zero distance between structures in chunks.", 16);
|
||||
|
||||
lootAmountFactor = CommonConfig.createConfigDouble(config, CATEGORY_STRUCTURES, "5.03_lootAmountFactor", "General factor for loot spawns. Applies to spawned IInventories, not loot blocks.", 1D);
|
||||
|
||||
debugStructures = CommonConfig.createConfigBool(config, CATEGORY_STRUCTURES, "5.04_debugStructures", "If enabled, special structure blocks like jigsaw blocks will not be transformed after generating", false);
|
||||
|
||||
structureMinChunks = CommonConfig.setDef(structureMinChunks, 8);
|
||||
structureMaxChunks = CommonConfig.setDef(structureMaxChunks, 24);
|
||||
structureMinChunks = CommonConfig.setDef(structureMinChunks, 4);
|
||||
structureMaxChunks = CommonConfig.setDef(structureMaxChunks, 12);
|
||||
|
||||
if(structureMinChunks > structureMaxChunks) {
|
||||
MainRegistry.logger.error("Fatal error config: Minimum value has been set higher than the maximum value!");
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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) {
|
||||
|
||||
double dist = pos.distanceTo(hitMop.hitVec);
|
||||
|
||||
// if penetration is enabled, run impact for all intersecting entities
|
||||
if(this.doesPenetrate()) {
|
||||
this.onImpact(new MovingObjectPosition(entity, hitMop.hitVec));
|
||||
if(hitCoin == null || dist < closestCoin) {
|
||||
this.onImpact(new MovingObjectPosition(entity, hitMop.hitVec));
|
||||
}
|
||||
} else {
|
||||
|
||||
double dist = pos.distanceTo(hitMop.hitVec);
|
||||
|
||||
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) {
|
||||
|
||||
51
src/main/java/com/hbm/entity/projectile/EntityCoin.java
Normal file
51
src/main/java/com/hbm/entity/projectile/EntityCoin.java
Normal 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;
|
||||
}
|
||||
}
|
||||
@ -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,47 +13,47 @@ 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;
|
||||
private TileEntityMachineArcFurnaceLarge afl;
|
||||
|
||||
public ArcFurnaceLargeMEInventory(TileEntityMachineArcFurnaceLarge afl) {
|
||||
this.afl = afl;
|
||||
}
|
||||
public ArcFurnaceLargeMEInventory(TileEntityMachineArcFurnaceLarge afl) {
|
||||
this.afl = afl;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack injectItems(IAEItemStack input, Actionable type, BaseActionSource src) {
|
||||
ItemStack is = input.getItemStack();
|
||||
is = afl.distributeInput(is, type == Actionable.MODULATE);
|
||||
@Override
|
||||
public IAEItemStack injectItems(IAEItemStack input, Actionable type, BaseActionSource src) {
|
||||
ItemStack is = input.getItemStack();
|
||||
is = afl.distributeInput(is, type == Actionable.MODULATE);
|
||||
|
||||
if(is == null) return null;
|
||||
return AEApi.instance().storage().createItemStack(is);
|
||||
}
|
||||
return AEApi.instance().storage().createItemStack(is);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src) {
|
||||
@Override
|
||||
public IAEItemStack extractItems(IAEItemStack request, Actionable mode, BaseActionSource src) {
|
||||
ItemStack is = request.getItemStack();
|
||||
is = afl.collectRequested(is, mode == Actionable.MODULATE);
|
||||
|
||||
if(is == null) return null;
|
||||
return AEApi.instance().storage().createItemStack(is);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemList<IAEItemStack> getAvailableItems(IItemList<IAEItemStack> out) {
|
||||
ItemStack is;
|
||||
@Override
|
||||
public IItemList<IAEItemStack> getAvailableItems(IItemList<IAEItemStack> out) {
|
||||
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;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageChannel getChannel() {
|
||||
return StorageChannel.ITEMS;
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
@Override
|
||||
public StorageChannel getChannel() {
|
||||
return StorageChannel.ITEMS;
|
||||
}
|
||||
}
|
||||
|
||||
144
src/main/java/com/hbm/inventory/gui/GUIScreenSlicePrinter.java
Normal file
144
src/main/java/com/hbm/inventory/gui/GUIScreenSlicePrinter.java
Normal 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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -19,19 +19,18 @@ 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;
|
||||
|
||||
public class GUIScreenWikiRender extends GuiScreen {
|
||||
|
||||
// Basically the same thing as GUIScreenPreview, but will iterate through all provided preview stacks
|
||||
// taking a screenshot of each, as fast as the game can render them
|
||||
// Basically the same thing as GUIScreenPreview, but will iterate through all provided preview stacks
|
||||
// taking a screenshot of each, as fast as the game can render them
|
||||
|
||||
protected static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/nei/gui_nei.png");
|
||||
protected ItemStack[] preview;
|
||||
protected int index = 0;
|
||||
protected int index = 0;
|
||||
protected int scale = 1;
|
||||
protected String saveLocation = "wiki-screenshots";
|
||||
protected String prefix = "";
|
||||
@ -52,65 +51,38 @@ public class GUIScreenWikiRender extends GuiScreen {
|
||||
this.getStackName = getStackName;
|
||||
}
|
||||
|
||||
@Override
|
||||
@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) {
|
||||
this.mc.thePlayer.closeScreen();
|
||||
return;
|
||||
}
|
||||
|
||||
// Once we've reached the end of the array, immedaitely close this GUI
|
||||
if(index >= preview.length) {
|
||||
this.mc.thePlayer.closeScreen();
|
||||
return;
|
||||
}
|
||||
|
||||
this.drawGuiContainerBackgroundLayer();
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
this.drawGuiContainerForegroundLayer(preview[index]);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
|
||||
ScaledResolution res = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
|
||||
int zoom = scale * res.getScaleFactor();
|
||||
|
||||
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);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
// Just skip any failures caused by display name or rendering
|
||||
}
|
||||
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, 0xFFFF00FF);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
// Just skip any failures caused by display name or rendering
|
||||
}
|
||||
|
||||
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();
|
||||
index++;
|
||||
}
|
||||
|
||||
protected void drawGuiContainerForegroundLayer(ItemStack preview) {
|
||||
if(preview == null) return;
|
||||
|
||||
|
||||
GL11.glPushMatrix();
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
|
||||
@ -119,11 +91,11 @@ public class GUIScreenWikiRender extends GuiScreen {
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
|
||||
|
||||
GL11.glScaled(scale, scale, scale);
|
||||
|
||||
|
||||
ScaledResolution res = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight);
|
||||
GL11.glTranslated(9D, res.getScaledHeight_double() / scale - 9D, -200);
|
||||
GL11.glTranslated(9D, res.getScaledHeight_double() / scale - 9D, -200);
|
||||
|
||||
this.zLevel = 200.0F;
|
||||
itemRender.zLevel = 200.0F;
|
||||
@ -134,7 +106,7 @@ public class GUIScreenWikiRender extends GuiScreen {
|
||||
|
||||
itemRender.zLevel = 0.0F;
|
||||
this.zLevel = 0.0F;
|
||||
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -21,9 +21,10 @@ public class ItemPoolsPile {
|
||||
public static final String POOL_PILE_MAKESHIFT_PLATES = "POOL_PILE_MAKESHIFT_PLATES";
|
||||
public static final String POOL_PILE_MAKESHIFT_WIRE = "POOL_PILE_MAKESHIFT_WIRE";
|
||||
public static final String POOL_PILE_NUKE_STORAGE = "POOL_PILE_NUKE_STORAGE";
|
||||
|
||||
public static final String POOL_PILE_OF_GARBAGE = "POOL_PILE_OF_GARBAGE";
|
||||
|
||||
public static void init() {
|
||||
|
||||
|
||||
//items found in glyphid hives
|
||||
new ItemPool(POOL_PILE_HIVE) {{
|
||||
this.pool = new WeightedRandomChestContent[] {
|
||||
@ -56,7 +57,7 @@ public class ItemPoolsPile {
|
||||
weighted(Items.experience_bottle, 0, 1, 3, 5),
|
||||
};
|
||||
}};
|
||||
|
||||
|
||||
//items found in glyphid bone piles
|
||||
new ItemPool(POOL_PILE_BONES) {{
|
||||
this.pool = new WeightedRandomChestContent[] {
|
||||
@ -65,7 +66,7 @@ public class ItemPoolsPile {
|
||||
weighted(ModItems.biomass, 0, 1, 1, 2)
|
||||
};
|
||||
}};
|
||||
|
||||
|
||||
//bottlecap stashess
|
||||
new ItemPool(POOL_PILE_CAPS) {{
|
||||
this.pool = new WeightedRandomChestContent[] {
|
||||
@ -74,7 +75,7 @@ public class ItemPoolsPile {
|
||||
weighted(ModItems.cap_sparkle, 0, 4, 4, 1),
|
||||
};
|
||||
}};
|
||||
|
||||
|
||||
//medicine stashes
|
||||
new ItemPool(POOL_PILE_MED_SYRINGE) {{
|
||||
this.pool = new WeightedRandomChestContent[] {
|
||||
@ -91,13 +92,13 @@ public class ItemPoolsPile {
|
||||
weighted(ModItems.siox, 0, 1, 1, 5),
|
||||
};
|
||||
}};
|
||||
|
||||
|
||||
//makeshift gun
|
||||
new ItemPool(POOL_PILE_MAKESHIFT_GUN) {{ this.pool = new WeightedRandomChestContent[] { weighted(ModItems.gun_maresleg, 0, 1, 1, 10) }; }};
|
||||
new ItemPool(POOL_PILE_MAKESHIFT_WRENCH) {{ this.pool = new WeightedRandomChestContent[] { weighted(ModItems.wrench, 0, 1, 1, 10) }; }};
|
||||
new ItemPool(POOL_PILE_MAKESHIFT_PLATES) {{ this.pool = new WeightedRandomChestContent[] { weighted(ModItems.plate_steel, 0, 1, 1, 10) }; }};
|
||||
new ItemPool(POOL_PILE_MAKESHIFT_WIRE) {{ this.pool = new WeightedRandomChestContent[] { weighted(ModItems.wire_fine, Mats.MAT_ALUMINIUM.id, 1, 1, 10) }; }};
|
||||
|
||||
|
||||
new ItemPool(POOL_PILE_NUKE_STORAGE) {{
|
||||
this.pool = new WeightedRandomChestContent[] {
|
||||
weighted(ModItems.ammo_standard, EnumAmmo.NUKE_STANDARD.ordinal(), 1, 1, 50),
|
||||
@ -106,5 +107,34 @@ public class ItemPoolsPile {
|
||||
|
||||
};
|
||||
}};
|
||||
|
||||
new ItemPool(POOL_PILE_OF_GARBAGE) {{
|
||||
this.pool = new WeightedRandomChestContent[] {
|
||||
weighted(ModItems.pipe, 2600, 0, 2, 20),
|
||||
weighted(ModItems.scrap, 0, 1, 5, 20),
|
||||
weighted(ModItems.wire_fine, 8200, 1, 2, 20),
|
||||
weighted(ModItems.dust, 0, 1, 3, 40),
|
||||
weighted(ModItems.dust_tiny, 0, 1, 7, 40),
|
||||
weighted(ModItems.powder_cement, 0, 1, 6, 40),
|
||||
weighted(ModItems.nugget_lead, 0, 0, 3, 20),
|
||||
weighted(ModItems.wire_fine, 0, 0, 3, 20),
|
||||
weighted(ModItems.powder_ash, 0, 0, 1, 15),
|
||||
weighted(ModItems.plate_lead, 0, 0, 1, 15),
|
||||
weighted(Items.string, 0, 0, 1, 15),
|
||||
weighted(ModItems.bolt, 8200, 0, 2, 15),
|
||||
weighted(ModItems.pin, 0, 0, 2, 15),
|
||||
weighted(ModItems.cap_nuka, 0, 0, 8, 15),
|
||||
weighted(ModItems.plate_iron, 0, 0, 2, 15),
|
||||
weighted(ModItems.fallout, 0, 0, 2, 15),
|
||||
weighted(ModItems.coil_tungsten, 0, 0, 2, 15),
|
||||
weighted(ModItems.can_empty, 0, 0, 1, 15),
|
||||
weighted(ModItems.ingot_asbestos, 0, 0, 1, 15),
|
||||
weighted(ModItems.syringe_metal_empty, 0, 0, 1, 15),
|
||||
weighted(ModItems.syringe_empty, 0, 0, 1, 15),
|
||||
weighted(ModItems.pipe_lead, 0, 0, 1, 5),
|
||||
weighted(ModItems.motor, 0, 0, 1, 5),
|
||||
weighted(ModItems.canned_conserve, 2, 0, 1, 5),
|
||||
};
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@ -64,7 +64,7 @@ import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public class ModItems {
|
||||
|
||||
|
||||
public static HashSet<Item> excludeNEI = new HashSet();
|
||||
|
||||
public static void mainRegistry() {
|
||||
@ -645,7 +645,7 @@ public class ModItems {
|
||||
public static Item seg_10;
|
||||
public static Item seg_15;
|
||||
public static Item seg_20;
|
||||
|
||||
|
||||
public static Item combine_scrap;
|
||||
|
||||
public static Item shimmer_head;
|
||||
@ -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;
|
||||
@ -2073,7 +2073,7 @@ public class ModItems {
|
||||
public static Item hazmat_paa_boots;
|
||||
|
||||
public static Item rebar_placer;
|
||||
|
||||
|
||||
public static Item wand;
|
||||
public static Item wand_s;
|
||||
public static Item wand_d;
|
||||
@ -2235,7 +2235,7 @@ public class ModItems {
|
||||
public static Item conveyor_wand;
|
||||
|
||||
public static void initializeItem() {
|
||||
|
||||
|
||||
redstone_sword = new RedstoneSword(ToolMaterial.STONE).setUnlocalizedName("redstone_sword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(RefStrings.MODID + ":redstone_sword");
|
||||
big_sword = new BigSword(ToolMaterial.EMERALD).setUnlocalizedName("big_sword").setCreativeTab(CreativeTabs.tabCombat).setTextureName(RefStrings.MODID + ":big_sword");
|
||||
|
||||
@ -2967,7 +2967,7 @@ public class ModItems {
|
||||
gas_full = new ItemGasTank().setUnlocalizedName("gas_full").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.gas_empty).setTextureName(RefStrings.MODID + ":gas_empty");
|
||||
|
||||
ItemSimpleConsumable.init();
|
||||
|
||||
|
||||
//TODO: move all this crap to ItemSimpleConsumable
|
||||
syringe_empty = new Item().setUnlocalizedName("syringe_empty").setFull3D().setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":syringe_empty");
|
||||
syringe_metal_empty = new Item().setUnlocalizedName("syringe_metal_empty").setFull3D().setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":syringe_metal_empty");
|
||||
@ -2977,7 +2977,7 @@ public class ModItems {
|
||||
syringe_metal_super = new ItemSyringe().setUnlocalizedName("syringe_metal_super").setFull3D().setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":syringe_metal_super");
|
||||
syringe_taint = new ItemSyringe().setUnlocalizedName("syringe_taint").setFull3D().setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":syringe_taint");
|
||||
syringe_mkunicorn = new ItemSyringe().setUnlocalizedName("syringe_mkunicorn").setFull3D().setCreativeTab(null).setTextureName(RefStrings.MODID + ":syringe_mkunicorn");
|
||||
|
||||
|
||||
med_bag = new ItemSyringe().setUnlocalizedName("med_bag").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":med_bag");
|
||||
radx = new ItemPill(0).setUnlocalizedName("radx").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":radx");
|
||||
siox = new ItemPill(0).setUnlocalizedName("siox").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":siox");
|
||||
@ -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");
|
||||
@ -4513,7 +4514,7 @@ public class ModItems {
|
||||
.addAbility(IToolHarvestAbility.SMELTER, 0)
|
||||
.addAbility(IToolHarvestAbility.SILK, 0)
|
||||
.addAbility(IToolHarvestAbility.LUCK, 2).setUnlocalizedName("cmb_pickaxe").setTextureName(RefStrings.MODID + ":cmb_pickaxe");
|
||||
|
||||
|
||||
cmb_axe = new ItemToolAbility(30F, 0, MainRegistry.tMatCMB, EnumToolType.AXE)
|
||||
.addAbility(IToolAreaAbility.RECURSION, 2)
|
||||
.addAbility(IToolHarvestAbility.SMELTER, 0)
|
||||
@ -4538,7 +4539,7 @@ public class ModItems {
|
||||
.addAbility(IToolAreaAbility.RECURSION, 2)
|
||||
.addAbility(IToolHarvestAbility.SILK, 0)
|
||||
.addAbility(IToolHarvestAbility.LUCK, 1).setUnlocalizedName("elec_pickaxe").setTextureName(RefStrings.MODID + ":elec_drill_anim");
|
||||
|
||||
|
||||
elec_axe = new ItemToolAbilityPower(10F, 0, MainRegistry.tMatElec, EnumToolType.AXE, 500000, 1000, 100)
|
||||
.addAbility(IToolAreaAbility.HAMMER, 1)
|
||||
.addAbility(IToolAreaAbility.HAMMER_FLAT, 1)
|
||||
@ -4547,14 +4548,14 @@ public class ModItems {
|
||||
.addAbility(IToolHarvestAbility.LUCK, 1)
|
||||
.addAbility(IWeaponAbility.CHAINSAW, 0)
|
||||
.addAbility(IWeaponAbility.BEHEADER, 0).setShears().setUnlocalizedName("elec_axe").setTextureName(RefStrings.MODID + ":elec_chainsaw_anim");
|
||||
|
||||
|
||||
elec_shovel = new ItemToolAbilityPower(5F, 0, MainRegistry.tMatElec, EnumToolType.SHOVEL, 500000, 1000, 100)
|
||||
.addAbility(IToolAreaAbility.HAMMER, 1)
|
||||
.addAbility(IToolAreaAbility.HAMMER_FLAT, 1)
|
||||
.addAbility(IToolAreaAbility.RECURSION, 2)
|
||||
.addAbility(IToolHarvestAbility.SILK, 0)
|
||||
.addAbility(IToolHarvestAbility.LUCK, 1).setUnlocalizedName("elec_shovel").setTextureName(RefStrings.MODID + ":elec_shovel_anim");
|
||||
|
||||
|
||||
desh_sword = new ItemSwordAbility(12.5F, 0, MainRegistry.tMatDesh)
|
||||
.addAbility(IWeaponAbility.STUN, 0).setUnlocalizedName("desh_sword").setTextureName(RefStrings.MODID + ":desh_sword");
|
||||
|
||||
@ -4564,7 +4565,7 @@ public class ModItems {
|
||||
.addAbility(IToolAreaAbility.RECURSION, 0)
|
||||
.addAbility(IToolHarvestAbility.SILK, 0)
|
||||
.addAbility(IToolHarvestAbility.LUCK, 1).setUnlocalizedName("desh_pickaxe").setTextureName(RefStrings.MODID + ":desh_pickaxe");
|
||||
|
||||
|
||||
desh_axe = new ItemToolAbility(7.5F, -0.05, MainRegistry.tMatDesh, EnumToolType.AXE)
|
||||
.addAbility(IToolAreaAbility.HAMMER, 0)
|
||||
.addAbility(IToolAreaAbility.HAMMER_FLAT, 0)
|
||||
@ -4979,9 +4980,9 @@ public class ModItems {
|
||||
}
|
||||
|
||||
private static void registerItem() {
|
||||
|
||||
|
||||
excludeNEI.add(item_secret);
|
||||
|
||||
|
||||
//Weapons
|
||||
GameRegistry.registerItem(redstone_sword, redstone_sword.getUnlocalizedName());
|
||||
GameRegistry.registerItem(big_sword, big_sword.getUnlocalizedName());
|
||||
@ -5688,7 +5689,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(fluid_barrel_empty, fluid_barrel_empty.getUnlocalizedName());
|
||||
GameRegistry.registerItem(fluid_barrel_full, fluid_barrel_full.getUnlocalizedName());
|
||||
GameRegistry.registerItem(fluid_barrel_infinite, fluid_barrel_infinite.getUnlocalizedName());
|
||||
|
||||
|
||||
//Packaged fluids
|
||||
GameRegistry.registerItem(fluid_pack_empty, fluid_pack_empty.getUnlocalizedName());
|
||||
GameRegistry.registerItem(fluid_pack_full, fluid_pack_full.getUnlocalizedName());
|
||||
@ -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());
|
||||
|
||||
176
src/main/java/com/hbm/items/machine/ItemPWRPrinter.java
Normal file
176
src/main/java/com/hbm/items/machine/ItemPWRPrinter.java
Normal 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");
|
||||
}
|
||||
|
||||
}
|
||||
@ -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);
|
||||
list.add(I18nUtil.resolveKey("gui.weapon.ammo") + ": " + mag.getIconForHUD(stack, player).getDisplayName() + " " + mag.reportAmmoStateForHUD(stack, player));
|
||||
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) {
|
||||
|
||||
@ -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);
|
||||
@ -226,6 +227,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);
|
||||
|
||||
@ -397,6 +397,25 @@ public class LegoClient {
|
||||
GL11.glPopMatrix();
|
||||
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);
|
||||
|
||||
@ -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); };
|
||||
|
||||
@ -89,6 +96,9 @@ public class XFactoryAccelerator {
|
||||
.setOnUpdate(LAMBDA_UPDATE_TUNGSTEN);
|
||||
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);
|
||||
|
||||
@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
110
src/main/java/com/hbm/items/weapon/sedna/impl/ItemGunNI4NI.java
Normal file
110
src/main/java/com/hbm/items/weapon/sedna/impl/ItemGunNI4NI.java
Normal 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); }
|
||||
}
|
||||
@ -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; }
|
||||
}
|
||||
@ -41,8 +41,8 @@ public class HbmWorld {
|
||||
private static void registerNTMFeatures() {
|
||||
CivilianFeatures.registerComponents();
|
||||
OfficeFeatures.registerComponents();
|
||||
RuinFeatures.registerComponents();
|
||||
// RuinFeatures.registerComponents();
|
||||
BunkerComponents.registerComponents();
|
||||
MapGenStructureIO.func_143031_a(SiloComponent.class, "NTMSiloComponent");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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());
|
||||
|
||||
@ -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");
|
||||
|
||||
|
||||
@ -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"));
|
||||
@ -64,6 +63,21 @@ public class StructureManager {
|
||||
public static final NBTStructure desert_shack_1 = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/desert_shack_1.nbt"));
|
||||
public static final NBTStructure desert_shack_2 = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/desert_shack_2.nbt"));
|
||||
public static final NBTStructure desert_shack_3 = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/desert_shack_3.nbt"));
|
||||
public static final NBTStructure laboratory = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/laboratory.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"));
|
||||
public static final NBTStructure ntmruinsC = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/ntmruinsC.nbt"));
|
||||
public static final NBTStructure ntmruinsD = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/ntmruinsD.nbt"));
|
||||
public static final NBTStructure ntmruinsE = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/ntmruinsE.nbt"));
|
||||
public static final NBTStructure ntmruinsF = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/ntmruinsF.nbt"));
|
||||
public static final NBTStructure ntmruinsG = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/ntmruinsG.nbt"));
|
||||
public static final NBTStructure ntmruinsH = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/ntmruinsH.nbt"));
|
||||
public static final NBTStructure ntmruinsI = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/ntmruinsI.nbt"));
|
||||
public static final NBTStructure ntmruinsJ = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/ntmruinsJ.nbt"));
|
||||
|
||||
public static final NBTStructure forest_post = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/forest_post.nbt"));
|
||||
|
||||
public static final NBTStructure spire = new NBTStructure(new ResourceLocation(RefStrings.MODID, "structures/spire.nbt"));
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
@ -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();
|
||||
|
||||
@ -70,6 +70,30 @@ public class ColorUtil {
|
||||
return 0xFFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
|
||||
@ -29,6 +29,7 @@ public class LootGenerator {
|
||||
public static final String LOOT_GLYPHID_HIVE = "LOOT_GLYPHID_HIVE";
|
||||
public static final String LOOT_METEOR = "LOOT_METEOR";
|
||||
public static final String LOOT_FLAREGUN = "LOOT_FLAREGUN";
|
||||
public static final String LOOT_SHIT = "LOOT_SHIT";
|
||||
|
||||
public static void applyLoot(World world, int x, int y, int z, String name) {
|
||||
switch(name) {
|
||||
@ -42,6 +43,7 @@ public class LootGenerator {
|
||||
case LOOT_GLYPHID_HIVE: lootGlyphidHive(world, x, y, z);
|
||||
case LOOT_METEOR: lootBookMeteor(world, x, y, z);
|
||||
case LOOT_FLAREGUN: lootFlareGun(world, x, y, z);
|
||||
case LOOT_SHIT: lootShit(world, x, y, z);
|
||||
default: lootBones(world, x, y, z); break;
|
||||
}
|
||||
}
|
||||
@ -233,4 +235,16 @@ public class LootGenerator {
|
||||
0.25, k * 0.03125, 0.125);
|
||||
}
|
||||
}
|
||||
public static void lootShit(World world, int x, int y, int z) {
|
||||
|
||||
TileEntityLoot loot = (TileEntityLoot) world.getTileEntity(x, y, z);
|
||||
|
||||
if(loot != null && loot.items.isEmpty()) {
|
||||
|
||||
int limit = world.rand.nextInt(3) + 3;
|
||||
for(int i = 0; i < limit; i++) {
|
||||
addItemWithDeviation(loot, world.rand, ItemPool.getStack(ItemPool.getPool(ItemPoolsPile.POOL_PILE_OF_GARBAGE), world.rand), world.rand.nextDouble() - 0.5, i * 0.03125, world.rand.nextDouble() - 0.5);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,10 +15,10 @@ import com.hbm.world.gen.component.CivilianFeatures.NTMLab2;
|
||||
import com.hbm.world.gen.component.CivilianFeatures.RuralHouse1;
|
||||
import com.hbm.world.gen.component.OfficeFeatures.LargeOffice;
|
||||
import com.hbm.world.gen.component.OfficeFeatures.LargeOfficeCorner;
|
||||
import com.hbm.world.gen.component.RuinFeatures.NTMRuin1;
|
||||
import com.hbm.world.gen.component.RuinFeatures.NTMRuin2;
|
||||
import com.hbm.world.gen.component.RuinFeatures.NTMRuin3;
|
||||
import com.hbm.world.gen.component.RuinFeatures.NTMRuin4;
|
||||
//import com.hbm.world.gen.component.RuinFeatures.NTMRuin1;
|
||||
//import com.hbm.world.gen.component.RuinFeatures.NTMRuin2;
|
||||
//import com.hbm.world.gen.component.RuinFeatures.NTMRuin3;
|
||||
//import com.hbm.world.gen.component.RuinFeatures.NTMRuin4;
|
||||
import com.hbm.world.gen.component.SiloComponent;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
@ -124,26 +124,26 @@ public class MapGenNTMFeatures extends MapGenStructure {
|
||||
*/
|
||||
//TODO: Do something about this so it's nice-looking and easily readable. Plus, test compatibility against mods like BoP
|
||||
|
||||
if(rand.nextInt(3) == 0) { //Empty Ruin Structures
|
||||
switch(rand.nextInt(4)) {
|
||||
case 0:
|
||||
NTMRuin1 ruin1 = new NTMRuin1(rand, i, j);
|
||||
this.components.add(ruin1);
|
||||
break;
|
||||
case 1:
|
||||
NTMRuin2 ruin2 = new NTMRuin2(rand, i, j);
|
||||
this.components.add(ruin2);
|
||||
break;
|
||||
case 2:
|
||||
NTMRuin3 ruin3 = new NTMRuin3(rand, i, j);
|
||||
this.components.add(ruin3);
|
||||
break;
|
||||
case 3:
|
||||
NTMRuin4 ruin4 = new NTMRuin4(rand, i, j);
|
||||
this.components.add(ruin4);
|
||||
}
|
||||
// if(rand.nextInt(3) == 0) { //Empty Ruin Structures
|
||||
// switch(rand.nextInt(4)) {
|
||||
// case 0:
|
||||
// NTMRuin1 ruin1 = new NTMRuin1(rand, i, j);
|
||||
// this.components.add(ruin1);
|
||||
// break;
|
||||
// case 1:
|
||||
// NTMRuin2 ruin2 = new NTMRuin2(rand, i, j);
|
||||
// this.components.add(ruin2);
|
||||
// break;
|
||||
// case 2:
|
||||
// NTMRuin3 ruin3 = new NTMRuin3(rand, i, j);
|
||||
// this.components.add(ruin3);
|
||||
// break;
|
||||
// case 3:
|
||||
// NTMRuin4 ruin4 = new NTMRuin4(rand, i, j);
|
||||
// this.components.add(ruin4);
|
||||
// }
|
||||
|
||||
} else if(biome.heightVariation <= 0.25F && rand.nextInt(10) == 0) { //for now our only restriction is kinda-flat biomes. that and chance might change idk
|
||||
if(biome.heightVariation <= 0.25F && rand.nextInt(10) == 0) { //for now our only restriction is kinda-flat biomes. that and chance might change idk
|
||||
SiloComponent silo = new SiloComponent(rand, i, j);
|
||||
this.components.add(silo);
|
||||
} else if(biome.temperature >= 1.0 && biome.rainfall == 0 && !(biome instanceof BiomeGenMesa)) { //Desert & Savannah
|
||||
|
||||
@ -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") {{
|
||||
@ -103,8 +104,6 @@ public class NTMWorldGenerator implements IWorldGenerator {
|
||||
spawnWeight = 8;
|
||||
}});
|
||||
|
||||
NBTStructure.registerNullWeight(0, 2, oceanBiomes::contains); //why the fuck did this change
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("dish") {{
|
||||
canSpawn = biome -> biome == BiomeGenBase.plains;
|
||||
structure = new JigsawPiece("dish", StructureManager.dish, -10);
|
||||
@ -131,9 +130,76 @@ public class NTMWorldGenerator implements IWorldGenerator {
|
||||
spawnWeight = 30;
|
||||
}});
|
||||
|
||||
NBTStructure.registerNullWeight(0, 4, oceanBiomes::contains);
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("labolatory") {{
|
||||
canSpawn = biome -> biome == BiomeGenBase.plains;
|
||||
structure = new JigsawPiece("laboratory", StructureManager.laboratory, -10);
|
||||
minHeight = 53;
|
||||
maxHeight = 65;
|
||||
spawnWeight = 8;
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
canSpawn = biome -> biome == BiomeGenBase.forest;
|
||||
structure = new JigsawPiece("forest_post", StructureManager.forest_post, -9);
|
||||
spawnWeight = 40;
|
||||
}});
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("ruin1") {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt();
|
||||
structure = new JigsawPiece("NTMRuinsA", StructureManager.ntmruinsA, -1) {{conformToTerrain = true;}};
|
||||
spawnWeight = 20;
|
||||
}});
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("ruin2") {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt();
|
||||
structure = new JigsawPiece("NTMRuinsB", StructureManager.ntmruinsB, -1) {{conformToTerrain = true;}};
|
||||
spawnWeight = 25;
|
||||
}});
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("ruin3") {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt();
|
||||
structure = new JigsawPiece("NTMRuinsC", StructureManager.ntmruinsC, -1) {{conformToTerrain = true;}};
|
||||
spawnWeight = 25;
|
||||
}});
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("ruin4") {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt();
|
||||
structure = new JigsawPiece("NTMRuinsD", StructureManager.ntmruinsD, -1) {{conformToTerrain = true;}};
|
||||
spawnWeight = 30;
|
||||
}});
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("ruin5") {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt();
|
||||
structure = new JigsawPiece("NTMRuinsE", StructureManager.ntmruinsE, -1) {{conformToTerrain = true;}};
|
||||
spawnWeight = 30;
|
||||
}});
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("ruin6") {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt();
|
||||
structure = new JigsawPiece("NTMRuinsF", StructureManager.ntmruinsF, -1) {{conformToTerrain = true;}};
|
||||
spawnWeight = 50;
|
||||
}});
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("ruin7") {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt();
|
||||
structure = new JigsawPiece("NTMRuinsG", StructureManager.ntmruinsG, -1) {{conformToTerrain = true;}};
|
||||
spawnWeight = 50;
|
||||
}});
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("ruin8") {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt();
|
||||
structure = new JigsawPiece("NTMRuinsH", StructureManager.ntmruinsH, -1) {{conformToTerrain = true;}};
|
||||
spawnWeight = 50;
|
||||
}});
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("ruin9") {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt();
|
||||
structure = new JigsawPiece("NTMRuinsI", StructureManager.ntmruinsI, -1) {{conformToTerrain = true;}};
|
||||
spawnWeight = 50;
|
||||
}});
|
||||
NBTStructure.registerStructure(0, new SpawnCondition("ruin10") {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome) && biome.canSpawnLightningBolt();
|
||||
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);
|
||||
NBTStructure.registerNullWeight(0, 4, oceanBiomes::contains);
|
||||
|
||||
Map<Block, BlockSelector> bricks = new HashMap<Block, BlockSelector>() {{
|
||||
put(ModBlocks.meteor_brick, new MeteorBricks());
|
||||
|
||||
@ -8,42 +8,42 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.structure.MapGenStructureIO;
|
||||
import net.minecraft.world.gen.structure.StructureBoundingBox;
|
||||
|
||||
// Idk what i should do with these if you read this bob do whatever since it's not used anywhere
|
||||
public class RuinFeatures {
|
||||
|
||||
|
||||
public static void registerComponents() {
|
||||
MapGenStructureIO.func_143031_a(NTMRuin1.class, "NTMRuin1");
|
||||
MapGenStructureIO.func_143031_a(NTMRuin2.class, "NTMRuin2");
|
||||
MapGenStructureIO.func_143031_a(NTMRuin3.class, "NTMRuin3");
|
||||
MapGenStructureIO.func_143031_a(NTMRuin4.class, "NTMRuin4");
|
||||
}
|
||||
|
||||
|
||||
public static class NTMRuin1 extends Component {
|
||||
|
||||
|
||||
private static ConcreteBricks RandomConcreteBricks = new ConcreteBricks();
|
||||
|
||||
|
||||
public NTMRuin1() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public NTMRuin1(Random rand, int minX, int minZ) {
|
||||
super(rand, minX, 64, minZ, 8, 6, 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) {
|
||||
|
||||
|
||||
//System.out.println(this.coordBaseMode);
|
||||
if(!this.setAverageHeight(world, box, this.boundingBox.minY)) {
|
||||
return false;
|
||||
}
|
||||
//System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ);
|
||||
|
||||
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, 8, 10, -1, box);
|
||||
|
||||
|
||||
int pillarMetaWE = this.getPillarMeta(4);
|
||||
int pillarMetaNS = this.getPillarMeta(8);
|
||||
|
||||
|
||||
this.fillWithBlocks(world, box, 0, 0, 0, 0, 6, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall
|
||||
this.fillWithMetadataBlocks(world, box, 1, 3, 0, 3, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false);
|
||||
this.fillWithBlocks(world, box, 4, 0, 0, 4, 6 - 1, 0, ModBlocks.concrete_pillar, Blocks.air, false);
|
||||
@ -83,39 +83,39 @@ public class RuinFeatures {
|
||||
this.fillWithRandomizedBlocks(world, box, 8, 0, 6, 8, 0, 6, false, rand, RandomConcreteBricks);
|
||||
this.fillWithRandomizedBlocks(world, box, 8, 0, 10 - 2, 8, 1, 10 - 1, false, rand, RandomConcreteBricks);
|
||||
this.fillWithRandomizedBlocks(world, box, 8, 2, 10 - 1, 8, 2, 10 - 1, false, rand, RandomConcreteBricks);
|
||||
|
||||
|
||||
this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 1, 8 - 1, 0, 10 - 1, Blocks.gravel, Blocks.air, false);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class NTMRuin2 extends Component {
|
||||
|
||||
|
||||
private static ConcreteBricks RandomConcreteBricks = new ConcreteBricks();
|
||||
|
||||
|
||||
public NTMRuin2() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public NTMRuin2(Random rand, int minX, int minZ) {
|
||||
super(rand, minX, 64, minZ, 7, 5, 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) {
|
||||
|
||||
|
||||
//System.out.println(this.coordBaseMode);
|
||||
if(!this.setAverageHeight(world, box, this.boundingBox.minY)) {
|
||||
return false;
|
||||
}
|
||||
//System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ);
|
||||
|
||||
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, 7, 10, -1, box);
|
||||
|
||||
|
||||
int pillarMetaWE = this.getPillarMeta(4);
|
||||
int pillarMetaNS = this.getPillarMeta(8);
|
||||
|
||||
|
||||
this.fillWithBlocks(world, box, 0, 0, 0, 0, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall
|
||||
this.fillWithMetadataBlocks(world, box, 1, 3, 0, 7 - 1, 3, 0, ModBlocks.concrete_pillar, pillarMetaWE, Blocks.air, 0, false);
|
||||
this.fillWithBlocks(world, box, 7, 0, 0, 7, 5, 0, ModBlocks.concrete_pillar, Blocks.air, false);
|
||||
@ -146,40 +146,40 @@ public class RuinFeatures {
|
||||
this.fillWithRandomizedBlocks(world, box, 7, 0, 6, 7, 0, 10 - 1, false, rand, RandomConcreteBricks);
|
||||
this.fillWithRandomizedBlocks(world, box, 7, 1, 6, 7, 1, 7, false, rand, RandomConcreteBricks);
|
||||
this.fillWithRandomizedBlocks(world, box, 7, 1, 10 - 1, 7, 2, 10 - 1, false, rand, RandomConcreteBricks);
|
||||
|
||||
|
||||
this.randomlyFillWithBlocks(world, box, rand, 0.25F, 1, 0, 1, 7 - 1, 0, 10 - 1, Blocks.gravel, Blocks.air, false);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class NTMRuin3 extends Component {
|
||||
|
||||
|
||||
private static ConcreteBricks RandomConcreteBricks = new ConcreteBricks();
|
||||
|
||||
|
||||
public NTMRuin3() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public NTMRuin3(Random rand, int minX, int minZ) {
|
||||
super(rand, minX, 64, minZ, 8, 3, 10);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) {
|
||||
|
||||
|
||||
//System.out.println(this.coordBaseMode);
|
||||
if(!this.setAverageHeight(world, box, this.boundingBox.minY)) {
|
||||
return false;
|
||||
}
|
||||
//System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ);
|
||||
|
||||
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, 0, 10, -1, box);
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 8, 0, 8, 10, -1, box);
|
||||
|
||||
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, 0, 8, 0, -1, box);
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, 4, 8, 4, -1, box);
|
||||
|
||||
|
||||
this.fillWithBlocks(world, box, 0, 0, 0, 0, 3, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall
|
||||
this.fillWithBlocks(world, box, 8, 0, 0, 8, 1, 0, ModBlocks.concrete_pillar, Blocks.air, false);
|
||||
this.fillWithRandomizedBlocks(world, box, 1, 0, 0, 8 - 1, 0, 0, false, rand, RandomConcreteBricks);
|
||||
@ -202,44 +202,44 @@ public class RuinFeatures {
|
||||
this.fillWithBlocks(world, box, 4, 0, 4, 4, 2, 4, ModBlocks.concrete_pillar, Blocks.air, false); //Center Wall
|
||||
this.fillWithRandomizedBlocks(world, box, 3, 0, 4, 3, 1, 4, false, rand, RandomConcreteBricks);
|
||||
this.fillWithRandomizedBlocks(world, box, 5, 0, 4, 8 - 1, 1, 4, false, rand, RandomConcreteBricks);
|
||||
|
||||
|
||||
this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 1, 8 - 1, 0, 3, Blocks.gravel, Blocks.air, false);
|
||||
this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 5, 8 - 1, 0, 10 - 1, Blocks.gravel, Blocks.air, false);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class NTMRuin4 extends Component {
|
||||
|
||||
|
||||
private static ConcreteBricks RandomConcreteBricks = new ConcreteBricks();
|
||||
|
||||
|
||||
public NTMRuin4() {
|
||||
super();
|
||||
}
|
||||
|
||||
|
||||
public NTMRuin4(Random rand, int minX, int minZ) {
|
||||
super(rand, minX, 64, minZ, 10, 2, 11);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean addComponentParts(World world, Random rand, StructureBoundingBox box) {
|
||||
|
||||
|
||||
//System.out.println(this.coordBaseMode);
|
||||
if(!this.setAverageHeight(world, box, this.boundingBox.minY)) {
|
||||
return false;
|
||||
}
|
||||
//System.out.println("" + this.boundingBox.minX + ", " + this.boundingBox.minY + ", " + this.boundingBox.minZ);
|
||||
|
||||
|
||||
|
||||
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 0, 0, 0, 11, -1, box);
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 10, 5, 10, 11, -1, box);
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 5, 0, 5, 4, -1, box);
|
||||
|
||||
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, 11, 10 - 1, 11, -1, box);
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 1, 0, 4, 0, -1, box);
|
||||
placeFoundationUnderneath(world, Blocks.stonebrick, 0, 5, 5, 10 - 1, 5, -1, box);
|
||||
|
||||
|
||||
this.fillWithBlocks(world, box, 0, 0, 0, 0, 1, 0, ModBlocks.concrete_pillar, Blocks.air, false); //Back Wall Pt. 1
|
||||
this.fillWithBlocks(world, box, 5, 0, 0, 5, 2, 0, ModBlocks.concrete_pillar, Blocks.air, false);
|
||||
this.fillWithRandomizedBlocks(world, box, 1, 0, 0, 4, 0, 0, false, rand, RandomConcreteBricks);
|
||||
@ -263,12 +263,12 @@ public class RuinFeatures {
|
||||
this.fillWithRandomizedBlocks(world, box, 0, 0, 1, 0, 0, 11 - 1, false, rand, RandomConcreteBricks); //Left Wall
|
||||
this.fillWithRandomizedBlocks(world, box, 0, 1, 1, 0, 1, 1, false, rand, RandomConcreteBricks);
|
||||
this.fillWithRandomizedBlocks(world, box, 0, 1, 4, 0, 1, 7, false, rand, RandomConcreteBricks);
|
||||
|
||||
|
||||
this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 1, 4, 0, 5, Blocks.gravel, Blocks.air, false);
|
||||
this.randomlyFillWithBlocks(world, box, rand, 0.05F, 1, 0, 6, 10 - 1, 0, 11 - 1, Blocks.gravel, Blocks.air, false);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
2082
src/main/resources/assets/hbm/models/weapons/n_i_4_n_i.obj
Normal file
2082
src/main/resources/assets/hbm/models/weapons/n_i_4_n_i.obj
Normal file
File diff suppressed because it is too large
Load Diff
BIN
src/main/resources/assets/hbm/structures/forest_post.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/forest_post.nbt
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/laboratory.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/laboratory.nbt
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/ntmruinsA.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/ntmruinsA.nbt
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/ntmruinsB.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/ntmruinsB.nbt
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/ntmruinsC.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/ntmruinsC.nbt
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/ntmruinsD.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/ntmruinsD.nbt
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/ntmruinsE.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/ntmruinsE.nbt
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/ntmruinsF.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/ntmruinsF.nbt
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/ntmruinsG.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/ntmruinsG.nbt
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/ntmruinsH.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/ntmruinsH.nbt
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/ntmruinsI.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/ntmruinsI.nbt
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/ntmruinsJ.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/ntmruinsJ.nbt
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/structures/radio_house.nbt
Normal file
BIN
src/main/resources/assets/hbm/structures/radio_house.nbt
Normal file
Binary file not shown.
BIN
src/main/resources/assets/hbm/textures/items/pwr_printer.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/pwr_printer.png
Normal file
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 |
Loading…
x
Reference in New Issue
Block a user