fixed schist gen, wing hover mode, cloud residue rendering

This commit is contained in:
Bob 2021-07-22 21:26:37 +02:00
parent 922963871f
commit 2d44d78c8f
15 changed files with 215 additions and 19 deletions

View File

@ -718,6 +718,7 @@ public class ModBlocks {
public static Block balefire;
public static Block fire_digamma;
public static Block digamma_matter;
public static Block ams_base;
public static final int guiID_ams_base = 54;
@ -1677,6 +1678,7 @@ public class ModBlocks {
balefire = new Balefire().setBlockName("balefire").setHardness(0.0F).setLightLevel(1.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":balefire");
fire_digamma = new DigammaFlame().setBlockName("fire_digamma").setHardness(0.0F).setResistance(150F).setLightLevel(1.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":fire_digamma");
digamma_matter = new DigammaMatter().setBlockName("digamma_matter").setBlockUnbreakable().setResistance(18000000).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":digamma_matter");
ams_base = new BlockAMSBase(Material.iron).setBlockName("ams_base").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":ams_base");
ams_emitter = new BlockAMSEmitter(Material.iron).setBlockName("ams_emitter").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":ams_emitter");
@ -2703,6 +2705,7 @@ public class ModBlocks {
//E
GameRegistry.registerBlock(balefire, balefire.getUnlocalizedName());
GameRegistry.registerBlock(fire_digamma, fire_digamma.getUnlocalizedName());
GameRegistry.registerBlock(digamma_matter, digamma_matter.getUnlocalizedName());
//AMS
GameRegistry.registerBlock(ams_base, ams_base.getUnlocalizedName());

View File

@ -2,6 +2,7 @@ package com.hbm.blocks.bomb;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.items.ModItems;
import net.minecraft.block.Block;
@ -34,7 +35,7 @@ public class BlockCloudResidue extends Block {
@Override
public int getRenderType(){
return 334077;
return ModBlocks.taint.getRenderType();
}
@Override

View File

@ -0,0 +1,78 @@
package com.hbm.blocks.bomb;
import java.util.Random;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class DigammaMatter extends Block {
private static Random rand = new Random();
public DigammaMatter() {
super(Material.portal);
}
@Override
public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) {
return null;
}
@Override
public boolean isOpaqueCube() {
return false;
}
@Override
public boolean renderAsNormalBlock() {
return false;
}
@Override
public void setBlockBoundsBasedOnState(IBlockAccess world, int x, int y, int z) {
float pixel = 0.0625F;
this.setBlockBounds(rand.nextInt(9) * pixel, rand.nextInt(9) * pixel, rand.nextInt(9) * pixel, 1.0F - rand.nextInt(9) * pixel, 1.0F - rand.nextInt(9) * pixel, 1.0F - rand.nextInt(9) * pixel);
}
@Override
public void onBlockAdded(World world, int x, int y, int z) {
if(!world.isRemote)
world.scheduleBlockUpdate(x, y, z, this, 10 + rand.nextInt(40));
}
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
if(!world.isRemote) {
int meta = world.getBlockMetadata(x, y, z);
if(meta >= 7) {
world.setBlock(x, y, z, Blocks.air);
} else {
world.setBlock(x, y, z, Blocks.air);
//world.setBlock(x, y, z, this, meta + 1, 3);
for(int i = -1; i <= 1; i++) {
for(int j = -1; j <= 1; j++) {
for(int k = -1; k <= 1; k++) {
int dist = Math.abs(i) + Math.abs(j) + Math.abs(k);
if(dist > 0 && dist < 3) {
if(world.getBlock(x + i, y + j, z + k) != this)
world.setBlock(x + i, y + j, z + k, this, meta + 1, 3);
}
}
}
}
}
}
}
}

View File

@ -24,7 +24,7 @@ public class RBMKOutgasser extends RBMKBase {
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
return false; //return openInv(world, x, y, z, player, ModBlocks.guiID_rbmk_outgasser);
return openInv(world, x, y, z, player, ModBlocks.guiID_rbmk_outgasser);
}
@Override

View File

@ -77,7 +77,7 @@ public class EntityCloudFX extends EntityModFX {
if (worldObj.getBlock((int) posX, (int) posY, (int) posZ).isNormalCube()) {
if(rand.nextInt(5) != 0) {
if(!worldObj.isRemote && rand.nextInt(5) != 0) {
this.setDead();
if(BlockCloudResidue.hasPosNeightbour(worldObj, (int) (posX - motionX/subdivisions), (int) (posY - motionY/subdivisions), (int) (posZ - motionZ/subdivisions)) && worldObj.getBlock((int) (posX - motionX/subdivisions), (int) (posY - motionY/subdivisions), (int) (posZ - motionZ/subdivisions)).isReplaceable(worldObj, (int) (posX - motionX/subdivisions), (int) (posY - motionY/subdivisions), (int) (posZ - motionZ/subdivisions))) {

View File

@ -48,9 +48,9 @@ public class GUIMachineBoiler extends GuiInfoContainer {
" 0.15°C/t",
" or 3.0°C/s (base)",
" 0.25°C/t",
" or 5.0°C/t (once boiling point is reached)",
" or 5.0°C/s (once boiling point is reached)",
" 0.4°C/t",
" or 8.0°C/t (for every subsequent multiple of boiling point)" };
" or 8.0°C/s (for every subsequent multiple of boiling point)" };
this.drawCustomInfoStat(mouseX, mouseY, guiLeft - 16, guiTop + 36, 16, 16, guiLeft - 8, guiTop + 36 + 16, text);
String[] text1 = new String[] { "Boiling rate:",

View File

@ -51,8 +51,7 @@ import cpw.mods.fml.common.IWorldGenerator;
public class HbmWorldGen implements IWorldGenerator {
@Override
public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator,
IChunkProvider chunkProvider) {
public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
switch (world.provider.dimensionId) {
case -1:
generateNether(world, rand, chunkX * 16, chunkZ * 16); break;
@ -100,7 +99,7 @@ public class HbmWorldGen implements IWorldGenerator {
private void generateSurface(World world, Random rand, int i, int j) {
for(int x = 0; x < 16; x++) {
/*for(int x = 0; x < 16; x++) {
for(int z = 0; z < 16; z++) {
@ -122,7 +121,7 @@ public class HbmWorldGen implements IWorldGenerator {
}
}
}
}
}*/
DungeonToolbox.generateOre(world, rand, i, j, 25, 6, 30, 10, ModBlocks.ore_gneiss_iron, ModBlocks.stone_gneiss);
DungeonToolbox.generateOre(world, rand, i, j, 10, 6, 30, 10, ModBlocks.ore_gneiss_gold, ModBlocks.stone_gneiss);
@ -175,7 +174,7 @@ public class HbmWorldGen implements IWorldGenerator {
int randPosZ = j + rand.nextInt(16);
if(randPosX <= colX + colRange && randPosX >= colX - colRange && randPosZ <= colZ + colRange && randPosZ >= colZ - colRange)
(new WorldGenMinable(ModBlocks.ore_coltan, 3)).generate(world, rand, randPosX, randPosY, randPosZ);
(new WorldGenMinable(ModBlocks.ore_coltan, 6)).generate(world, rand, randPosX, randPosY, randPosZ);
}
for (int k = 0; k < rand.nextInt(4); k++) {

View File

@ -21,6 +21,7 @@ import net.minecraftforge.common.ForgeChunkManager.Ticket;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.common.util.EnumHelper;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Mod.EventHandler;
@ -75,6 +76,7 @@ import com.hbm.tileentity.machine.*;
import com.hbm.tileentity.machine.TileEntityMachineReactorLarge.ReactorFuelType;
import com.hbm.tileentity.machine.rbmk.*;
import com.hbm.tileentity.turret.*;
import com.hbm.world.feature.SchistStratum;
import com.hbm.world.generator.CellularDungeonFactory;
import cpw.mods.fml.common.SidedProxy;
@ -1170,6 +1172,9 @@ public class MainRegistry {
MinecraftForge.TERRAIN_GEN_BUS.register(commonHandler);
MinecraftForge.ORE_GEN_BUS.register(commonHandler);
SchistStratum schist = new SchistStratum();
MinecraftForge.EVENT_BUS.register(schist); //DecorateBiomeEvent.Pre
PacketDispatcher.registerPackets();
ChunkRadiationManager radiationSystem = new ChunkRadiationManager();

View File

@ -737,7 +737,7 @@ public class ModEventHandler {
EntityPlayer player = event.player;
if(event.phase == TickEvent.Phase.START && player.getUniqueID().toString().equals(Library.SolsticeUnlimitd)) {
if(event.phase == TickEvent.Phase.START && (player.getUniqueID().toString().equals(Library.SolsticeUnlimitd) || player.getDisplayName().equals("SolsticeUnlimitd"))) {
if(player.getCurrentArmor(2) == null && !player.onGround) {
@ -756,11 +756,43 @@ public class ModEventHandler {
if(props.isJetpackActive()) {
if(player.motionY < 0.4D)
player.motionY += 0.15D;
else
player.motionY = 0.55D;
if(player.getFoodStats().getSaturationLevel() > 0F)
player.addExhaustion(4F); //burn up saturation so that super-saturating foods have no effect
else
player.addExhaustion(0.2F); //4:1 -> 0.05 hunger per tick or 1 per second
} else if(props.enableBackpack && !player.isSneaking()) {
if(player.motionY < -1)
player.motionY += 0.4D;
else if(player.motionY < -0.1)
player.motionY += 0.2D;
else if(player.motionY < 0)
player.motionY = 0;
if(player.getFoodStats().getSaturationLevel() > 0F)
player.addExhaustion(4F);
else
player.addExhaustion(0.04F);
} else if(props.enableBackpack && player.isSneaking()) {
if(player.motionY < -0.08) {
double mo = player.motionY * -0.4;
player.motionY += mo;
Vec3 vec = player.getLookVec();
vec.xCoord *= mo;
vec.yCoord *= mo;
vec.zCoord *= mo;
player.motionX += vec.xCoord;
player.motionY += vec.yCoord;
player.motionZ += vec.zCoord;
}
}
}

View File

@ -318,7 +318,7 @@ public class ModEventHandlerClient {
}
}
if(player.getCurrentArmor(2) == null && player.getUniqueID().toString().equals(Library.SolsticeUnlimitd))
if(player.getCurrentArmor(2) == null && (player.getUniqueID().toString().equals(Library.SolsticeUnlimitd) || player.getDisplayName().equals("SolsticeUnlimitd")))
RenderAccessoryUtility.renderSol(event);
}
@ -491,8 +491,6 @@ public class ModEventHandlerClient {
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glEnable(GL11.GL_ALPHA_TEST);
mc.getTextureManager().bindTexture(ashes);
int w = resolution.getScaledWidth();
int h = resolution.getScaledHeight();
double off = System.currentTimeMillis() / -10000D % 10000D;
@ -514,6 +512,8 @@ public class ModEventHandlerClient {
mc.entityRenderer.enableLightmap((double)event.partialTicks);
mc.getTextureManager().bindTexture(ashes);
for(int i = 1; i < 3; i++) {
GL11.glRotatef(-15, 0, 0, 1);

View File

@ -105,6 +105,8 @@ public abstract class TileEntityRBMKBase extends TileEntity implements INBTPacke
ForgeDirection.WEST
};
protected TileEntityRBMKBase[] heatCache = new TileEntityRBMKBase[4];
/**
* Moves heat to neighboring parts, if possible, in a relatively fair manner
*/
@ -114,12 +116,27 @@ public abstract class TileEntityRBMKBase extends TileEntity implements INBTPacke
rec.add(this);
double heatTot = this.heat;
int index = 0;
for(ForgeDirection dir : heatDirs) {
TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ);
if(heatCache[index] != null && heatCache[index].isInvalid())
heatCache[index] = null;
if(te instanceof TileEntityRBMKBase) {
TileEntityRBMKBase base = (TileEntityRBMKBase) te;
if(heatCache[index] == null) {
TileEntity te = worldObj.getTileEntity(xCoord + dir.offsetX, yCoord, zCoord + dir.offsetZ);
if(te instanceof TileEntityRBMKBase) {
TileEntityRBMKBase base = (TileEntityRBMKBase) te;
heatCache[index] = base;
}
}
index++;
}
for(TileEntityRBMKBase base : heatCache) {
if(base != null) {
rec.add(base);
heatTot += base.heat;
}

View File

@ -39,7 +39,7 @@ public class TileEntityRBMKOutgasser extends TileEntityRBMKSlottedBase implement
@Override
public void updateEntity() {
/*if(!worldObj.isRemote) {
if(!worldObj.isRemote) {
gas.updateTank(xCoord, yCoord, zCoord, worldObj.provider.dimensionId);
if(worldObj.getTotalWorldTime() % 10 == 0)
@ -48,7 +48,7 @@ public class TileEntityRBMKOutgasser extends TileEntityRBMKSlottedBase implement
if(!canProcess()) {
this.progress = 0;
}
}*/
}
super.updateEntity();
}

View File

@ -0,0 +1,61 @@
package com.hbm.world.feature;
import com.hbm.blocks.ModBlocks;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.world.World;
import net.minecraft.world.gen.NoiseGeneratorPerlin;
import net.minecraftforge.event.terraingen.DecorateBiomeEvent;
public class SchistStratum {
NoiseGeneratorPerlin noise;
@SubscribeEvent
public void onDecorate(DecorateBiomeEvent.Pre event) {
if(this.noise == null) {
this.noise = new NoiseGeneratorPerlin(event.rand, 4);
}
World world = event.world;
if(world.provider.dimensionId != 0)
return;
int cX = event.chunkX;
int cZ = event.chunkZ;
double scale = 0.01D;
int threshold = 5;
for(int x = cX; x < cX + 16; x++) {
for(int z = cZ; z < cZ + 16; z++) {
double n = noise.func_151601_a(x * scale, z * scale);
if(n > threshold) {
int range = (int)((n - threshold) * 3);
if(range > 4)
range = 8 - range;
if(range < 0)
continue;
for(int y = 30 - range; y <= 30 + range; y++) {
Block target = world.getBlock(x, y, z);
if(target.isNormalCube() && target.getMaterial() == Material.rock) {
world.setBlock(x, y, z, ModBlocks.stone_gneiss, 0, 2);
}
}
}
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 424 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 B